Widget v1.0
Read on setting up widget
To initialize the widget, you will need to first generate a Widget Token, which will only be valid for a certain time period. You will need to pass this token along with the Sender ID to widget initialization snippets.
GET /v2/senders/{senderId}/widget-token
Field | Required | Type | Description |
token | Response | String | Token Details |
senderId | Yes | UUID | User ID |
expiry_minutes | Response | Numeric | Token validity time |
Once you have the token, you will need to follow the steps mentioned below to setup the widget v1.0.
1. Include the Widget Script
2. Create a div where widget needs to be placed
3. Initialize the Widget
The properties required while initializing the widget depends on the type of widget. Details are listed below along with a sample.
Name | Required | Type | Description |
elementId | Yes | string | Target element where widget will be rendered. |
senderId | Yes | string | senderId for whom the widget should be rendered. |
token | Yes | string | Unique Token that needs to be generated using Generate Widget Token API. |
type | Yes | string | kyc |
width | Yes | Standard Size Dimension eg. 100px, 100%, 100em | Width of widget |
height | Yes | Standard Size Dimension e.g. 100px, 100%, 100em | Height of widget |
locale | No | String | By default, this is set to English, For Korean pass ko and for English pass en. If left blank or invalid locale is sent it will fall back to default language. |
stylesheet | No | URL | This stylesheet will override the default design of the widget. |
multiStep | No | boolean(true or false) | Configuration to display the widget in a single or multiple form |
4. Add an Event Handler
Widget will trigger an event anytime there is changes in a resource. To listen to the events generated by the widget include below code snippet.
Event Name | Widget Type | Description |
---|---|---|
VERIFIED | kyc | KYC process is completed and user is verified. |
RETRY | kyc | The user is moved to KYC retry status. Additional KYC information is required from the sender. |
IN_PROGRESS | kyc | User kyc has been submitted for verification. Their status will be updated once verification process is completed. |
DOCUMENT_REQUESTED | kyc | User needs to provide additional KYC documentation for verification. |
RETRY_REQUESTED | kyc | User needs to review the submitted information and re-submit it. |
REVIEW_PENDING | kyc | User has submitted KYC information but is under compliance review. |
SUSPENDED | kyc | The user has been suspended. User is unable to conduct any activity on the platform. |
BANK_ADDED | bank | Sender’s bank addition process has been successfully completed. |
BANK_ERROR | bank | Error while adding sender’s bank. Please try again. |
EXIT_EVENT | bank | Sender's has closed the bank widget. |
CARD_ADDED | card | Sender’s card addition process has been successfully completed. |
ADD_LIMIT_EXCEEDED | card | User has exceeded the 7 day or 30 day card add attempt limit. To add a new card, user will need to wait until the appropriate time period has passed. |
CARD_ERROR | card | Error while adding sender’s card. Please try again. |
TIER2_REQUESTED | tier | Tier 2 request sent successfully. User’s tier will be updated once the request has been reviewed by compliance. |
TIER3_REQUESTED | tier | Tier 3 request sent successfully. User’s tier will be updated once the request has been reviewed by compliance. |
TIER_REQUEST_FAILED | tier | Error while upgrading sender’s tier. Please try again. |
THREE_DS_VERIFIED | 3ds | 3DS verification successful. |
THREE_DS_HOLD | 3ds | 3DS verification is on hold and hence, transaction is on hold as well. Please contact Machnet customer support. |
THREE_DS_FAILED | 3ds | 3DS verification is unsuccessful. Transaction is cancelled. |
THREE_DS_IN_PROGRESS | 3ds | 3DS verification is in progress. |
Last updated