{"title":"Android Component","category":"default","creationDate":1776961628,"content":"<p>This page explains how to add Cash App Pay to your existing <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow?platform=Android&amp;integration=Components&amp;version=latest\">Android Components integration<\/a>.<\/p>\n<div class=\"sc-notice info\"><div>\n<p><strong>If you are using Android Components v5.0.0 or later:<\/strong><\/p>\n<p>This payment method requires no additional configuration.<\/p>\n<p>Follow the  <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow?platform=Android&amp;integration=Components\">Components integration guide<\/a> and use the following module and Component names:<\/p>\n<ul>\n<li>To <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow\/?platform=Android&amp;integration=Components#import\">import the module<\/a>: <strong>cashapppay<\/strong><\/li>\n<li>To <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow?platform=Android&amp;integration=Components#launch-and-show\">launch and show the Component<\/a>: <strong>CashAppPayComponent<\/strong><\/li>\n<\/ul>\n<\/div><\/div>\n<p>If you have an existing <a href=\"\/pt\/online-payments\/build-your-integration\/sessions-flow?platform=Android&amp;integration=Components\">Android Components<\/a> integration, you can use our Redirect Component to redirect the shopper to complete the payment. As with other redirect payment methods, you need to <a href=\"#handle-the-redirect\">handle the redirect<\/a> after the shopper returns to your app.<\/p>\n<h2>Requirements<\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Requirement<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Integration type<\/strong><\/td>\n<td style=\"text-align: left;\">Make sure that you have built an Advanced flow <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Android&amp;integration=Components\">Android Components integration<\/a>.  <br> The minimum required version is 4.12.0. <\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Webhooks<\/strong><\/td>\n<td style=\"text-align: left;\">Enable the <a href=\"\/pt\/online-payments\/tokenization\/create-tokens#enable-the-webhook\">Recurring tokens life cycle events<\/a> webhook.<\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Setup steps<\/strong><\/td>\n<td style=\"text-align: left;\">Before you begin: <ul><li markdown=\"1\"><a href=\"\/pt\/payment-methods\/add-payment-methods\">Add Cash App Pay in your Customer Area<\/a>.<\/li> <li markdown=\"1\">In your <a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a> go to <strong>Developer<\/strong> &gt; <strong>Additional data<\/strong> and under <strong>Payment<\/strong> select <strong>Recurring details<\/strong>. Then select <strong>Save configuration<\/strong>.<\/li><\/ul><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Set up the Cash App Pay Component<\/h2>\n<ol>\n<li>\n<p>Import the Cash App Pay Component to your <code>build.gradle<\/code> file.<\/p>\n<pre><code class=\"language-groovy\">implementation \"com.adyen.checkout:cashapppay:&lt;latest-version&gt;\"<\/code><\/pre>\n<p>For the latest version, refer to our <a href=\"https:\/\/github.com\/Adyen\/adyen-android\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">GitHub<\/a>.<\/p>\n<\/li>\n<li>\n<p>Build a client-side configuration of the Cash App Pay Component.<\/p>\n<pre><code class=\"language-kotlin\">val cashAppPayConfiguration =\nCashAppPayConfiguration.Builder(shopperLocale, environment, clientKey)\n    \/\/ mandatory configuration\n    .setReturnUrl(CashAppPayComponent.getReturnUrl(context))\n    .build<\/code><\/pre>\n<\/li>\n<li>\n<p>Add the Component view to your layout. You will attach the initialized component to this view when <a href=\"#collect-payment-details\">collecting payment details<\/a>.<\/p>\n<pre><code class=\"language-xml\">&lt;com.adyen.checkout.cashapppay.CashAppPayView\n    android:id=\"@+id\/cashAppPayView\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\" \/&gt;<\/code><\/pre>\n<\/li>\n<li>\n<p>Add an <code>IntentFilter<\/code> to the <code>Activity<\/code> that will handle the <code>returnUrl<\/code> specified in your configuration and your <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Android&amp;integration=Components#make-a-payment\"><code>\/payments<\/code> request<\/a>.<\/p>\n<pre><code class=\"language-xml\">&lt;activity\n  android:name=\".YourActivity\"&gt;\n    &lt;intent-filter&gt;\n       &lt;action android:name=\"android.intent.action.VIEW\"\/&gt;\n       &lt;category android:name=\"android.intent.category.DEFAULT\"\/&gt;\n       &lt;category android:name=\"android.intent.category.BROWSABLE\"\/&gt;\n       &lt;data android:host=\"${applicationId}\" android:scheme=\"adyencheckout\"\/&gt;\n    &lt;\/intent-filter&gt;\n&lt;\/activity&gt;<\/code><\/pre>\n<p>The <code>${applicationId}<\/code> will be replaced with <code>your.package.name<\/code> at build time.<\/p>\n<\/li>\n<\/ol>\n<h3>Optional configuration<\/h3>\n<p>You can add the following optional configuration:<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter name<\/th>\n<th>Description<\/th>\n<th>Default<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>setShowStorePaymentField<\/code><\/td>\n<td>Set to <span translate=\"no\"><strong>false<\/strong><\/span> if you do not want to show a toggle that lets the shopper choose whether to save their payment details.<\/td>\n<td><span translate=\"no\"><strong>true<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td><code>setStorePaymentMethod<\/code><\/td>\n<td>Set to <span translate=\"no\"><strong>true<\/strong><\/span> 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. <br> Set <code>setShowStorePaymentField<\/code> to <span translate=\"no\"><strong>false<\/strong><\/span> if you use this.<\/td>\n<td><span translate=\"no\"><strong>false<\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"collect-payment-details\">Collect payment details<\/h2>\n<p>In this step, we use the client-side Component to send the shopper to the Cash App Pay app to authorize the payment.<\/p>\n<ol>\n<li>\n<p>Deserialize <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Android&amp;integration=Components#get-available-payment-methods\">the <code>\/paymentMethods<\/code> response<\/a> with the <code>SERIALIZER<\/code> object.<\/p>\n<pre><code class=\"language-kotlin\">val paymentMethodsApiResponse = PaymentMethodsApiResponse.SERIALIZER.deserialize(paymentMethodsResponse)<\/code><\/pre>\n<\/li>\n<li>\n<p>From the result, get the object containing <code>paymentMethods.type<\/code>: <span translate=\"no\"><strong>cashapp<\/strong><\/span>.<\/p>\n<\/li>\n<li>\n<p>Initialize an instance of the Component. To do this, you need to call <code>PROVIDER.get<\/code> from the Cash App Pay Component and pass the following:<\/p>\n<ul>\n<li>The context (for example, <code>FRAGMENT_OR_ACTIVITY<\/code>)<\/li>\n<li>The <code>PaymentMethod<\/code> object (for example, <code>paymentMethod<\/code>)<\/li>\n<li>The <code>cashappConfiguration<\/code> object<\/li>\n<\/ul>\n<pre><code class=\"language-kotlin\">val cashAppPayComponent = CashAppPayComponent.PROVIDER.get(FRAGMENT_OR_ACTIVITY, paymentMethod, cashAppPayConfiguration)<\/code><\/pre>\n<\/li>\n<li>\n<p>Attach the Component to the view to start getting your shopper's payment details. You need to call <code>attach<\/code> from the payment method's Component view and pass in:<\/p>\n<ul>\n<li>the <code>cashappComponent<\/code><\/li>\n<li>the context (for example, <code>FRAGMENT_OR_ACTIVITY<\/code>)<\/li>\n<\/ul>\n<pre><code class=\"language-kotlin\">cashAppPayView.attach(cashAppPayComponent, FRAGMENT_OR_ACTIVITY)<\/code><\/pre>\n<\/li>\n<li>\n<p>Add the <a href=\"https:\/\/developers.cash.app\/cash-app-pay-partner-api\/guides\/pay-kit-sdk\/pay-kit-android#cashapppaybutton\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Cash App Pay button<\/a>. When the shopper clicks the button, call <code>cashAppPayComponent.submit()<\/code>. The Cash App Pay app will launch for the shopper to approve the payment.<\/p>\n<\/li>\n<li>\n<p>You start receiving updates when the shopper completes an action in their Cash App Pay app. Check if <code>isValid<\/code> is <span translate=\"no\"><strong>true<\/strong><\/span>, and if the shopper proceeds to pay, pass the <code>paymentComponentState.data.paymentMethod<\/code> to your server.<\/p>\n<pre><code class=\"language-kotlin\">cashappComponent.observe(this@FRAGMENT_OR_ACTIVITY) { state -&gt;\n    if (state?.isValid == true) {\n        \/\/serialize data\n        val paymentComponentData = PaymentComponentData.SERIALIZER.serialize(state.data)\n        \/\/ When the shopper proceeds to pay, pass the serialized `state.data` to your server to send a \/payments request\n    }\n}<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2 id=\"make-payment\">Make a payment<\/h2>\n<p>When the shopper proceeds to pay:<\/p>\n<ol>\n<li>\n<p>From your server, make a POST  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request, specifying:<\/p>\n<ul>\n<li><code>paymentMethod.type<\/code>: Set this to <span translate=\"no\"><strong>cashapp<\/strong><\/span>.<\/li>\n<li><code>returnUrl<\/code>: URL to where the shopper should be redirected back to after they complete the payment. Get this URL from the Component in the <code>CashAppPayComponent.getReturnUrl(context)<\/code>.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'\/payments request'\" :id=\"''\" :code-data=\"[{&quot;language&quot;:&quot;json&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v72\\\/payments\\n-H 'x-api-key: ADYEN_API_KEY'\\n-H 'content-type: application\\\/json'\\n-d '{\\n    \\&quot;merchantAccount\\&quot;: \\&quot;YOUR_MERCHANT_ACCOUNT\\&quot;,\\n    \\&quot;amount\\&quot;:{\\n        \\&quot;currency\\&quot;: \\&quot;USD\\&quot;,\\n        \\&quot;value\\&quot;: 1000\\n    },\\n    \\&quot;shopperReference\\&quot;: \\&quot;YOUR_UNIQUE_SHOPPER_ID\\&quot;,\\n    \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n    \\&quot;paymentMethod\\&quot;: {\\n        \\&quot;type\\&quot;: \\&quot;cashapp\\&quot;\\n    },\\n    \\&quot;returnUrl\\&quot;: \\&quot;adyencheckout:\\\/\\\/your.package.name\\&quot;\\n}'&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>In the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> response, note the following:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/CheckoutService\/latest\/payments__resParam_pspReference\" class=\"codeLabel external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">pspReference<\/a>: Our unique identifier for the transaction.<\/li>\n<li><code>resultCode<\/code>: Use this to show the payment result to your shopper.<\/li>\n<li><code>merchantReference<\/code>: The <code>reference<\/code> from the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h2 id=\"show-result\">Show the payment result<\/h2>\n<p>Use the\u00a0 <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/details#responses-200-resultCode\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">resultCode<\/a> from the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/details\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/details<\/a> response to show the payment result to your shopper. You will also receive the outcome of the payment asynchronously in a <a href=\"\/pt\/development-resources\/webhooks\">webhook<\/a>.<\/p>\n<p>For Cash App Pay payments, you can receive the following <code>resultCode<\/code> values:<\/p>\n<table>\n<thead>\n<tr>\n<th>resultCode<\/th>\n<th>Description<\/th>\n<th>Action to take<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Received<\/strong><\/td>\n<td>The shopper has completed the payment but the final result is not yet known.<\/td>\n<td>Inform the shopper that you have received their order, and are waiting for the payment to be completed. <br>You will receive an <strong>AUTHORISATION<\/strong> webhook when the status of the payment is updated.<\/td>\n<\/tr>\n<tr>\n<td><strong>Authorised<\/strong><\/td>\n<td>The payment was successful.<\/td>\n<td>Inform the shopper that the payment has been successful. <br> If you are using manual capture, you also need to <a href=\"\/pt\/online-payments\/capture#manual-capture\">capture<\/a> the payment.<\/td>\n<\/tr>\n<tr>\n<td><strong>Cancelled<\/strong><\/td>\n<td>The shopper cancelled the payment.<\/td>\n<td>Ask the shopper whether they want to continue with the order, or ask them to select a different payment method.<\/td>\n<\/tr>\n<tr>\n<td><strong>Error<\/strong><\/td>\n<td>There was an error when the payment was being processed. For more information, check the <a href=\"\/pt\/development-resources\/refusal-reasons\">\n  <code>refusalReason<\/code>\n<\/a> field.<\/td>\n<td>Inform the shopper that there was an error processing their payment.<\/td>\n<\/tr>\n<tr>\n<td><strong>Refused<\/strong><\/td>\n<td>The payment was refused.  For more information, check the <a href=\"\/pt\/development-resources\/refusal-reasons\">\n  <code>refusalReason<\/code>\n<\/a> field.<\/td>\n<td>Ask the shopper to try the payment again using a different payment method.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"recurring-payments\">Recurring and card-on-file payments<\/h2>\n<p>Cash App Pay supports <a href=\"\/pt\/online-payments\/tokenization\">tokenization<\/a> 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.<\/p>\n<div class=\"notices red\">\n<p>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.<\/p>\n<\/div>\n<h3>Create a token<\/h3>\n<p>To store a shopper's Cash App Pay details, set <code>setShowStorePaymentField<\/code> to <span translate=\"no\"><strong>true<\/strong><\/span> when <a href=\"#optional-configuration\">adding the Cash App Pay Component<\/a>. This shows a toggle that lets the shopper choose whether to save their payment details. You can also store the details automatically by setting <code>setstorePaymentMethod<\/code> to <span translate=\"no\"><strong>true<\/strong><\/span> and <code>setShowStorePaymentField<\/code> to <span translate=\"no\"><strong>false<\/strong><\/span> in the Component configuration.<\/p>\n<p>If the shopper chooses to save their details when making a payment, the <code>observe<\/code> method from the Component includes a <code>state.data.storePaymentMethod<\/code>. Pass this to your server.<\/p>\n<p>To create a token, include in your  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request:<\/p>\n<ul>\n<li><code>storePaymentMethod<\/code>: The <code>paymentComponentState.data.storePaymentMethod<\/code> from your client app.<\/li>\n<li> <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments#request-shopperReference\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">shopperReference<\/a>&#58; Your unique identifier for the shopper.<\/li>\n<\/ul>\n<h3 id=\"cashtag\">Get the shopper's $cashtag<\/h3>\n<p>We recommend making sure that your recurring payments include the shopper's <strong>$cashtag<\/strong>. The $cashtag makes it easier for the shopper to recognize the recurring payment as a legitimate one. This helps to avoid chargebacks. <\/p>\n<ol>\n<li>Make sure that you have enabled receiving the shopper's $cashtag:<br \/>\nIn your Customer Area, go to <strong>Developers<\/strong> &gt; <strong>Additional Data<\/strong> and select <strong>Token information for digital wallets<\/strong>.<\/li>\n<li>Make a POST  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\/details\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments\/details<\/a> request. For instructions, see  <a href=\"\/pt\/online-payments\/build-your-integration\/advanced-flow\/?platform=Android&amp;integration=Components&amp;version=latest#send-additional-payment-details\">Send additional payment details<\/a>. <\/li>\n<li>\n<p>From the <code>\/payments\/details<\/code> response, save the following <code>additionalData<\/code> details:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>additionalData.cashapp.cashtag<\/code><\/td>\n<td style=\"text-align: left;\">The shopper's $cashtag.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>additionalData.tokenization.shopperReference<\/code><\/td>\n<td style=\"text-align: left;\">The shopper reference you specified in the payment request.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>additionalData.tokenization.storedPaymentMethodId<\/code><\/td>\n<td style=\"text-align: left;\">The token that was generated through the payment request.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Note that the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Tokenization-webhooks\/latest\/post\/recurring.token.created\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">recurring.token.created<\/a> also includes the shopper reference and the recurring detail reference, but not the $cashtag.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'\/payments\/details response with $cashtag and recurring details'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"additionalData\\\": {\\n      \\\"cashapp.cashtag\\\": \\\"$CASHTAG_C_TOKEN\\\",\\n      \\\"tokenization.shopperReference\\\": \\\"YOUR_SHOPPER_REFERENCE\\\",\\n      \\\"tokenization.storedPaymentMethodId\\\": \\\"M5N7TQ4TG5PFWR50\\\"\\n   },\\n   \\\"amount\\\":{\\n      \\\"currency\\\":\\\"USD\\\",\\n      \\\"value\\\":1000\\n   },\\n   \\\"merchantRreference\\\":\\\"YOUR_ORDER_NUMBER\\\",\\n   \\\"paymentMethod\\\":{\\n      \\\"type\\\":\\\"cashapp\\\",\\n      \\\"subtype\\\":\\\"redirect\\\"\\n   },\\n   \\\"pspReference\\\":\\\"V4HZ4RBFJGXXGN82\\\",\\n   \\\"resultCode\\\":\\\"Authorised\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<h3 id=\"make-a-payment-with-stored-details\">Make a payment with a token<\/h3>\n<p>When the shopper selects to pay, the Component calls the <code>onSubmit<\/code> event, which contains a <code>state.data<\/code>.<\/p>\n<ol>\n<li>\n<p>Pass the <code>state.data<\/code> to your server.<\/p>\n<\/li>\n<li>\n<p>From your server, make a  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request, specifying:<\/p>\n<ul>\n<li>The parameters required for one-off or recurring tokenized payments. For instructions, see <a href=\"\/pt\/online-payments\/tokenization\">Tokenization<\/a>.<\/li>\n<li><code>paymentMethod<\/code>: The <code>state.data.paymentMethod<\/code> from the <code>onSubmit<\/code> event.<\/li>\n<\/ul>\n<p>To make it easier for the shopper to recognize the recurring payment as a legitimate one, optionally include:<\/p>\n<ul>\n<li><code>paymentMethod.cashtag<\/code>: the shoppers <a href=\"#cashtag\">$cashtag<\/a>.<\/li>\n<\/ul>\n<p><\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Payment request with a token'\" :id=\"'8220713181'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/checkout-test.adyen.com\\\/v68\\\/payments \\\\\\n-H 'x-api-key: ADYEN_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-d '{\\n    \\&quot;amount\\&quot;: {\\n      \\&quot;value\\&quot;: 1000,\\n      \\&quot;currency\\&quot;: \\&quot;USD\\&quot;\\n    },\\n    \\&quot;paymentMethod\\&quot;: {\\n      \\&quot;cashtag\\&quot;:\\&quot;$CASHTAG_C_TOKEN\\&quot;,\\n      \\&quot;storedPaymentMethodId\\&quot;: \\&quot;M5N7TQ4TG5PFWR50\\&quot;,\\n      \\&quot;type\\&quot;:\\&quot;cashapp\\&quot;\\n    },\\n    \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n    \\&quot;merchantAccount\\&quot;: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n    \\&quot;returnUrl\\&quot;: \\&quot;...\\&quot;,\\n    \\&quot;shopperReference\\&quot;: \\&quot;YOUR_SHOPPER_REFERENCE\\&quot;,\\n    \\&quot;shopperInteraction\\&quot;: \\&quot;ContAuth\\&quot;,\\n    \\&quot;recurringProcessingModel\\&quot;: \\&quot;CardOnFile\\&quot;\\n }'&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v27.0.0\\nimport com.adyen.Client;\\nimport com.adyen.enums.Environment;\\nimport com.adyen.model.checkout.*;\\nimport java.time.OffsetDateTime;\\nimport java.util.*;\\nimport com.adyen.model.RequestOptions;\\nimport com.adyen.service.checkout.*;\\n\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nClient client = new Client(\\&quot;ADYEN_API_KEY\\&quot;, Environment.TEST);\\n\\n\\\/\\\/ Create the request object(s)\\nAmount amount = new Amount()\\n  .currency(\\&quot;USD\\&quot;)\\n  .value(1000L);\\n\\nCashAppDetails cashAppDetails = new CashAppDetails()\\n  .cashtag(\\&quot;$CASHTAG_C_TOKEN\\&quot;),\\n  .storedPaymentMethodId(\\&quot;M5N7TQ4TG5PFWR50\\&quot;)\\n  .type(CashAppDetails.TypeEnum.CASHAPP);\\n\\nPaymentRequest paymentRequest = new PaymentRequest()\\n  .reference(\\&quot;YOUR_ORDER_NUMBER\\&quot;)\\n  .amount(amount)\\n  .merchantAccount(\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;)\\n  .recurringProcessingModel(PaymentRequest.RecurringProcessingModelEnum.CARDONFILE)\\n  .paymentMethod(new CheckoutPaymentMethod(cashAppDetails))\\n  .shopperInteraction(PaymentRequest.ShopperInteractionEnum.CONTAUTH)\\n  .returnUrl(\\&quot;...\\&quot;)\\n  .shopperReference(\\&quot;YOUR_SHOPPER_REFERENCE\\&quot;);\\n\\n\\\/\\\/ Send the request\\nPaymentsApi service = new PaymentsApi(client);\\nPaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey(\\&quot;UUID\\&quot;));&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen PHP API Library v19.0.0\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Model\\\\Checkout\\\\Amount;\\nuse Adyen\\\\Model\\\\Checkout\\\\CheckoutPaymentMethod;\\nuse Adyen\\\\Model\\\\Checkout\\\\PaymentRequest;\\nuse Adyen\\\\Service\\\\Checkout\\\\PaymentsApi;\\n\\n$client = new Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_API_KEY\\&quot;);\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\n\\\/\\\/ Create the request object(s)\\n$amount = new Amount();\\n$amount\\n  -&gt;setCurrency(\\&quot;USD\\&quot;)\\n  -&gt;setValue(1000);\\n\\n$checkoutPaymentMethod = new CheckoutPaymentMethod();\\n$checkoutPaymentMethod\\n  -&gt;setCashtag(\\&quot;$CASHTAG_C_TOKEN\\&quot;)\\n  -&gt;setStoredPaymentMethodId(\\&quot;M5N7TQ4TG5PFWR50\\&quot;)\\n  -&gt;setType(\\&quot;cashapp\\&quot;);\\n\\n$paymentRequest = new PaymentRequest();\\n$paymentRequest\\n  -&gt;setReference(\\&quot;YOUR_ORDER_NUMBER\\&quot;)\\n  -&gt;setAmount($amount)\\n  -&gt;setMerchantAccount(\\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;)\\n  -&gt;setRecurringProcessingModel(\\&quot;CardOnFile\\&quot;)\\n  -&gt;setPaymentMethod($checkoutPaymentMethod)\\n  -&gt;setShopperInteraction(\\&quot;ContAuth\\&quot;)\\n  -&gt;setReturnUrl(\\&quot;...\\&quot;)\\n  -&gt;setShopperReference(\\&quot;YOUR_SHOPPER_REFERENCE\\&quot;);\\n\\n$requestOptions['idempotencyKey'] = 'UUID';\\n\\n\\\/\\\/ Send the request\\n$service = new PaymentsApi($client);\\n$response = $service-&gt;payments($paymentRequest, $requestOptions);&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen .net API Library v17.0.0\\nusing Adyen;\\nusing Environment = Adyen.Model.Environment;\\nusing Adyen.Model;\\nusing Adyen.Model.Checkout;\\nusing Adyen.Service.Checkout;\\n\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nvar config = new Config()\\n{\\n    XApiKey = \\&quot;ADYEN_API_KEY\\&quot;,\\n    Environment = Environment.Test\\n};\\nvar client = new Client(config);\\n\\n\\\/\\\/ Create the request object(s)\\nAmount amount = new Amount\\n{\\n  Currency = \\&quot;USD\\&quot;,\\n  Value = 1000\\n};\\n\\nCashAppDetails cashAppDetails = new CashAppDetails\\n{\\n  Cashtag = \\&quot;$CASHTAG_C_TOKEN\\&quot;,\\n  StoredPaymentMethodId = \\&quot;M5N7TQ4TG5PFWR50\\&quot;,\\n  Type = CashAppDetails.TypeEnum.Cashapp\\n};\\n\\nPaymentRequest paymentRequest = new PaymentRequest\\n{\\n  Reference = \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  Amount = amount,\\n  MerchantAccount = \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  RecurringProcessingModel = PaymentRequest.RecurringProcessingModelEnum.CardOnFile,\\n  PaymentMethod = new CheckoutPaymentMethod(cashAppDetails),\\n  ShopperInteraction = PaymentRequest.ShopperInteractionEnum.ContAuth,\\n  ReturnUrl = \\&quot;...\\&quot;,\\n  ShopperReference = \\&quot;YOUR_SHOPPER_REFERENCE\\&quot;\\n};\\n\\n\\\/\\\/ Send the request\\nvar service = new PaymentsService(client);\\nvar response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = \\&quot;UUID\\&quot;});&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v18.0.0\\n\\\/\\\/ Require the parts of the module you want to use\\nconst { Client, CheckoutAPI } = require('@adyen\\\/api-library');\\n\\\/\\\/ Initialize the client object\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nconst client = new Client({apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object(s)\\nconst paymentRequest = {\\n  amount: {\\n    value: 1000,\\n    currency: \\&quot;USD\\&quot;\\n  },\\n  paymentMethod: {\\n    cashtag: \\&quot;$CASHTAG_C_TOKEN\\&quot;,\\n    storedPaymentMethodId: \\&quot;M5N7TQ4TG5PFWR50\\&quot;,\\n    type: \\&quot;cashapp\\&quot;\\n  },\\n  reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  merchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  returnUrl: \\&quot;...\\&quot;,\\n  shopperReference: \\&quot;YOUR_SHOPPER_REFERENCE\\&quot;,\\n  shopperInteraction: \\&quot;ContAuth\\&quot;,\\n  recurringProcessingModel: \\&quot;CardOnFile\\&quot;\\n}\\n\\n\\\/\\\/ Send the request\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;},{&quot;language&quot;:&quot;go&quot;,&quot;tabTitle&quot;:&quot;Go&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Go API Library v10.4.0\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/adyen\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v9\\\/src\\\/checkout\\&quot;\\n)\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nclient := adyen.NewClient(&amp;common.Config{\\n  ApiKey:      \\&quot;ADYEN_API_KEY\\&quot;,\\n  Environment: common.TestEnv,\\n})\\n\\n\\\/\\\/ Create the request object(s)\\namount := checkout.Amount{\\n  Currency: \\&quot;USD\\&quot;,\\n  Value: 1000,\\n}\\n\\ncashAppDetails := checkout.CashAppDetails{\\n  Cashtag: common.PtrString(\\&quot;$CASHTAG_C_TOKEN\\&quot;),\\n  StoredPaymentMethodId: common.PtrString(\\&quot;M5N7TQ4TG5PFWR50\\&quot;),\\n  Type: common.PtrString(\\&quot;cashapp\\&quot;),\\n}\\n\\npaymentRequest := checkout.PaymentRequest{\\n  Reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  Amount: amount,\\n  MerchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  RecurringProcessingModel: common.PtrString(\\&quot;CardOnFile\\&quot;),\\n  PaymentMethod: checkout.CashAppDetailsAsCheckoutPaymentMethod(&amp;cashAppDetails),\\n  ShopperInteraction: common.PtrString(\\&quot;ContAuth\\&quot;),\\n  ReturnUrl: \\&quot;...\\&quot;,\\n  ShopperReference: common.PtrString(\\&quot;YOUR_SHOPPER_REFERENCE\\&quot;),\\n}\\n\\n\\\/\\\/ Send the request\\nservice := client.Checkout()\\nreq := service.PaymentsApi.PaymentsInput().IdempotencyKey(\\&quot;UUID\\&quot;).PaymentRequest(paymentRequest)\\nres, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v12.5.1\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_API_KEY\\&quot;\\n# For the live environment, additionally include your liveEndpointUrlPrefix.\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\n# Create the request object(s)\\njson_request = {\\n  \\&quot;amount\\&quot;: {\\n    \\&quot;value\\&quot;: 1000,\\n    \\&quot;currency\\&quot;: \\&quot;USD\\&quot;\\n  },\\n  \\&quot;paymentMethod\\&quot;: {\\n    \\&quot;cashtag\\&quot;: \\&quot;$CASHTAG_C_TOKEN\\&quot;,\\n    \\&quot;storedPaymentMethodId\\&quot;: \\&quot;M5N7TQ4TG5PFWR50\\&quot;,\\n    \\&quot;type\\&quot;: \\&quot;cashapp\\&quot;\\n  },\\n  \\&quot;reference\\&quot;: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  \\&quot;merchantAccount\\&quot;: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  \\&quot;returnUrl\\&quot;: \\&quot;...\\&quot;,\\n  \\&quot;shopperReference\\&quot;: \\&quot;YOUR_SHOPPER_REFERENCE\\&quot;,\\n  \\&quot;shopperInteraction\\&quot;: \\&quot;ContAuth\\&quot;,\\n  \\&quot;recurringProcessingModel\\&quot;: \\&quot;CardOnFile\\&quot;\\n}\\n\\n# Send the request\\nresult = adyen.checkout.payments_api.payments(request=json_request, idempotency_key=\\&quot;UUID\\&quot;)&quot;},{&quot;language&quot;:&quot;rb&quot;,&quot;tabTitle&quot;:&quot;Ruby&quot;,&quot;content&quot;:&quot;# Adyen Ruby API Library v9.5.1\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_API_KEY'\\n# For the live environment, additionally include your liveEndpointUrlPrefix.\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Create the request object(s)\\nrequest_body = {\\n  :amount =&gt; {\\n    :value =&gt; 1000,\\n    :currency =&gt; 'USD'\\n  },\\n  :paymentMethod =&gt; {\\n    :cashtag =&gt; '$CASHTAG_C_TOKEN',\\n    :storedPaymentMethodId =&gt; 'M5N7TQ4TG5PFWR50',\\n    :type =&gt; 'cashapp'\\n  },\\n  :reference =&gt; 'YOUR_ORDER_NUMBER',\\n  :merchantAccount =&gt; 'ADYEN_MERCHANT_ACCOUNT',\\n  :returnUrl =&gt; '...',\\n  :shopperReference =&gt; 'YOUR_SHOPPER_REFERENCE',\\n  :shopperInteraction =&gt; 'ContAuth',\\n  :recurringProcessingModel =&gt; 'CardOnFile'\\n}\\n\\n# Send the request\\nresult = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' =&gt; 'UUID' })&quot;},{&quot;language&quot;:&quot;ts&quot;,&quot;tabTitle&quot;:&quot;NodeJS (TypeScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v18.0.0\\n\\\/\\\/ Require the parts of the module you want to use\\nimport { Client, CheckoutAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\\/\\\/ Initialize the client object\\n\\\/\\\/ For the live environment, additionally include your liveEndpointUrlPrefix.\\nconst client = new Client({apiKey: \\&quot;ADYEN_API_KEY\\&quot;, environment: \\&quot;TEST\\&quot;});\\n\\n\\\/\\\/ Create the request object(s)\\nconst amount: Types.checkout.Amount = {\\n  currency: \\&quot;USD\\&quot;,\\n  value: 1000\\n};\\n\\nconst cashAppDetails: Types.checkout.CashAppDetails = {\\n  cashtag: \\&quot;$CASHTAG_C_TOKEN\\&quot;,\\n  storedPaymentMethodId: \\&quot;M5N7TQ4TG5PFWR50\\&quot;,\\n  type: Types.checkout.CashAppDetails.TypeEnum.Cashapp\\n};\\n\\nconst paymentRequest: Types.checkout.PaymentRequest = {\\n  reference: \\&quot;YOUR_ORDER_NUMBER\\&quot;,\\n  amount: amount,\\n  merchantAccount: \\&quot;ADYEN_MERCHANT_ACCOUNT\\&quot;,\\n  recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.CardOnFile,\\n  paymentMethod: cashAppDetails,\\n  shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.ContAuth,\\n  returnUrl: \\&quot;...\\&quot;,\\n  shopperReference: \\&quot;YOUR_SHOPPER_REFERENCE\\&quot;\\n};\\n\\n\\\/\\\/ Send the request\\nconst checkoutAPI = new CheckoutAPI(client);\\nconst response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: \\&quot;UUID\\&quot; });&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>In the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> response, note the following:<\/p>\n<ul>\n<li><code>resultCode<\/code>: Use this to <a href=\"#show-result\">show the payment result to your shopper<\/a>.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Response'\" :id=\"'token-response'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n   \\\"pspReference\\\": \\\"8815329842815468\\\",\\n   \\\"resultCode\\\": \\\"Authorised\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<h3 id=\"token-disabled\">Receive a notification when a shopper deletes stored Cash App Pay details<\/h3>\n<p>When a shopper deletes their stored payment details in Cash App Pay, Adyen sends a <code>recurring.token.disabled<\/code> webhook.<br \/>\nYou can prevent future failed payments by removing the stored token for Cash App pay and asking the shopper to use another payment method.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Example recurring.token.disabled notification'\" :id=\"'example-recurring-token-disabled'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n\\\"createdAt\\\" : \\\"2025-08-12T18:58:11+02:00\\\",\\n\\\"environment\\\" : \\\"test\\\",\\n\\\"type\\\" : \\\"recurring.token.disabled\\\",\\n\\\"data\\\" : {\\n   \\\"merchantAccount\\\" : \\\" YOUR_MERCHANT_ACCOUNT\\\",\\n   \\\"shopperReference\\\" : \\\"YOUR_SHOPPER_REFERENCE\\\",\\n   \\\"storedPaymentMethodId\\\" : \\\"G7NRRBC9H7VGGS75\\\",\\n   \\\"type\\\" : \\\"cashapp\\\"\\n},\\n\\\"eventId\\\" : \\\"N4P54KZTS2SVS3V5\\\"\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2 id=\"test-and-go-live\">Test and go live<\/h2>\n<p>Test your Cash App Pay integration using the test environment. You can simulate various payment scenarios using Cash App Pay <a href=\"https:\/\/developers.cash.app\/cash-app-pay-partner-api\/guides\/technical-guides\/sandbox\/developer-sandbox#magic-values\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">magic values<\/a>. You can check the status of Cash App Pay test payments in your Customer Area, under <strong>Transactions<\/strong> &gt; <strong>Payments<\/strong>.<\/p>\n<p>When you are ready to go live, add Cash App Pay in your live Customer Area.<\/p>\n<h2 id=\"see-also\">See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/online-payments\/android\/components\"\n                        target=\"_self\"\n                        >\n                    Android Components integration guide\n                <\/a><\/li><li><a href=\"\/development-resources\/webhooks\"\n                        target=\"_self\"\n                        >\n                    Notification webhooks\n                <\/a><\/li><li><a href=\"https:\/\/docs.adyen.com\/api-explorer\/#\/CheckoutService\/latest\/overview\"\n                        target=\"_blank\"\n                         class=\"external\">\n                    API Explorer\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/cash-app-pay\/android-component","articleFields":{"feedback_component":true,"type":"page","_expandable":null,"operations":"","status":"current","parameters":{"module_import":"cashapppay","android_component":"CashAppPayComponent","integration":"Components","platform":"Android","payment_method":"Cash App Pay","add_version":true,"version":"4.12.0"}},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/cash-app-pay\/android-component","title":"Android Component","content":"This page explains how to add Cash App Pay to your existing Android Components integration.\n\nIf you are using Android Components v5.0.0 or later:\nThis payment method requires no additional configuration.\nFollow the  Components integration guide and use the following module and Component names:\n\nTo import the module: cashapppay\nTo launch and show the Component: CashAppPayComponent\n\n\nIf you have an existing Android 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 after the shopper returns to your app.\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have built an Advanced flow Android Components integration.   The minimum required version is 4.12.0. \n\n\nWebhooks\nEnable the Recurring tokens life cycle events webhook.\n\n\nSetup steps\nBefore you begin: Add Cash App Pay in your Customer Area. In your Customer Area go to Developer &gt; Additional data and under Payment select Recurring details. Then select Save configuration.\n\n\n\nSet up the Cash App Pay Component\n\n\nImport the Cash App Pay Component to your build.gradle file.\nimplementation \"com.adyen.checkout:cashapppay:&lt;latest-version&gt;\"\nFor the latest version, refer to our GitHub.\n\n\nBuild a client-side configuration of the Cash App Pay Component.\nval cashAppPayConfiguration =\nCashAppPayConfiguration.Builder(shopperLocale, environment, clientKey)\n    \/\/ mandatory configuration\n    .setReturnUrl(CashAppPayComponent.getReturnUrl(context))\n    .build\n\n\nAdd the Component view to your layout. You will attach the initialized component to this view when collecting payment details.\n&lt;com.adyen.checkout.cashapppay.CashAppPayView\n    android:id=\"@+id\/cashAppPayView\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\" \/&gt;\n\n\nAdd an IntentFilter to the Activity that will handle the returnUrl specified in your configuration and your \/payments request.\n&lt;activity\n  android:name=\".YourActivity\"&gt;\n    &lt;intent-filter&gt;\n       &lt;action android:name=\"android.intent.action.VIEW\"\/&gt;\n       &lt;category android:name=\"android.intent.category.DEFAULT\"\/&gt;\n       &lt;category android:name=\"android.intent.category.BROWSABLE\"\/&gt;\n       &lt;data android:host=\"${applicationId}\" android:scheme=\"adyencheckout\"\/&gt;\n    &lt;\/intent-filter&gt;\n&lt;\/activity&gt;\nThe ${applicationId} will be replaced with your.package.name at build time.\n\n\nOptional configuration\nYou can add the following optional configuration:\n\n\n\nParameter name\nDescription\nDefault\n\n\n\n\nsetShowStorePaymentField\nSet to false if you do not want to show a toggle that lets the shopper choose whether to save their payment details.\ntrue\n\n\nsetStorePaymentMethod\nSet 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.\nfalse\n\n\n\nCollect payment details\nIn this step, we use the client-side Component to send the shopper to the Cash App Pay app to authorize the payment.\n\n\nDeserialize the \/paymentMethods response with the SERIALIZER object.\nval paymentMethodsApiResponse = PaymentMethodsApiResponse.SERIALIZER.deserialize(paymentMethodsResponse)\n\n\nFrom the result, get the object containing paymentMethods.type: cashapp.\n\n\nInitialize an instance of the Component. To do this, you need to call PROVIDER.get from the Cash App Pay Component and pass the following:\n\nThe context (for example, FRAGMENT_OR_ACTIVITY)\nThe PaymentMethod object (for example, paymentMethod)\nThe cashappConfiguration object\n\nval cashAppPayComponent = CashAppPayComponent.PROVIDER.get(FRAGMENT_OR_ACTIVITY, paymentMethod, cashAppPayConfiguration)\n\n\nAttach 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:\n\nthe cashappComponent\nthe context (for example, FRAGMENT_OR_ACTIVITY)\n\ncashAppPayView.attach(cashAppPayComponent, FRAGMENT_OR_ACTIVITY)\n\n\nAdd the Cash App Pay button. When the shopper clicks the button, call cashAppPayComponent.submit(). The Cash App Pay app will launch for the shopper to approve the payment.\n\n\nYou 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.\ncashappComponent.observe(this@FRAGMENT_OR_ACTIVITY) { state -&gt;\n    if (state?.isValid == true) {\n        \/\/serialize data\n        val paymentComponentData = PaymentComponentData.SERIALIZER.serialize(state.data)\n        \/\/ When the shopper proceeds to pay, pass the serialized `state.data` to your server to send a \/payments request\n    }\n}\n\n\nMake a payment\nWhen the shopper proceeds to pay:\n\n\nFrom your server, make a POST  \/payments request, specifying:\n\npaymentMethod.type: Set this to cashapp.\nreturnUrl: 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).\n\n\n\n\n\n\nIn the  \/payments response, note the following:\n\npspReference: Our unique identifier for the transaction.\nresultCode: Use this to show the payment result to your shopper.\nmerchantReference: The reference from the  \/payments request.\n\n\n\nShow the payment result\nUse the\u00a0 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.\nFor Cash App Pay payments, you can receive the following resultCode values:\n\n\n\nresultCode\nDescription\nAction to take\n\n\n\n\nReceived\nThe shopper has completed the payment but the final result is not yet known.\nInform 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.\n\n\nAuthorised\nThe payment was successful.\nInform the shopper that the payment has been successful.  If you are using manual capture, you also need to capture the payment.\n\n\nCancelled\nThe shopper cancelled the payment.\nAsk the shopper whether they want to continue with the order, or ask them to select a different payment method.\n\n\nError\nThere was an error when the payment was being processed. For more information, check the \n  refusalReason\n field.\nInform the shopper that there was an error processing their payment.\n\n\nRefused\nThe payment was refused.  For more information, check the \n  refusalReason\n field.\nAsk the shopper to try the payment again using a different payment method.\n\n\n\nRecurring and card-on-file payments\nCash App Pay supports 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.\n\nWe 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.\n\nCreate a token\nTo store a shopper's Cash App Pay details, set setShowStorePaymentField to true when adding the Cash App Pay Component. 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.\nIf 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.\nTo create a token, include in your  \/payments request:\n\nstorePaymentMethod: The paymentComponentState.data.storePaymentMethod from your client app.\n shopperReference&#58; Your unique identifier for the shopper.\n\nGet the shopper's $cashtag\nWe 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. \n\nMake sure that you have enabled receiving the shopper's $cashtag:\nIn your Customer Area, go to Developers &gt; Additional Data and select Token information for digital wallets.\nMake a POST  \/payments\/details request. For instructions, see  Send additional payment details. \n\nFrom the \/payments\/details response, save the following additionalData details:\n\n\n\nParameter\nDescription\n\n\n\n\nadditionalData.cashapp.cashtag\nThe shopper's $cashtag.\n\n\nadditionalData.tokenization.shopperReference\nThe shopper reference you specified in the payment request.\n\n\nadditionalData.tokenization.storedPaymentMethodId\nThe token that was generated through the payment request.\n\n\n\nNote that the  recurring.token.created also includes the shopper reference and the recurring detail reference, but not the $cashtag.\n\n\n\n\n\nMake a payment with a token\nWhen the shopper selects to pay, the Component calls the onSubmit event, which contains a state.data.\n\n\nPass the state.data to your server.\n\n\nFrom your server, make a  \/payments request, specifying:\n\nThe parameters required for one-off or recurring tokenized payments. For instructions, see Tokenization.\npaymentMethod: The state.data.paymentMethod from the onSubmit event.\n\nTo make it easier for the shopper to recognize the recurring payment as a legitimate one, optionally include:\n\npaymentMethod.cashtag: the shoppers $cashtag.\n\n\n\n\n\n\n\nIn the  \/payments response, note the following:\n\nresultCode: Use this to show the payment result to your shopper.\n\n\n\n\n\n\nReceive a notification when a shopper deletes stored Cash App Pay details\nWhen a shopper deletes their stored payment details in Cash App Pay, Adyen sends a recurring.token.disabled webhook.\nYou can prevent future failed payments by removing the stored token for Cash App pay and asking the shopper to use another payment method.\n\n    \n\nTest and go live\nTest 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 &gt; Payments.\nWhen you are ready to go live, add Cash App Pay in your live Customer Area.\nSee also\n\n\n                    Android Components integration guide\n                \n                    Notification webhooks\n                \n                    API Explorer\n                \n","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"Cash App Pay","lvl3":"Android Component"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/payment-methods","lvl2":"https:\/\/docs.adyen.com\/pt\/payment-methods\/cash-app-pay","lvl3":"\/pt\/payment-methods\/cash-app-pay\/android-component"},"levels":4,"category":"Payment method","category_color":"green","tags":["Android","Component"]},"articleFiles":{"0136221937.js":"<p alt=\"\">0136221937.js<\/p>","8220713181.js":"<p alt=\"\">8220713181.js<\/p>"}}
