---
title: "Android Component"
url: "https://docs.adyen.com/payment-methods/cash-app-pay/android-component"
source_url: "https://docs.adyen.com/payment-methods/cash-app-pay/android-component.md"
canonical: "https://docs.adyen.com/payment-methods/cash-app-pay/android-component"
last_modified: "2026-06-01T15:33:15+02:00"
language: "en"
---

# Android Component

[View source](/payment-methods/cash-app-pay/android-component.md)

This page explains how to add Cash App Pay to your existing [Android Components integration](/online-payments/build-your-integration/advanced-flow?platform=Android\&integration=Components\&version=latest).

**If you are using Android Components v5.0.0 or later:**

This payment method requires no additional configuration.

Follow the [Components integration guide](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components) and use the following module and Component names:

* To [import the module](/online-payments/build-your-integration/sessions-flow/?platform=Android\&integration=Components#import): **cashapppay**
* To [launch and show the Component](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#launch-and-show): **CashAppPayComponent**

If you have an existing [Android Components](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components) integration, you can use our Redirect Component to redirect the shopper to complete the payment. As with other redirect payment methods, you need to [handle the redirect](#handle-the-redirect) after the shopper returns to your app.

## Requirements

| Requirement          | Description                                                                                                                                                                                                                                                                                |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Integration type** | Make sure that you have built an Advanced flow [Android Components integration](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components). The minimum required version is 4.12.0.                                                                  |
| **Webhooks**         | Enable the [Recurring tokens life cycle events](/online-payments/tokenization/create-tokens#enable-the-webhook) webhook.                                                                                                                                                                   |
| **Setup steps**      | Before you begin:- [Add Cash App Pay in your Customer Area](/payment-methods/add-payment-methods).
- In your [Customer Area](https://ca-test.adyen.com/) go to **Developer** > **Additional data** and under **Payment** select **Recurring details**. Then select **Save configuration**. |

## Set up the Cash App Pay Component

1. Import the Cash App Pay Component to your `build.gradle` file.

   ```groovy
   implementation "com.adyen.checkout:cashapppay:<latest-version>"
   ```

   For the latest version, refer to our [GitHub](https://github.com/Adyen/adyen-android).

2. Build a client-side configuration of the Cash App Pay Component.

   ```kotlin
   val cashAppPayConfiguration =
   CashAppPayConfiguration.Builder(shopperLocale, environment, clientKey)
       // mandatory configuration
       .setReturnUrl(CashAppPayComponent.getReturnUrl(context))
       .build
   ```

3. Add the Component view to your layout. You will attach the initialized component to this view when [collecting payment details](#collect-payment-details).

   ```xml
   <com.adyen.checkout.cashapppay.CashAppPayView
       android:id="@+id/cashAppPayView"
       android:layout_width="match_parent"
       android:layout_height="wrap_content" />
   ```

4. Add an `IntentFilter` to the `Activity` that will handle the `returnUrl` specified in your configuration and your [`/payments` request](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#make-a-payment).

   ```xml
   <activity
     android:name=".YourActivity">
       <intent-filter>
          <action android:name="android.intent.action.VIEW"/>
          <category android:name="android.intent.category.DEFAULT"/>
          <category android:name="android.intent.category.BROWSABLE"/>
          <data android:host="${applicationId}" android:scheme="adyencheckout"/>
       </intent-filter>
   </activity>
   ```

   The `${applicationId}` will be replaced with `your.package.name` at build time.

### Optional configuration

You can add the following optional configuration:

| Parameter name             | Description                                                                                                                                                                                                                                                                                    | Default   |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `setShowStorePaymentField` | Set to **false** if you do not want to show a toggle that lets the shopper choose whether to save their payment details.                                                                                                                                                                       | **true**  |
| `setStorePaymentMethod`    | Set to **true** to save the shopper's payment details without showing a toggle. For example, use this for a page where the shopper enters their details for a subscription service that charges the shopper on a recurring basis. Set `setShowStorePaymentField` to **false** if you use this. | **false** |

## Collect payment details

In this step, we use the client-side Component to send the shopper to the Cash App Pay app to authorize the payment.

1. Deserialize [the `/paymentMethods` response](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#get-available-payment-methods) with the `SERIALIZER` object.

   ```kotlin
   val paymentMethodsApiResponse = PaymentMethodsApiResponse.SERIALIZER.deserialize(paymentMethodsResponse)
   ```

2. From the result, get the object containing `paymentMethods.type`: **cashapp**.

3. Initialize an instance of the Component. To do this, you need to call `PROVIDER.get` from the Cash App Pay Component and pass the following:

   * The context (for example, `FRAGMENT_OR_ACTIVITY`)
   * The `PaymentMethod` object (for example, `paymentMethod`)
   * The `cashappConfiguration` object

   ```kotlin
   val cashAppPayComponent = CashAppPayComponent.PROVIDER.get(FRAGMENT_OR_ACTIVITY, paymentMethod, cashAppPayConfiguration)
   ```

4. Attach the Component to the view to start getting your shopper's payment details. You need to call `attach` from the payment method's Component view and pass in:

   * the `cashappComponent`
   * the context (for example, `FRAGMENT_OR_ACTIVITY`)

   ```kotlin
   cashAppPayView.attach(cashAppPayComponent, FRAGMENT_OR_ACTIVITY)
   ```

5. Add the [Cash App Pay button](https://developers.cash.app/cash-app-pay-partner-api/guides/pay-kit-sdk/pay-kit-android#cashapppaybutton). When the shopper clicks the button, call `cashAppPayComponent.submit()`. The Cash App Pay app will launch for the shopper to approve the payment.

6. You start receiving updates when the shopper completes an action in their Cash App Pay app. Check if `isValid` is **true**, and if the shopper proceeds to pay, pass the `paymentComponentState.data.paymentMethod` to your server.

   ```kotlin
   cashappComponent.observe(this@FRAGMENT_OR_ACTIVITY) { state ->
       if (state?.isValid == true) {
           //serialize data
           val paymentComponentData = PaymentComponentData.SERIALIZER.serialize(state.data)
           // When the shopper proceeds to pay, pass the serialized `state.data` to your server to send a /payments request
       }
   }
   ```

## Make a payment

When the shopper proceeds to pay:

1. From your server, make a POST [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying:

   * `paymentMethod.type`: Set this to **cashapp**.
   * `returnUrl`: URL to where the shopper should be redirected back to after they complete the payment. Get this URL from the Component in the `CashAppPayComponent.getReturnUrl(context)`.

   **/payments request**

   ```json
   curl https://checkout-test.adyen.com/v72/payments
   -H 'x-api-key: ADYEN_API_KEY'
   -H 'content-type: application/json'
   -d '{
       "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
       "amount":{
           "currency": "USD",
           "value": 1000
       },
       "shopperReference": "YOUR_UNIQUE_SHOPPER_ID",
       "reference": "YOUR_ORDER_NUMBER",
       "paymentMethod": {
           "type": "cashapp"
       },
       "returnUrl": "adyencheckout://your.package.name"
   }'
   ```

2. In the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response, note the following:

   * [pspReference](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/payments__resParam_pspReference): Our unique identifier for the transaction.
   * `resultCode`: Use this to show the payment result to your shopper.
   * `merchantReference`: The `reference` from the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request.

## Show the payment result

Use the  [resultCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details#responses-200-resultCode) from the [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) response to show the payment result to your shopper. You will also receive the outcome of the payment asynchronously in a [webhook](/development-resources/webhooks).

For Cash App Pay payments, you can receive the following `resultCode` values:

| resultCode     | Description                                                                                                                                               | Action to take                                                                                                                                                                                   |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Received**   | The shopper has completed the payment but the final result is not yet known.                                                                              | Inform the shopper that you have received their order, and are waiting for the payment to be completed. You will receive an **AUTHORISATION** webhook when the status of the payment is updated. |
| **Authorised** | The payment was successful.                                                                                                                               | Inform the shopper that the payment has been successful. If you are using manual capture, you also need to [capture](/online-payments/capture#manual-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` ](/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` ](/development-resources/refusal-reasons)field.                                 | Ask the shopper to try the payment again using a different payment method.                                                                                                                       |

## Recurring and card-on-file payments

Cash App Pay supports [tokenization](/online-payments/tokenization) of the shopper's payment details for future recurring and card-on-file payments. Card-on-file payments are ad-hoc payments where you use the shopper's token. By getting the shopper's permission to save their payment details when you create the token, you can bypass the shopper approval step for those future payments.

We strongly recommend that you ask explicit permission from the shopper if you intend to make future recurring or card-on-file payments. In the case of recurring payments, being transparent about the payment schedule and the amount of recurring payments reduces the risk of chargebacks.

### Create a token

To store a shopper's Cash App Pay details, set `setShowStorePaymentField` to **true** when [adding the Cash App Pay Component](#optional-configuration). This shows a toggle that lets the shopper choose whether to save their payment details. You can also store the details automatically by setting `setstorePaymentMethod` to **true** and `setShowStorePaymentField` to **false** in the Component configuration.

If the shopper chooses to save their details when making a payment, the `observe` method from the Component includes a `state.data.storePaymentMethod`. Pass this to your server.

To create a token, include in your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request:

* `storePaymentMethod`: The `paymentComponentState.data.storePaymentMethod` from your client app.
* [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperReference): Your unique identifier for the shopper.

### Get the shopper's $cashtag

We recommend making sure that your recurring payments include the shopper's **$cashtag**. The $cashtag makes it easier for the shopper to recognize the recurring payment as a legitimate one. This helps to avoid chargebacks.

1. Make sure that you have enabled receiving the shopper's $cashtag:\
   In your Customer Area, go to **Developers** > **Additional Data** and select **Token information for digital wallets**.

2. Make a POST [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) request. For instructions, see [Send additional payment details](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components\&version=latest#send-additional-payment-details).

3. From the `/payments/details` response, save the following `additionalData` details:

   | Parameter                                           | Description                                                 |
   | --------------------------------------------------- | ----------------------------------------------------------- |
   | `additionalData.cashapp.cashtag`                    | The shopper's $cashtag.                                     |
   | `additionalData.tokenization.shopperReference`      | The shopper reference you specified in the payment request. |
   | `additionalData.tokenization.storedPaymentMethodId` | The token that was generated through the payment request.   |

   Note that the [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) also includes the shopper reference and the recurring detail reference, but not the $cashtag.

   **/payments/details response with $cashtag and recurring details**

   ```json
   {
      "additionalData": {
         "cashapp.cashtag": "$CASHTAG_C_TOKEN",
         "tokenization.shopperReference": "YOUR_SHOPPER_REFERENCE",
         "tokenization.storedPaymentMethodId": "M5N7TQ4TG5PFWR50"
      },
      "amount":{
         "currency":"USD",
         "value":1000
      },
      "merchantRreference":"YOUR_ORDER_NUMBER",
      "paymentMethod":{
         "type":"cashapp",
         "subtype":"redirect"
      },
      "pspReference":"V4HZ4RBFJGXXGN82",
      "resultCode":"Authorised"
   }
   ```

### Make a payment with a token

When the shopper selects to pay, the Component calls the `onSubmit` event, which contains a `state.data`.

1. Pass the `state.data` to your server.

2. From your server, make a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying:

   * The parameters required for one-off or recurring tokenized payments. For instructions, see [Tokenization](/online-payments/tokenization).
   * `paymentMethod`: The `state.data.paymentMethod` from the `onSubmit` event.

   To make it easier for the shopper to recognize the recurring payment as a legitimate one, optionally include:

   * `paymentMethod.cashtag`: the shoppers [$cashtag](#cashtag).

   **Payment request with a token**

   #### curl

   ```bash
   curl https://checkout-test.adyen.com/v68/payments \
   -H 'x-api-key: ADYEN_API_KEY' \
   -H 'content-type: application/json' \
   -d '{
       "amount": {
         "value": 1000,
         "currency": "USD"
       },
       "paymentMethod": {
         "cashtag":"$CASHTAG_C_TOKEN",
         "storedPaymentMethodId": "M5N7TQ4TG5PFWR50",
         "type":"cashapp"
       },
       "reference": "YOUR_ORDER_NUMBER",
       "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
       "returnUrl": "...",
       "shopperReference": "YOUR_SHOPPER_REFERENCE",
       "shopperInteraction": "ContAuth",
       "recurringProcessingModel": "CardOnFile"
    }'
   ```

   #### Java

   ```java
   // Adyen Java API Library v27.0.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);

   CashAppDetails cashAppDetails = new CashAppDetails()
     .cashtag("$CASHTAG_C_TOKEN"),
     .storedPaymentMethodId("M5N7TQ4TG5PFWR50")
     .type(CashAppDetails.TypeEnum.CASHAPP);

   PaymentRequest paymentRequest = new PaymentRequest()
     .reference("YOUR_ORDER_NUMBER")
     .amount(amount)
     .merchantAccount("ADYEN_MERCHANT_ACCOUNT")
     .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.CARDONFILE)
     .paymentMethod(new CheckoutPaymentMethod(cashAppDetails))
     .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH)
     .returnUrl("...")
     .shopperReference("YOUR_SHOPPER_REFERENCE");

   // Send the request
   PaymentsApi service = new PaymentsApi(client);
   PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID"));
   ```

   #### PHP

   ```php
   // Adyen PHP API Library v19.0.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, 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
     ->setCashtag("$CASHTAG_C_TOKEN")
     ->setStoredPaymentMethodId("M5N7TQ4TG5PFWR50")
     ->setType("cashapp");

   $paymentRequest = new PaymentRequest();
   $paymentRequest
     ->setReference("YOUR_ORDER_NUMBER")
     ->setAmount($amount)
     ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT")
     ->setRecurringProcessingModel("CardOnFile")
     ->setPaymentMethod($checkoutPaymentMethod)
     ->setShopperInteraction("ContAuth")
     ->setReturnUrl("...")
     ->setShopperReference("YOUR_SHOPPER_REFERENCE");

   $requestOptions['idempotencyKey'] = 'UUID';

   // Send the request
   $service = new PaymentsApi($client);
   $response = $service->payments($paymentRequest, $requestOptions);
   ```

   #### C\#

   ```cs
   // Adyen .net API Library v17.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
   };

   CashAppDetails cashAppDetails = new CashAppDetails
   {
     Cashtag = "$CASHTAG_C_TOKEN",
     StoredPaymentMethodId = "M5N7TQ4TG5PFWR50",
     Type = CashAppDetails.TypeEnum.Cashapp
   };

   PaymentRequest paymentRequest = new PaymentRequest
   {
     Reference = "YOUR_ORDER_NUMBER",
     Amount = amount,
     MerchantAccount = "ADYEN_MERCHANT_ACCOUNT",
     RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.CardOnFile,
     PaymentMethod = new CheckoutPaymentMethod(cashAppDetails),
     ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth,
     ReturnUrl = "...",
     ShopperReference = "YOUR_SHOPPER_REFERENCE"
   };

   // Send the request
   var service = new PaymentsService(client);
   var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
   ```

   #### NodeJS (JavaScript)

   ```js
   // Adyen Node API Library v18.0.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: {
       value: 1000,
       currency: "USD"
     },
     paymentMethod: {
       cashtag: "$CASHTAG_C_TOKEN",
       storedPaymentMethodId: "M5N7TQ4TG5PFWR50",
       type: "cashapp"
     },
     reference: "YOUR_ORDER_NUMBER",
     merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
     returnUrl: "...",
     shopperReference: "YOUR_SHOPPER_REFERENCE",
     shopperInteraction: "ContAuth",
     recurringProcessingModel: "CardOnFile"
   }

   // Send the request
   const checkoutAPI = new CheckoutAPI(client);
   const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
   ```

   #### Go

   ```go
   // Adyen Go API Library v10.4.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,
   }

   cashAppDetails := checkout.CashAppDetails{
     Cashtag: common.PtrString("$CASHTAG_C_TOKEN"),
     StoredPaymentMethodId: common.PtrString("M5N7TQ4TG5PFWR50"),
     Type: common.PtrString("cashapp"),
   }

   paymentRequest := checkout.PaymentRequest{
     Reference: "YOUR_ORDER_NUMBER",
     Amount: amount,
     MerchantAccount: "ADYEN_MERCHANT_ACCOUNT",
     RecurringProcessingModel: common.PtrString("CardOnFile"),
     PaymentMethod: checkout.CashAppDetailsAsCheckoutPaymentMethod(&cashAppDetails),
     ShopperInteraction: common.PtrString("ContAuth"),
     ReturnUrl: "...",
     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)
   ```

   #### Python

   ```py
   # Adyen Python API Library v12.5.1
   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": {
       "value": 1000,
       "currency": "USD"
     },
     "paymentMethod": {
       "cashtag": "$CASHTAG_C_TOKEN",
       "storedPaymentMethodId": "M5N7TQ4TG5PFWR50",
       "type": "cashapp"
     },
     "reference": "YOUR_ORDER_NUMBER",
     "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
     "returnUrl": "...",
     "shopperReference": "YOUR_SHOPPER_REFERENCE",
     "shopperInteraction": "ContAuth",
     "recurringProcessingModel": "CardOnFile"
   }

   # Send the request
   result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID")
   ```

   #### Ruby

   ```rb
   # Adyen Ruby API Library v9.5.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 => {
       :value => 1000,
       :currency => 'USD'
     },
     :paymentMethod => {
       :cashtag => '$CASHTAG_C_TOKEN',
       :storedPaymentMethodId => 'M5N7TQ4TG5PFWR50',
       :type => 'cashapp'
     },
     :reference => 'YOUR_ORDER_NUMBER',
     :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT',
     :returnUrl => '...',
     :shopperReference => 'YOUR_SHOPPER_REFERENCE',
     :shopperInteraction => 'ContAuth',
     :recurringProcessingModel => 'CardOnFile'
   }

   # Send the request
   result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' })
   ```

   #### NodeJS (TypeScript)

   ```ts
   // Adyen Node API Library v18.0.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 cashAppDetails: Types.checkout.CashAppDetails = {
     cashtag: "$CASHTAG_C_TOKEN",
     storedPaymentMethodId: "M5N7TQ4TG5PFWR50",
     type: Types.checkout.CashAppDetails.TypeEnum.Cashapp
   };

   const paymentRequest: Types.checkout.PaymentRequest = {
     reference: "YOUR_ORDER_NUMBER",
     amount: amount,
     merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
     recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.CardOnFile,
     paymentMethod: cashAppDetails,
     shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth,
     returnUrl: "...",
     shopperReference: "YOUR_SHOPPER_REFERENCE"
   };

   // Send the request
   const checkoutAPI = new CheckoutAPI(client);
   const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
   ```

3. In the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response, note the following:

   * `resultCode`: Use this to [show the payment result to your shopper](#show-result).

   **Response**

   ```json
   {
      "pspReference": "8815329842815468",
      "resultCode": "Authorised"
   }
   ```

### Receive a notification when a shopper deletes stored Cash App Pay details

When a shopper deletes their stored payment details in Cash App Pay, Adyen sends a `recurring.token.disabled` webhook.\
You can prevent future failed payments by removing the stored token for Cash App pay and asking the shopper to use another payment method.

**Example recurring.token.disabled notification**

```json
{
"createdAt" : "2025-08-12T18:58:11+02:00",
"environment" : "test",
"type" : "recurring.token.disabled",
"data" : {
   "merchantAccount" : " YOUR_MERCHANT_ACCOUNT",
   "shopperReference" : "YOUR_SHOPPER_REFERENCE",
   "storedPaymentMethodId" : "G7NRRBC9H7VGGS75",
   "type" : "cashapp"
},
"eventId" : "N4P54KZTS2SVS3V5"
}
```

## Test and go live

Test your Cash App Pay integration using the test environment. You can simulate various payment scenarios using Cash App Pay [magic values](https://developers.cash.app/cash-app-pay-partner-api/guides/technical-guides/sandbox/developer-sandbox#magic-values). You can check the status of Cash App Pay test payments in your Customer Area, under **Transactions** > **Payments**.

When you are ready to go live, add Cash App Pay in your live Customer Area.

## See also

* [Android Components integration guide](/online-payments/android/components)
* [Notification webhooks](/development-resources/webhooks)
* [API Explorer](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/overview)
