Checkout configure()

configure()

The configure function is used to prepare the Checkout library for a payment. It must be called before either showEmbeddedPage() or showPaymentPage() to store payment details.


Usage Copied to clipboard

Checkout.configure(configuration);


Example Copied to clipboard

Checkout.configure({
    session: {
        id: '<your_session_id>'
    }
});

Arguments Copied to clipboard

configuration Copied to clipboard Object

The configuration object describes the merchant, customer, payment, and checkout appearance and behaviour. Fields in the object can contain literal values or a function that returns the value. Functions will be invoked before showing the payment interface.

Validation problems with the configuration object will be delivered to the error callback.

session Copied to clipboard Object
id Copied to clipboard String

Identifier of the payment session containing values for any of the request fields to be used in this operation.

Values contained in the session will override values provided by the request.
Data consists of ASCII characters
Min length:31
Max length:35
version Copied to clipboard String

Use this field to implement optimistic locking of the session content.

Do this if you make business decisions based on data from the session and wish to ensure that the same data is being used for the request operation.

To use optimistic locking, record session.version when you make your decisions, and then pass that value in session.version when you submit your request operation to the gateway.

If session.version provided by you does not match that stored against the session, the gateway will reject the operation with error.cause=INVALID_REQUEST.

See Making Business Decisions Based on Session Content.
Data consists of ASCII characters
Min length:10
Max length:10

Return Value Copied to clipboard

None