Load the embed script and create an instance
for the order token
.
type RevolutCheckout = (
'token': string,
mode?: 'prod' | 'sandbox' = 'prod'
) => Promise<Instance>;
Initialise the widget using an order token
(also called public_id
), which is returned in the response of the Create an order operation, and declare the environment that you want to use:
RevolutCheckout("<token>", "prod").then(function (instance) {
// Work with instance:
// instance.payWithPopup()
// instance.createCardField()
// ...
});
The Create an order endpoint was updated to a new version and now returns token
as the public identifier for the order. Previous integrations might still use the deprecated endpoint returning public_id
.
We strongly advise upgrading to the new Create an order endpoint.
Parameter | Description | Format | Required |
---|---|---|---|
<token> | The token is passed as the parameter to call the widget instance. You can find the value of token 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 |
This statement returns a Promise with an order Instance
.
The environment that you use must match the environment you used to create the order.