Our iOS Drop-in renders Cash App Pay in your payment form, and redirects the shopper to complete the payment.
Requirements
Select the server-side flow that your integration uses:
Requirement | Description |
---|---|
Integration type | Make sure that you have built a Sessions flow iOS Drop-in integration. The minimum required version is 5.2.0. |
Setup steps | Before you begin:
|
Install the Adyen iOS client-side library
Choose how you want to install the Adyen iOS client-side library:
To install iOS Drop-in using Swift Package Manager, follow the Apple guide and specify:
- The repository URL as
https://github.com/Adyen/adyen-ios
- The version to be at least v5.42.0
- Include
AdyenCashAppPay
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: This is the default with Drop-in v5.0.0 or later.
- /payments: If you implemented an additional use case.
Drop-in configuration
To add Cash App Pay to your Drop-in integration, set the cashAppPay
property of Drop-in's configuration instance.
dropInConfiguration.cashAppPay = CashAppPayConfiguration(redirectURL: URL(string: "yourAppURLOrScheme"))
Set your AdyenSession
instance as Drop-in's delegate to let it handle the flow.
dropIn.delegate = self.session
Present the Drop-in's view (modally, in a navigation stack, and so on).
navigationController.present(dropIn.viewController)
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 to 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. showsStorePaymentField must be set to false if you use this. |
false |
Show the payment result
Use the resultCode from the /payments/details response to show the payment result to your shopper. You will also receive the outcome of the payment asynchronously in a webhook.
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 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
field. |
Inform the shopper that there was an error processing their payment. |
Refused | The payment was refused. For more information, check the
refusalReason
field. |
Ask the shopper to try the payment again using a different payment method. |
Recurring payments
Cash App Pay supports tokenization of the shopper's payment details for recurring transactions.
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 amount reduces the risk of chargebacks.
Create a token
Include the
storedPaymentMethodMode
parameter in your /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 save their payment details. |
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:
storedPaymentMethod
: To store the payment method. This property is ignored ifshowsStorePaymentMethodField
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 for subscriptions or contracts.
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. 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.