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.

billing Copied to clipboard Object
address Copied to clipboard Object

Information on the billing address including the contact details of the payer.

billing Copied to clipboard Object
address Copied to clipboard Object
city Copied to clipboard String

The city portion of the payers address.

Data can consist of any characters
Min length:1
Max length:100
billing Copied to clipboard Object
address Copied to clipboard Object
country Copied to clipboard String

The 3 letter ISO standard alpha country code of the payers address.

Data must consist of the characters A-Z
Min length:3
Max length:3
billing Copied to clipboard Object
address Copied to clipboard Object
postcodeZip Copied to clipboard String

The post code or zip code of the payers address.

Data may consist of the characters 0-9, a-z, A-Z, ' ', '-'
Min length:1
Max length:10
billing Copied to clipboard Object
address Copied to clipboard Object
stateProvince Copied to clipboard String

The state or province of the payers address.

Data can consist of any characters
Min length:1
Max length:20
billing Copied to clipboard Object
address Copied to clipboard Object
street Copied to clipboard String

The first line of the address.

For example, this may be the street name and number, or the Post Office Box details.
Data can consist of any characters
Min length:1
Max length:100
billing Copied to clipboard Object
address Copied to clipboard Object
street2 Copied to clipboard String

The second line of the address (if provided).

Data can consist of any characters
Min length:1
Max length:100
customer Copied to clipboard Object
email Copied to clipboard String

The email address of the customer.

The field format restriction ensures that the email address is longer than 3 characters and adheres to a generous subset of valid RFC 2822 email addresses.
Ensures that the email address is longer than 3 characters and adheres to a generous subset of valid RFC 2822 email addresses
merchant Copied to clipboard String REQUIRED

The unique identifier issued to you by your payment provider.

This identifier can be up to 12 characters in length.
Data may consist of the characters 0-9, a-z, A-Z, '-', '_'
Min length:1
Max length:40
order Copied to clipboard Object REQUIRED

Information about the order associated with this transaction.

id Copied to clipboard String

A unique identifier for this order to distinguish it from any other order you create.

Use this identifier when referring to this order in subsequent transactions and in retrieval operations. This value must be unique for every order you create using your merchant profile.
Data can consist of any characters
Min length:1
Max length:40
amount Copied to clipboard Number REQUIRED

The total amount for the order.

If you provide both this value and any of the sub-total amounts (order.itemAmount, order.shippingAndHandlingAmount, order.taxAmount) then the sum of the sub-total amounts MUST equal the order.amount.
Data is a string that consists of the characters 0-9 and '.' and represents a valid decimal number.
Min length:1
Max length:14
currency Copied to clipboard String REQUIRED

The currency of the transaction expressed as an ISO 4217 alpha code, e.g. USD.

Data must consist of the characters A-Z
Min length:3
Max length:3
description Copied to clipboard String REQUIRED

Short textual description of the contents of the order.

Data can consist of any characters
Min length:1
Max length:127
shippingAndHandlingAmount Copied to clipboard Number

The total shipping and handling amount for the order.

Data is a string that consists of the characters 0-9 and '.' and represents a valid decimal number.
Min length:1
Max length:14
taxAmount Copied to clipboard Number

The total tax amount for the order.

If you do not provide this value but provide line item data, then this amount is calculated as the sum of the item.quantity times the item.unitTaxAmount for all the line items (total tax amount).
If you provide both this value and line item data, then the order.taxAmount MUST equal the total tax amount.
This data may be used to qualify for better interchange rates on corporate purchase card transactions.
Data is a string that consists of the characters 0-9 and '.' and represents a valid decimal number.
Min length:1
Max length:14
paymentPage Copied to clipboard Object REQUIRED

Information that controls the payer's interaction on the payment page.

billingAddress Copied to clipboard Object
displayControl Copied to clipboard String

Indicates if you require the payer to provide their billing address on the payment page.

By default, it will be assumed that this field will be OPTIONAL.
Value must be a member of the following list. The values are case sensitive.
HIDEHides data fields from the payer.
MANDATORYDisplays data fields and allows the payer to enter data into these fields.
OPTIONALDisplays data fields and allows the payer to opt out of data entry for these fields.
READ_ONLYData is displayed but cannot be modified.
customer Copied to clipboard Object
email Copied to clipboard Object
displayControl Copied to clipboard String

Indicates if you require the payer to provide their email address on the payment page.

By default, it will be assumed that this field will be READ_ONLY.
Value must be a member of the following list. The values are case sensitive.
HIDEHides data fields from the payer.
MANDATORYDisplays data fields and allows the payer to enter data into these fields.
OPTIONALDisplays data fields and allows the payer to opt out of data entry for these fields.
READ_ONLYData is displayed but cannot be modified.
googleAnalytics Copied to clipboard Object
propertyId Copied to clipboard String

This is the property ID for your shop site provided by Google Analytics in the form UA-XXXXX-Y.

Provide this ID if you want to track interactions with your payment page using Google Analytics, see www.google.com/analytics.
Data can consist of any characters
Min length:1
Max length:20
merchant Copied to clipboard Object REQUIRED

Information that allows you to display your brand and business details on the payment page.

address Copied to clipboard Object

Information on your business address.

line1 Copied to clipboard String

The first line of your business address for display to the payer on the payment page.

Data can consist of any characters
Min length:0
Max length:100
line2 Copied to clipboard String

The second line of your business address for display to the payer on the payment page.

Data can consist of any characters
Min length:0
Max length:100
line3 Copied to clipboard String

The third line of your business address for display to the payer on the payment page.

Data can consist of any characters
Min length:0
Max length:100
line4 Copied to clipboard String

The fourth line of your business address for display to the payer on the payment page.

Data can consist of any characters
Min length:0
Max length:100
email Copied to clipboard String

The email address of your business for display to the payer on the payment page.

For example, email address for customer service.
Ensures that the email address is longer than 3 characters and adheres to a generous subset of valid RFC 2822 email addresses
name Copied to clipboard String REQUIRED

The name of your business for display to the payer on the payment page

Data can consist of any characters
Min length:1
Max length:40
phone Copied to clipboard String

The phone number of your business for display to the payer on the payment page.

Data can consist of any characters
Min length:0
Max length:20
shipping Copied to clipboard Object

Information on the shipping address including the contact details of the addressee.

address Copied to clipboard Object

The address to which the goods contained in this order are being shipped.

This data may be used to qualify for better interchange rates on corporate purchase card transactions.
city Copied to clipboard String

The city portion of the address.

Data can consist of any characters
Min length:1
Max length:100
country Copied to clipboard String

The 3 letter ISO standard alpha country code of the address.

Data must consist of the characters A-Z
Min length:3
Max length:3
postcodeZip Copied to clipboard String

The post code or zip code of the address.

Data may consist of the characters 0-9, a-z, A-Z, ' ', '-'
Min length:1
Max length:10
stateProvince Copied to clipboard String

The state or province of the address.

Data can consist of any characters
Min length:1
Max length:20
street Copied to clipboard String

The first line of the address.

For example, this may be the street name and number, or the Post Office Box details.
Data can consist of any characters
Min length:1
Max length:100
street2 Copied to clipboard String

The second line of the address (if provided).

Data can consist of any characters
Min length:1
Max length:100
firstName Copied to clipboard String

The first name of the person to whom the order is being shipped.

Data can consist of any characters
Min length:1
Max length:50
lastName Copied to clipboard String

The last name or surname of the person to whom the order is being shipped.

Data can consist of any characters
Min length:1
Max length:50
method Copied to clipboard String

The shipping method code to indicate the time frame and the priority of the order.

Value must be a member of the following list. The values are case sensitive.
ELECTRONICElectronic delivery.
GROUNDGround (4 or more days).
OVERNIGHTOvernight (next day).
PRIORITYPriority (2-3 days).
SAME_DAYSame day.
phone Copied to clipboard String

The phone number of the person to whom the order is being shipped.

Data can consist of any characters
Min length:1
Max length:20

Return Value Copied to clipboard

None