Checkout
This function triggers a modal for the user to confirm the transfer
Description
The checkout function is designed to be the simplest way for your users to purchase items on your website using crypto. Once users complete their purchase, you will receive a webhook at the URL that you configure.
Details
Signature
Checkout(args)
Arguments
Parameter | Type | Definition |
---|---|---|
| Function | Function to callback upon txhash, success or failed transfer. Structure of result object passed into callback function: |
| String | Address to send funds to. This should be your treasury address. |
| String | Amount to send in display units of the currency. So if you want the user to pay 0.5 ETH, pass in '0.5' to this field. |
| asset (class) | Asset object of the currency you want to accept as the mode of payment. |
| String | Description of the item that you would like users to be shown on the Checkout screen. |
| String | Metadata you want to be sent along with your webhook. Please validate this data on your webhook notification endpoint before using. Eg.
|
Return Value
None
Webhook
You can configure a POST Webhook URL in the developer portal that will be invoked once the funds have been transferred to your treasury address.
The following is the format of the webhook call body:
Example
Last updated