Given below are the integration steps to embed the widget in your website.
Web Widget integration involves the inclusion of three HTML tag.
2. Widget Location
3. Initialiser file (Base)
Mandatory (It should be an id of an element not a class), the name given in step 2 for id
Mandatory, this you will get from dashboard post registration
Optional , the wallet address to which tokens to be transferred. this can be set within script code or can be passed as paramerter with url while initiating the widget.
Optional , the amount for which you need to buy token.
Optional , the email ID of the user.
Optional, the block chain ID in which the token is present. example: 80001 for polygon testnet
Optional, the address for the required token, this can be fetched from respective chains data.
if you are passing chainID, then tokenAddress or tokenSymbol one of them is need to show specific token or else all tokens from that chain will be displayed to users.
token Symbol as per standards. you can get it from coingecko or coinmarketcap
"userID" : "ABCXXXX",
"userName" : "user",
Optional, metaData is any extra data that user wants to send along with webhook events in the order. Note: metaData should be sent in key value pairs of strings only
Optional, successRedirectUrl is the url to which the widget will redirect on successful order completion
Note: successRedirectUrl should always start with http or https
Optional, failureRedirectUrl is the url to which the widget will redirect in case of failure
Note: failureRedirectUrl should always start with http or https
Note: By default widget will be initialised with OnRamp functionalities only. And only INR 100 is the valid amount for order creation in staging and Mumbai Matic is the only token supported for now to test the end to end onramp flow .
Widget initialisation happens when you call createWidget.init(); and all the respective events are notified back to the parent and once can handle event based actions respectively by passing the callbackFn names to the events like this createWidget.on(eventType, callbackFn);
callbackFn - Its the function you have to pass along with the eventType. This function will get called when the event is fired.
Below are the eventTypes and its description.
this will listen to all the events of the widget and notify the callback function once event is triggered.
this will listen to the success event of the widget
this will listen to the failed event of the widget.
this will listen to the order related events.
this will listen to order completed events.
this will listen to action events.
Below is the validation for UTR length , on staging use any random character with below validation.
- UPI Payment - 12 character Numbers
- IMPS payment - 12 character Numbers
- NEFT payment - 16 character alphanumeric