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

Checkout.configure(configuration);


Example

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

Arguments

configuration 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 Object
address Object

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

billing Object
address Object
city String

The city portion of the payers address.

Data can consist of any characters
Min length:1
Max length:100
billing Object
address Object
country 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 Object
address Object
postcodeZip 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 Object
address Object
stateProvince String

The state or province of the payers address.

Data can consist of any characters
Min length:1
Max length:20
billing Object
address Object
street 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 Object
address Object
street2 String

The second line of the address (if provided).

Data can consist of any characters
Min length:1
Max length:100
customer Object
email 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 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 Object REQUIRED

Information about the order associated with this transaction.

id 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 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 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 String REQUIRED

Short textual description of the contents of the order.

Data can consist of any characters
Min length:1
Max length:127
shippingAndHandlingAmount 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 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 Object REQUIRED

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

billingAddress Object
displayControl 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 Object
email Object
displayControl 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 Object
propertyId 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 Object REQUIRED

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

address Object

Information on your business address.

line1 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 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 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 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 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 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 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 Object

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

address 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 String

The city portion of the address.

Data can consist of any characters
Min length:1
Max length:100
country 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 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 String

The state or province of the address.

Data can consist of any characters
Min length:1
Max length:20
street 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 String

The second line of the address (if provided).

Data can consist of any characters
Min length:1
Max length:100
firstName 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 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 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 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

None