redirectToCheckout(props)

Function to redirect the shopper in a Hosted Payment Page(HPP) integration.

Parameters

propsrequiredHostedPaymentPageOptions

Returns

string | void
linkTypeScript
1import { init } from '@airwallex/components-sdk';
2
3const { payment } = await init({
4 env: 'demo', // Choose the Airwallex environment ('demo' or 'prod')
5 enabledElements: ['payments'],
6});
7payment.redirectToCheckout({
8 intent_id: 'replace-with-your-intent-id',
9 client_secret: 'replace-with-your-client-secret',
10 currency: 'replace-with-your-currency',
11 country_code: 'replace-with-your-country-code',
12});

HostedPaymentPageOptions

Configuration option for Hosted Payment Page(HPP), a checkout solution that redirects shoppers to a secure, pre-built payment page hosted by Airwallex.

client_secretrequiredstring

The client_secret of the Payment Intent when Payment Intent is provided. Otherwise, this should be the client_secret of the Customer object.

currencyrequiredstring

The three-letter ISO currency code representing the currency of the Payment Intent or Payment Consent.

allowedCardNetworksoptional[]

One or more card networks that you support.

Checkout configuration options for Apple Pay.

The authorization type for the card payment. Set it to 'pre_auth' if you want to place a hold on your customer’s card for more than 7 days, i.e., extend the authorization time window. Currently 'pre_auth' is only available when the card brand is Visa or Mastercard. autoCapture will be automatically set to false if you enable 'pre_auth'. Default value is 'final_auth'.

autoCaptureoptionalboolean

Whether the amount should be captured automatically upon successful payment authorization. Set it to false if you want to place a hold on the payment method and capture the funds sometime later. Default value is true.

country_codeoptionalstring

The two-letter ISO country code of the shopper's country. This is required for bank_transfer, online_banking, skrill or seven_eleven payment methods.

cvcRequiredoptionalboolean

Whether you require the shopper to provide CVC when they checkout with a network tokenized card.

disableAutoRedirectoptionalboolean

Whether auto redirect to the URL specified by the merchant should be disabled. Default value is false.

The Airwallex integration environment your site would like to connect with. Default value is prod.

failUrloptionalstring

The HTPS URL to redirect shoppers when payment fails.

Checkout configuration options for Google Pay.

intent_idoptionalstring

The ID of the Payment Intent you would like to checkout. Required when mode is 'payment'.

localeoptional

The locale for your website.

logoUrloptionalstring

The URL of your website logo to display on the header of the Hosted Payment Page.

The payment methods your website would like to integrate with.

modeoptional

The checkout mode for the shopper. Default value is 'payment'.

When using Payments for Platforms, specify the ID of the connected account associated with the payment if you want to use its information to process the payment. For example, the statement descriptor displayed on the shopper's credit card or bank statement and the payment methods activated by the connected account.

Options for recurring flow.

The billing information that you require from the user in order to process the transaction.

shopper_emailoptionalstring

The shopper's email address.

shopper_nameoptionalstring

The shopper's full name.

shopper_phoneoptionalstring

The shopper's phone number.

showTermLinkoptionalboolean

successUrloptionalstring

The HTTPS URL to redirect shoppers when payment is successful.

Page style customization options for Hosted Payment Page.

The options for WeChat Pay.

componentsdeprecated[]

The payment methods your website would like to integrate with.

withBillingdeprecatedboolean

Used to increase the likelihood of 3DS frictionless checkout. Set this to true if you want the payment form to collect billing information from the shopper. Only applies to card payment method.