PxpCheckoutConfig

View the reference for the PxpCheckoutConfig file.

Reference

import PxpCheckoutConfig from "@pxpio/web-components-sdk";

const checkoutConfig: PxpCheckoutConfig = {
  environment: string,
  session: SessionData,
  merchantShopperId: string,
  ownerType: string,
  ownerId: string,
  transactionData: {
    currency: string,
    amount: number,
    entryType: string,
    intent: string,
    merchantTransactionId: string,
    merchantTransactionDate: string
  },
  shippingAddress: {
    countryCode: string,
    postalCode: string,
    address: string
  },
  analyticsEvent: (event) => console.log(event)
};

Properties

Property

Description

environment
string

The environment type.

Possible values:

  • test
  • live

session
sessionData

Details about the checkout session.

transactionData
object

Details about the transaction currency and amount.

transactionData.currency
string

The currency code associated with the transaction, in ISO 4217 format.

transactionData.amount
number

The transaction amount.

transactionData.intent
string

The transaction intent.

Possible values:

  • Authorisation
  • EstimatedAuthorisation
  • Purchase
  • Payout
  • Verification

transactionData.entryType
string

The entry type.

Possible values:

  • Ecom
  • MOTO

transactionData.merchantTransactionId
string

A unique identifier for this transaction.

transactionData.merchantTransactionDate
string

The date and time of the transaction, in ISO 8601 format.

merchantShopperId
string

A unique identifier for this shopper.

ownerType
string

The type of owner.

Possible values:

  • MerchantGroup
  • Merchant
  • Site

ownerId
string

The identifier of the owner related to the ownerType.

shippingAddress
object

The shopping address associated with the checkout process. This address can be used to prefill the billing address fields if the cardholder chooses to use the same address for billing. You can update this after the checkout is initialised by using the setShippingAddress method of the PxpCheckout instance.

shippingAddress.address
string

The address line of the shipping address.

shippingAddress.postalCode
string

The postal or ZIP code of the shipping address.

shippingAddress.countryCode
string

The country code identifying the country associated with the shipping address, in ISO-3166-1 alpha-2 format.

Callbacks

CallbackDescription
analyticsEvent: (event) => console.log(event)Callback function for analytics events.

Example

import PxpCheckoutConfig from "@pxpio/web-components-sdk";

const checkoutConfig: PxpCheckoutConfig = {
  environment: "test",
  session: sessionData,
  transactionData: { 
    currency: "USD",
    amount: 1000 
  },
  merchantShopperId: "shopper_001",
  ownerType: "Merchant",
  ownerId: "merchant_001",
  shippingAddress: { 
    address: "123 Elm St",
    postalCode: "90210", 
    countryCode: "US"
  },
  analyticsEvent: (analyticsEvent: AnalyticsEvent.BaseAnalyticsEvent) => void | Promise<void>
};