Skip to main content

Creating a Checkout component

You can enable this by calling addCheckout():

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

options is an optional object that can contain the following properties:

  • taxAmount: tax amount
  • shippingAmount: amount of shipping
  • discountAmount: amount of discount
  • orderItems: array of products:
    • name: name of product
    • quantity: quantity of product
    • sku: sku of product
    • unitPrice: unit price of product
    • totalAmount: total cost of product
  • customer: inforamtion about customer
    • firstName: first name of customer
    • lastName: last name of customer
    • email: email of customer
    • phoneNumber: phone number of customer
  • billingAddress: billinng address
    • firstName
    • lastName
    • email
    • phoneNumber
    • streetAddress
    • streetAddress2
    • city
    • country
    • region
    • postalCode
    • state
  • checkoutOptions: object that contain checkout metadata
  • metadata: additional metadata to send with the payment request (optional)