Accept Cash App Pay payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.
Requirements
Requirement | Description |
---|---|
Integration type | Make sure that you have an existing API-only integration. |
Setup steps | Before you begin, contact our Support Team to add Cash App Pay in your Customer Area. |
For an API-only integration, you cannot add Cash App Pay in your Customer Area yourself.
Build your payment form for Cash App Pay
Include Cash App Pay in the list of available payment methods.
We provide logos for Cash App Pay which you can use on your payment form. For more information, refer to Downloading logos.
If you are using the /paymentMethods endpoint to show available payment methods to the shopper, specify the following:
- countryCode: US
- amount.currency: USD.
- amount.value: the value of the payment, in minor units.
- channel: specify Web, iOS, or Android.
The response contains paymentMethod.type
: cashapp.
Make a payment
-
From your server, make a /payments request, specifying:
paymentMethod.type
: cashapppaymentMethod.subtype
: redirectchannel
: specify Web, iOS, or Android.
-
In the /payments response, note the
action
object. This contains the information needed to redirect the shopper.
Handle the redirect
-
To complete the payment, redirect the shopper to the
action.url
returned in the /payments response, taking into account the following recommendations:-
When using the HTTP GET method:
For security reasons, when showing the redirect in the app, we recommend that you use SFSafariViewController for iOS or Chrome Custom Tabs for Android, instead of WebView objects. Also refer to the security best practices for WebView. -
Redirection for mobile integrations:
For mobile integrations, we strongly recommended that you redirect the shopper to the default browser of their device. Redirecting to the default browser ensures the best compatibility, handling of multi-factor authentication, app-to-app redirection, and error handling.
-
-
After the shopper is redirected back to your website, check the payment result by making a POST /payments/details request, specifying:
details
: object that contains the URL-decodedredirectResult
returned when the shopper was redirected back to your site.
-
In the response note the following:
resultCode
: use this to present the result to your shopper.pspReference
: our unique identifier for the transaction.
Present 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 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 charged amount reduces the risk of chargebacks.
To make recurring payments:
-
Create a token through the initial Cash App Pay transaction for the shopper, specifying:
- The tokenization parameters.
paymentMethod.type
: cashapppaymentMethod.subtype
: redirectchannel
: specify Web, iOS, or Android.
-
Get the shopper's token from the payment response or the RECURRING_CONTRACT webhook.
For example:additionalData.recurring.recurringDetailReference
: M5N7TQ4TG5PFWR50. -
Use the token in later Cash App Pay payments for the shopper, specifying:
- The tokenization parameters.
paymentMethod.type
: cashapppaymentMethod.subtype
: redirectchannel
: specify Web, iOS, or Android.
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.