Search...
APIJSLog inGet started in sandbox
Airwallex logo
Home
Platform APIs
Connected Accounts
Accounts
Payments
Billing
Transactional FX
Payouts
Issuing
Back to home
OverviewChoose your payments solutionGet started with payments
Supported currencies
Online payments
Online payments overviewPayment Method Onboarding RequirementGet started with online paymentsHosted Payment Page
Drop-in Element
Embedded Elements
Card Element
Split Card Element
Korean Local Cards - Split Card Element
Guest user checkout
Legacy Embedded Elements
Mobile SDK
Plugins
Native API
Automatic Currency ConversionMulti-Currency Pricing API
Invoice integrations
Tax filing

Guest user checkout

This page describes how to embed a Korean Local Cards - Split Card Element on your payment page to accept payments.

How it works

The diagram below depicts the information flow in a Korean Local Cards - Split Card Elements integration. Korean Local Cards - Split Card Element Guest Checkout Diagram

Before you begin

Before you implement the integration, consider the following:

Step 1: Set up the server to create a PaymentIntent

When the shopper begins the checkout process, you will need to create a PaymentIntent object to indicate your intent to collect payment from the shopper.

When the checkout page loads, on your server, call Create a PaymentIntent API with an amount and currency. Always decide how much to charge on the server side, a trusted environment, as opposed to the client. This prevents malicious shoppers from being able to alter the payment amount.

Provide return_url in Create a PaymentIntent API to indicate where Airwallex should redirect the shopper after completing the payment, whether successful or otherwise.

The PaymentIntent’s id and client_secret are returned in the response — these parameters let you confirm the payment and update card details on the client, without allowing manipulation of sensitive information, like payment amount.

Shell

Step 2: Initialize Airwallex on your checkout page

First, you will need to import Airwallex.js and then initialize the package. For details, see Initialize Airwallex JS.

Step 3: Add the Korean Local Cards - Split Card Elements to your checkout page

To embed the Korean Local Cards - Split Card Elements into your checkout page, you will need to create an empty container, create the Elements and then mount the Elements to the container.

Define the payment form

First, create an empty container div with a unique id in your payment form and a Submit button to trigger the payment request. Ensure that the payment form only contains one Element with this unique id. Airwallex inserts an iframe into this div that securely collects card information.

HTML

Create the Korean Local Cards - Split Card Elements

When the payment form has loaded, call createElement(type, options) by specifying the Element type as krCardNumber, krCardExpiry, krCardIdentifier and krCardPswFirstTwo respectively to create card number, expiry date, Cardholder DoB/Company Business Number and Card PIN first-2 digits Elements. Ensure that the payment form only contains one Element with these ids.

JavaScript

Mount the Split Card Elements

Call mount() with the id of the div to mount the Element to the DOM. The Elements should only be mounted once in a single payment flow.

JavaScript

Optionally, you can provide the PaymentIntent id and client_secret in createElement() JS or create a PaymentIntent after the shopper clicks the Submit button and pass the details in confirm() JS.

JavaScript

Step 4: Confirm the PaymentIntent

When the shopper clicks the Submit button, call confirm() JS by passing the id and client_secret returned in Create a PaymentIntent, to complete the payment.

cardNumber.confirm(options);

You can also pass other options in confirm() depending on your payment flow. For details, see confirm() JS.

Handle the submit event

Add an event handler to the Submit button and listen to the form’s submit event to know when to confirm the payment.

JavaScript

Test your integration

Note

Korean Local Cards do not operate a sandbox environment. Please reach out to your Airwallex account manager and solution engineer for arranging the testing.

Troubleshooting

For troubleshooting tips, see Airwallex.js error codes.

Was this page helpful?