Load the embed script and create an instance
for the order token
.
type RevolutCheckout = (
'public_id': string,
mode?: 'prod' | 'sandbox' = 'prod'
) => Promise<Instance>;
Initialise the widget using an order token
(also called public_id
) and declaring the environment that you want to use:
RevolutCheckout("<PUBLIC_ID>", "prod").then(function (instance) {
// Work with instance:
// instance.payWithPopup()
// instance.createCardField()
// ...
});
Parameter | Description | Format | Required |
---|---|---|---|
<PUBLIC_ID> | The public_id is passed as the parameter to call the widget instance. You can find the value of public_id in the response when you create an order on the Merchant API. | String | Yes |
mode | The environment of the Merchant API you wish to use. Default: prod . Possible values:
| String | No |
Returns a Promise with an order Instance
.
The environment that you use must match the environment you used to create the order you want to make a payment for.