> ## Documentation Index
> Fetch the complete documentation index at: https://primer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# configure

Configure Universal Checkout using this method.
Based on the use case, set different settings that can be passed to Universal Checkout.
Please refer to the section below for more information.

```ts TS theme={"dark"}
import { Primer, PrimerSettings } from "@primer-io/react-native";

// ...

const onUniversalCheckoutButtonTapped = async () => {
  const settings: PrimerSettings = {
    /* options */
  };

  await Primer.configure(settings);
};
```

## Parameters

**Parameters**

**settings** `PrimerSettings`

⚠️ If no settings are provided, the SDK will initialize with its default settings. \\

Use `PrimerSettings` to provide different options based on your use case.

**Properties**

**paymentHandling** `String`

Can be set to `'MANUAL'` or `'AUTO'`
Force the SDK locale. By default, the locale will be set to the device's locale.

**localeData** `IPrimerLocaleData`

Forces some payment methods' locale.

**properties**

**languageCode** `String`

Forces the language code (e.g. `en`). Defaults on your app's language code if available.

**localeCode** `String`

Forces the locale code (e.g. `US`). Defaults on your app's country locale code if available.

**paymentMethodOptions** `IPrimerPaymentMethodOptions`

Customize the appearance and behavior of the card fields in the checkout form for various payment methods

**Properties**

**iOS** `object`

**Properties**

**urlScheme** `String`

⚠️ Required for some payment methods (e.g. PayPal). \\

This option sets the deeplink schema used when redirecting back from 3rd
party applications to your app.

**android** `object`

**Properties**

**redirectScheme** `String`

⚠️ Required for some payment methods (e.g. PayPal). \\

This option sets the deeplink schema used when redirecting back from 3rd
party applications to your app.

**applePayOptions** `IPrimerApplePayOptions`

Options for using Apple Pay as a payment method.

**Properties**

**merchantIdentifier** `String`

Set it to the merchant identifier as it is shown in your Apple Pay certificate.

**merchantName** `String`

Deprecated: Use Client Session API to provide merchant name value.

**isCaptureBillingAddressEnabled** `Boolean`

Defaults to `false`. Set to `true` to let Apple Pay capture the customer's billing address.

Deprecated: Use BillingOptions to configure required billing fields.

**showApplePayForUnsupportedDevice** `Boolean`

If in some cases you don't want to present ApplePay option if the device is not supporting it set this to `false`. The default value is `true`.

Default value is \`true\`. Set to \`false\` if you do not want to present Apple Pay option on unsupported devices.

**checkProvidedNetworks** `Boolean`

> [!WARNING]
>
> This is an advanced configuration flag. You should discuss it with the Primer team before using it.

If set to `true`, only merchant-allowed card networks can be used when paying with Apple Pay. If set to `false` any network can be used provided the device supports Apple Pay.

Merchant-allowed networks are provided using [`orderedAllowedCardNetworks`](https://primer.io/docs/api-reference/v2.4/api-reference/client-session-api/create-a-client-session#body-payment-method-ordered-allowed-card-networks) when creating the client session.

Default value is \`true\`. This flag supports the old behavior where Apple Pay flow might not present if there are no cards in the Wallet.

**shippingOptions** `ShippingOptions`

Configure shipping options for Apple Pay.

**Properties**

**shippingContactFields** `Array of RequiredContactField`

Specify which contact fields are required for shipping.

**requireShippingMethod** `Boolean`

Indicate if a shipping method is required.

**billingOptions** `BillingOptions`

Configure billing options for Apple Pay.

**Properties**

**requiredBillingContactFields** `Array of RequiredContactField`

Specify which contact fields are required for billing.

**allowedCardTypes** `Array of PrimerWalletCardType`

Restrict the card types Apple Pay offers. Supported values: `credit`, `debit`. When omitted or empty, all card types are offered.

**cardPaymentOptions** `IPrimerCardPaymentOptions` *deprecated*

⚠️ This option is `Deprecated` since v.2.14.0.

**Properties**

**is3DSOnVaultingEnabled** `Boolean`

Enable 3DS flow on vaulted cards.

**goCardlessOptions** `IPrimerGoCardlessOptions`

⚠️ Required when using Go Cardless in your integration.

**Properties**

**businessName** `String`

Business name.

**businessAddress** `String`

Business address.

**googlePayOptions** `IPrimerGooglePayOptions`

⚠️ Required when using Google Pay in your integration.

**Properties**

**merchantName** `String`

Set it the merchant name that you want to be shown on the Google Pay
screen.

**allowedCardTypes** `Array of PrimerWalletCardType`

Restrict the card types Google Pay offers. Supported values: `credit`, `debit`, `prepaid`. When omitted or empty, all card types are offered.

> [!NOTE]
>
> Google Pay has no flag to disallow debit cards, so debit cards are always offered even if `debit` is not included.

**isCaptureBillingAddressEnabled** `Boolean`

Sets whether user's billing address should be captured from Google Pay.

**isExistingPaymentMethodRequired** `Boolean`

If set to `true`, this specifies that Google Pay can only be used for payments if the user's Google Pay wallet already contains allowed payment methods.

**klarnaOptions** `IPrimerKlarnaOptions`

⚠️ Required when using Klarna in your integration.

**Properties**

**recurringPaymentDescription** `String`

Set the payment description that will be shown on the Klarna screen.

**webViewTitle** `String`

⚠️ This option is `Deprecated`.\
Sets the toolbar title of the Activity displaying Klarna views.

**threeDsOptions** `IPrimerThreeDsOptions`

Sets the 3DS options in the SDK.

**Properties**

**iOS** `object`

**Properties**

**threeDsAppRequestorUrl** `String`

Set the [iOS Universal Link](https://developer.apple.com/ios/universal-links/) that's used to call your app after an **out-of-band (OOB)** authentication.

**android** `object`

**Properties**

**threeDsAppRequestorUrl** `String`

Set the [App link](https://developer.android.com/training/app-links) that's used to call your app after an **out-of-band (OOB)** authentication.

**stripeOptions** `IPrimerStripeOptions`

⚠️ Required when using Stripe ACH in your integration.

**Properties**

**publishableKey** `String`

Set the [Stripe publishable
key](https://docs.stripe.com/keys#obtain-api-keys).

**mandateData** `IPrimerStripeTemplateMandateData | IPrimerFullMandateData`

Data used for mandate in Drop-in

**IPrimerStripeTemplateMandateData**

Data for the mandate allowing you to specify the name of the
merchant that would be used in a predefined mandate template.

**Properties**

**merchantName** `String`

The name of the merchant.

**IPrimerFullMandateData**

Data for the mandate allowing you to specify the full mandate.

**Properties**

**fullMandateText** `String`

The string resource pointing to the full mandate. Supported on
Android and iOS.

**fullMandateStringResourceName** `String`

The name of the Android string resource pointing to the full
mandate. Supported only on Android.

**uiOptions** `IPrimerUIOptions`

**Properties**

**isInitScreenEnabled** `Boolean`

Set to `false` to hide the loading screen before the Universal Checkout or the Vault Manager. Defaults to `true`.

**isSuccessScreenEnabled** `Boolean`

Set to `false` to hide the screen after a successful payment, or tokenization on the vault flow. Defaults to `true`.

**isErrorScreenEnabled** `Boolean`

Set to `false` to hide the error screen when an error occurs. Defaults to `true`.

**dismissalMechanism** `DismissalMechanism[]`

Set the mechanism for dismissing Universal Checkout. Options are:

* `gestures`: The dialog can be dismissed by tapping outside or by swiping down.
* `closeButton`: A close button is provided, allowing users to dismiss the dialog manually.

**theme** `IPrimerTheme`

Set a custom theme for Primer SDK.

**cardFormUIOptions** `IPrimerCardFormUIOptions`

Configure the card form UI options.

**Properties**

**payButtonAddNewCard** `Boolean`

When set to true, the Drop-In's card form pay button will show "Add new card"; otherwise it will show "Pay \$x.xx".

**debugOptions** `IPrimerDebugOptions`

**Properties**

**is3DSSanityCheckEnabled** `Boolean`

Debug option on 3DS for Primer SDK.

**clientSessionCachingEnabled** `boolean`

> [!WARNING]
>
> Before enabling flag to true it's recommended to reach out to Primer support
> for additional verification since there are edge cases where it's not advised.

Indicates whether client session caching is enabled.

When set to `true`, responses from the server will be cached on the client side, allowing for faster subsequent
access to the same data within the cache duration. When set to `false`, every request to the server will be
processed without utilizing any client-side cache, ensuring that the client always receives the most up-to-date data.

**apiVersion** `PrimerApiVersion`

Indicates the API version to use when interacting with the Primer backend. Options are:

* `2.4` - will use ApiVersion 2.4

Note that this is optional, if a value is not supplied, ApiVersion `V2.4` will be used by default.

**onBeforeClientSessionUpdate** `() =\> void`

Called when the client session is in the process of being updated. Use it to show a loading indicator on your UI.

**onClientSessionUpdate** `(clientSession: PrimerClientSession) =\> void`

Called when the client session has been updated by the checkout. Returns the updated client session which can be used to inform your UI. For example updating tax, shipping or discount amounts displayed to your customers.

**onBeforePaymentCreate** `(checkoutPaymentMethodData: PrimerCheckoutPaymentMethodData, handler: PrimerPaymentCreationHandler) =\> void`

Called when a payment will be created.
Use as an opportunity to update UI accordingly - for example, to display a "loading" component.
The `handler` must be used to then abort or continue with payment creation.
Primer will continue with payment creation if `onBeforePaymentCreate` is not implemented.

**Parameters**

**checkoutPaymentMethodData** `PrimerCheckoutPaymentMethodData`

**Parameters**

**paymentMethodType** `String`

The type of the payment method Primer will use for payment creation, one of [PaymentMethodType](https://primer.io/docs/sdk/web/v2.x.x/constants/payment-method-types.md)

**paymentMethod** `String`

The name of the payment method Primer will use for payment creation.

**handler** `PrimerPaymentCreationHandler`

Provides two methods to continue or abort the payment.\
&#x20;You MUST call one of the methods of the handler if `onBeforePaymentCreate` is implemented.

**Parameters**

**abortPaymentCreation** `(errorMessage: string | null) =\> void`

Choose to abort a payment.

**continuePaymentCreation** `() =\> void`

Choose to continue with payment creation

**onCheckoutComplete** `(checkoutData: PrimerCheckoutData) =\> void`

Called when a payment has been created. Move on to next step in your checkout flow, such as showing a success message, etc.

**Parameters**

**checkoutData** `PrimerCheckoutData`

**Properties**

**payment** `IPrimerCheckoutDataPayment`

**Properties**

**id** `string`

Primer's unique identifier for the payment.

**orderId** `string`

Your order identifier as provided in the client session.

**paymentFailureReason** `PrimerPaymentErrorCode`

Can be either `payment-failed` which is an error from the PSP side, or `cancelled-by-customer` which means the failure initiated on the customer side. I.e. cancelling a 3DS flow.

**additionalInfo** `object`

Custom information, that depends on the payment method.

**Variations**

**XenditCheckoutVoucherAdditionalInfo**

**Properties**

**expiresAt** `String` *required*

**couponCode** `String` *required*

**retailerName** `String` *required*

**PromptPayCheckoutAdditionalInfo**

**Properties**

**expiresAt** `String` *required*

**qrCodeUrl** `String?`

**qrCodeBase64** `String` *required*

**MultibancoCheckoutAdditionalInfo**

**Properties**

**expiresAt** `String` *required*

**entity** `String` *required*

**reference** `String` *required*

&#x20;

**onTokenizeSuccess** `(paymentMethodTokenData: PrimerPaymentMethodTokenData, handler: PrimerTokenizationHandler) =\> void`

> [!NOTE]
>
> If you set `paymentHandling` to `MANUAL`, implementing this is mandatory.

**Parameters**

**paymentMethodTokenData** `PrimerPaymentMethodTokenData`

**Properties**

**analyticsId** `string`

An unique identifier for the payment instrument token.

**id** `string`

Payment method identifier.

**isVaulted** `boolean`

Indicating the use of vaulted instruments for the payment method.

**paymentInstrumentData** `PaymentInstrumentData`

Additional information about the payment instrument.
Depending on the payment method type, only some of the following properties are present on the object.

**Properties**

**network** `string?`

The human readable representation of card network (e.g., Visa, Mastercard).

**cardholderName** `string?`

The name of the cardholder.

**first6Digits** `number?`

The first 6 digits of the card number.

**firstDigits** `number?`

The first 6 or 8 digits of the card number within PCI guidelines.

**last4Digits** `number?`

The last 4 digits of the card number.

**accountNumberLast4Digits** `number?`

The last 4 digits of the account number.

**expirationMonth** `number?`

The expiration month of the card, in 2-digit format.

**expirationYear** `number?`

The expiration year of the card, in 4-digit format.

**externalPayerInfo** `IExternalPayerInfo?`

Additional PayPal data.

**Properties**

**email** `string`

The payer's email address.

**externalPayerId** `string?`

The payer's unique ID.

**firstName** `string?`

The payer's given name.

**lastName** `string`

The payer's given surname.

**klarnaCustomerToken** `string?`

**sessionData** `IKlarnaSessionData?`

**paymentMethodType** `string?`

A unique string identifier for the payment method. (e.g. `PAYPAL`, `GOOGLE_PAY`)

**binData** `IBinData?`

Additional BIN data.

**Properties**

**network** `string?`

The card network (e.g., VISA, MASTERCARD, AMEX).

**bankName** `string?`

The name of the bank.

**paymentInstrumentType** `string`

The type of the payment instrument.

Example of possible values (new values could be added as we add new payment methods):

* `APPLE_PAY`
* `CARD_OFF_SESSION_PAYMENT`
* `GOOGLE_PAY`
* `KLARNA_CUSTOMER_TOKEN`
* `OFF_SESSION_PAYMENT`
* `PAYMENT_CARD`
* `PAYPAL_BILLING_AGREEMENT`
* `PAYPAL_ORDER`

**token** `string` *required*

The payment instrument token you can use to [create a payment request](https://primer.io/docs/api-reference/v2.4/api-reference/payments-api/create-a-payment.md) from your backend.

**tokenType** `"SINGLE_USE" | "MULTI_USE"`

Whether this payment method token can be used only once or multiple times.

**threeDSecureAuthentication** `ThreeDSAuthenticationData`

**Properties**

**responseCode** `ThreeDSecureStatus`

Indicates the outcome of the 3D Secure authentication process.\
Possible values:

* `AUTH_SUCCESS`: The authentication was successful.
* `AUTH_FAILED`: The authentication process failed.
* `SKIPPED`: The authentication was skipped.
* `CHALLENGE`: A challenge was issued during the authentication process.

**reasonCode** `string`

An optional code indicating the reason for the outcome of the 3D Secure authentication.

**reasonText** `string`

An optional text description providing further details about the reason for the authentication outcome.

**protocolVersion** `string`

Specifies the version of the 3D Secure protocol that was used.

**challengeIssued** `boolean`

Indicates whether a challenge was issued as part of the authentication process.

* `true`: A challenge was issued.
* `false`: No challenge was issued.

**vaultData** `PrimerVaultData`

**Properties**

**customerId** `string`

The `customerId` associated to the payment method, if vaulted.

**handler** `OnTokenizeSuccessHandler`

**Properties**

**handleSuccess** `() =\> void`

Display a success screen.

**handleFailure** `(errorMessage: string) =\> void`

Display `errorMessage` as an error or failure message.

**continueWithNewClientToken** `(clientToken: string) =\> void`

Continue the payment flow using the given `clientToken`.

Called after a customer submitted their payment data and the payment details have been tokenized.
You'll receive a `paymentMethodToken` in `onTokenizeSuccess()`.

* [Create a payment request](https://primer.io/docs/api-reference/v2.4/api-reference/payments-api/create-a-payment.md) passing the `paymentMethodToken` to your backend

* If the payment is successful, call `handler.handleSuccess()` in order to display a success screen

* If the payment is unsuccessful, call `handler.handleFailure(errorMessage)` to display an error or failure message

* Payments API may return a new `clientToken` for additional steps (in the `requiredActions` on the response). In this case, call `handler.continueWithNewClientToken(clientToken)` to continue with the payment flow

&#x20;

**onResumeSuccess** `(resumeToken: string, handler: PrimerResumeHandler) =\> void`

**Parameters**

**resumeToken** `string`

The resume token you can use to [resume the payment flow](https://primer.io/docs/api-reference/v2.4/api-reference/payments-api/resume-a-payment.md) on your backend.

**handler**

**Properties**

**handleSuccess** `() =\> void`

Display a success screen.

**handleFailure** `(errorMessage: string) =\> void`

Display \`errorMessage\` as an error or failure message.

**continueWithNewClientToken** `(clientToken: string) =\> void`

Continue the payment flow using the given `clientToken`.

**onResumePending** `(additionalInfo: PrimerCheckoutAdditionalInfo) =\> void`

This callback is triggered when the payment is not authorized as it's an asynchronous alternative payment method, such as a voucher payment method.

> [!WARNING]
>
> This method will be called only when using the `PrimerPaymentHandling` is set to `MANUAL`

**Properties**

**additionalInfo** `PrimerCheckoutAdditionalInfo` *required*

**variations**

**XenditCheckoutVoucherAdditionalInfo**

**Properties**

**additionalInfoName** `XenditCheckoutVoucherAdditionalInfo`

The name of this additional info.

**expiresAt** `String` *required*

**couponCode** `String` *required*

**retailerName** `String` *required*

**PromptPayCheckoutAdditionalInfo**

**Properties**

**additionalInfoName** `PromptPayCheckoutAdditionalInfo`

The name of this additional info.

**expiresAt** `String` *required*

**qrCodeUrl** `String?`

**qrCodeBase64** `String` *required*

**MultibancoCheckoutAdditionalInfo**

**Properties**

**additionalInfoName** `MultibancoCheckoutAdditionalInfo`

The name of this additional info.

**expiresAt** `String` *required*

**entity** `String` *required*

**reference** `String` *required*

**DisplayStripeAchMandateAdditionalInfo**

**Properties**

**additionalInfoName** `DisplayStripeAchMandateAdditionalInfo`

The name of this additional info.

**onCheckoutReceivedAdditionalInfo** `(additionalInfo: PrimerCheckoutAdditionalInfo) =\> void`

This callback is triggered when the payment is not authorized as it’s an asynchronous alternative payment method, such as a voucher payment method.

> [!WARNING]
>
> This method will be called only when using the `PrimerPaymentHandling` is set to `AUTO`

**Parameters**

**additionalInfo** `PrimerCheckoutAdditionalInfo` *required*

**variations**

**XenditCheckoutVoucherAdditionalInfo**

**Properties**

**additionalInfoName** `XenditCheckoutVoucherAdditionalInfo`

The name of this additional info.

**expiresAt** `String` *required*

**couponCode** `String` *required*

**retailerName** `String` *required*

**PromptPayCheckoutAdditionalInfo**

**Properties**

**additionalInfoName** `PromptPayCheckoutAdditionalInfo`

The name of this additional info.

**expiresAt** `String` *required*

**qrCodeUrl** `String?`

**qrCodeBase64** `String` *required*

**MultibancoCheckoutAdditionalInfo**

**Properties**

**additionalInfoName** `MultibancoCheckoutAdditionalInfo`

The name of this additional info.

**expiresAt** `String` *required*

**entity** `String` *required*

**reference** `String` *required*

**DisplayStripeAchMandateAdditionalInfo**

**Properties**

**additionalInfoName** `DisplayStripeAchMandateAdditionalInfo`

The name of this additional info.

**onError** `(error: PrimerError, checkoutData: PrimerCheckoutData | null, handler: PrimerErrorHandler | undefined) =\> void`

This method will be called when an error occurs. It may return `PrimerCheckoutData` if the error occurs after the payment creation.

> [!NOTE]
>
> Please note, that if you `override` this method, you *must* call the `errorHandler` to finalize the flow.

**Properties**

**error** `PrimerError` *required*

**Properties**

**errorId** `String` *required*

A unique error identifier.

**errorCode** `String?`

A unique error code.

**description** `String` *required*

A error description.

**checkoutData** `PrimerCheckoutData`

**Properties**

**payment** `IPrimerCheckoutDataPayment`

**Properties**

**id** `string`

Primer's unique identifier for the payment.

**orderId** `string`

Your order identifier as provided in the client session.

**paymentFailureReason** `PrimerPaymentErrorCode`

Can be either `payment-failed` which is an error from the PSP side, or `cancelled-by-customer` which means the failure initiated on the customer side. I.e. cancelling a 3DS flow.

**additionalInfo** `object`

Custom information, that depends on the payment method.

**Variations**

**XenditCheckoutVoucherAdditionalInfo**

**Properties**

**expiresAt** `String` *required*

**couponCode** `String` *required*

**retailerName** `String` *required*

**PromptPayCheckoutAdditionalInfo**

**Properties**

**expiresAt** `String` *required*

**qrCodeUrl** `String?`

**qrCodeBase64** `String` *required*

**MultibancoCheckoutAdditionalInfo**

**Properties**

**expiresAt** `String` *required*

**entity** `String` *required*

**reference** `String` *required*

**handler** `PrimerErrorHandler`

**Methods**

**showErrorMessage(errorMessage: String | null)**

Call with your custom error message.

**onDismiss** `() =\> void`

This method will be called to notify you that the Primer SDK has been
dismissed.

**headlessUniversalCheckoutCallbacks** `object`

**Properties**

**onAvailablePaymentMethodsLoad** `(availablePaymentMethods: any[]) =\> void`

Called when the available payment methods have been loaded. Takes an array of objects as its argument.

**Parameters**

**paymentMethods** `PaymentMethodInfo[]`

**Properties**

**type** `PaymentMethodType` *required*

**managerType** `"CARD" | "NATIVE" | "REDIRECT"` *required*

The type of payment manager to use.

**onTokenizationStart** `(paymentMethodType: string) =\> void`

This method will be called with just before the tokenization gets started.

**Attributes**

**paymentMethodType** `String` *required*

**onTokenizationSuccess** `(paymentMethodTokenData: PrimerPaymentMethodTokenData, handler: PrimerHeadlessUniversalCheckoutResumeHandler) =\> void`

This method will be called when the tokenization was successful.

**onCheckoutResume** `(resumeToken: string, handler: PrimerHeadlessUniversalCheckoutResumeHandler) =\> void`

**Parameters**

**resumeToken** `string`

The resume token you can use to [resume the payment flow](https://primer.io/docs/api-reference/v2.4/api-reference/payments-api/resume-a-payment.md) on your backend.

**handler** `PrimerHeadlessUniversalCheckoutResumeHandler`

**Properties**

**complete** `() =\> void`

Complete the payment flow.

**continueWithNewClientToken** `(clientToken: string) =\> void`

Continue the payment flow using the given `clientToken`.

**onCheckoutPending** `(additionalInfo: PrimerCheckoutAdditionalInfo) =\> void`

This callback is triggered when the payment is not authorized as it's an asynchronous alternative payment method, such as a voucher payment method.

> [!WARNING]
>
> This method will be called only when using the `PrimerPaymentHandling` is set to `MANUAL`

**Properties**

**additionalInfo** `PrimerCheckoutAdditionalInfo` *required*

**variations**

**XenditCheckoutVoucherAdditionalInfo**

**Properties**

**additionalInfoName** `XenditCheckoutVoucherAdditionalInfo`

The name of this additional info.

**expiresAt** `String` *required*

**couponCode** `String` *required*

**retailerName** `String` *required*

**PromptPayCheckoutAdditionalInfo**

**Properties**

**additionalInfoName** `PromptPayCheckoutAdditionalInfo`

The name of this additional info.

**expiresAt** `String` *required*

**qrCodeUrl** `String?`

**qrCodeBase64** `String` *required*

**MultibancoCheckoutAdditionalInfo**

**Properties**

**additionalInfoName** `MultibancoCheckoutAdditionalInfo`

The name of this additional info.

**expiresAt** `String` *required*

**entity** `String` *required*

**reference** `String` *required*

**DisplayStripeAchMandateAdditionalInfo**

**Properties**

**additionalInfoName** `DisplayStripeAchMandateAdditionalInfo`

The name of this additional info.

**onCheckoutAdditionalInfo** `(additionalInfo: PrimerCheckoutAdditionalInfo) =\> void`

This callback is triggered when the payment is not authorized as it’s an asynchronous alternative payment method, such as a voucher payment method.

> [!WARNING]
>
> This method will be called only when using the `PrimerPaymentHandling` is set to `AUTO`

**Parameters**

**additionalInfo** `PrimerCheckoutAdditionalInfo` *required*

**variations**

**XenditCheckoutVoucherAdditionalInfo**

**Properties**

**additionalInfoName** `XenditCheckoutVoucherAdditionalInfo`

The name of this additional info.

**expiresAt** `String` *required*

**couponCode** `String` *required*

**retailerName** `String` *required*

**PromptPayCheckoutAdditionalInfo**

**Properties**

**additionalInfoName** `PromptPayCheckoutAdditionalInfo`

The name of this additional info.

**expiresAt** `String` *required*

**qrCodeUrl** `String?`

**qrCodeBase64** `String` *required*

**MultibancoCheckoutAdditionalInfo**

**Properties**

**additionalInfoName** `MultibancoCheckoutAdditionalInfo`

The name of this additional info.

**expiresAt** `String` *required*

**entity** `String` *required*

**reference** `String` *required*

**DisplayStripeAchMandateAdditionalInfo**

**Properties**

**additionalInfoName** `DisplayStripeAchMandateAdditionalInfo`

The name of this additional info.

**onError** `(error: PrimerError, checkoutData: PrimerCheckoutData | null) =\> void`

This method will be called when an error occurs. It may return `PrimerCheckoutData` if the error occurs after the payment creation.

**Properties**

**error** `PrimerError` *required*

**Properties**

**errorId** `String` *required*

A unique error identifier.

**errorCode** `String?`

A unique error code.

**description** `String` *required*

A error description.

**checkoutData** `PrimerCheckoutData`

**Properties**

**payment** `IPrimerCheckoutDataPayment`

**Properties**

**id** `string`

Primer's unique identifier for the payment.

**orderId** `string`

Your order identifier as provided in the client session.

**paymentFailureReason** `PrimerPaymentErrorCode`

Can be either `payment-failed` which is an error from the PSP side, or `cancelled-by-customer` which means the failure initiated on the customer side. I.e. cancelling a 3DS flow.

**additionalInfo** `object`

Custom information, that depends on the payment method.

**Variations**

**XenditCheckoutVoucherAdditionalInfo**

**Properties**

**expiresAt** `String` *required*

**couponCode** `String` *required*

**retailerName** `String` *required*

**PromptPayCheckoutAdditionalInfo**

**Properties**

**expiresAt** `String` *required*

**qrCodeUrl** `String?`

**qrCodeBase64** `String` *required*

**MultibancoCheckoutAdditionalInfo**

**Properties**

**expiresAt** `String` *required*

**entity** `String` *required*

**reference** `String` *required*

**onCheckoutComplete** `(checkoutData: PrimerCheckoutData) =\> void`

Called when a payment has been created. Move on to next step in your checkout flow, such as showing a success message, etc.

**Parameters**

**checkoutData** `PrimerCheckoutData`

**Properties**

**payment** `IPrimerCheckoutDataPayment`

**Properties**

**id** `string`

Primer's unique identifier for the payment.

**orderId** `string`

Your order identifier as provided in the client session.

**paymentFailureReason** `PrimerPaymentErrorCode`

Can be either `payment-failed` which is an error from the PSP side, or `cancelled-by-customer` which means the failure initiated on the customer side. I.e. cancelling a 3DS flow.

**additionalInfo** `object`

Custom information, that depends on the payment method.

**Variations**

**XenditCheckoutVoucherAdditionalInfo**

**Properties**

**expiresAt** `String` *required*

**couponCode** `String` *required*

**retailerName** `String` *required*

**PromptPayCheckoutAdditionalInfo**

**Properties**

**expiresAt** `String` *required*

**qrCodeUrl** `String?`

**qrCodeBase64** `String` *required*

**MultibancoCheckoutAdditionalInfo**

**Properties**

**expiresAt** `String` *required*

**entity** `String` *required*

**reference** `String` *required*

**onBeforeClientSessionUpdate** `() =\> void`

Called when the client session is in the process of being updated. Use it to show a loading indicator on your app.

**onClientSessionUpdate** `(clientSession: PrimerClientSession) =\> void`

Called when the client session has been updated by the checkout. Returns the updated client session which can be
used to inform your UI. For example updating tax, shipping or discount amounts displayed to your customers.

**onBeforePaymentCreate** `(checkoutPaymentMethodData: PrimerCheckoutPaymentMethodData, handler: PrimerPaymentCreationHandler) =\> void`

Called when a payment will be created.
Use as an opportunity to update UI accordingly - for example, to display a "loading" component.
The `handler` must be used to then abort or continue with payment creation.
Primer will continue with payment creation if `onBeforePaymentCreate` is not implemented.

**Parameters**

**checkoutPaymentMethodData** `PrimerCheckoutPaymentMethodData`

**Parameters**

**paymentMethodType** `String`

The type of the payment method Primer will use for payment creation, one of [PaymentMethodType](https://primer.io/docs/sdk/web/v2.x.x/constants/payment-method-types.md)

**paymentMethod** `String`

The name of the payment method Primer will use for payment creation.

**handler** `PrimerPaymentCreationHandler`

Provides two methods to continue or abort the payment.\
&#x20;You MUST call one of the methods of the handler if `onBeforePaymentCreate` is implemented.

**Parameters**

**abortPaymentCreation** `(errorMessage: string | null) =\> void`

Choose to abort a payment.

**continuePaymentCreation** `() =\> void`

Choose to continue with payment creation

**onPreparationStart** `(paymentMethodType: string) =\> void`

This method will be called when the SDK starts preparing to tokenize the payment method.

**onPaymentMethodShow** `(paymentMethodType: string) =\> void`

Called when the payment method is displayed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.