Configuration
Last updated: October 6, 2025
The Checkout React Native Components library provides extensive configuration options to customize the appearance and behavior of your payment components.
The main configuration object that defines the behavior and appearance of your payment components.
1import { CheckoutConfiguration, Environment, Locale } from '@checkout.com/checkout-react-native-components';23const config: CheckoutConfiguration = {4publicKey: 'pk_test_your_public_key',5environment: Environment.sandbox,6locale: Locale.en_GB,7merchantIdentifier: 'merchant.com.your-app.name',8translations: {9[Locale.en_GB]: {10cardNumber: 'Card Number',11payButtonPay: 'Pay Now'12}13},14style: {15colorTokensMain: {16primary: '#186AFF',17background: '#FFFFFF',18border: '#E3E8F2',19error: '#E01E5A'20},21borderButtonRadius: 12,22borderFormRadius: 823}24};
| Property | Type | Description |
|---|---|---|
required |
| Your Checkout.com public API key |
required |
| Environment for API calls |
|
| Locale for UI text (defaults to English) |
|
| Apple Pay merchant identifier |
|
| Custom text translations |
|
| UI customization options |
Customize the appearance of your payment components with color tokens:
1const customStyle = {2colorTokensMain: {3// Primary brand color4primary: '#186AFF',56// Background colors7background: '#FFFFFF',8formBackground: '#F7F9FC',910// Border colors11border: '#E3E8F2',12formBorder: '#C8D1E0',13outline: '#91B2EE',1415// State colors16error: '#E01E5A',17success: '#1AA27B',18disabled: '#B0B0B0',1920// Text colors21secondary: '#545F7A',22inverse: '#FFFFFF',2324// Action colors25action: '#186AFF',2627scrolledContainer: '#F0F0F0' // Android only28}29};
| Key | Format | Description |
|---|---|---|
|
| Primary brand color for buttons and interactive elements |
|
| Main background color |
|
| Background color for form fields |
|
| Default border color |
|
| Border color for form fields |
|
| Focus outline color |
|
| Error state color |
|
| Success state color |
|
| Disabled element color |
|
| Secondary text color |
|
| Inverse text color (for dark backgrounds) |
|
| Action button color |
|
| Android-specific scrolled container color |
Customize the border radius of buttons and form elements:
1const customBorders = {2borderButtonRadius: 12, // Button border radius3borderFormRadius: 8 // Form field border radius4};
| Property | Type | Default | Description |
|---|---|---|---|
|
|
| Border radius for form fields |
|
|
| Border radius for buttons |
The library supports multiple locales with customizable translations.
1enum Locale {2ar = 'ar', // Arabic3da_DK = 'da-DK', // Danish4de_DE = 'de-DE', // German5el = 'el', // Greek6en_GB = 'en-GB', // English (UK)7es_ES = 'es-ES', // Spanish8fi_FI = 'fi-FI', // Finnish9fil_PH = 'fil-PH', // Filipino10fr_FR = 'fr-FR', // French11hi_IN = 'hi-IN', // Hindi12id_ID = 'id-ID', // Indonesian13it_IT = 'it-IT', // Italian14ja_JP = 'ja-JP', // Japanese15ms_MY = 'ms-MY', // Malay16nb_NO = 'nb-NO', // Norwegian17nl_NL = 'nl-NL', // Dutch18pt_PT = 'pt-PT', // Portuguese19sv_SE = 'sv-SE', // Swedish20th_TH = 'th-TH', // Thai21vi_VN = 'vi-VN', // Vietnamese22zh_CN = 'zh-CN', // Chinese (Simplified)23zh_HK = 'zh-HK', // Chinese (Hong Kong)24zh_TW = 'zh-TW' // Chinese (Traditional)25}
1const customTranslations = {2[Locale.en_GB]: {3// Address and billing4addBillingAddress: 'Add Billing Address',5addAddress: 'Add Address',6address: 'Address',7addressLine1: 'Address Line 1',8addressLine2: 'Address Line 2',9billingAddress: 'Billing Address',1011// Card form labels12card: 'Card',13cardNumber: 'Card Number',14cardExpiryDate: 'MM/YY',15cardExpiryDatePlaceholderMonth: 'MM',16cardExpiryDatePlaceholderYear: 'YY',17cardSecurityCode: 'CVV',18cardSecurityCodePlaceholder: 'CVV',19cardHolderName: 'Cardholder Name',2021// Personal information22firstName: 'First Name',23lastName: 'Last Name',24email: 'Email Address',25phoneNumber: 'Phone Number',2627// Location fields28city: 'City',29state: 'State/Province',30zip: 'ZIP/Postal Code',31country: 'Country',32selectCountry: 'Select Country',33selectState: 'Select State',3435// Actions and buttons36payButtonPay: 'Pay Now',37payButtonPaymentProcessing: 'Processing...',38payButtonPaymentComplete: 'Payment Complete',39confirm: 'Confirm',40editAddress: 'Edit Address',41search: 'Search',4243// Validation and error messages44formRequired: 'This field is required',45cardNumberInvalid: 'Invalid card number',46cardNumberNotSupported: 'Card type not supported',47cardExpiryDateIncomplete: 'Expiry date incomplete',48cardExpiryDateInvalid: 'Invalid expiry date',49cardSecurityCodeInvalid: 'Invalid security code',50emailFormatInvalid: 'Invalid email format',51insufficientCharacters: 'Insufficient characters',5253// Payment errors54paymentDeclinedTryAgain: 'Payment declined. Please try again.',55paymentDeclinedNotEnoughFunds: 'Insufficient funds',56paymentDeclinedInvalidCustomerData: 'Invalid payment details',57paymentDeclinedInvalidPaymentSessionData: 'Invalid payment session data',58paymentDeclinedMerchantMisconfiguration: 'Merchant configuration error',5960// Search and selection61noMatchesFound: 'No matches found',62trySearchingWithAnotherTerm: 'Try searching with another term',6364// Miscellaneous65optional: 'Optional',66useShippingAsBilling: 'Use shipping address as billing address',67preferredSchemeCta: 'Select Preferred Scheme',68preferredSchemeDescription: 'Please select your preferred card scheme'69}70};
Configure the behavior of the Flow component:
1const flowConfig = {2showPayButton: false, // Hide built-in pay button3paymentButtonAction: 'tokenize' // Tokenize instead of submitting the payment4};56<Flow config={flowConfig} />
Configure the behavior of the Card component:
1const cardConfig = {2showPayButton: true, // Show built-in pay button3paymentButtonAction: 'payment' // Process payment when pressed4};56<Card config={cardConfig} />
1import React, { useRef, useState, useEffect } from 'react';2import {3CheckoutProvider,4CheckoutConfiguration,5Flow,6Environment,7Locale,8} from '@checkout.com/checkout-react-native-components';910const config: CheckoutConfiguration = {11publicKey: 'pk_test_your_public_key',12environment: Environment.sandbox,13locale: Locale.en_GB,14merchantIdentifier: 'merchant.com.your-app.name',15translations: {16[Locale.en_GB]: {17cardNumber: 'Card Number',18payButtonPay: 'Pay Now',19formRequired: 'This field is required'20}21},22style: {23colorTokensMain: {24primary: '#186AFF',25background: '#FFFFFF',26formBackground: '#F7F9FC',27border: '#E3E8F2',28formBorder: '#C8D1E0',29outline: '#91B2EE',30error: '#E01E5A',31success: '#1AA27B',32disabled: '#B0B0B0',33secondary: '#545F7A',34inverse: '#FFFFFF',35action: '#186AFF'36},37borderButtonRadius: 12,38borderFormRadius: 839}40};4142export default function PaymentScreen() {43const [paymentSession, setPaymentSession] = useState(null);4445useEffect(() => {46// Fetches the payment session from your server47fetchPaymentSession().then(setPaymentSession);48}, []);4950return (51<CheckoutProvider52config={config}53paymentSession={paymentSession}54onSuccess={(paymentMethod, paymentID) => {55console.log('Payment successful:', { paymentMethod, paymentID });56}}57onError={(error) => {58console.error('Payment error:', error);59}}60>61<Flow />62</CheckoutProvider>63);64}