--- title: "iOS Component" url: "https://docs.adyen.com/payment-methods/cash-app-pay/ios-component" source_url: "https://docs.adyen.com/payment-methods/cash-app-pay/ios-component.md" canonical: "https://docs.adyen.com/payment-methods/cash-app-pay/ios-component" last_modified: "2026-05-24T12:54:31+02:00" language: "en" --- # iOS Component [View source](/payment-methods/cash-app-pay/ios-component.md) This page explains how to add Cash App Pay to your existing [iOS Components integration](/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Components\&version=latest). ## Requirements Select the [server-side flow](/online-payments/build-your-integration) that your integration uses: ### Tab: Sessions flow | Requirement | Description | | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | Make sure that you have built a Sessions flow [iOS Components integration](/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Components). The minimum required version is 5.2.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) using you Cash App client ID. - In your [Customer Area](https://ca-test.adyen.com/) go to **Developer** > **Additional data** and under **Payment** select **Recurring details**. Then select **Save configuration**. | ### Tab: Advanced flow | Requirement | Description | | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | Make sure that you have built an Advanced flow [iOS Components integration](/online-payments/build-your-integration/advanced-flow?platform=iOS\&integration=Components). The minimum required version is 5.2.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) using you Cash App client ID. - In your [Customer Area](https://ca-test.adyen.com/) go to **Developer** > **Additional data** and under **Payment** select **Recurring details**. Then select **Save configuration**. | ### Install the Adyen iOS client-side library Choose how you want to install the Adyen iOS client-side library: ### Tab: Swift Package Manager To install iOS Drop-in using Swift Package Manager, [follow the Apple guide](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app) and specify: * The repository URL as `https://github.com/Adyen/adyen-ios` * The version to be at least **v5.42.0** * Include `AdyenCashAppPay` ### Tab: CocoaPods To install iOS Drop-in from CocoaPods: 1. Add `pod 'Adyen/CashAppPay'` to your `Podfile`. 2. Run `pod install`. ## API reference You do not need to send additional fields for Cash App Pay. To see optional fields that you can send for all payment methods, choose the endpoint you integrated: * [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions): This is the default with [Components v5.0.0](/online-payments/build-your-integration/sessions-flow?platform=iOS\&integration=Components) or later. * [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments): If you implemented an [additional use case](/online-payments/build-your-integration). ## Component configuration To add Cash App Pay to your Components integration: ### Tab: /sessions 1. Create a `CashAppPayConfiguration` instance with the redirect URL for your app. ```swift // Create a `CashAppPayConfiguration` instance with the redirect URL for your your app. let configuration = CashAppPayConfiguration(redirectURL: URL(string: "yourAppURLOrScheme")) // Create a `CashAppPayPaymentMethod` instance from your payment methods list. let paymentMethod = paymentMethods.paymentMethod(ofType: CashAppPayPaymentMethod.self) //Create the the `CashAppPayComponent` with the `paymentMethod` and the `configuration`. let component = CashAppPayComponent(paymentMethod: paymentMethod, context: adyenContext, configuration: configuration) ``` 2. Set your `AdyenSession` instance as the delegate to let it handle the flow. ```swift component.delegate = self.adyenSession ``` 3. Present your component's view. ```swift navigationController.present(component.viewController) ``` ### Tab: Advanced flow 1. Create a `CashAppPayConfiguration` instance with the redirect URL for your app. ```swift // Create a `CashAppPayConfiguration` instance with the redirect URL for your your app. let configuration = CashAppPayConfiguration(redirectURL: URL(string: "yourAppURLOrScheme")) // Create a `CashAppPayPaymentMethod` instance from your payment methods list. let paymentMethod = paymentMethods.paymentMethod(ofType: CashAppPayPaymentMethod.self) //Create the the `CashAppPayComponent` with the `paymentMethod` and the `configuration`. let component = CashAppPayComponent(paymentMethod: paymentMethod, context: adyenContext, configuration: configuration) ``` The shopper clicks the Cash App Pay button to authorize the payment in their Cash App Pay app. When the shopper returns to your app, the Component invokes the `didSubmit` method. 2. Get the contents of `data.paymentMethod` and pass this to your server. Dismiss the Component immediately, or wait until you have submitted the details to your server. ```swift func didSubmit(_ data: PaymentComponentData, from component: PaymentComponent) ``` In case an error occurs on the app, the Component invokes the `didFail` method from the `PaymentComponentDelegate`. Dismiss the Component's view controller and show an error message. ```swift func didFail(with error: Error, from component: PaymentComponent) ``` ### Optional configuration You can add the following optional configuration: | Parameter name | Description | Default | | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | | `showsStorePaymentField` | Set to **false** if you do not want to show a toggle that lets the shopper choose whether to save their payment details. | **true** | | `storePaymentMethod` | 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 `showsStorePaymentField` to **false** if you use this. | **false** | ## 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. The `CashAppPayComponent` supports recurring payments with its `configuration` property in the `CashAppPayConfiguration` class. ### Tab: Sessions flow ### Create a token Include the [`storedPaymentMethodMode` ](https://docs.adyen.com/api-explorer/Checkout/70/post/sessions#request-storePaymentMethodMode)parameter in your [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) request. Possible values: | Value | Description | | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **disabled** (default) | Do not store payment details. | | **askForConsent** | If `shopperReference` is included in the request, show a toggle in the payment form that lets the shopper choose whether to store their payment details with our [Tokenization feature](/online-payments/tokenization). | | **enabled** | If `shopperReference` is included in the request, store 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. | The Cash App SDK requires you to specify whether to create a recurring request. If you set `storedPaymentMethodMode` to **enabled** or **disabled**, you must also specify the following in your [configuration](#configuration): * `storedPaymentMethod`: To store the payment method. This property is ignored if `showsStorePaymentMethodField` is **true**. If you or the shopper chooses to store payment details, your instance of `AdyenSession` creates a token when the shopper pays. ### 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. To obtain the shopper's $cashtag, you need to make a `/payments/details` request. If you are using the Sessions flow and want to include the $cashtag in recurring payments, you need to switch to the Advanced flow and implement both the `/payments/details` request and the `/payments` request. ### Make a payment with a token When the shopper pays, your instance of `AdyenSession` includes the shopper's stored Cash App Pay details. You can also use tokens to [make shopper-not-present payments](/online-payments/tokenization/make-token-payments#make-a-subscription-or-unscheduled-card-on-file-payment) for subscriptions or contracts. ### Tab: Advanced flow ### Create a token If you are using the Advanced Flow with the `/paymentMethods` endpoint, set the `showsStorePaymentMethodField` parameter in your [component configuration](#configuration): * To show the toggle to let the shopper choose whether to save their payment details, set `showsStorePaymentMethodField` to **true**. * To not show the toggle and instead store the shopper's payment details automatically, set `showsStorePaymentMethodField` to **false** when adding the Cash App Pay Component, and set `storePaymentMethod` to **true**. ```swift let configuration = CashAppPayComponent.Configuration(showsStorePaymentMethodField: true) let component = CashAppPayComponent(paymentMethod: paymentMethod, apiContext: apiContext, configuration: configuration) component.delegate = self self.cashAppPayComponent = component present(component.viewController, animated: true) ``` If the payment is made with stored details, the `didSubmit` method from the Component will include `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 `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 [Submit additional payment details](/online-payments/build-your-integration/advanced-flow?platform=iOS\&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 proceeds to pay, the Component invokes the `didSubmit` method containing the `data.paymentMethod` from the `PaymentComponentDelegate`. 1. Pass the `data.paymentMethod` 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 `data.paymentMethod` from the `didSubmit` event from your client app. To make it easier for the shopper to recognize the recurring payment as a legitimate one, optionally include: * `paymentMethod.cashtag`: the shoppers [$cashtag](#cashtag). ### 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 * [iOS Components integration guide](/online-payments/ios/components) * [Notification webhooks](/development-resources/webhooks) * [API Explorer](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/overview)