Advanced Usage
The Simpler JavaScript SDK can be instantiated with a more advanced configuration which will override the default values.
Configuration
Options are passed to the checkout()
function as object:
Simpler.checkout({
appId: "00000000-0000-0000-0000-000000000000",
target: document.getElementById("checkout-form"),
currency: "EUR",
locale: "en",
separator: "marquee",
items: [{
id: "123",
quantity: 2,
attributes: [{
key: "color",
value: "blue"
}]
}],
onSuccess(orderId) {
// redirect user to order success page
window.location.pathname = "/success?order_id=" + orderId;
},
});
Property | Accepted Value(s) | Default Value |
---|---|---|
| A valid UUID string | Required |
| A valid HTML Element | Required |
| A valid ISO 4217 currency code (i.e | Required |
|
|
|
|
|
|
| This property holds an array of cart items. |
|
| The product identifier. | Required |
| The product's cart quantity. |
|
| A key-value pair of attribute code and its related value id. |
|
| A callback function which will be invoked once order has been successfully submitted from Simpler to the remote API. This callback provides the |
|
Updated about 1 month ago