Skip to main content

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

ParameterTypeRequiredDescriptionDefault
merchantIdstringyesyour merchant ID
orderIdstringnoany string generated by you used to track the order in your systemnull
orderAmountnumbernothe order amount in orderCurrency; it must be specified, unless the subscription parameter is setnull
orderCurrencystringnofiat order currency'USD'
userNamestringnothe user's name to use for subscription payment email remindersnull
userEmailstringnothe user's email address for subscription payment email remindersnull
recurrencenumbernobasic subscription recurrence (see Basic Subscriptions)atlos.RECURRENCE_NONE
subscriptionSubscriptionItem[]noadvanced subscription (see Advanced Subscriptions)null
resetSubscriptionbooleannowhether or not to cancel all prior subscriptions of this usertrue
subscriptionIdstringnoif you pass this field, the payment will be credited to that subscription; this ID is generated by ATLOS and it must existnull
postbackUrlstringnooverrides the postback URL specified in settings in Merchant Panel (useful for custom plugins)null
noBuyCryptobooleannocauses the widget not to display the "Buy crypto" linkfalse
onSuccessfunctionnoa callback function to call when the payment is completed successfullynull
onCanceledfunctionnoa callback function to call when the payment widget is closed and the payment was not completednull
onCompletedfunctionnoa callback function to call when the payment widget is closed and the payment was completed successfullynull
languagestringnolanguagebrowser language
theme'light'|'dark'nocolor theme'light'