Skip to main content

Setting Up a Custom Checkout Component

You can enable this by calling addCheckout():

window.addEventListener('load', function () {
neodeos.init('sandbox', '<public key>')
.addCheckout('iframeContainer', '<amount>', '<3-letters currency code>', '<Checkout Provider Type>', '<Checkout Provider Id>', 'options', 'checkoutOptions' );
});

The options object supports the following optional properties:

  • taxAmount: the total applicable tax for the order
  • shippingAmount: the cost associated with shipping the order
  • discountAmount: any discount applied to the transaction
  • orderItems: an array of individual products in the order, each containing:
    • name: the product's display name
    • quantity: the number of units being purchased
    • sku: the product's stock keeping unit identifier
    • unitPrice: the price per single unit of the product
    • totalAmount: calculated total for this product line (unit price × quantity)
  • customer: object containing the customer's personal details:
    • firstName: customer's given name
    • lastName: customer's surname
    • email: customer's email address
    • phoneNumber: customer's contact number
  • billingAddress: object representing the billing details:
    • firstName
    • lastName
    • email
    • phoneNumber
    • streetAddress
    • streetAddress2
    • city
    • country
    • region
    • postalCode
    • state
  • checkoutOptions: an object used to pass metadata and configuration parameters relevant to the checkout flow