Skip to main content

Initializing the payonic-click2pay.js client

After including payonic-click2pay.js, initialize the client using your merchantId from the enroll merchant response.

Init will return a list of cards if the user recognised and the has a recognitionToken cookie.

If the user is not on a recognised device Init will return an empty list.

InitParams

merchantId String

The id returned when enrolling a new merchant

locale String

The the preferred locale. It should have a format of ISO {LanguageCode}_{CountryCode2} pair (e.g., en_US )

availableCardBrands String[]

A list of available cards for the checkout experience.

Initialize the payonic-click2pay.js client
payonicClickToPay.Init({
merchantId: "Z7NWVCUWZ2QP",
locale: "en_US",
availableCardBrands: [
"mastercard",
"visa",
"amex",
"discover"
]
}");
Response
[
{
Provider: "Unified"
DigitalCardId: "8d070e67-8503-4260-8f7f-ed574e36d9c6"
PanBin: "518600"
PanLastFour: "8785"
ExpiryMonth: "01"
ExpiryYear: "28"
Scheme: "mastercard"
Raw: {
// Raw card returned by the provider
}
},
...
]