Options
key string required
string requiredMerchant public key.
host string required
string requiredCheckout server baseUrl.
type string optional
string optionalWhether you to create a bank account or card token.
Only accepts bank_account or card values. Set to card by default.
theme string optional
string optionalSpecify the preferred ui appearance for the Checkout form.
Supported themes are light and dark.
Set to light by default.
locale string optional
string optionalSpecify the preferred language for the Checkout form.
Supported languages are en and es.
Set to current locale system from user web browser by default if is supported, otherwise fallback to en.
defaultCountry string optional
string optionalDefault value for country field id allowBilling is true. Set to US by default.
defaultCurrency string optional
string optionalDefault value for currency field if allowCurrency is true. Set to USD by default.
allowBilling string optional
string optionalWhether to allow or not billing information. Set to true by default.
allowCurrency string optional
string optionalWhether to allow or not currency field. Set to true by default.
onLoaded function optional
function optionalCallback triggered when checkout is fully and successfully loaded.
onCreated(token object) function optional
object) function optionalCallback triggered when checkout has successfully created a token.
onCanceled function optional
function optionalCallback triggered when checkout is canceled by user.
onError(error object) function optional
object) function optionalCallback triggered when checkout throws an error.
var checkout = new Checkout(
host: "https://checkout3.gpnpay.com",
key: "pk_test_qhDUMhE0-lzH4PtK0nDvPQ",
type: "card",
theme: "dark",
locale: "es",
allowBilling: true,
allowCurrency: true,
defaultCountry: "US", // United States
defaultCurrency: "USD", // United States Dollar
onLoaded: function () {
// checkout loaded.
},
onCreated: function (token) {
// token created.
},
onCanceled: function () {
// user canceled
},
onError: function (error) {
// error has occurred
},
);final checkout = Checkout(
host: 'https://checkout3.gpnpay.com',
key: 'pk_test_qhDUMhE0-lzH4PtK0nDvPQ',
type: TokenType.card,
theme: 'dark',
locale: 'es',
allowBilling: true,
allowCurrency: true,
defaultCountry: 'US', // United States
defaultCurrency: 'USD', // United States Dollar
onLoaded: () {
// checkout loaded.
},
onCreated: (PaymentToken token) {
// token created.
},
onCanceled: () {
// user canceled
},
onError: (Object error) {
// error has occurred
},
);<checkout
host="https://checkout3.gpnpay.com"
key="pk_test_qhDUMhE0-lzH4PtK0nDvPQ"
[type]="TokenType.card",
theme="dark",
locale="es",
defaultCountry="US"
defaultCurrency="USD"
allowBilling
allowCurrency
(loaded)="handleLoad()"
(created)="handleCreate($event)"
(canceled)="handleCanceled()"
(error)="handleError($event)"
></checkout>Last updated