Widget Parameters
To open the Payment Widget, call the Pay
method of the atlos
object. You can listen to events and customize the appearance on the widget by passing parameters to the Pay
method.
Code Example
<button onclick="atlos.Pay({
merchantId: '8XOZ64KC9X',
orderId: '123456',
orderAmount: 19.95,
orderCurrency: 'USD',
userName: 'John Smith',
userEmail: 'name@email.com',
recurrence: atlos.RECURRENCE_MONTH,
subscription: null,
resetSubscription: true,
subscriptionId: null,
postbackUrl: null,
noBuyCrypto: false,
onSuccess: handleSuccess,
onCanceled: handleCanceled,
onCompleted: handleCompleted,
language: 'en',
theme: 'light'})">
Click to Pay
</button>
Note that only the merchantId
and the orderAmount
are required. All other parameters are optional. The orderAmount
is optional if the subscription
parameter is specified.
Parameter Description
Parameter | Type | Required | Description | Default |
---|---|---|---|---|
merchantId | string | yes | your merchant ID | – |
orderId | string | no | any string generated by you used to track the order in your system | null |
orderAmount | number | no | the order amount in orderCurrency ; it must be specified, unless the subscription parameter is set | null |
orderCurrency | string | no | fiat order currency | 'USD' |
userName | string | no | the user's name to use for subscription payment email reminders | null |
userEmail | string | no | the user's email address for subscription payment email reminders | null |
recurrence | number | no | basic subscription recurrence (see Basic Subscriptions) | atlos.RECURRENCE_NONE |
subscription | SubscriptionItem[] | no | advanced subscription (see Advanced Subscriptions) | null |
resetSubscription | boolean | no | whether or not to cancel all prior subscriptions of this user | true |
subscriptionId | string | no | if you pass this field, the payment will be credited to that subscription; this ID is generated by ATLOS and it must exist | null |
postbackUrl | string | no | overrides the postback URL specified in settings in Merchant Panel (useful for custom plugins) | null |
noBuyCrypto | boolean | no | causes the widget not to display the "Buy crypto" link | false |
onSuccess | function | no | a callback function to call when the payment is completed successfully | null |
onCanceled | function | no | a callback function to call when the payment widget is closed and the payment was not completed | null |
onCompleted | function | no | a callback function to call when the payment widget is closed and the payment was completed successfully | null |
language | string | no | language | browser language |
theme | 'light'|'dark' | no | color theme | 'light' |