Redirect
Instead of displaying the form directly on your page, you can redirect users to an external page to complete the payment process. The Web SDK makes it easy to generate the redirection URL and send the necessary data.
Objective
You will learn how to:
- Create the configuration object
- Initialize the payment form.
- Display the Checkout.
1. Creating the configuration object
const iziConfig = {
config: {
...,
render: {
typeForm: 'redirect',
redirectUrls: {
onSuccess: 'https://tu-dominio/success',
onError: 'https://tu-dominio/error',
onCancel: 'https://tu-dominio/carrito',
},
},
...
}
};
Note
You can configure the corresponding attributes to customize its appearance and behavior here
.
2. Instantiating the class
const checkout = new Izipay({config: iziConfig});
3. Displaying the checkout
try {
checkout &&
checkout.LoadForm({
authorization: 'TU_TOKEN_SESSION',
keyRSA: 'TU_KEY_RSA',
});
} catch (error) {
console.log(error.message, error.Errors, error.date);
}
info
- In this mode, the response will be sent to the merchant via a
POST
to the url sent in the onSuccess|onError|onCancel parameter. - Make sure you have a page that can receive this kind of data, you can use technologies like
PHP
,ASP
or some kind of server side languages. - In this mode the
callbackResponse
parameter does not apply.
Demo
Next, we invite you to explore our interactive demo.
Live editor
Result
Loading...