> ## Documentation Index
> Fetch the complete documentation index at: https://adyen-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# API Only with Encrypted Card Data

> Build your own UI and use Adyen's client-side solutions to encrypt card details.

To ensure PCI compliance when you build your own cards payment form, use our client-side solutions to help encrypt card details.

> [tab] Web
>
> Build your own UI for the card payment form, and then use our Custom Card Web Component to collect, validate, and encrypt your shopper's card details. The Component renders card input fields in iframes served by Adyen.

> [tab] Mobile (iOS or Android)
>
> Build your own UI for the card payment form, collect the shopper's card details, and then use Adyen classes to validate and encrypt the data in your client app.
>
> If you prefer not to build your own card payment form, use Drop-in or Card Component for [web](https://adyen-preview.mintlify.site/payment-methods/cards/web), [iOS](https://adyen-preview.mintlify.site/payment-methods/cards/ios), [Android](https://adyen-preview.mintlify.site/payment-methods/cards/android), [React Native](https://docs.adyen.com/payment-methods/cards/react-native), or [Flutter](https://docs.adyen.com/payment-methods/cards/flutter) instead.
>
> ## Requirements
>
> | Requirement | Description |
> | - | - |
> | **Integration type** | Make sure that you have built an [API-only integration](https://adyen-preview.mintlify.site/online-payments/build-your-integration/advanced-flow.md). |
> | **Setup steps** | Before you begin, [add the cards that you want to support in your test Customer Area](https://adyen-preview.mintlify.site/payment-methods/add-payment-methods). |
>
> ## Show the available cards in your payment form
>
> For information about the supported locations and currencies for each card, refer to [Payment methods](https://www.adyen.com/payment-methods).
>
> Specify in your [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) request a combination of [countryCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) and [amount.currency](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-amount), and use the [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) response to determine which cards are available to the shopper. For more information, refer to our [API-only integration guide](https://adyen-preview.mintlify.site/online-payments/build-your-integration/advanced-flow.md#get-available-payment-methods).
>
> Next, use our client-side solutions to validate and encrypt your shopper's card details. Select the platform below:

> [tab] Web
>
> The [Custom Card Component](https://github.com/Adyen/adyen-web/tree/main/packages/lib/src/components/CustomCard) renders card input fields in iframes served by Adyen. Use this to collect, validate, and encrypt your shopper's card details.
>
> 1. Install the Custom Card Component. Either install the Adyen Web Node package or use a `<script>` tag:
>
>    * npm (recommended)
>
>      a. Install the [Adyen Web Node package](https://www.npmjs.com/package/@adyen/adyen-web):
>
>      ```bash theme={null}
>      npm install @adyen/adyen-web --save
>      ```
>
>      b. Import Adyen Web into your application:
>
>      ```js theme={null}
>      import { AdyenCheckout } from '@adyen/adyen-web';
>      import '@adyen/adyen-web/styles/adyen.css';
>      ```
>
>    * Script
>
>      a. Include the following script in the `<body>` above any other JavaScript in your checkout page:
>
>      We recommend that you also validate the [Subresource Integrity (SRI) hash](https://adyen-preview.mintlify.site/online-payments/web-best-practices.md#implement-subresource-integrity-hashes), which we provide for each version of our JavaScript and CSS files. You can find the SRI hashes in our [release notes](https://adyen-preview.mintlify.site/online-payments/release-notes.md), under **Updating to this version**.
>
>      ```html theme={null}
>      <script src="https://checkoutshopper-test.cdn.adyen.com/checkoutshopper/sdk/{VERSION}/adyen.js"
>      integrity="sha384-KF6Y8NQXGnIuzqJn5rcqCe6dMy7gBWobcIKr1BmIaz6pOeBAV0hrHBBMbHC/inHu"
>      crossorigin="anonymous"></script>
>      <!-- Adyen provides the SRI hash that you include as the integrity attribute.-->
>      <!-- Refer to our release notes to get the SRI hash for the specific version: https://docs.adyen.com/online-payments/release-notes -->
>      ```
>
>      b. Use the following CSS file:
>
>      ```html theme={null}
>      <link rel="stylesheet" href="https://checkoutshopper-test.adyen.com/checkoutshopper/sdk/{VERSION}/adyen.css"
>      integrity="sha384-uwMmo3xJR0e9jI+Oi5kzu43ShY0pXrb3auIlCjLjMNtl0X8Nat55eXNqwj8xU6H9"
>      crossorigin="anonymous">
>      <!-- Adyen provides the SRI hash that you include as the integrity attribute. -->
>      <!-- Refer to our release notes to get the SRI hash for the specific version: https://docs.adyen.com/online-payments/release-notes -->
>      ```
>
>      You can [add your own styling](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md#optional-configuration) by overriding the rules in this CSS file.
> 2. Create a configuration object, specifying the following parameters:
>
>    | Parameter | Description |
>    | - | - |
>    | `locale` | The shopper's locale. This is used to set the language rendered in the Components. For a list of supported locales, see [Localization](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md#optional-configuration). |
>    | `clientKey` | A public key linked to your API credential, used for [client-side authentication](https://adyen-preview.mintlify.site/development-resources/client-side-authentication). |
>    | `environment` | Use **test**. When you are ready to accept live payments, change the value to match your [live endpoints](https://adyen-preview.mintlify.site/development-resources/live-endpoints.md): - Europe: **live** - Australia: **live-aus** - US: **live-us** - Northeast Asia: **live-nea** |
>    | `onSubmit` | Specify a function to handle the `onSubmit` event that the Component calls after the shopper selects the **Pay** button. |
>
>    ```js theme={null}
>      function handleOnSubmit(state, component) {
>          state.isValid // True or false. Specifies if all the information that the shopper provided is valid.
>          state.data // Provides the data that you need to pass in the `/payments` call.
>          component // Provides the active component instance that called this event.
>      }
>
>      const configuration = {
>          locale: "en_US",
>          environment: "test",
>          clientKey: "YOUR_CLIENT_KEY",
>          onSubmit: handleOnSubmit
>      };
>    ```
>
> []()
>
> 3. Use the configuration object to create an instance of `AdyenCheckout`. In Components versions 5.0.0 or later, the creation of `AdyenCheckout` is asynchronous:
>
>    * v5.0.0 or later:
>
>      ```js theme={null}
>      const checkout = await AdyenCheckout(configuration);
>      ```
>
>    * before v5.0.0:
>
>      ```js theme={null}
>      const checkout = new AdyenCheckout(configuration);
>      ```
> 4. Implement callbacks to handle the following events triggered by the Custom Card Component:
>
> | Event | Description |
> | - | - |
> | `onAutoComplete` | Provides the card holder name when a shopper uses Chrome or Safari's autofill function to fill out the card holder name field. |
> | `onSubmit` | Called when the shopper selects the **Pay** button. Here you have the option to override your [main Adyen Checkout configuration](https://adyen-preview.mintlify.site/online-payments/build-your-integration/advanced-flow.md#add). **v5.0.0 or later** you can also watch [`state.errors` ](https://github.com/Adyen/adyen-components-js-sample-code/blob/master/src/customcard/customCards.config.js#L261)and call the custom card specific `setErrors` function. |
> | `onLoad` | Called when all the card input fields have been created but are not yet ready to use. |
> | `onConfigSuccess` | Called when the card input fields are ready to use. |
> | `onFieldValid` | Called when the input in a field becomes valid. Also called when the input changes and becomes invalid. For the card number field, it returns the following: - `endDigits`: the last four digits of the card number. - **v5.10.0 or later** `issuerBin`: if the card number has sixteen or more digits, this is the first eight digits of the card number. |
> | `onBrand` | Called when the card brand is detected. |
> | `onError` | Called when card number or expiry date is invalid, or a field is incomplete field. Called again when errors are cleared. **v5.0.0 or later**: the `onError` handler is no longer used only for custom card component related errors. You can also watch `state.errors` from the `onSubmit` event. |
> | `onFocus` | Called when a field gains focus. |
> | `onBinValue` | Called when the shopper enters the card number. Returns `binValue`: the first six digits of the card number. Requires the [client key](https://adyen-preview.mintlify.site/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key.md) for client-side authentication. |
> | `onBinLookup` **v4.6.0 or later** | Called when the shopper enters the card number. Requires a minimum of 11 digits of the card number to be entered. Returns the following: - `type`: type of the card. - `brands`: brands on the card. - `supportedBrands`: the brands you support. - `detectedBrands`: brands detected on the card. - **v5.30.1 or later** `issuingCountryCode`: the two-letter country code of the country where the card was issued. - **v5.43.0 or later** `paymentMethodVariant`: the [card type variant](https://adyen-preview.mintlify.site/development-resources/paymentmethodvariant.md). |
>
> 5. Add the Custom Card Component to your payment form:
>
>    a. Create a DOM element, placing it where you want the card input fields to be rendered:
>
>    ```xml theme={null}
>    <div id="customCard-container">
>        <label>
>            <span>Card number:</span>
>            <span data-cse="encryptedCardNumber"></span>
>        </label>
>        <label>
>            <span>Expiry date:</span>
>            <span data-cse="encryptedExpiryDate"></span>
>        </label>
>        <label>
>            <span>CVV/CVC:</span>
>            <span data-cse="encryptedSecurityCode"></span>
>        </label>
>    </div>
>    ```
>
>    b. Create an instance of the Custom Card Component, and mount it. You can also include optional configuration.
>
>    | Field | Description | Default |
>    | - | - | - |
>    | `ariaLabels` | Specify `aria-label` attributes for the input fields for web accessibility. **v4.0.0 or later**: Use [translation fields](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md#optional-configuration) instead. | Refer to [Default labels](#default-style). |
>    | `autoFocus` | Automatically move the focus from date field to the CVC field once a date has been entered. Starting v5.8.0 the focus changes to the date field when the entered card number reaches the expected length. | **true** |
>    | `brands` | Array of card brands that will be recognized by the component. For a list of possible values, refer to [Supported card types](#supported-card-types). | `['mc','visa','amex']` |
>    | `styles` | Set a style object to customize the input fields. For a list of supported properties, refer to [Styling](#styling). | Refer to [Default styles](#default-style). |
>    | `minimumExpiryDate` **v4.3.0 or later** | If a shopper enters a date that is earlier than specified here, they will see the following error: "Your card expires before check out date." Format: `mm/yy` | |
>
>    ```js theme={null}
>    const customCard = new CustomCard(checkout, {
>        // Optional configuration
>        type: 'card',
>        brands: ['mc', 'visa', 'amex', 'bcmc', 'maestro'],
>        styles: {
>            error: {
>                color: 'red'
>            },
>            validated: {
>                color: 'green'
>            },
>            placeholder: {
>                color: '#d8d8d8'
>            }
>        },
>        // Only for Web Components before 4.0.0.
>        // For Web Components 4.0.0 and above, configure aria-label attributes in translation files
>        ariaLabels: {
>            lang: 'en-GB',
>            encryptedCardNumber: {
>                label: 'Credit or debit card number field',
>                iframeTitle: 'Iframe for secured card number',
>                error: 'Message that gets read out when the field is in the error state'
>            }
>        },
>        // Events
>        onSubmit: function() {},
>        onValid : function() {},
>        onLoad: function() {},
>        onConfigSuccess: function() {},
>        onFieldValid : function() {},
>        onBrand: function() {},
>        onError: function() {},
>        onFocus: function() {},
>        onBinValue: function(bin) {},
>        onBinLookup: function(callbackObj: CbObjOnBinLookup) {}
>    }).mount('#customCard-container');
>    ```
>
>    When the shopper enters their card details, the Component calls the `onSubmit` event, which contains a `state`.
>
> 6. If `state.isValid` is **true**, pass the `state.data` to your server. The data includes the following:
>
>    * Encrypted card details.
>
>      **Encrypted card details**
>
>      ```json theme={null}
>      {
>         "encryptedCardNumber":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>         "encryptedExpiryMonth":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>         "encryptedExpiryYear":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>         "encryptedSecurityCode":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>      }
>      ```
>
>    * [Device characteristics and other data](https://adyen-preview.mintlify.site/risk-management/fraud-data-collection.md) that we use to detect fraudulent payment activity, and mitigate fraud.
>
>      **User data**
>
>      ```json theme={null}
>      riskData: {
>         "clientData": "eyJ0cmFuc1N0YXR1cy...I6IlkifQ=="
>      }
>      ```
>
>    Include the full `data` object when you [make a payment](#make-a-payment).
>
> ## Styling card input fields
>
> If you want to change the styling of the card number, CVC, and expiry date of a card:
>
> 1. Create an object and set the following CSS values:
>
>    You can provide styling for the following:
>
>    * `base`: Base styling applied to the iframe. All styling extends from this style.
>    * `error`: Styling applied when a field fails validation.
>    * `placeholder`: Styling applied to the field's [placeholder values](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow.md#optional-configuration).
>    * `validated`: Styling applied once a field passes validation.
>
>    Here is an example style object:
>
>    ```js theme={null}
>    // Define style object
>    var styleObject = {
>      base: {
>        color: 'black',
>        fontSize: '16px',
>        fontSmoothing: 'antialiased',
>        fontFamily: 'Helvetica'
>      },
>      error: {
>        color: 'red'
>      },
>      placeholder: {
>        color: '#d8d8d8'
>      },
>      validated: {
>        color: 'green'
>      }
>    };
>    ```
>
> 2. Style the elements with the following properties. These properties map to CSS properties and accept allowed CSS values:
>
>    | JavaScript | CSS |
>    | - | - |
>    | `background` | background |
>    | `caretColor` | caret-color |
>    | `color` | color |
>    | `display` | display |
>    | `font` | font |
>    | `fontFamily` | font-family |
>    | `fontSize` | font-size |
>    | `fontSizeAdjust` | font-size-adjust |
>    | `fontSmoothing` | font-smoothing |
>    | `fontStretch` | font-stretch |
>    | `fontStyle` | font-style |
>    | `fontVariant` | font-variant |
>    | `fontVariantAlternates` | font-variant-alternates |
>    | `fontVariantCaps` | font-variant-caps |
>    | `fontVariantEastAsian` | font-variant-east-asian |
>    | `fontVariantLigatures` | font-variant-ligatures |
>    | `fontVariantNumeric` | font-variant-numeric |
>    | `fontWeight` | font-weight |
>    | `letterSpacing` | letter-spacing |
>    | `lineHeight` | line-height |
>    | `mozOsxFontSmoothing` | moz-osx-font-smoothing |
>    | `mozTransition` | moz-transition |
>    | `outline` | outline |
>    | `opacity` | opacity |
>    | `padding` | padding |
>    | `textAlign` | text-align |
>    | `textShadow` | text-shadow |
>    | `transition` | transition |
>    | `webkitFontSmoothing` | webkit-font-smoothing |
>    | `webkitTransition` | webkit-transition |
>
> 3. Add the styling to the [configuration object of your `AdyenCheckout` instance](https://adyen-preview.mintlify.site/online-payments/build-your-integration/sessions-flow#configure).
>
>    **Configuration object with card styling**
>
>    ```js theme={null}
>    const configuration = {
>      //...other configuration parameters
>      paymentMethodsConfiguration: {
>        card: {
>          styles: styleObject,
>        },
>        //Required to apply styling to stored cards.
>        storedCard: {
>          styles: styleObject,
>        }
>      },
>    };
>    ```
>
> ## Default styles and labels
>
> If you do not provide configuration for styles and labels, the Component will use the following default properties.
>
> ```js theme={null}
> {
>     styles: {
>             base: {
>                 color: "#001b2b",
>                 fontSize: "16px",
>                 fontWeight: "400"
>             },
>             placeholder: {
>                 color: "#90a2bd",
>                 fontWeight: "200"
>             },
>             error: {
>                 color: "#001b2b"
>             }
>     },
>     ariaLabels: {
>         lang: "en-GB",
>         encryptedCardNumber: {
>             label: "Credit or debit card number",
>             iframeTitle: "Iframe for card data input field"
>         },
>         encryptedExpiryDate: {
>             label: "Credit or debit card expiration date",
>             iframeTitle: "Iframe for card data input field"
>         },
>         encryptedSecurityCode: {
>             label: "Iframe for card data input field"
>         }
>     }
> }
> ```
>
> ## Supported card types in web
>
> Use the values in this list when specifying card types in the `brands` array. If card types are not provided, the configuration defaults to `['mc','visa','amex']`.
>
> | Card Type | Description |
> | - | - |
> | amex | Amex |
> | argencard | Argencard |
> | bcmc | Bancontact/Mister Cash |
> | bijcard | de Bijenkorf Card |
> | cabal | Cabal |
> | cartebancaire | Carte Bancaires |
> | codensa | Codensa |
> | cup | China Union Pay |
> | dankort | Dankort |
> | diners | Diners Club |
> | discover | Discover |
> | electron | Electron |
> | elo | ELO |
> | forbrugsforeningen | Forbrugsforeningen |
> | hiper | HiperCard |
> | hipercard | HiperCard |
> | jcb | JCB |
> | karenmillen | Karen Millen GiftCard |
> | laser | Laser |
> | maestro | Maestro |
> | maestrouk | Maestro UK |
> | mc | Mastercard |
> | mcalphabankbonus | Alpha Bank Mastercard Bonus |
> | mir | MIR |
> | naranja | Naranja |
> | oasis | Oasis GiftCard |
> | rupay | RuPay |
> | shopping | Tarjeta Shopping |
> | solo | Solo |
> | troy | Troy |
> | uatp | UATP |
> | visa | Visa |
> | visaalphabankbonus | Alpha Bank Visa Bonus |
> | visadankort | Visa Dankort |
> | warehouse | Warehouse GiftCard |

> [tab] iOS
>
> Build your own UI for the card payment form, collect the shopper's card details, and then use the following classes to validate and encrypt the data in your client app:
>
> * [`CardEncryptor`](https://adyen.github.io/adyen-ios/5.0.0/documentation/adyen/)
> * [`CardNumberValidator`](https://adyen.github.io/adyen-ios/5.0.0/documentation/adyen/)
> * [`CardExpiryDateValidator`](https://adyen.github.io/adyen-ios/5.0.0/documentation/adyen/)
> * [`CardSecurityCodeValidator`](https://adyen.github.io/adyen-ios/5.0.0/documentation/adyen/)
>
> To use our iOS classes, you need to:
>
> 1. Install the Adyen iOS client-side library from either CocoaPods or Carthage.
>
>    * To install iOS Drop-in from **CocoaPods**:
>
>      1. Add `pod 'Adyen'` to your `Podfile`.
>      2. Run `pod install`.
>    * To install iOS Drop-in from **Carthage**:
>
>      1. Add `github "adyen/adyen-ios"` to your `Cartfile`.
>      2. Run `carthage update`.
>      3. Link the framework with your target as described in [Carthage Readme](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application).
>
> 2. Get your Client Encryption Public Key. You need to set this as your `publicKey` when using the `CardEncryptor` class. To get your public key:
>
>    1. Sign in to your [Customer Area](https://ca-test.adyen.com/) using your company account.
>    2. Navigate to **Developers** > **API credentials**.
>    3. Click on your web service user (**ws\@Company.\[YourCompanyAccount]**) in the users list.\
>       This opens the **Edit Web Service User** page.
>    4. In the **Client-Side Encryption** panel, copy the **Client Encryption Public Key**.
>
> 3. Create a function that validates card data and provides the encrypted card details.
>
>    **iOS classes for validating and encrypting card data**
>
>    ```swift theme={null}
>    func validateCardData() {
>            let cardValidator = CardNumberValidator()
>            let isCardValid: Bool = cardValidator.isValid(cardNumberValue ?? "")
>            let expiryValidator = CardExpiryDateValidator()
>            let isExpiryValid: Bool = expiryValidator.isValid(expiryDate)
>            let securityCodeValidator = CardSecurityCodeValidator()
>            let isSecurityCodeValid = securityCodeValidator.isValid(securityCodeValue)
>            if isCardValid && isExpiryValid && isSecurityCodeValid && (cardHolderNameValue != nil){
>                let cardObject = CardEncryptor.Card(number: cardNumberValue, securityCode: securityCodeValue, expiryMonth: expiryMonthValue, expiryYear: expiryYearValue)
>                let encryptedCard = CardEncryptor.encryptedCard(for: cardObject, publicKey: self.PUBLIC_KEY)
>                makePayment(details: encryptedCard, holderName: cardHolderNameValue ?? "", type: "scheme")
>            }
>        }
>    ```
>
> 4. Pass the encrypted data to your server and proceed to [make a payment](#make-a-payment).
>
>    **Encrypted shopper payment details for Card**
>
>    ```json theme={null}
>    {
>        "encryptedCardNumber":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>        "encryptedExpiryMonth":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>        "encryptedExpiryYear":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>        "encryptedSecurityCode":"adyenjs_0_1_18$MT6ppy0FAMVMLH..."
>    }
>    ```

> [tab] Android
>
> Build your own UI for the card payment form, collect the shopper's card details, and then use the [`CardEncrypter` ](https://adyen.github.io/adyen-android/cse/com.adyen.checkout.cse/-card-encrypter/index.html)class to encrypt the data in your client app.
>
> To use our Android modules, you need to:
>
> 1. Add the dependency in your `build.gradle` (Module) file. To get the latest version, check our [GitHub repository](https://github.com/Adyen/adyen-android).
>
>    ```groovy theme={null}
>    implementation "com.adyen.checkout:cse:$checkout_version"
>    ```
>
> 2. Get your Client Encryption Public Key. You need to set this as your `publicKey` when using the `CardEncrypter` class. To get your public key:
>
>    1. Sign in to your [Customer Area](https://ca-test.adyen.com/) using your company account.
>    2. Navigate to **Developers** > **API credentials**.
>    3. Click on your web service user (**ws\@Company.\[YourCompanyAccount]**) in the users list.\
>       This opens the **Edit Web Service User** page.
>    4. In the **Client-Side Encryption** panel, copy the **Client Encryption Public Key**.
>
> 3. Use `CardEncrypter` to provide the encrypted card details.
>
>    **Android module for encrypting card data**
>
>    ```kotlin theme={null}
>    // Example values
>    val cardNumber = "4111111111111111"
>    val expiryMonth = "3"
>    val expiryYear = "2020"
>    val cvc = "737"
>
>       // Validate the card details before encrypting it
>    if (validateCard()) {
>        val unencryptedCard = UnencryptedCard.Builder()
>            .setNumber(cardNumber)
>            .setExpiryDate(expiryMonth, expiryYear)
>            .setCvc(cvc)
>            .build()
>
>        val encryptedCard = CardEncrypter.encryptFields(unencryptedCard, "YOUR_PUBLIC_KEY")
>    }
>    ```
>
> 4. Pass the encrypted data to your server and proceed to [make a payment](#make-a-payment).
>
>    **Encrypted shopper payment details for Card**
>
>    ```json theme={null}
>    {
>        "encryptedCardNumber":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>        "encryptedExpiryMonth":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>        "encryptedExpiryYear":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>        "encryptedSecurityCode":"adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>    }
>    ```

> [tab] React Native
>
> Build your own UI for the card payment form, collect the shopper's card details, and use the `encryptCard` function to encrypt the data in your client app.
>
> To use our React Native functions:
>
> 1. Import the client side encryption module.
>
>    ```js theme={null}
>    import { AdyenCSE, AdyenAction } from '@adyen/react-native';
>    ```
>
> 2. Get your Client Encryption Public Key. You need to set this as your `PUBLIC_KEY` when using the `encryptCard` function. To get your public key:
>
>    1. Sign in to your [Customer Area](https://ca-test.adyen.com/) using your company account.
>    2. Navigate to **Developers** > **API credentials**.
>    3. Click on your web service user (**ws\@Company.\[YourCompanyAccount]**) in the users list.\
>       This opens the **Edit Web Service User** page.
>    4. In the **Client-Side Encryption** panel, copy the **Client Encryption Public Key**.
>
> 3. Put unencrypted card data into the `unencryptedCard` object.
>
>    **Create a card data object**
>
>    ```js theme={null}
>    const unencryptedCard = {
>       number,
>       expiryMonth,
>       expiryYear,
>       cvv,
>    }
>    ```
>
> 4. Call the `encryptCard` function, passing the object with the unencrypted card details.
>
>    **Encrypt card data in React Native**
>
>    ```js theme={null}
>    const encryptedCard = await AdyenCSE.encryptCard(
>       unencryptedCard,
>       YOUR_PUBLIC_KEY
>    )
>    ```
>
> 5. Pass the encrypted data as the `paymentMethod` when you [make a payment](#make-a-payment).
>
>    **Use encrypted card data as payment method**
>
>    ```js theme={null}
>    const data = {
>       paymentMethod: {
>          type: 'scheme',
>          encryptedCardNumber: encryptedCard.number,
>          encryptedExpiryMonth: encryptedCard.expiryMonth,
>          encryptedExpiryYear: encryptedCard.expiryYear,
>          encryptedSecurityCode: encryptedCard.cvv,
>          threeDS2SdkVersion: AdyenAction.threeDS2SdkVersion
>       },
>    let result = await ApiClient.payments(data, ...);
>    }
>    ```

> [tab] Flutter
>
> Build your own UI for the card payment form, collect the shopper's card details, and use the `encryptCard` function to encrypt the card details.
>
> 1. Get your Client Encryption Public Key. You need to set this as your `publicKey` when you encrypt the card details. To get your public key:
>
>    1. Sign in to your [Customer Area](https://ca-test.adyen.com/) using your company account.
>    2. Navigate to **Developers** > **API credentials**.
>    3. Click on your web service user (**ws\@Company.\[YourCompanyAccount]**) in the users list.\
>       This opens the **Edit Web Service User** page.
>    4. In the **Client-Side Encryption** panel, copy the **Client Encryption Public Key**.
>
> 2. Encrypt the card details.
>
>    **Encrypt card details**
>
>    ```js theme={null}
>    final UnencryptedCard unencryptedCard = UnencryptedCard(
>         cardNumber: "4111111111111",
>         expiryMonth: "03",
>         expiryYear: "2030",
>         cvc: "7373",
>    );
>
>    final EncryptedCard encryptedCard = await AdyenCheckout.instance.encryptCard(unencryptedCard, PUBLIC_KEY);
>    ```
>
> 3. Pass the encrypted data as the `paymentMethod` when you [make a payment](#make-a-payment).
>
> ## Make a payment
>
> From your server, make a POST [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying:
>
> | Parameter | Description |
> | - | - |
> | `amount` | The `currency` of the payment and its `value` in [minor units](https://adyen-preview.mintlify.site/development-resources/currency-codes.md). |
> | `reference` | Your unique reference for this payment. |
> | `paymentMethod` | Object that contains the encrypted card details from the [client side](#show-the-available-cards-in-your-payment-form), the card holder's name (if you collected it), and a `type` parameter set to **scheme**. |
> | `returnUrl` | URL to where the shopper should be taken back to after a redirection. The URL can contain a maximum of 1024 characters and should include the protocol: `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. If the URL to return to includes non-ASCII characters, like spaces or special letters, URL encode the value. The URL must not include personally identifiable information (PII), for example name or email address. |
> | `merchantAccount` | Your merchant account name. |
> | `riskData` | [Device characteristics and other data](https://adyen-preview.mintlify.site/risk-management/fraud-data-collection.md) that we use to detect fraudulent payment activity, and mitigate fraud. If you [collect additional data](#collecting-additional-data) from other pages on your website, that data is also included in this object. |
>
> ```bash curl theme={null}
> curl https://checkout-test.adyen.com/v72/payments \
> -H 'x-api-key: ADYEN_API_KEY' \
> -H 'content-type: application/json' \
> -d '{
>   "amount":{
>     "currency":"USD",
>     "value":1000
>   },
>   "reference":"YOUR_ORDER_NUMBER",
>   "paymentMethod":{
> 	    "type": "scheme",
> 	    "encryptedCardNumber": "test_4111111111111111",
> 	    "encryptedExpiryMonth": "test_03",
> 	    "encryptedExpiryYear": "test_2030",
> 	    "encryptedSecurityCode": "test_737",
>       "holderName": "S. Hopper"
>   },
>   "returnUrl": "https://your-company.example.com/...",
>   "merchantAccount":"ADYEN_MERCHANT_ACCOUNT",
>   "riskData": {
>         "clientData": "eyJ0cmFuc1N0YXR1cy...I6IlkifQ=="
>   }
> }'
> ```
>
> ```java Java theme={null}
> // Adyen Java API Library v28.4.0
> import com.adyen.Client;
> import com.adyen.enums.Environment;
> import com.adyen.model.checkout.*;
> import java.time.OffsetDateTime;
> import java.util.*;
> import com.adyen.model.RequestOptions;
> import com.adyen.service.checkout.*;
>
> // For the live environment, additionally include your liveEndpointUrlPrefix.
> Client client = new Client("ADYEN_API_KEY", Environment.TEST);
>
> // Create the request object(s)
> Amount amount = new Amount()
>   .currency("USD")
>   .value(1000L);
>
> CardDetails cardDetails = new CardDetails()
>   .encryptedCardNumber("test_4111111111111111")
>   .holderName("S. Hopper")
>   .encryptedSecurityCode("test_737")
>   .encryptedExpiryYear("test_2030")
>   .encryptedExpiryMonth("test_03")
>   .type(CardDetails.TypeEnum.SCHEME);
>
> RiskData riskData = new RiskData()
>   .clientData("eyJ0cmFuc1N0YXR1cy...I6IlkifQ==");
>
> PaymentRequest paymentRequest = new PaymentRequest()
>   .reference("YOUR_ORDER_NUMBER")
>   .amount(amount)
>   .merchantAccount("ADYEN_MERCHANT_ACCOUNT")
>   .paymentMethod(new CheckoutPaymentMethod(cardDetails))
>   .returnUrl("https://your-company.example.com/...")
>   .riskData(riskData);
>
> // Send the request
> PaymentsApi service = new PaymentsApi(client);
> PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID"));
> ```
>
> ```php PHP theme={null}
> // Adyen PHP API Library v20.3.0
> use Adyen\Client;
> use Adyen\Environment;
> use Adyen\Model\Checkout\Amount;
> use Adyen\Model\Checkout\CheckoutPaymentMethod;
> use Adyen\Model\Checkout\RiskData;
> use Adyen\Model\Checkout\PaymentRequest;
> use Adyen\Service\Checkout\PaymentsApi;
>
> $client = new Client();
> $client->setXApiKey("ADYEN_API_KEY");
> // For the live environment, additionally include your liveEndpointUrlPrefix.
> $client->setEnvironment(Environment::TEST);
>
>
> // Create the request object(s)
> $amount = new Amount();
> $amount
>   ->setCurrency("USD")
>   ->setValue(1000);
>
> $checkoutPaymentMethod = new CheckoutPaymentMethod();
> $checkoutPaymentMethod
>   ->setEncryptedCardNumber("test_4111111111111111")
>   ->setHolderName("S. Hopper")
>   ->setEncryptedSecurityCode("test_737")
>   ->setEncryptedExpiryYear("test_2030")
>   ->setEncryptedExpiryMonth("test_03")
>   ->setType("scheme");
>
> $riskData = new RiskData();
> $riskData
>   ->setClientData("eyJ0cmFuc1N0YXR1cy...I6IlkifQ==");
>
> $paymentRequest = new PaymentRequest();
> $paymentRequest
>   ->setReference("YOUR_ORDER_NUMBER")
>   ->setAmount($amount)
>   ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT")
>   ->setPaymentMethod($checkoutPaymentMethod)
>   ->setReturnUrl("https://your-company.example.com/...")
>   ->setRiskData($riskData);
>
> $requestOptions['idempotencyKey'] = 'UUID';
>
> // Send the request
> $service = new PaymentsApi($client);
> $response = $service->payments($paymentRequest, $requestOptions);
> ```
>
> ```cs C# theme={null}
> // Adyen .net API Library v20.0.0
> using Adyen;
> using Environment = Adyen.Model.Environment;
> using Adyen.Model;
> using Adyen.Model.Checkout;
> using Adyen.Service.Checkout;
>
> // For the live environment, additionally include your liveEndpointUrlPrefix.
> var config = new Config()
> {
>     XApiKey = "ADYEN_API_KEY",
>     Environment = Environment.Test
> };
> var client = new Client(config);
>
> // Create the request object(s)
> Amount amount = new Amount
> {
>   Currency = "USD",
>   Value = 1000
> };
>
> CardDetails cardDetails = new CardDetails
> {
>   EncryptedCardNumber = "test_4111111111111111",
>   HolderName = "S. Hopper",
>   EncryptedSecurityCode = "test_737",
>   EncryptedExpiryYear = "test_2030",
>   EncryptedExpiryMonth = "test_03",
>   Type = CardDetails.TypeEnum.Scheme
> };
>
> RiskData riskData = new RiskData
> {
>   ClientData = "eyJ0cmFuc1N0YXR1cy...I6IlkifQ=="
> };
>
> PaymentRequest paymentRequest = new PaymentRequest
> {
>   Reference = "YOUR_ORDER_NUMBER",
>   Amount = amount,
>   MerchantAccount = "ADYEN_MERCHANT_ACCOUNT",
>   PaymentMethod = new CheckoutPaymentMethod(cardDetails),
>   ReturnUrl = "https://your-company.example.com/...",
>   RiskData = riskData
> };
>
> // Send the request
> var service = new PaymentsService(client);
> var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
> ```
>
> ```js NodeJS (JavaScript) theme={null}
> // Adyen Node API Library v19.3.0
> // Require the parts of the module you want to use
> const { Client, CheckoutAPI } = require('@adyen/api-library');
> // Initialize the client object
> // For the live environment, additionally include your liveEndpointUrlPrefix.
> const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});
>
> // Create the request object(s)
> const paymentRequest = {
>   amount: {
>     currency: "USD",
>     value: 1000
>   },
>   reference: "YOUR_ORDER_NUMBER",
>   paymentMethod: {
>     type: "scheme",
>     encryptedCardNumber: "test_4111111111111111",
>     encryptedExpiryMonth: "test_03",
>     encryptedExpiryYear: "test_2030",
>     encryptedSecurityCode: "test_737",
>     holderName: "S. Hopper"
>   },
>   returnUrl: "https://your-company.example.com/...",
>   merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
>   riskData: {
>     clientData: "eyJ0cmFuc1N0YXR1cy...I6IlkifQ=="
>   }
> }
>
> // Send the request
> const checkoutAPI = new CheckoutAPI(client);
> const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
> ```
>
> ```go Go theme={null}
> // Adyen Go API Library v12.2.0
> import (
>   "context"
>   "github.com/adyen/adyen-go-api-library/v9/src/common"
>   "github.com/adyen/adyen-go-api-library/v9/src/adyen"
>   "github.com/adyen/adyen-go-api-library/v9/src/checkout"
> )
> // For the live environment, additionally include your liveEndpointUrlPrefix.
> client := adyen.NewClient(&common.Config{
>   ApiKey:      "ADYEN_API_KEY",
>   Environment: common.TestEnv,
> })
>
> // Create the request object(s)
> amount := checkout.Amount{
>   Currency: "USD",
>   Value: 1000,
> }
>
> cardDetails := checkout.CardDetails{
>   EncryptedCardNumber: common.PtrString("test_4111111111111111"),
>   HolderName: common.PtrString("S. Hopper"),
>   EncryptedSecurityCode: common.PtrString("test_737"),
>   EncryptedExpiryYear: common.PtrString("test_2030"),
>   EncryptedExpiryMonth: common.PtrString("test_03"),
>   Type: common.PtrString("scheme"),
> }
>
> riskData := checkout.RiskData{
>   ClientData: common.PtrString("eyJ0cmFuc1N0YXR1cy...I6IlkifQ=="),
> }
>
> paymentRequest := checkout.PaymentRequest{
>   Reference: "YOUR_ORDER_NUMBER",
>   Amount: amount,
>   MerchantAccount: "ADYEN_MERCHANT_ACCOUNT",
>   PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails),
>   ReturnUrl: "https://your-company.example.com/...",
>   RiskData: &riskData,
> }
>
> // Send the request
> service := client.Checkout()
> req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest)
> res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)
> ```
>
> ```py Python theme={null}
> # Adyen Python API Library v12.7.0
> import Adyen
>
> adyen = Adyen.Adyen()
> adyen.client.xapikey = "ADYEN_API_KEY"
> # For the live environment, additionally include your liveEndpointUrlPrefix.
> adyen.client.platform = "test" # The environment to use library in.
>
> # Create the request object(s)
> json_request = {
>   "amount": {
>     "currency": "USD",
>     "value": 1000
>   },
>   "reference": "YOUR_ORDER_NUMBER",
>   "paymentMethod": {
>     "type": "scheme",
>     "encryptedCardNumber": "test_4111111111111111",
>     "encryptedExpiryMonth": "test_03",
>     "encryptedExpiryYear": "test_2030",
>     "encryptedSecurityCode": "test_737",
>     "holderName": "S. Hopper"
>   },
>   "returnUrl": "https://your-company.example.com/...",
>   "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
>   "riskData": {
>     "clientData": "eyJ0cmFuc1N0YXR1cy...I6IlkifQ=="
>   }
> }
>
> # Send the request
> result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID")
> ```
>
> ```rb Ruby theme={null}
> # Adyen Ruby API Library v9.7.1
> require "adyen-ruby-api-library"
>
> adyen = Adyen::Client.new
> adyen.api_key = 'ADYEN_API_KEY'
> # For the live environment, additionally include your liveEndpointUrlPrefix.
> adyen.env = :test # Set to "live" for live environment
>
> # Create the request object(s)
> request_body = {
>   :amount => {
>     :currency => 'USD',
>     :value => 1000
>   },
>   :reference => 'YOUR_ORDER_NUMBER',
>   :paymentMethod => {
>     :type => 'scheme',
>     :encryptedCardNumber => 'test_4111111111111111',
>     :encryptedExpiryMonth => 'test_03',
>     :encryptedExpiryYear => 'test_2030',
>     :encryptedSecurityCode => 'test_737',
>     :holderName => 'S. Hopper'
>   },
>   :returnUrl => 'https://your-company.example.com/...',
>   :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT',
>   :riskData => {
>     :clientData => 'eyJ0cmFuc1N0YXR1cy...I6IlkifQ=='
>   }
> }
>
> # Send the request
> result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' })
> ```
>
> ```ts NodeJS (TypeScript) theme={null}
> // Adyen Node API Library v19.3.0
> // Require the parts of the module you want to use
> import { Client, CheckoutAPI, Types } from "@adyen/api-library";
> // Initialize the client object
> // For the live environment, additionally include your liveEndpointUrlPrefix.
> const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});
>
> // Create the request object(s)
> const amount: Types.checkout.Amount = {
>   currency: "USD",
>   value: 1000
> };
>
> const cardDetails: Types.checkout.CardDetails = {
>   encryptedCardNumber: "test_4111111111111111",
>   holderName: "S. Hopper",
>   encryptedSecurityCode: "test_737",
>   encryptedExpiryYear: "test_2030",
>   encryptedExpiryMonth: "test_03",
>   type: Types.checkout.CardDetails.TypeEnum.Scheme
> };
>
> const riskData: Types.checkout.RiskData = {
>   clientData: "eyJ0cmFuc1N0YXR1cy...I6IlkifQ=="
> };
>
> const paymentRequest: Types.checkout.PaymentRequest = {
>   reference: "YOUR_ORDER_NUMBER",
>   amount: amount,
>   merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
>   paymentMethod: cardDetails,
>   returnUrl: "https://your-company.example.com/...",
>   riskData: riskData
> };
>
> // Send the request
> const checkoutAPI = new CheckoutAPI(client);
> const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
> ```
>
> The [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response contains:
>
> * [pspReference](https://docs.adyen.com/api-explorer/Checkout/latest/payments#responses-200-pspReference): Our unique identifier for the transaction.
> * `resultCode`: Use this to [present the payment result to your shopper](#present-the-payment-result).
> * `merchantReference`: The `reference` from the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request.
> * `additionalData`: Additional information about the transaction.\
>   To specify the fields that you want to receive in `additionalData`, log in to your [Customer Area](https://ca-test.adyen.com/), and go to **Developers** > **Additional data**.
>
> **/payments response**
>
> ```json theme={null}
> {
>   "additionalData": {
>     "cardSummary": "1111"
>   },
>   "pspReference": "851572424333194G",
>   "resultCode": "Authorised",
>   "merchantReference": "YOUR_ORDER_NUMBER"
> }
> ```
>
> ## Present the payment result
>
> Use the  [resultCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-resultCode) from the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response to present the payment result to your shopper. You will also receive the outcome of the payment asynchronously in a [webhook](https://adyen-preview.mintlify.site/development-resources/webhooks.md).
>
> For card payments, you can receive the following `resultCode` values:
>
> | resultCode | Description | Action to take |
> | - | - | - |
> | **Authorised** | The payment was successful. | Inform the shopper that the payment has been successful. If you are using [manual capture](https://adyen-preview.mintlify.site/online-payments/capture#manual-capture), you also need to [capture](https://adyen-preview.mintlify.site/online-payments/capture) the payment. |
> | **Cancelled** | The shopper cancelled the payment. | Ask the shopper whether they want to continue with the order, or ask them to select a different payment method. |
> | **Error** | There was an error when the payment was being processed. For more information, check the [`refusalReason` ](https://adyen-preview.mintlify.site/development-resources/refusal-reasons)field. | Inform the shopper that there was an error processing their payment. |
> | **Refused** | The payment was refused. For more information, check the [`refusalReason` ](https://adyen-preview.mintlify.site/development-resources/refusal-reasons)field. | Ask the shopper to try the payment again using a different payment method. |
>
> Additional `resultCode` values are possible in case of the 3D Secure authentication flow. For more information, refer to [Result codes](https://adyen-preview.mintlify.site/online-payments/build-your-integration/payment-result-codes.md#3d-secure-authentication).
>
> ## Showing co-badged cards
>
> [Regulatory guidelines for some regions](https://adyen-preview.mintlify.site/online-payments/co-badged-cards-compliance.md) require the following:
>
> * When a shopper presents a co-badged card, they must be allowed to select their preferred brand.
> * If the shopper selected a preferred brand, the payment must be completed with this brand.
> * If you accept credit and debit cards, your card payment section must refer to both debit and credit cards. You cannot present only a credit card section.
>
> For Web integrations, to comply with these guidelines:
>
> 1. Use the [`onBinLookup` ](#events)event to detect if a card is co-badged.
> 2. If you accept debit and credit cards, use a label that does not discriminate between card products in your checkout. For example, **Cards**, or **Card payment**.
> 3. If a card is co-badged, present all supported brands to the shopper, allowing them to click on the brand they want to pay with. Each of the presented brands should have an `alt` or a `data-value` attribute.
> 4. If the shopper makes a choice, pass the corresponding event to the `dualBrandingChangeHandler` function.\
>    The shopper's selected brand will then be included in the `state.data` from the Component.
>
> The following example shows how to present brand logos for a co-badged Bancontact/Maestro card:
>
> ```js theme={null}
> function onBinLookup(pCallbackObj) {
>     // Handle a dual branded result
>     if (pCallbackObj.supportedBrandsRaw?.length > 1) {
>         onDualBrand(pCallbackObj);
>     }
> }
> // Implement dual branding
> function onDualBrand(pCallbackObj) {
>   const logoOne = document.getElementById('pmImageDual1');
>   const logoTwo = document.getElementById('pmImageDual2');
>   const supportedBrands = pCallbackObj.supportedBrandsRaw;
>
>   //Set one brand icon, add alt or data-value attributes; add an event listener
>   logoOne.setAttribute('src', supportedBrands[0].brandImageUrl);
>   logoOne.setAttribute('alt', supportedBrands[0].brand);
>   logoOne.setAttribute('data-value', supportedBrands[0].brand);
>   logoOne.addEventListener('click', dualBrandListener);
>
>   // Set the other brand icon, add alt or data-value attributes; add an event listener
>   logoTwo.setAttribute('src', supportedBrands[1].brandImageUrl);
>   logoTwo.setAttribute('alt', supportedBrands[1].brand);
>   logoTwo.setAttribute('data-value', supportedBrands[1].brand);
>   logoTwo.addEventListener('click', dualBrandListener);
> }
> ```
>
> Implementing `dualBrandListener` to pass the selected attributes to to `dualBrandingChangeHandler`:
>
> ```js theme={null}
> function dualBrandListener(e) {
>     securedFields.dualBrandingChangeHandler(e);
> }
> ```
>
> ## Present debit and credit cards separately
>
> This requires Checkout API v53 and later.
>
> In some scenarios, you may want to present your shoppers with separate payment forms for debit cards and credit cards. Some examples include:
>
> * If you accept payments in Sweden, you need to present debit cards before credit cards in order to comply with [local legislation](https://www.regeringen.se/rattsliga-dokument/lagradsremiss/2019/12/presentation-av-betalningssatt-vid-marknadsforing-av-betaltjanster-online).
> * In Brazil, many shoppers use *Combo cards*, allowing for both debit and credit transactions. Having a separate form for **Debit Card** and **Credit Card** gives your shoppers a clear indication of whether they are making a debit or credit transaction.
>
> For more details, see the corresponding sections about [Brazil](#brazil) and [Sweden](#sweden).
>
> To show debit and credit cards separately:
>
> 1. If you are using the [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) endpoint to get a list of payment methods to present on the client side, include:
>
>    * [splitCardFundingSources](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-splitCardFundingSources): Set this to **true** to receive separate objects for credit and debit cards in the response.
>
>    The following example shows how to get the available payment methods for a shopper in the **Netherlands**, making a **EUR 47.00** payment.
>
>    **/paymentMethods request**
>
>    ```bash theme={null}
>    curl https://checkout-test.adyen.com/v72/paymentMethods \
>    -H 'x-api-key: ADYEN_API_KEY' \
>    -H 'content-type: application/json' \
>    -d '{
>      "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
>      "countryCode": "NL",
>      "amount": {
>        "currency": "EUR",
>        "value": 4700
>      },
>      "splitCardFundingSources": true
>    }'
>    ```
>
>    The response includes the list of available payment methods, with debit and credit cards split into separate objects.
>
>    **Response**
>
>    ```json theme={null}
>    {
>       ...
>       "paymentMethods": [
>           {
>               "brands": [
>                   "mc",
>                   "visa",
>                   "amex"
>               ],
>               ...
>               "fundingSource": "credit",
>               "name": "Credit Card",
>               "type": "scheme"
>           },
>           {
>               "brands": [
>                   "mc",
>                   "visa",
>                   "amex"
>               ],
>               "fundingSource": "debit",
>               "name": "Debit Card",
>               "type": "scheme"
>           }
>       ]
>    }
>    ```
>
> 2. When the shopper selects to pay with either a debit or credit card, proceed to make a POST [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request and include:
>
>    * `paymentMethod.fundingSource`: Set this to either **credit** or **debit**.
>
>    The following example shows how you can make a payment request for a debit card.
>
>    **/payments request**
>
>    ```bash theme={null}
>    curl https://checkout-test.adyen.com/v72/payments \
>    -H 'x-api-key: ADYEN_API_KEY' \
>    -H 'content-type: application/json' \
>    -d '{
>      "amount":{
>        "currency":"EUR",
>        "value":4700
>      },
>      "reference":"YOUR_ORDER_NUMBER",
>      "paymentMethod": {
>        "type": "scheme",
>        "encryptedCardNumber": "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>        "encryptedExpiryMonth": "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>        "encryptedExpiryYear": "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>        "encryptedSecurityCode": "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>        "holderName": "S. Hopper",
>        "fundingSource": "debit"
>      },
>      "additionalData": {
>        "overwriteBrand": true
>      },
>      "returnUrl": "https://your-company.example.com/...",
>      "merchantAccount":"YOUR_MERCHANT_ACCOUNT"
>    }'
>    ```
>
> ### Brazil
>
> For debit transactions, we highly recommend using [3D Secure](https://adyen-preview.mintlify.site/online-payments/3d-secure) and [automatic capture](https://adyen-preview.mintlify.site/online-payments/capture) due to some issuers' restrictions.
>
> ### Sweden
>
> When accepting payments in Sweden, present debit before credit cards, and label the forms clearly in order to comply with [Swedish legislations](https://www.regeringen.se/rattsliga-dokument/lagradsremiss/2019/12/presentation-av-betalningssatt-vid-marknadsforing-av-betaltjanster-online).
>
> ## Recurring payments
>
> Cards support [tokenization](https://adyen-preview.mintlify.site/online-payments/tokenization) for [one-click](https://adyen-preview.mintlify.site/get-started-with-adyen/adyen-glossary.md#one-click-payments), [subscription](https://adyen-preview.mintlify.site/get-started-with-adyen/adyen-glossary.md#subscriptions), and [unscheduled card-on-file](https://adyen-preview.mintlify.site/get-started-with-adyen/adyen-glossary.md#unscheduled-card-on-file-ucof) payments. Refer to [Create tokens](https://adyen-preview.mintlify.site/online-payments/tokenization/create-tokens.md) to integrate with our tokenization feature.
>
> We strongly recommend that you ask explicit permission from the shopper if you intend to make future recurring payments. Being transparent about the payment schedule and the charged amount reduces the risk of chargebacks.
>
> ### Store card details
>
> When [creating a token](https://adyen-preview.mintlify.site/online-payments/tokenization/create-tokens.md) for cards:
>
> * Use the standard tokenization parameters in your payment request. You do not need to include any additional parameters for cards.
>
> **Create a token for one-click payments**
>
> ```bash curl theme={null}
> curl https://checkout-test.adyen.com/v72/payments \
> -H 'x-api-key: ADYEN_API_KEY' \
> -H 'content-type: application/json' \
> -d '{
>    "amount":{
>       "value":0,
>       "currency":"USD"
>    },
>    "paymentMethod":{
>       "type":"scheme",
>       "encryptedCardNumber": "test_4111111111111111",
>       "encryptedExpiryMonth": "test_03",
>       "encryptedExpiryYear": "test_2030",
>       "encryptedSecurityCode": "test_737",
>       "holderName":"John Smith"
>    },
>    "reference":"YOUR_ORDER_REFERENCE",
>    "shopperInteraction": "Ecommerce",
>    "recurringProcessingModel": "CardOnFile",
>    "storePaymentMethod": "true",
>    "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
>    "shopperReference":"YOUR_SHOPPER_REFERENCE",
>    "returnUrl":"https://your-company.example.com/..."
> }'
> ```
>
> ```java Java theme={null}
> // Adyen Java API Library v39.3.0
> import com.adyen.Client;
> import com.adyen.enums.Environment;
> import com.adyen.model.checkout.*;
> import java.time.OffsetDateTime;
> import java.util.*;
> import com.adyen.model.RequestOptions;
> import com.adyen.service.checkout.*;
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> Client client = new Client("ADYEN_API_KEY", Environment.TEST);
>
> // Create the request object(s)
> Amount amount = new Amount()
>   .currency("USD")
>   .value(0L);
>
> CardDetails cardDetails = new CardDetails()
>   .encryptedCardNumber("test_4111111111111111")
>   .holderName("John Smith")
>   .encryptedSecurityCode("test_737")
>   .encryptedExpiryYear("test_2030")
>   .encryptedExpiryMonth("test_03")
>   .type(CardDetails.TypeEnum.SCHEME);
>
> PaymentRequest paymentRequest = new PaymentRequest()
>   .reference("YOUR_ORDER_REFERENCE")
>   .amount(amount)
>   .storePaymentMethod(true)
>   .merchantAccount("YOUR_MERCHANT_ACCOUNT")
>   .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.CARDONFILE)
>   .paymentMethod(new CheckoutPaymentMethod(cardDetails))
>   .shopperInteraction(PaymentRequest.ShopperInteractionEnum.ECOMMERCE)
>   .returnUrl("https://your-company.example.com/...")
>   .shopperReference("YOUR_SHOPPER_REFERENCE");
>
> // Send the request
> PaymentsApi service = new PaymentsApi(client);
> PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID"));
> ```
>
> ```php PHP theme={null}
> <?php
> // Adyen PHP API Library v28.2.0
> use Adyen\Client;
> use Adyen\Environment;
> use Adyen\Model\Checkout\Amount;
> use Adyen\Model\Checkout\CheckoutPaymentMethod;
> use Adyen\Model\Checkout\PaymentRequest;
> use Adyen\Service\Checkout\PaymentsApi;
>
> $client = new Client();
> $client->setXApiKey("ADYEN_API_KEY");
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> $client->setEnvironment(Environment::TEST);
>
>
> // Create the request object(s)
> $amount = new Amount();
> $amount
>   ->setCurrency("USD")
>   ->setValue(0);
>
> $checkoutPaymentMethod = new CheckoutPaymentMethod();
> $checkoutPaymentMethod
>   ->setEncryptedCardNumber("test_4111111111111111")
>   ->setHolderName("John Smith")
>   ->setEncryptedSecurityCode("test_737")
>   ->setEncryptedExpiryYear("test_2030")
>   ->setEncryptedExpiryMonth("test_03")
>   ->setType("scheme");
>
> $paymentRequest = new PaymentRequest();
> $paymentRequest
>   ->setReference("YOUR_ORDER_REFERENCE")
>   ->setAmount($amount)
>   ->setStorePaymentMethod(true)
>   ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT")
>   ->setRecurringProcessingModel("CardOnFile")
>   ->setPaymentMethod($checkoutPaymentMethod)
>   ->setShopperInteraction("Ecommerce")
>   ->setReturnUrl("https://your-company.example.com/...")
>   ->setShopperReference("YOUR_SHOPPER_REFERENCE");
>
> $requestOptions['idempotencyKey'] = 'UUID';
>
> // Send the request
> $service = new PaymentsApi($client);
> $response = $service->payments($paymentRequest, $requestOptions);
> ```
>
> ```cs C# theme={null}
> // Adyen .net API Library v32.1.1
> using Adyen;
> using Environment = Adyen.Model.Environment;
> using Adyen.Model;
> using Adyen.Model.Checkout;
> using Adyen.Service.Checkout;
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> var config = new Config()
> {
>     XApiKey = "ADYEN_API_KEY",
>     Environment = Environment.Test
> };
> var client = new Client(config);
>
> // Create the request object(s)
> Amount amount = new Amount
> {
>   Currency = "USD",
>   Value = 0
> };
>
> CardDetails cardDetails = new CardDetails
> {
>   EncryptedCardNumber = "test_4111111111111111",
>   HolderName = "John Smith",
>   EncryptedSecurityCode = "test_737",
>   EncryptedExpiryYear = "test_2030",
>   EncryptedExpiryMonth = "test_03",
>   Type = CardDetails.TypeEnum.Scheme
> };
>
> PaymentRequest paymentRequest = new PaymentRequest
> {
>   Reference = "YOUR_ORDER_REFERENCE",
>   Amount = amount,
>   StorePaymentMethod = true,
>   MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
>   RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.CardOnFile,
>   PaymentMethod = new CheckoutPaymentMethod(cardDetails),
>   ShopperInteraction = PaymentRequest.ShopperInteractionEnum.Ecommerce,
>   ReturnUrl = "https://your-company.example.com/...",
>   ShopperReference = "YOUR_SHOPPER_REFERENCE"
> };
>
> // Send the request
> var service = new PaymentsService(client);
> var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
> ```
>
> ```js NodeJS (JavaScript) theme={null}
> // Adyen Node API Library v29.0.0
> const { Client, CheckoutAPI } = require('@adyen/api-library');
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> const config = new Config({
>   apiKey: "ADYEN_API_KEY",
>   environment: EnvironmentEnum.TEST
> });
>
> const client = new Client(config);
>
> // Create the request object(s)
> const paymentRequest = {
>   amount: {
>     value: 0,
>     currency: "USD"
>   },
>   paymentMethod: {
>     type: "scheme",
>     encryptedCardNumber: "test_4111111111111111",
>     encryptedExpiryMonth: "test_03",
>     encryptedExpiryYear: "test_2030",
>     encryptedSecurityCode: "test_737",
>     holderName: "John Smith"
>   },
>   reference: "YOUR_ORDER_REFERENCE",
>   shopperInteraction: "Ecommerce",
>   recurringProcessingModel: "CardOnFile",
>   storePaymentMethod: "true",
>   merchantAccount: "YOUR_MERCHANT_ACCOUNT",
>   shopperReference: "YOUR_SHOPPER_REFERENCE",
>   returnUrl: "https://your-company.example.com/..."
> }
>
> // Send the request
> const checkoutAPI = new CheckoutAPI(client);
> const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
> ```
>
> ```go Go theme={null}
> // Adyen Go API Library v21.0.0
> import (
>   "context"
>   "github.com/adyen/adyen-go-api-library/v21/src/common"
>   "github.com/adyen/adyen-go-api-library/v21/src/adyen"
>   "github.com/adyen/adyen-go-api-library/v21/src/checkout"
> )
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> client := adyen.NewClient(&common.Config{
>   ApiKey:      "ADYEN_API_KEY",
>   Environment: common.TestEnv,
> })
>
> // Create the request object(s)
> amount := checkout.Amount{
>   Currency: "USD",
>   Value: 0,
> }
>
> cardDetails := checkout.CardDetails{
>   EncryptedCardNumber: common.PtrString("test_4111111111111111"),
>   HolderName: common.PtrString("John Smith"),
>   EncryptedSecurityCode: common.PtrString("test_737"),
>   EncryptedExpiryYear: common.PtrString("test_2030"),
>   EncryptedExpiryMonth: common.PtrString("test_03"),
>   Type: common.PtrString("scheme"),
> }
>
> paymentRequest := checkout.PaymentRequest{
>   Reference: "YOUR_ORDER_REFERENCE",
>   Amount: amount,
>   StorePaymentMethod: common.PtrBool(true),
>   MerchantAccount: "YOUR_MERCHANT_ACCOUNT",
>   RecurringProcessingModel: common.PtrString("CardOnFile"),
>   PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails),
>   ShopperInteraction: common.PtrString("Ecommerce"),
>   ReturnUrl: "https://your-company.example.com/...",
>   ShopperReference: common.PtrString("YOUR_SHOPPER_REFERENCE"),
> }
>
> // Send the request
> service := client.Checkout()
> req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest)
> res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)
> ```
>
> ```py Python theme={null}
> # Adyen Python API Library v13.6.0
> import Adyen
>
> adyen = Adyen.Adyen()
> adyen.client.xapikey = "ADYEN_API_KEY"
> # For the LIVE environment, also include your liveEndpointUrlPrefix.
> adyen.client.platform = "test" # The environment to use library in.
>
> # Create the request object(s)
> json_request = {
>   "amount": {
>     "value": 0,
>     "currency": "USD"
>   },
>   "paymentMethod": {
>     "type": "scheme",
>     "encryptedCardNumber": "test_4111111111111111",
>     "encryptedExpiryMonth": "test_03",
>     "encryptedExpiryYear": "test_2030",
>     "encryptedSecurityCode": "test_737",
>     "holderName": "John Smith"
>   },
>   "reference": "YOUR_ORDER_REFERENCE",
>   "shopperInteraction": "Ecommerce",
>   "recurringProcessingModel": "CardOnFile",
>   "storePaymentMethod": "True",
>   "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
>   "shopperReference": "YOUR_SHOPPER_REFERENCE",
>   "returnUrl": "https://your-company.example.com/..."
> }
>
> # Send the request
> result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID")
> ```
>
> ```rb Ruby theme={null}
> # Adyen Ruby API Library v10.4.0
> require "adyen-ruby-api-library"
>
> adyen = Adyen::Client.new
> adyen.api_key = 'ADYEN_API_KEY'
> # For the LIVE environment, also include your liveEndpointUrlPrefix.
> adyen.env = :test # Set to "live" for live environment
>
> # Create the request object(s)
> request_body = {
>   :amount => {
>     :value => 0,
>     :currency => 'USD'
>   },
>   :paymentMethod => {
>     :type => 'scheme',
>     :encryptedCardNumber => 'test_4111111111111111',
>     :encryptedExpiryMonth => 'test_03',
>     :encryptedExpiryYear => 'test_2030',
>     :encryptedSecurityCode => 'test_737',
>     :holderName => 'John Smith'
>   },
>   :reference => 'YOUR_ORDER_REFERENCE',
>   :shopperInteraction => 'Ecommerce',
>   :recurringProcessingModel => 'CardOnFile',
>   :storePaymentMethod => 'true',
>   :merchantAccount => 'YOUR_MERCHANT_ACCOUNT',
>   :shopperReference => 'YOUR_SHOPPER_REFERENCE',
>   :returnUrl => 'https://your-company.example.com/...'
> }
>
> # Send the request
> result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' })
> ```
>
> ```ts NodeJS (TypeScript) theme={null}
> // Adyen Node API Library v29.0.0
> import { Client, CheckoutAPI, Types } from "@adyen/api-library";
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> const config = new Config({
>   apiKey: "ADYEN_API_KEY",
>   environment: EnvironmentEnum.TEST
> });
>
> const client = new Client(config);
>
> // Create the request object(s)
> const amount: Types.checkout.Amount = {
>   currency: "USD",
>   value: 0
> };
>
> const cardDetails: Types.checkout.CardDetails = {
>   encryptedCardNumber: "test_4111111111111111",
>   holderName: "John Smith",
>   encryptedSecurityCode: "test_737",
>   encryptedExpiryYear: "test_2030",
>   encryptedExpiryMonth: "test_03",
>   type: Types.checkout.CardDetails.TypeEnum.Scheme
> };
>
> const paymentRequest: Types.checkout.PaymentRequest = {
>   reference: "YOUR_ORDER_REFERENCE",
>   amount: amount,
>   storePaymentMethod: true,
>   merchantAccount: "YOUR_MERCHANT_ACCOUNT",
>   recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.CardOnFile,
>   paymentMethod: cardDetails,
>   shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.Ecommerce,
>   returnUrl: "https://your-company.example.com/...",
>   shopperReference: "YOUR_SHOPPER_REFERENCE"
> };
>
> // Send the request
> const checkoutAPI = new CheckoutAPI(client);
> const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
> ```
>
> When a token is created, you receive a [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) webhook. The webhook contains the `storedPaymentMethodId` that you can use to make subsequent payments using the stored payment details.
>
> ### Show stored cards
>
> 1. In your [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) request, include the [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-shopperReference) that you specified when creating the token to receive the stored payment details for the shopper.
>
>    The [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) response includes a `storedPaymentMethods` array containing the stored payment methods for this shopper. The `storedPaymentMethods` array contains the `id` that you need when making a payment.
>
>    ```json theme={null}
>             {
>             ...
>             "storedPaymentMethods":[
>                 {
>                    "brand":"visa",
>                    "expiryMonth":"10",
>                    "expiryYear":"2020",
>                    "holderName":"John Smith",
>                    "id":"8415718415172204",
>                    "lastFour":"1111",
>                    "name":"VISA",
>                    "supportedShopperInteractions":[
>                       "Ecommerce",
>                       "ContAuth"
>                    ],
>                    "type":"scheme"
>                 }
>             ]
>             ...
>             }
>    ```
>
> 2. On your checkout page, use the Custom Card Component to collect the following details from the shopper:
>
>    | Card details | Example input |
>    | - | - |
>    | The security code (CVV / CVC) | "737" |
>
>    When `onSubmit` callback is triggered and if `state.isValid` is true, get the encrypted values from `state.data` and pass these values to your server.
>
> ### Make a one-click payment
>
> [Make a one-click payment](https://adyen-preview.mintlify.site/online-payments/tokenization/make-token-payments.md#make-a-one-click-payment) using standard tokenization parameters. You do not need to include any additional parameters for cards.
>
> **Make a one-click payment with a card token**
>
> ```bash curl theme={null}
> curl https://checkout-test.adyen.com/v72/payments \
> -H 'x-API-key: ADYEN_API_KEY' \
> -H 'Content-Type: application/json' \
> -d '{
>      "amount":{
>        "value":2000,
>        "currency":"USD"
>      },
>      "paymentMethod":{
>        "type":"scheme",
>        "storedPaymentMethodId":"8415718415172204",
>        "encryptedSecurityCode":"adyenjs_0_1_18$MT6ppy0FAMVMLH..."
>      },
>      "reference":"YOUR_ORDER_NUMBER",
>      "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
>      "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy..",
>      "shopperReference":"YOUR_UNIQUE_SHOPPER_ID",
>      "shopperInteraction":"ContAuth",
>      "recurringProcessingModel":"CardOnFile"
>  }'
> ```
>
> ```java Java theme={null}
> // Adyen Java API Library v39.4.0
> import com.adyen.Client;
> import com.adyen.enums.Environment;
> import com.adyen.model.checkout.*;
> import java.time.OffsetDateTime;
> import java.util.*;
> import com.adyen.model.RequestOptions;
> import com.adyen.service.checkout.*;
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> Client client = new Client("ADYEN_API_KEY", Environment.TEST);
>
> // Create the request object(s)
> Amount amount = new Amount()
>   .currency("USD")
>   .value(2000L);
>
> CardDetails cardDetails = new CardDetails()
>   .encryptedSecurityCode("adyenjs_0_1_18$MT6ppy0FAMVMLH...")
>   .storedPaymentMethodId("8415718415172204")
>   .type(CardDetails.TypeEnum.SCHEME);
>
> PaymentRequest paymentRequest = new PaymentRequest()
>   .reference("YOUR_ORDER_NUMBER")
>   .amount(amount)
>   .merchantAccount("YOUR_MERCHANT_ACCOUNT")
>   .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.CARDONFILE)
>   .paymentMethod(new CheckoutPaymentMethod(cardDetails))
>   .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH)
>   .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..")
>   .shopperReference("YOUR_UNIQUE_SHOPPER_ID");
>
> // Send the request
> PaymentsApi service = new PaymentsApi(client);
> PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID"));
> ```
>
> ```php PHP theme={null}
> <?php
> // Adyen PHP API Library v28.2.0
> use Adyen\Client;
> use Adyen\Environment;
> use Adyen\Model\Checkout\Amount;
> use Adyen\Model\Checkout\CheckoutPaymentMethod;
> use Adyen\Model\Checkout\PaymentRequest;
> use Adyen\Service\Checkout\PaymentsApi;
>
> $client = new Client();
> $client->setXApiKey("ADYEN_API_KEY");
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> $client->setEnvironment(Environment::TEST);
>
>
> // Create the request object(s)
> $amount = new Amount();
> $amount
>   ->setCurrency("USD")
>   ->setValue(2000);
>
> $checkoutPaymentMethod = new CheckoutPaymentMethod();
> $checkoutPaymentMethod
>   ->setEncryptedSecurityCode("adyenjs_0_1_18\$MT6ppy0FAMVMLH...")
>   ->setStoredPaymentMethodId("8415718415172204")
>   ->setType("scheme");
>
> $paymentRequest = new PaymentRequest();
> $paymentRequest
>   ->setReference("YOUR_ORDER_NUMBER")
>   ->setAmount($amount)
>   ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT")
>   ->setRecurringProcessingModel("CardOnFile")
>   ->setPaymentMethod($checkoutPaymentMethod)
>   ->setShopperInteraction("ContAuth")
>   ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..")
>   ->setShopperReference("YOUR_UNIQUE_SHOPPER_ID");
>
> $requestOptions['idempotencyKey'] = 'UUID';
>
> // Send the request
> $service = new PaymentsApi($client);
> $response = $service->payments($paymentRequest, $requestOptions);
> ```
>
> ```cs C# theme={null}
> // Adyen .net API Library v32.1.2
> using Adyen;
> using Environment = Adyen.Model.Environment;
> using Adyen.Model;
> using Adyen.Model.Checkout;
> using Adyen.Service.Checkout;
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> var config = new Config()
> {
>     XApiKey = "ADYEN_API_KEY",
>     Environment = Environment.Test
> };
> var client = new Client(config);
>
> // Create the request object(s)
> Amount amount = new Amount
> {
>   Currency = "USD",
>   Value = 2000
> };
>
> CardDetails cardDetails = new CardDetails
> {
>   EncryptedSecurityCode = "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>   StoredPaymentMethodId = "8415718415172204",
>   Type = CardDetails.TypeEnum.Scheme
> };
>
> PaymentRequest paymentRequest = new PaymentRequest
> {
>   Reference = "YOUR_ORDER_NUMBER",
>   Amount = amount,
>   MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
>   RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.CardOnFile,
>   PaymentMethod = new CheckoutPaymentMethod(cardDetails),
>   ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth,
>   ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy..",
>   ShopperReference = "YOUR_UNIQUE_SHOPPER_ID"
> };
>
> // Send the request
> var service = new PaymentsService(client);
> var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
> ```
>
> ```js NodeJS (JavaScript) theme={null}
> // Adyen Node API Library v29.1.0
> const { Client, CheckoutAPI } = require('@adyen/api-library');
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> const config = new Config({
>   apiKey: "ADYEN_API_KEY",
>   environment: EnvironmentEnum.TEST
> });
>
> const client = new Client(config);
>
> // Create the request object(s)
> const paymentRequest = {
>   amount: {
>     value: 2000,
>     currency: "USD"
>   },
>   paymentMethod: {
>     type: "scheme",
>     storedPaymentMethodId: "8415718415172204",
>     encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH..."
>   },
>   reference: "YOUR_ORDER_NUMBER",
>   merchantAccount: "YOUR_MERCHANT_ACCOUNT",
>   returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..",
>   shopperReference: "YOUR_UNIQUE_SHOPPER_ID",
>   shopperInteraction: "ContAuth",
>   recurringProcessingModel: "CardOnFile"
> }
>
> // Send the request
> const checkoutAPI = new CheckoutAPI(client);
> const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
> ```
>
> ```go Go theme={null}
> // Adyen Go API Library v21.0.0
> import (
>   "context"
>   "github.com/adyen/adyen-go-api-library/v21/src/common"
>   "github.com/adyen/adyen-go-api-library/v21/src/adyen"
>   "github.com/adyen/adyen-go-api-library/v21/src/checkout"
> )
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> client := adyen.NewClient(&common.Config{
>   ApiKey:      "ADYEN_API_KEY",
>   Environment: common.TestEnv,
> })
>
> // Create the request object(s)
> amount := checkout.Amount{
>   Currency: "USD",
>   Value: 2000,
> }
>
> cardDetails := checkout.CardDetails{
>   EncryptedSecurityCode: common.PtrString("adyenjs_0_1_18$MT6ppy0FAMVMLH..."),
>   StoredPaymentMethodId: common.PtrString("8415718415172204"),
>   Type: common.PtrString("scheme"),
> }
>
> paymentRequest := checkout.PaymentRequest{
>   Reference: "YOUR_ORDER_NUMBER",
>   Amount: amount,
>   MerchantAccount: "YOUR_MERCHANT_ACCOUNT",
>   RecurringProcessingModel: common.PtrString("CardOnFile"),
>   PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails),
>   ShopperInteraction: common.PtrString("ContAuth"),
>   ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..",
>   ShopperReference: common.PtrString("YOUR_UNIQUE_SHOPPER_ID"),
> }
>
> // Send the request
> service := client.Checkout()
> req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest)
> res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)
> ```
>
> ```py Python theme={null}
> # Adyen Python API Library v13.6.0
> import Adyen
>
> adyen = Adyen.Adyen()
> adyen.client.xapikey = "ADYEN_API_KEY"
> # For the LIVE environment, also include your liveEndpointUrlPrefix.
> adyen.client.platform = "test" # The environment to use library in.
>
> # Create the request object(s)
> json_request = {
>   "amount": {
>     "value": 2000,
>     "currency": "USD"
>   },
>   "paymentMethod": {
>     "type": "scheme",
>     "storedPaymentMethodId": "8415718415172204",
>     "encryptedSecurityCode": "adyenjs_0_1_18$MT6ppy0FAMVMLH..."
>   },
>   "reference": "YOUR_ORDER_NUMBER",
>   "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
>   "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..",
>   "shopperReference": "YOUR_UNIQUE_SHOPPER_ID",
>   "shopperInteraction": "ContAuth",
>   "recurringProcessingModel": "CardOnFile"
> }
>
> # Send the request
> result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID")
> ```
>
> ```rb Ruby theme={null}
> # Adyen Ruby API Library v10.4.0
> require "adyen-ruby-api-library"
>
> adyen = Adyen::Client.new
> adyen.api_key = 'ADYEN_API_KEY'
> # For the LIVE environment, also include your liveEndpointUrlPrefix.
> adyen.env = :test # Set to "live" for live environment
>
> # Create the request object(s)
> request_body = {
>   :amount => {
>     :value => 2000,
>     :currency => 'USD'
>   },
>   :paymentMethod => {
>     :type => 'scheme',
>     :storedPaymentMethodId => '8415718415172204',
>     :encryptedSecurityCode => 'adyenjs_0_1_18$MT6ppy0FAMVMLH...'
>   },
>   :reference => 'YOUR_ORDER_NUMBER',
>   :merchantAccount => 'YOUR_MERCHANT_ACCOUNT',
>   :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..',
>   :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID',
>   :shopperInteraction => 'ContAuth',
>   :recurringProcessingModel => 'CardOnFile'
> }
>
> # Send the request
> result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' })
> ```
>
> ```ts NodeJS (TypeScript) theme={null}
> // Adyen Node API Library v29.1.0
> import { Client, CheckoutAPI, Types } from "@adyen/api-library";
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> const config = new Config({
>   apiKey: "ADYEN_API_KEY",
>   environment: EnvironmentEnum.TEST
> });
>
> const client = new Client(config);
>
> // Create the request object(s)
> const amount: Types.checkout.Amount = {
>   currency: "USD",
>   value: 2000
> };
>
> const cardDetails: Types.checkout.CardDetails = {
>   encryptedSecurityCode: "adyenjs_0_1_18$MT6ppy0FAMVMLH...",
>   storedPaymentMethodId: "8415718415172204",
>   type: Types.checkout.CardDetails.TypeEnum.Scheme
> };
>
> const paymentRequest: Types.checkout.PaymentRequest = {
>   reference: "YOUR_ORDER_NUMBER",
>   amount: amount,
>   merchantAccount: "YOUR_MERCHANT_ACCOUNT",
>   recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.CardOnFile,
>   paymentMethod: cardDetails,
>   shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth,
>   returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..",
>   shopperReference: "YOUR_UNIQUE_SHOPPER_ID"
> };
>
> // Send the request
> const checkoutAPI = new CheckoutAPI(client);
> const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
> ```
>
> ### Make a subscription payment
>
> [Make a subscription payment](https://adyen-preview.mintlify.site/online-payments/tokenization/make-token-payments.md#make-a-subscription-or-unscheduled-card-on-file-payment) using standard tokenization parameters. You do not need to include any additional parameters for cards.
>
> **Make a subscription payment with a card token**
>
> ```bash curl theme={null}
> curl https://checkout-test.adyen.com/v72/payments \
> -H 'x-API-key: ADYEN_API_KEY' \
> -H 'Content-Type: application/json' \
> -d '{
>      "amount":{
>        "value":2000,
>        "currency":"USD"
>      },
>      "paymentMethod":{
>        "type":"scheme",
>        "storedPaymentMethodId":"8415718415172204"
>      },
>      "reference":"YOUR_ORDER_NUMBER",
>      "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
>      "returnUrl":"...",
>      "shopperReference":"YOUR_UNIQUE_SHOPPER_ID",
>      "shopperInteraction":"ContAuth",
>      "recurringProcessingModel":"Subscription"
>  }'
> ```
>
> ```java Java theme={null}
> // Adyen Java API Library v39.4.0
> import com.adyen.Client;
> import com.adyen.enums.Environment;
> import com.adyen.model.checkout.*;
> import java.time.OffsetDateTime;
> import java.util.*;
> import com.adyen.model.RequestOptions;
> import com.adyen.service.checkout.*;
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> Client client = new Client("ADYEN_API_KEY", Environment.TEST);
>
> // Create the request object(s)
> Amount amount = new Amount()
>   .currency("USD")
>   .value(2000L);
>
> CardDetails cardDetails = new CardDetails()
>   .storedPaymentMethodId("8415718415172204")
>   .type(CardDetails.TypeEnum.SCHEME);
>
> PaymentRequest paymentRequest = new PaymentRequest()
>   .reference("YOUR_ORDER_NUMBER")
>   .amount(amount)
>   .merchantAccount("YOUR_MERCHANT_ACCOUNT")
>   .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.SUBSCRIPTION)
>   .paymentMethod(new CheckoutPaymentMethod(cardDetails))
>   .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH)
>   .returnUrl("...")
>   .shopperReference("YOUR_UNIQUE_SHOPPER_ID");
>
> // Send the request
> PaymentsApi service = new PaymentsApi(client);
> PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID"));
> ```
>
> ```php PHP theme={null}
> <?php
> // Adyen PHP API Library v28.2.0
> use Adyen\Client;
> use Adyen\Environment;
> use Adyen\Model\Checkout\Amount;
> use Adyen\Model\Checkout\CheckoutPaymentMethod;
> use Adyen\Model\Checkout\PaymentRequest;
> use Adyen\Service\Checkout\PaymentsApi;
>
> $client = new Client();
> $client->setXApiKey("ADYEN_API_KEY");
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> $client->setEnvironment(Environment::TEST);
>
>
> // Create the request object(s)
> $amount = new Amount();
> $amount
>   ->setCurrency("USD")
>   ->setValue(2000);
>
> $checkoutPaymentMethod = new CheckoutPaymentMethod();
> $checkoutPaymentMethod
>   ->setStoredPaymentMethodId("8415718415172204")
>   ->setType("scheme");
>
> $paymentRequest = new PaymentRequest();
> $paymentRequest
>   ->setReference("YOUR_ORDER_NUMBER")
>   ->setAmount($amount)
>   ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT")
>   ->setRecurringProcessingModel("Subscription")
>   ->setPaymentMethod($checkoutPaymentMethod)
>   ->setShopperInteraction("ContAuth")
>   ->setReturnUrl("...")
>   ->setShopperReference("YOUR_UNIQUE_SHOPPER_ID");
>
> $requestOptions['idempotencyKey'] = 'UUID';
>
> // Send the request
> $service = new PaymentsApi($client);
> $response = $service->payments($paymentRequest, $requestOptions);
> ```
>
> ```cs C# theme={null}
> // Adyen .net API Library v32.1.2
> using Adyen;
> using Environment = Adyen.Model.Environment;
> using Adyen.Model;
> using Adyen.Model.Checkout;
> using Adyen.Service.Checkout;
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> var config = new Config()
> {
>     XApiKey = "ADYEN_API_KEY",
>     Environment = Environment.Test
> };
> var client = new Client(config);
>
> // Create the request object(s)
> Amount amount = new Amount
> {
>   Currency = "USD",
>   Value = 2000
> };
>
> CardDetails cardDetails = new CardDetails
> {
>   StoredPaymentMethodId = "8415718415172204",
>   Type = CardDetails.TypeEnum.Scheme
> };
>
> PaymentRequest paymentRequest = new PaymentRequest
> {
>   Reference = "YOUR_ORDER_NUMBER",
>   Amount = amount,
>   MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
>   RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.Subscription,
>   PaymentMethod = new CheckoutPaymentMethod(cardDetails),
>   ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth,
>   ReturnUrl = "...",
>   ShopperReference = "YOUR_UNIQUE_SHOPPER_ID"
> };
>
> // Send the request
> var service = new PaymentsService(client);
> var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
> ```
>
> ```js NodeJS (JavaScript) theme={null}
> // Adyen Node API Library v29.1.0
> const { Client, CheckoutAPI } = require('@adyen/api-library');
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> const config = new Config({
>   apiKey: "ADYEN_API_KEY",
>   environment: EnvironmentEnum.TEST
> });
>
> const client = new Client(config);
>
> // Create the request object(s)
> const paymentRequest = {
>   amount: {
>     value: 2000,
>     currency: "USD"
>   },
>   paymentMethod: {
>     type: "scheme",
>     storedPaymentMethodId: "8415718415172204"
>   },
>   reference: "YOUR_ORDER_NUMBER",
>   merchantAccount: "YOUR_MERCHANT_ACCOUNT",
>   returnUrl: "...",
>   shopperReference: "YOUR_UNIQUE_SHOPPER_ID",
>   shopperInteraction: "ContAuth",
>   recurringProcessingModel: "Subscription"
> }
>
> // Send the request
> const checkoutAPI = new CheckoutAPI(client);
> const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
> ```
>
> ```go Go theme={null}
> // Adyen Go API Library v21.0.0
> import (
>   "context"
>   "github.com/adyen/adyen-go-api-library/v21/src/common"
>   "github.com/adyen/adyen-go-api-library/v21/src/adyen"
>   "github.com/adyen/adyen-go-api-library/v21/src/checkout"
> )
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> client := adyen.NewClient(&common.Config{
>   ApiKey:      "ADYEN_API_KEY",
>   Environment: common.TestEnv,
> })
>
> // Create the request object(s)
> amount := checkout.Amount{
>   Currency: "USD",
>   Value: 2000,
> }
>
> cardDetails := checkout.CardDetails{
>   StoredPaymentMethodId: common.PtrString("8415718415172204"),
>   Type: common.PtrString("scheme"),
> }
>
> paymentRequest := checkout.PaymentRequest{
>   Reference: "YOUR_ORDER_NUMBER",
>   Amount: amount,
>   MerchantAccount: "YOUR_MERCHANT_ACCOUNT",
>   RecurringProcessingModel: common.PtrString("Subscription"),
>   PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails),
>   ShopperInteraction: common.PtrString("ContAuth"),
>   ReturnUrl: "...",
>   ShopperReference: common.PtrString("YOUR_UNIQUE_SHOPPER_ID"),
> }
>
> // Send the request
> service := client.Checkout()
> req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest)
> res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)
> ```
>
> ```py Python theme={null}
> # Adyen Python API Library v13.6.0
> import Adyen
>
> adyen = Adyen.Adyen()
> adyen.client.xapikey = "ADYEN_API_KEY"
> # For the LIVE environment, also include your liveEndpointUrlPrefix.
> adyen.client.platform = "test" # The environment to use library in.
>
> # Create the request object(s)
> json_request = {
>   "amount": {
>     "value": 2000,
>     "currency": "USD"
>   },
>   "paymentMethod": {
>     "type": "scheme",
>     "storedPaymentMethodId": "8415718415172204"
>   },
>   "reference": "YOUR_ORDER_NUMBER",
>   "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
>   "returnUrl": "...",
>   "shopperReference": "YOUR_UNIQUE_SHOPPER_ID",
>   "shopperInteraction": "ContAuth",
>   "recurringProcessingModel": "Subscription"
> }
>
> # Send the request
> result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID")
> ```
>
> ```rb Ruby theme={null}
> # Adyen Ruby API Library v10.4.0
> require "adyen-ruby-api-library"
>
> adyen = Adyen::Client.new
> adyen.api_key = 'ADYEN_API_KEY'
> # For the LIVE environment, also include your liveEndpointUrlPrefix.
> adyen.env = :test # Set to "live" for live environment
>
> # Create the request object(s)
> request_body = {
>   :amount => {
>     :value => 2000,
>     :currency => 'USD'
>   },
>   :paymentMethod => {
>     :type => 'scheme',
>     :storedPaymentMethodId => '8415718415172204'
>   },
>   :reference => 'YOUR_ORDER_NUMBER',
>   :merchantAccount => 'YOUR_MERCHANT_ACCOUNT',
>   :returnUrl => '...',
>   :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID',
>   :shopperInteraction => 'ContAuth',
>   :recurringProcessingModel => 'Subscription'
> }
>
> # Send the request
> result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' })
> ```
>
> ```ts NodeJS (TypeScript) theme={null}
> // Adyen Node API Library v29.1.0
> import { Client, CheckoutAPI, Types } from "@adyen/api-library";
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> const config = new Config({
>   apiKey: "ADYEN_API_KEY",
>   environment: EnvironmentEnum.TEST
> });
>
> const client = new Client(config);
>
> // Create the request object(s)
> const amount: Types.checkout.Amount = {
>   currency: "USD",
>   value: 2000
> };
>
> const cardDetails: Types.checkout.CardDetails = {
>   storedPaymentMethodId: "8415718415172204",
>   type: Types.checkout.CardDetails.TypeEnum.Scheme
> };
>
> const paymentRequest: Types.checkout.PaymentRequest = {
>   reference: "YOUR_ORDER_NUMBER",
>   amount: amount,
>   merchantAccount: "YOUR_MERCHANT_ACCOUNT",
>   recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.Subscription,
>   paymentMethod: cardDetails,
>   shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth,
>   returnUrl: "...",
>   shopperReference: "YOUR_UNIQUE_SHOPPER_ID"
> };
>
> // Send the request
> const checkoutAPI = new CheckoutAPI(client);
> const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
> ```
>
> ### Make an unscheduled card-on-file payment
>
> [Make an unscheduled card-on-file payment](https://adyen-preview.mintlify.site/online-payments/tokenization/make-token-payments.md#make-a-subscription-or-unscheduled-card-on-file-payment) using standard tokenization parameters. You do not need to include any additional parameters for cards.
>
> **Make an unscheduled card-on-file payment with a card token**
>
> ```bash curl theme={null}
> curl https://checkout-test.adyen.com/v72/payments \
> -H 'x-API-key: ADYEN_API_KEY' \
> -H 'Content-Type: application/json' \
> -d '{
>      "amount":{
>        "value":2000,
>        "currency":"USD"
>      },
>      "paymentMethod":{
>        "type":"scheme",
>        "storedPaymentMethodId":"8415718415172204"
>      },
>      "reference":"YOUR_ORDER_NUMBER",
>      "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
>      "returnUrl":"...",
>      "shopperReference":"YOUR_UNIQUE_SHOPPER_ID",
>      "shopperInteraction":"ContAuth",
>      "recurringProcessingModel":"UnscheduledCardOnFile"
>  }'
> ```
>
> ```java Java theme={null}
> // Adyen Java API Library v39.4.0
> import com.adyen.Client;
> import com.adyen.enums.Environment;
> import com.adyen.model.checkout.*;
> import java.time.OffsetDateTime;
> import java.util.*;
> import com.adyen.model.RequestOptions;
> import com.adyen.service.checkout.*;
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> Client client = new Client("ADYEN_API_KEY", Environment.TEST);
>
> // Create the request object(s)
> Amount amount = new Amount()
>   .currency("USD")
>   .value(2000L);
>
> CardDetails cardDetails = new CardDetails()
>   .storedPaymentMethodId("8415718415172204")
>   .type(CardDetails.TypeEnum.SCHEME);
>
> PaymentRequest paymentRequest = new PaymentRequest()
>   .reference("YOUR_ORDER_NUMBER")
>   .amount(amount)
>   .merchantAccount("YOUR_MERCHANT_ACCOUNT")
>   .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.UNSCHEDULEDCARDONFILE)
>   .paymentMethod(new CheckoutPaymentMethod(cardDetails))
>   .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH)
>   .returnUrl("...")
>   .shopperReference("YOUR_UNIQUE_SHOPPER_ID");
>
> // Send the request
> PaymentsApi service = new PaymentsApi(client);
> PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID"));
> ```
>
> ```php PHP theme={null}
> <?php
> // Adyen PHP API Library v28.2.0
> use Adyen\Client;
> use Adyen\Environment;
> use Adyen\Model\Checkout\Amount;
> use Adyen\Model\Checkout\CheckoutPaymentMethod;
> use Adyen\Model\Checkout\PaymentRequest;
> use Adyen\Service\Checkout\PaymentsApi;
>
> $client = new Client();
> $client->setXApiKey("ADYEN_API_KEY");
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> $client->setEnvironment(Environment::TEST);
>
>
> // Create the request object(s)
> $amount = new Amount();
> $amount
>   ->setCurrency("USD")
>   ->setValue(2000);
>
> $checkoutPaymentMethod = new CheckoutPaymentMethod();
> $checkoutPaymentMethod
>   ->setStoredPaymentMethodId("8415718415172204")
>   ->setType("scheme");
>
> $paymentRequest = new PaymentRequest();
> $paymentRequest
>   ->setReference("YOUR_ORDER_NUMBER")
>   ->setAmount($amount)
>   ->setMerchantAccount("YOUR_MERCHANT_ACCOUNT")
>   ->setRecurringProcessingModel("UnscheduledCardOnFile")
>   ->setPaymentMethod($checkoutPaymentMethod)
>   ->setShopperInteraction("ContAuth")
>   ->setReturnUrl("...")
>   ->setShopperReference("YOUR_UNIQUE_SHOPPER_ID");
>
> $requestOptions['idempotencyKey'] = 'UUID';
>
> // Send the request
> $service = new PaymentsApi($client);
> $response = $service->payments($paymentRequest, $requestOptions);
> ```
>
> ```cs C# theme={null}
> // Adyen .net API Library v32.1.2
> using Adyen;
> using Environment = Adyen.Model.Environment;
> using Adyen.Model;
> using Adyen.Model.Checkout;
> using Adyen.Service.Checkout;
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> var config = new Config()
> {
>     XApiKey = "ADYEN_API_KEY",
>     Environment = Environment.Test
> };
> var client = new Client(config);
>
> // Create the request object(s)
> Amount amount = new Amount
> {
>   Currency = "USD",
>   Value = 2000
> };
>
> CardDetails cardDetails = new CardDetails
> {
>   StoredPaymentMethodId = "8415718415172204",
>   Type = CardDetails.TypeEnum.Scheme
> };
>
> PaymentRequest paymentRequest = new PaymentRequest
> {
>   Reference = "YOUR_ORDER_NUMBER",
>   Amount = amount,
>   MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
>   RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.UnscheduledCardOnFile,
>   PaymentMethod = new CheckoutPaymentMethod(cardDetails),
>   ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth,
>   ReturnUrl = "...",
>   ShopperReference = "YOUR_UNIQUE_SHOPPER_ID"
> };
>
> // Send the request
> var service = new PaymentsService(client);
> var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
> ```
>
> ```js NodeJS (JavaScript) theme={null}
> // Adyen Node API Library v29.1.0
> const { Client, CheckoutAPI } = require('@adyen/api-library');
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> const config = new Config({
>   apiKey: "ADYEN_API_KEY",
>   environment: EnvironmentEnum.TEST
> });
>
> const client = new Client(config);
>
> // Create the request object(s)
> const paymentRequest = {
>   amount: {
>     value: 2000,
>     currency: "USD"
>   },
>   paymentMethod: {
>     type: "scheme",
>     storedPaymentMethodId: "8415718415172204"
>   },
>   reference: "YOUR_ORDER_NUMBER",
>   merchantAccount: "YOUR_MERCHANT_ACCOUNT",
>   returnUrl: "...",
>   shopperReference: "YOUR_UNIQUE_SHOPPER_ID",
>   shopperInteraction: "ContAuth",
>   recurringProcessingModel: "UnscheduledCardOnFile"
> }
>
> // Send the request
> const checkoutAPI = new CheckoutAPI(client);
> const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
> ```
>
> ```go Go theme={null}
> // Adyen Go API Library v21.0.0
> import (
>   "context"
>   "github.com/adyen/adyen-go-api-library/v21/src/common"
>   "github.com/adyen/adyen-go-api-library/v21/src/adyen"
>   "github.com/adyen/adyen-go-api-library/v21/src/checkout"
> )
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> client := adyen.NewClient(&common.Config{
>   ApiKey:      "ADYEN_API_KEY",
>   Environment: common.TestEnv,
> })
>
> // Create the request object(s)
> amount := checkout.Amount{
>   Currency: "USD",
>   Value: 2000,
> }
>
> cardDetails := checkout.CardDetails{
>   StoredPaymentMethodId: common.PtrString("8415718415172204"),
>   Type: common.PtrString("scheme"),
> }
>
> paymentRequest := checkout.PaymentRequest{
>   Reference: "YOUR_ORDER_NUMBER",
>   Amount: amount,
>   MerchantAccount: "YOUR_MERCHANT_ACCOUNT",
>   RecurringProcessingModel: common.PtrString("UnscheduledCardOnFile"),
>   PaymentMethod: checkout.CardDetailsAsCheckoutPaymentMethod(&cardDetails),
>   ShopperInteraction: common.PtrString("ContAuth"),
>   ReturnUrl: "...",
>   ShopperReference: common.PtrString("YOUR_UNIQUE_SHOPPER_ID"),
> }
>
> // Send the request
> service := client.Checkout()
> req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest)
> res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)
> ```
>
> ```py Python theme={null}
> # Adyen Python API Library v13.6.0
> import Adyen
>
> adyen = Adyen.Adyen()
> adyen.client.xapikey = "ADYEN_API_KEY"
> # For the LIVE environment, also include your liveEndpointUrlPrefix.
> adyen.client.platform = "test" # The environment to use library in.
>
> # Create the request object(s)
> json_request = {
>   "amount": {
>     "value": 2000,
>     "currency": "USD"
>   },
>   "paymentMethod": {
>     "type": "scheme",
>     "storedPaymentMethodId": "8415718415172204"
>   },
>   "reference": "YOUR_ORDER_NUMBER",
>   "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
>   "returnUrl": "...",
>   "shopperReference": "YOUR_UNIQUE_SHOPPER_ID",
>   "shopperInteraction": "ContAuth",
>   "recurringProcessingModel": "UnscheduledCardOnFile"
> }
>
> # Send the request
> result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID")
> ```
>
> ```rb Ruby theme={null}
> # Adyen Ruby API Library v10.4.0
> require "adyen-ruby-api-library"
>
> adyen = Adyen::Client.new
> adyen.api_key = 'ADYEN_API_KEY'
> # For the LIVE environment, also include your liveEndpointUrlPrefix.
> adyen.env = :test # Set to "live" for live environment
>
> # Create the request object(s)
> request_body = {
>   :amount => {
>     :value => 2000,
>     :currency => 'USD'
>   },
>   :paymentMethod => {
>     :type => 'scheme',
>     :storedPaymentMethodId => '8415718415172204'
>   },
>   :reference => 'YOUR_ORDER_NUMBER',
>   :merchantAccount => 'YOUR_MERCHANT_ACCOUNT',
>   :returnUrl => '...',
>   :shopperReference => 'YOUR_UNIQUE_SHOPPER_ID',
>   :shopperInteraction => 'ContAuth',
>   :recurringProcessingModel => 'UnscheduledCardOnFile'
> }
>
> # Send the request
> result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' })
> ```
>
> ```ts NodeJS (TypeScript) theme={null}
> // Adyen Node API Library v29.1.0
> import { Client, CheckoutAPI, Types } from "@adyen/api-library";
>
> // For the LIVE environment, also include your liveEndpointUrlPrefix.
> const config = new Config({
>   apiKey: "ADYEN_API_KEY",
>   environment: EnvironmentEnum.TEST
> });
>
> const client = new Client(config);
>
> // Create the request object(s)
> const amount: Types.checkout.Amount = {
>   currency: "USD",
>   value: 2000
> };
>
> const cardDetails: Types.checkout.CardDetails = {
>   storedPaymentMethodId: "8415718415172204",
>   type: Types.checkout.CardDetails.TypeEnum.Scheme
> };
>
> const paymentRequest: Types.checkout.PaymentRequest = {
>   reference: "YOUR_ORDER_NUMBER",
>   amount: amount,
>   merchantAccount: "YOUR_MERCHANT_ACCOUNT",
>   recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.UnscheduledCardOnFile,
>   paymentMethod: cardDetails,
>   shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth,
>   returnUrl: "...",
>   shopperReference: "YOUR_UNIQUE_SHOPPER_ID"
> };
>
> // Send the request
> const checkoutAPI = new CheckoutAPI(client);
> const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
> ```
>
> ## Collecting additional data to detect fraud
>
> For Web Drop-in/Components integrations, you can optionally [collect data to detect fraud](https://adyen-preview.mintlify.site/risk-management/fraud-data-collection.md) outside of the checkout page, in addition to the data that you send when the shopper checks out. We recommend that you collect data about the shopper's activity on every page of your site.
>
> To do this, add the following script to any of your web pages.
>
> **Data collection script**
>
> ```javascript theme={null}
> <script src="https://checkoutshopper-live.adyen.com/checkoutshopper/assets/js/datacollection/datacollection.js"></script>
> ```
>
> When the shopper checks out, the Custom Card Component sends all of the data collected by the script to Adyen. This includes the data from the checkout page as well as any data collected from other web pages that contain the script.
>
> ## Test and go live
>
> If your client-side integration isn't ready, you can [test API requests with encrypted card details](https://adyen-preview.mintlify.site/development-resources/test-cards-and-credentials/test-card-numbers.md#test-encrypted-card-details) by adding a `test_` prefix to the test card details.
>
> [v5.20.0 or later](https://adyen-preview.mintlify.site/online-payments/release-notes.md): Card input fields use [JSON Web Encryption](https://datatracker.ietf.org/doc/html/rfc7516), so your test environment must be a [secure context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#when_is_a_context_considered_secure). Use either a local or `https` domain, and add it to your [allowed origins](https://adyen-preview.mintlify.site/development-resources/client-side-authentication#allowed-origins).
>
> Before making live card payments:
>
> 1. Test your integration using our [test card numbers](https://adyen-preview.mintlify.site/development-resources/test-cards-and-credentials/test-card-numbers.md). You can check the status of test payments in your [Customer Area](https://ca-test.adyen.com/) > **Transactions** > **Payments**.
>
> 2. [Add the cards that you want to accept](https://adyen-preview.mintlify.site/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/).
>
> 3. Before you can start accepting card payments in the live environment, you need to assess your PCI DSS compliance and submit the required *Self-Assessment Questionnaire A* document. For more information, refer to [PCI DSS compliance guide](https://adyen-preview.mintlify.site/development-resources/pci-dss-compliance-guide#online-payments).
>
> ## See also
>
> * [API-only integration guide](https://docs.adyen.com/online-payments/api-only)
> * [Tokenization](https://adyen-preview.mintlify.site/online-payments/tokenization)
> * [Webhooks](https://adyen-preview.mintlify.site/development-resources/webhooks.md)
> * [API Explorer](https://docs.adyen.com/api-explorer/Checkout/latest/overview)


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