Options

key string required

Merchant public key.

host string required

Checkout server baseUrl.

type string optional

Whether you to create a bank account or card token.

Only accepts bank_account or card values. Set to card by default.

theme string optional

Specify the preferred ui appearance for the Checkout form.

Supported themes are light and dark.

Set to light by default.

locale string optional

Specify 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

Default value for country field id allowBilling is true. Set to US by default.

defaultCurrency string optional

Default value for currency field if allowCurrency is true. Set to USD by default.

allowBilling string optional

Whether to allow or not billing information. Set to true by default.

allowCurrency string optional

Whether to allow or not currency field. Set to true by default.

onLoaded function optional

Callback triggered when checkout is fully and successfully loaded.

onCreated(token object) function optional

Callback triggered when checkout has successfully created a token.

onCanceled function optional

Callback triggered when checkout is canceled by user.

onError(error object) function optional

Callback 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
    },
);

Last updated