**XPay Redirection** - _used to show the payment gateway at the another page._
npm install xpay-redirectXPay Redirection - _used to show the payment gateway at the another page._
Use this script tag to get access to the xpay redirection.
__
Steps:-
1. Create two HTML files like index.html and xpay.html.
2. Add a button or anchor tag at index.html to redirect to the xpay.html page.
``html`
paynow
3. At xpay.html. Add a div tag with the id xpay-ftb-web-redirect at the body tag. It is used to display the xpay module with the help of this id.
`html`
4. Add a Script tag to the head tag or body tag. And use the latest version.
`html`
5. Next, add the script tag at a necessary place. But add below the source script.
`html`
_Here, the config variable is used to pass the data as an object to the xpayftb.
xpayftb.XpayRedirect(config)_
Note:-
- _baseurl should pass as a string value. It is used as the base URL for API calls._
- _sessionid and paymenttokenid should pass as a string value. It is used all over the xpay._
- _delayTime should pass a number as seconds to close the popup._
- _maximumFractionDigits should pass a number for digits to display amount not compulsory._
- _merchantName is used to display the merchant name at xpay. And pass it as a string value._
- _merchantUrl should pass as a string value. It is used to return the merchant back to the checkout page or any URL or # ._
- _onResponse is a callback function. It is getting called when the API gives a successful response. Return data is an object with its API endpoint and result._
- _onError is a callback function. It is getting called when the API gives an error message. Return data is an object with its API endpoint and result._
- _onPopupClose` is a callback function. It is getting called when the user cancels the transaction or on close of payment success or session gets expired. Return data is an object with its action and result._