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.

agreement Object

A series of related orders that execute one commercial agreement.

For example, linking the orders for a series of recurring payments (a mobile phone subscription), split tenders (one payment using two cards), or when the merchant offers to take payments by a series of installments (hire purchase).

You must provide this data for some types of payments (such as recurring), but you can provide it for any cases where you want to link orders together.
amountVariability String

Indicates if all the payments within the agreement use the same amount or if the amount differs between the payments.

Value must be a member of the following list. The values are case sensitive.
FIXEDAll payments in the recurring payment agreement have the same amount. Examples include magazine subscriptions or gym memberships.
VARIABLEThe amount for the payments within the recurring payment agreement differs between payments. Examples include usage-based charges like utility or phone bills.
expiryDate String

Date at which your agreement with the payer to process payments expires.

Data must comply with ISO 8601 extended date format, yyyy-mm-dd
id String

Your identifier for the agreement you have with the payer to process payments.

When you collect cards from your payers and store them for later use, you must provide an agreement ID when you use the stored values for:

  • Recurring payments: you have an agreement with the payer that authorizes you to automatically debit their account at agreed intervals for fixed or variable amounts. For example, gym membership, phone bills, or magazine subscriptions.
  • Installment payments: you have an agreement with the payer that authorizes you to process multiple payments over an agreed period of time for a single purchase. For example, the payer purchases an item for $1000 and pays for it in four monthly installments.
  • Unscheduled: you have an agreement with the payer that authorizes you to process future payments when required. For example, the payer authorizes you to process an account top-up transaction for a transit card when the account balance drops below a certain threshold.
When you first establish an agreement with the payer you should also specify the type of agreement in agreement.type.
Data can consist of any characters
Min length:1
Max length:100
maximumAmountPerPayment Number

The maximum amount for a single payment in the series as agreed with the payer under your agreement with them.

The amount must be provided in the currency of 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
minimumDaysBetweenPayments Number

The minimum number of days between payments agreed with the payer under your agreement with them.

A number comprising the digits 0-9, having at least one digit. (For a complete description, see http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger.)
Min value:1
Max value:9999
numberOfPayments Number

The number of merchant-initiated payments within the recurring payment agreement.

A number comprising the digits 0-9, having at least one digit. (For a complete description, see http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger.)
Min value:1
Max value:999
paymentFrequency String

The frequency of the payments within the series as agreed with the payer under your agreement with them.

Value must be a member of the following list. The values are case sensitive.
AD_HOCThe agreement if for payments on an ah-hoc basis.
DAILYThe agreement if for a daily payment.
FORTNIGHTLYThe agreement if for a fortnightly payment.
MONTHLYThe agreement if for a monthly payment.
OTHERThe agreement is for payments according to a schedule other than the ones listed in the other enumeration values for this field.
QUARTERLYThe agreement if for a quarterly payment.
TWICE_YEARLYThe agreement if for a payment twice a year.
WEEKLYThe agreement if for a weekly payment.
YEARLYThe agreement if for a yearly payment.
authentication Object

Information about how the payer's identity is verified.

For example, using 3-D Secure authentication.

This parameter group include payer authentication options available to you, parameters you need to perform payer authentication for an available method, and the results of payer authentication.
3ds Object

Information about payer authentication using 3-D Secure authentication.

Only provide these fields if you authenticated the payer using a different 3-D Secure service provider. If you authenticated the payer using the gateway, then provide authentication.transactionId instead.

Parameters in this group apply to both 3-D Secure authentication version 1 and 3-D Secure Authentication version 2.

Depending on the 3-D Secure authentication version applicable you will also need additional parameters:

- 3-D Secure authentication version 1: see the authentication.3ds1 parameter group.
- 3-D Secure authentication version 2: see the authentication.3ds2 parameter group.
acsEci String

Indicates the security level of the transaction.

This is the Electronic Commerce Indicator (ECI) value provided by the issuer's Access Control Server (ACS) to indicate the results of the attempt to authenticate the payer.
Data may consist of the characters 0-9, a-z, A-Z
Min length:1
Max length:2
authenticationToken

The base64 encoded value generated by the issuer.

The authentication token Included in subsequent transaction request messages and used by the card scheme to verify that the authentication occurred and the values provided are valid. The token should be used unaltered. For 3DS version 1, this field corresponds to the Cardholder Authentication Verification Value (CAVV) for Visa, the Accountholder Authentication Value (AAV) for MasterCard and JCB, or the American Express Verification Value (AEVV) for American Express.

For 3DS version 2, this field corresponds to the Authentication Value.
Data is Base64 encoded
allowable lengths28 or 32
transactionId String

A unique identifier for the 3-D Secure authentication transaction.

For 3DS version 1, this field corresponds to the XID. The XID is an identifier generated by the gateway on behalf of the merchant.

For 3DS version 2, this field corresponds to the identifier assigned by the scheme directory server.


This identifier should be used in subsequent operation requests unaltered.

An XID submitted in this field must be in base64 format.
Data can consist of any characters
Min length:1
Max length:50
3ds1 Object

Information about payer authentication using 3-D Secure authentication version 1.

Only provide these fields if you authenticated the payer using a different 3-D Secure service provider. If you authenticated the payer using the gateway, then provide authentication.transactionId instead.
paResStatus

Indicates the result of payer authentication with the issuer.

This is the value returned in the transaction status field of the Payer Authentication Response (PARes) message from the card Issuer's Access Control Server (ACS). For example, Y, N, A, or U. Refer to the relevant documentation for Mastercard SecureCode™, Verified by Visa™, JCB J/Secure™, American Express SafeKey™, or Diners Club ProtectBuy™.
Data may consist of the characters a-z, A-Z
Min length:1
Max length:1
veResEnrolled

Indicates whether or not payer authentication is available for the card number you provided.

This is for experts only - most users should use the response.gatewayRecommendation field.

This is the value returned in the 'enrolled' field of the Verify Enrollment Response (VERes) message from the card scheme's Directory Server. For example, Y, N, or U. Refer to the relevant documentation for Mastercard SecureCode™, Verified by Visa™, JCB J/Secure™, American Express SafeKey™, or Diners Club ProtectBuy™.
Data may consist of the characters a-z, A-Z
Min length:1
Max length:1
3ds2 Object

Information about payer authentication using 3-D Secure authentication version 2.

Only provide these fields if you authenticated the payer using a different 3-D Secure service provider. If you authenticated the payer using the gateway, then provide authentication.transactionId instead.
custom

Additional information returned by the scheme or issuer in the authentication response that must be included (together with the standard authentication details) when submitting the transaction for processing by the acquirer.

Data is valid Json Format
Min length:1
Max length:4000
protocolVersion String

The version of the EMV 3-D Secure protocol used to perform 3-D Secure authentication, in the format specified by EMVCo.

For example, 2.1.0
Data may consist of the characters 0-9, a-z, A-Z, '.'
Min length:1
Max length:20
statusReasonCode String

A code indicating the reason for the transaction status returned in authentication.3ds2.transactionStatus.

Refer to the EMVCo specification for 3-D Secure.
Data can consist of any characters
Min length:2
Max length:2
transactionStatus

Indicates the result of payer authentication with the issuer.

This is the value returned in the transaction status field from the issuer's Access Control Server (ACS). For example, Y, N, U, A, R

Refer to the EMVCo specification for 3-D Secure.
Data may consist of the characters a-z, A-Z
Min length:1
Max length:1
transactionId String

The transactionId you used for the Initiate Authentication operation.

Data can consist of any characters
Min length:1
Max length:40
billing Object

Details of the payer's billing address.

address Object

The payer's billing address.

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

The name of the company associated with this 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
stateProvinceCode String

The three character ISO 3166-2 country subdivision code for the state or province of the address.

Providing this field might improve your payer experience for 3-D Secure payer authentication.
Data can consist of any characters
Min length:1
Max length:3
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
constraints Object

Information about any constraints that apply to this transaction.

Specify constraints to ensure that the transaction conforms to predefined criteria. This is useful if your integration does not directly collect all the transaction values (e.g. a session-based integration or a checkout integration).
cruise Object

Cruise industry data.

departurePort Object

A departurePort is the port where the passenger(s) boarded the cruise ship when the cruise trip started

address Object

Address of the cruise line.

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

The state or province code of the address.

The value must match the second part of the ISO 3166-2 code. For an address in the United States provide the 2-letter ISO 3166-2 state code. For US military bases provide one of AE, AA, AP. For an address in Canada provide the 2-letter ISO 3166-2 province code.
Data can consist of any characters
Min length:1
Max length:3
street String

The first line of the address.

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

Information about the customer, including their contact details.

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

The payer's first name.

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

The payer's last or surname.

Data can consist of any characters
Min length:1
Max length:50
mobilePhone

The payer's mobile phone or cell phone number in ITU-T E123 format, for example +1 607 1234 5678

The number consists of:

  • '+'
  • country code (1, 2 or 3 digits)
  • 'space'
  • national number ( which may embed single spaces characters for readability).

Data consists of '+', country code (1, 2 or 3 digits), 'space', and national number (which may embed single space characters for readability)
Mandatory country code:true
Max total digits:15
phone

The payer's phone number in ITU-T E123 format, for example +1 607 1234 456

The number consists of:

  • '+'
  • country code (1, 2 or 3 digits)
  • 'space'
  • national number ( which may embed single spaces characters for readability).

Data consists of '+', country code (1, 2 or 3 digits), 'space', and national number (which may embed single space characters for readability)
Mandatory country code:true
Max total digits:15
device Object

Information about the device used by the payer for this transaction.

ani String

The telephone number captured by ANI (Automatic Number Identification) when the customer calls to place the order.

Data can consist of any characters
Min length:1
Max length:10
aniCallType String

The 2 digit ANI information identifier provided by the telephone company to indicate the call type, for example, cellular (61-63), toll free (24,25), etc.

Data can consist of any characters
Min length:1
Max length:2
mobilePhoneModel String

The mobile phone manufacturer's identifier for the model of the mobile device used to initiate the payment.

Data can consist of any characters
Min length:1
Max length:255
initiator Object
userId String

The person who initiated this transaction.

This field is automatically populated by the gateway if the transaction was created via Merchant Administration (gatewayEntryPoint=MERCHANT_ADMINISTRATION) or Merchant Manager (MERCHANT_MANAGER). In this case this is the name that the person used to log in to Merchant Administration or Merchant Manager respectively.
Data can consist of any characters
Min length:1
Max length:256
interaction Object REQUIRED

Information that controls the payer's checkout interaction.

country String

The ISO 3166 alpha-3 country code of the payer's country, to be used to present country-specific content to the payer during the interaction.

For a Secure Remote Commerce interaction, the payer's country is used to present country-specific content such as Terms and Conditions and you only need to provide it, if you wish to override the default payer country you have configured for Secure Remove Commerce interactions.

Note that all content, including country-specific content, will be presented in the language based on the payer's locale provided in the interaction.locale field.

Data must consist of the characters A-Z
Min length:3
Max length:3
displayControl Object

A group of objects that control the visibility of, and payer-interaction with, displayed information.

billingAddress String

Indicates if you require the payer to provide their billing address during the payment interaction.

If you do not provide this field, the billing address 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.
customerEmail String

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

If you do not provide this field, the payer's email address will be hidden.
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.
paymentTerms String

Indicates whether you wish to hide payment terms for a payment plan during the payment interaction.

If you do not provide this field the payment terms for a payment plan will be displayed.
Value must be a member of the following list. The values are case sensitive.
HIDEHides the payment terms from the payer. Note that offering Plan AMEX in some regions may require you to inform the payer of the payment terms before processing the payment.
SHOW_IF_SUPPORTEDDisplays the payment terms, if available, to the payer.
shipping String

Indicates if you wish to hide the shipping details on the payment interaction.

If you don't provide this field, shipping details will be displayed to the payer.
Value must be a member of the following list. The values are case sensitive.
HIDEHides data fields from the payer.
READ_ONLYData is displayed but cannot be modified.
locale String

A language identifier or IETF language tag to control the language of the payment interaction with the payer (e.g. en_US, es, fr-CA).

By default, the language is determined from the payer's browser. Supply a value for this field only if you wish to override the default behavior. If the language you specify is not supported by the gateway, the payment is displayed in the best matching language.
Data must be a language identifier or IETF language tag
Min length:2
Max length:5
merchant Object REQUIRED

Information that allows you to display your brand and business details during the payment interaction.

address Object

Information on your business address.

line1 String

The first line of your business address for display to the payer during the payment interaction.

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 during the payment interaction.

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 during the payment interaction.

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 during the payment interaction.

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 during the payment interaction (e.g. an 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 interaction.

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 during the payment interaction.

Data can consist of any characters
Min length:0
Max length:20
url String

The URL of your business for display to the payer during the payment interaction.

Data must be an absolute URI conforming to the URI syntax published by IETF RFC 2396. The following schemes are forbidden : javascript
operation String REQUIRED

Indicates the operation that you wish to perform during the Hosted Checkout interaction.

Value must be a member of the following list. The values are case sensitive.
AUTHORIZERequest for the Hosted checkout interaction to create Authorization transaction for the payment.
NONEHosted Checkout will collect the payment details from the payer and securely store them against the Hosted Checkout session. No operation will be performed after the payer interaction.
PURCHASERequest for the Hosted checkout interaction to create Purchase transaction for the payment.
VERIFYRequest for the Hosted Checkout interaction to verify the payer's account. The payment details are verified using the verification method supported by the acquirer and the data provided in the request.
timeoutUrl String

The URL to which you want to return the payer if the payment is not completed in the allowed time.

This will either be the time you specified in interaction.timeout or the gateway default timeout value.
Data must be an absolute URI conforming to the URI syntax published by IETF RFC 2396. The following schemes are forbidden : javascript
lineOfBusiness String

Your payment service provider might have configured your merchant profile to support several lines of business.

Each line of business can have different payment parameters, such as bank account, supported cards or such.

For example, lineOfBusiness = TICKET_SALES can have a different bank account from lineOfBusiness = MERCHANDISING. One line of business on your profile might be "null". To use that, do not provide the lineOfBusiness field.
Data can consist of any characters except space
Min length:1
Max length:100
partnerSolutionId String

If, when integrating with the gateway, you are using a solution (e.g. a shopping cart or e-commerce solution) provided, supported or certified by your payment service provider, enter the solution ID issued by your payment service provider here.

If your payment service provider has not provided you with a solution ID, you should ignore this field.
Data can consist of any characters
Min length:1
Max length:40
session Object
id 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 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
shipping Object

Shipping information for this order.

address Object
address Object

The address to which this order will be shipped.

city String

The city portion of the address.

Data can consist of any characters
Min length:1
Max length:100
company String

The name of the company associated with this 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
source String

How you obtained the shipping address.

Value must be a member of the following list. The values are case sensitive.
ADDRESS_ON_FILEOrder shipped to an address that you have on file.
NEW_ADDRESSOrder shipped to an address provided by the payer for this transaction.
stateProvince String

The state or province of the address.

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

The three character ISO 3166-2 country subdivision code for the state or province of the address.

Providing this field might improve your payer experience for 3-D Secure payer authentication.
Data can consist of any characters
Min length:1
Max length:3
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
contact Object

Details of the contact person at the address the goods will be shipped to.

email String

The contact person's email address.

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
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
mobilePhone

The contact person's mobile phone or cell phone number in ITU-T E123 format, for example +1 607 1234 5678

The number consists of:

  • '+'
  • country code (1, 2 or 3 digits)
  • 'space'
  • national number ( which may embed single spaces characters for readability).

Data consists of '+', country code (1, 2 or 3 digits), 'space', and national number (which may embed single space characters for readability)
Mandatory country code:true
Max total digits:15
phone

The contact person's phone number in ITU-T E123 format, for example +1 607 1234 456

The number consists of:

  • '+'
  • country code (1, 2 or 3 digits)
  • 'space'
  • national number ( which may embed single spaces characters for readability).

Data consists of '+', country code (1, 2 or 3 digits), 'space', and national number (which may embed single space characters for readability)
Mandatory country code:true
Max total digits:15
method String

The shipping method used for delivery of this order.

Value must be a member of the following list. The values are case sensitive.
ELECTRONICElectronic delivery.
GROUNDGround (4 or more days).
NOT_SHIPPEDOrder for goods that are not shipped (for example, travel and event tickets)
OVERNIGHTOvernight (next day).
PICKUPShipped to a local store for pick up.
PRIORITYPriority (2-3 days).
SAME_DAYSame day.
transaction Object

Information about this transaction.

acquirer Object

Additional information to be passed to acquirer.

customData String

Additional information requested by the acquirer which cannot be passed using other available data fields.

This field must not contain sensitive data.
Data can consist of any characters, but sensitive data will be rejected
Min length:1
Max length:2048
traceId String

The unique identifier that allows the issuer to link related transactions.

Typically the gateway takes care of submitting this identifier to the issuer on your behalf. However, you must submit this identifier if you have processed the payer-initiated transaction (also called CIT) for the payment agreement outside the gateway or you are submitting a Refund where the Authorization or Payment has been performed outside the gateway.

For a Mastercard transaction this identifier must contain the scheme issued transaction identifier, network code and network date, and is also known as the Trace ID. For a Visa or American Express transaction this identifier matches the scheme issued transaction identifier, also known as Transaction Identifier or TID. Refer to the scheme's documentation for more details.

Payment in a Series

You must provide the information returned in the Authorization/Payment/Verification response for the last payer-initiated transaction in the series (CIT).

Refund

You must provide the information returned in the Authorization/Payment response for the payment for which you are issuing a refund.
Data can consist of any characters, but sensitive data will be rejected
Min length:1
Max length:15
transactionId String

This is the value provided to the acquirer to identify the order.

Ideally this will be the order.id, however if that value cannot be used directly, it will be transformed by the gateway to a unique value that the acquirer will accept. If that behavior is not suitable, you can directly provide the value in this field and it will be passed to the acquirer. You then take responsibility for its correctness. (Note: Contact your payment provider to see if this is supported for your acquirer).
Data can consist of any characters, but sensitive data will be rejected
Min length:1
Max length:100
deferredAuthorization Boolean

Indicates that you were not able to submit the Authorization (or Payment) transaction at the time it was completed with the cardholder due to a connectivity, system issue, or other limitations and have deferred submitting it until your system was back online.

The values 'true' or 'false'. (For a complete description, see http://www.w3.org/TR/xmlschema-2/#boolean.)
merchantNote String

Your note about this transaction.

Data can consist of any characters
Min length:1
Max length:250
reference String

An optional identifier for this transaction.

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

Return Value

None