{"title":"Google Pay Component integration","category":"default","creationDate":1776961628,"content":"<p>This page explains how to add Google Pay to your existing  Component integration.<\/p>\n<p>When shoppers select Google Pay, Component presents the Google Pay payment sheet where shoppers choose a card they want to use. If shoppers select a card that requires 3D Secure authentication, Component also handles redirecting shoppers to another website to complete the verification.<\/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 your <a href=\"\/pt\/online-payments\/react-native\/components\">Component integration<\/a>.<\/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\">Follow the <a href=\"https:\/\/developers.google.com\/pay\/api\/android\/guides\/setup\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">setup steps in the Google Pay documentation<\/a>.<\/li> <li markdown=\"1\"><a href=\"\/pt\/payment-methods\/add-payment-methods\">Add Google Pay in your Customer Area<\/a>.<\/li><\/ul>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>API reference<\/h2>\n<p>You do not need to send additional fields for Google Pay. See 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> endpoint API reference for the optional fields you can send.<\/p>\n<h2 id=\"configuration\">Component configuration<\/h2>\n<p>Pass state to your Checkout activity <code>onActivityResult<\/code>:<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Pass state to onActivityResult'\" :id=\"''\" :code-data='[{\"language\":\"kotlin\",\"tabTitle\":\"\",\"content\":\"@Override\\npublic void onActivityResult(int requestCode, int resultCode, Intent data) {\\n  super.onActivityResult(requestCode, resultCode, data);\\n  AdyenCheckout.handleActivityResult(requestCode, resultCode, data);\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2>Optional configuration<\/h2>\n<p>You can optionally include the following properties when you <a href=\"\/pt\/online-payments\/react-native\/components#configure\">configure <code>AdyenCheckout<\/code><\/a>:<\/p>\n<table>\n<thead>\n<tr>\n<th>Property<\/th>\n<th>Description<\/th>\n<th>Default<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>merchantAccount<\/code><\/td>\n<td>Your <a href=\"https:\/\/developers.google.com\/pay\/api\/web\/reference\/request-objects#MerchantInfo\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Google Merchant ID<\/a>. This can be anything for testing. Before you go live, get your Google Merchant ID from the <a href=\"https:\/\/pay.google.com\/business\/console\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Google Pay &amp; Wallet Console<\/a>.<\/td>\n<td>The corresponding merchant ID value from the <code>brands<\/code> array in the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/paymentMethods<\/a> response.<\/td>\n<\/tr>\n<tr>\n<td><code>allowedCardNetworks<\/code><\/td>\n<td>The list of allowed <a href=\"https:\/\/developers.google.com\/pay\/api\/web\/reference\/request-objects#CardParameters\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">card networks<\/a> in capital letters. The allowed networks are automatically configured based on your account settings, but you can override this here.<\/td>\n<td>-<\/td>\n<\/tr>\n<tr>\n<td><code>allowedAuthMethods<\/code><\/td>\n<td>The list of fields that are supported to authenticate a card transaction. Possible values:<br>- <strong>PAN_ONLY<\/strong>:associated with payment cards stored on file with the user's Google Account. Returned payment data includes personal account number (PAN) with the expiration month and the expiration year. <br>-<strong>CRYPTOGRAM_3DS<\/strong>: associated with cards stored as Android device tokens. Returned payment data includes a 3D Secure cryptogram generated on the device.<\/td>\n<td>-<\/td>\n<\/tr>\n<tr>\n<td><code>totalPriceStatus<\/code><\/td>\n<td>The status of the total price. Possible values:<br>- <strong>FINAL<\/strong>: the total price shown to the shopper doesn't change.<br>- <strong>ESTIMATED<\/strong>: the total price can change based on the details of the response, such as sales tax based on the billing address.<\/td>\n<td><strong>FINAL<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>allowPrepaidCards<\/code><\/td>\n<td>Set to <strong>false<\/strong> to turn off support for prepaid cards.<\/td>\n<td><strong>true<\/strong>: prepaid cards from <a href=\"\/pt\/payment-methods\/google-pay#supported-networks\">supported card networks<\/a> are supported.<\/td>\n<\/tr>\n<tr>\n<td><code>allowCreditCards<\/code><\/td>\n<td>Set to <strong>false<\/strong> to turn off support for credit cards.<\/td>\n<td><strong>true<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>billingAddressRequired<\/code><\/td>\n<td>Set to <strong>true<\/strong> to require the shopper to enter their full billing address. Only request this if it is required to process a transaction.<\/td>\n<td><strong>false<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>billingAddressParameters<\/code><\/td>\n<td>The expected fields returned if <code>billingAddressRequired<\/code> is set to <strong>true<\/strong>. For more information on the available fields, see Google Pay API documentation on <a href=\"https:\/\/developers.google.com\/pay\/api\/web\/reference\/request-objects#BillingAddressParameters\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>billingAddressParameters<\/code>\n<\/a>.<\/td>\n<td>-<\/td>\n<\/tr>\n<tr>\n<td><code>emailRequired<\/code><\/td>\n<td>Set to <strong>true<\/strong> to require the shopper to enter their email address.<\/td>\n<td><strong>false<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>shippingAddressRequired<\/code><\/td>\n<td>Set to <strong>true<\/strong> to require the shopper to enter their shipping address.<\/td>\n<td><strong>false<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>shippingAddressParameters<\/code><\/td>\n<td>The expected fields returned if <code>shippingAddressRequired<\/code> is set to <strong>true<\/strong>. For more information on the available fields, see Google Pay API documentation on <a href=\"https:\/\/developers.google.com\/pay\/api\/web\/reference\/request-objects#ShippingAddressParameters\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>shippingAddressParameters<\/code>\n<\/a>.<\/td>\n<td>-<\/td>\n<\/tr>\n<tr>\n<td><code>existingPaymentMethodRequired<\/code><\/td>\n<td>Set to <strong>true<\/strong> to only show the payment button if a shopper can pay with a supported payment method.<br>The value that says if the shopper can pay with each allowed payment method comes from the <code>IsReadyToPayResponse.paymentMethodPresent<\/code> object.<\/td>\n<td><strong>false<\/strong><\/td>\n<\/tr>\n<tr>\n<td><code>googlePayEnvironment<\/code><\/td>\n<td>The environment for Google Pay. Possible values:<br>- <strong>WalletConstants.ENVIRONMENT_TEST<\/strong> for test.<br>- <strong>WalletConstants.ENVIRONMENT_TEST<\/strong> for live.<\/td>\n<td>The corresponding environment to the <code>environment<\/code> you set when configuring <code>AdyenCheckout<\/code>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"notices green\">\n<p>To learn more about the optional request object options, check the <a href=\"https:\/\/developers.google.com\/pay\/api\/web\/reference\/request-objects\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Google Pay API documentation<\/a>.<\/p>\n<\/div>\n<h2 id=\"recurring-payments\">Recurring payments<\/h2>\n<p>To make recurring Google Pay payments, you first need to <a href=\"\/pt\/online-payments\/tokenization\/create-tokens\">create a shopper token<\/a> and then <a href=\"\/pt\/online-payments\/tokenization\/make-token-payments\">make subsequent recurring transactions<\/a> with the token.<br \/>\nRefer to <a href=\"\/pt\/online-payments\/tokenization\">Tokenization<\/a> for more information and detailed instructions.<\/p>\n<h2 id=\"test-and-go-live\">Test and go live<\/h2>\n<p>To start testing Google Pay, log in to a Google account and create a Google Pay wallet.<\/p>\n<p>There are two approaches to using this wallet for testing:<\/p>\n<ul>\n<li>\n<p><strong>Enroll in test card suite<\/strong><\/p>\n<p>Enroll your wallet in Google's <a href=\"https:\/\/developers.google.com\/pay\/api\/android\/guides\/resources\/test-card-suite\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">test card suite<\/a>. Test card suite pre-populates your wallet with a group of cards to use in the TEST environment. These are related to Adyen's collection of test cards, and cover scenarios including:<\/p>\n<ul>\n<li>Cards stored as FPAN<\/li>\n<li>Cards stored as DPAN (only when testing through native Android and Chrome on Android)<\/li>\n<li>Cards enabled for 3DS2<\/li>\n<\/ul>\n<p>When you start the payment flow and open the list of test cards, each card is marked with the applicable scenario.<\/p>\n<\/li>\n<li>\n<p><strong>Without test card suite<\/strong><\/p>\n<p>You upload real credit cards to your wallet, which are mapped to one of Adyen's <a href=\"\/pt\/development-resources\/test-cards-and-credentials\/test-card-numbers\">test cards<\/a> of the same brand. Your card is not charged.<\/p>\n<p>To test 3D Secure 2, you must use American Express or Discover cards, which trigger 3D Secure 2 challenge flows in the test environment. You cannot use any other card brands.<\/p>\n<\/li>\n<\/ul>\n<p>You can check the status of a Google Pay test payment in your <a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a> &gt; <strong>Transactions<\/strong> &gt; <strong>Payments<\/strong>, whether you used a card from the test card suite or or not. Remember that cards outside the test card suite are mapped to an Adyen test card of the same brand.<\/p>\n<p>For more information, see\u00a0<a href=\"https:\/\/developers.google.com\/pay\/api\/android\/guides\/test-and-deploy\/integration-checklist#about-the-test-environment\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Google Pay's test environment for Android<\/a>.<\/p>\n<h3>Before you go live<\/h3>\n<div class=\"notices green\">\n<p>We recommend that you test the scenarios described in <a href=\"https:\/\/developers.google.com\/pay\/api\/android\/reference\/client\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Google Pay\u2019s API reference for Android<\/a> in your live environment.<\/p>\n<\/div>\n<ol>\n<li>Make sure that your API credential has the <strong>API Clientside Encryption Payments role<\/strong>. Check this in your <a href=\"https:\/\/ca-live.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">live Customer Area<\/a> or ask your Admin user to verify.<\/li>\n<li>Go to your <a href=\"https:\/\/ca-live.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">live Customer Area<\/a> to configure your <a href=\"https:\/\/developers.google.com\/pay\/api\/android\/reference\/request-objects#MerchantInfo\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Google Merchant ID<\/a>.<\/li>\n<li>Complete all the steps in the Google Pay API <a href=\"https:\/\/developers.google.com\/pay\/api\/android\/guides\/test-and-deploy\/deploy-your-application\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">deploy to production documentation for Android<\/a>.<\/li>\n<\/ol>\n<p> <\/p>\n<p>In the live environment, note that Google Pay will only be available if:<\/p>\n<ul>\n<li>The shopper is logged in to their Google account.<\/li>\n<li>The shopper has at least one valid payment method on their Google Pay account.<\/li>\n<\/ul>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/online-payments\/react-native\/components\"\n                        target=\"_self\"\n                        >\n                    Component integration guide\n                <\/a><\/li><li><a href=\"https:\/\/developers.google.com\/pay\/api\/\"\n                        target=\"_blank\"\n                         class=\"external\">\n                    Google Pay API\n                <\/a><\/li><li><a href=\"\/online-payments\/tokenization\"\n                        target=\"_self\"\n                        >\n                    Tokenization\n                <\/a><\/li><li><a href=\"\/development-resources\/error-codes#google-pay-error-codes\"\n                        target=\"_self\"\n                        >\n                    Google Pay error codes\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\/google-pay\/react-native-component","articleFields":{"description":"Add Google Pay to an existing Components integration.","parameters":{"integration":"Component","integration_guide_url":"react-native\/components","component_name":"Component","component_name_capitalized":"The Component","payment_method":"Google Pay","payment_method_type":"googlepay","link":"https:\/\/developers.google.com\/pay\/api\/android\/guides\/setup","merchant_id":"https:\/\/developers.google.com\/pay\/api\/android\/reference\/request-objects#MerchantInfo"}},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/google-pay\/react-native-component","title":"Google Pay Component integration","content":"This page explains how to add Google Pay to your existing  Component integration.\nWhen shoppers select Google Pay, Component presents the Google Pay payment sheet where shoppers choose a card they want to use. If shoppers select a card that requires 3D Secure authentication, Component also handles redirecting shoppers to another website to complete the verification.\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have built your Component integration.\n\n\nSetup steps\nBefore you begin: Follow the setup steps in the Google Pay documentation. Add Google Pay in your Customer Area..\n\n\n\nAPI reference\nYou do not need to send additional fields for Google Pay. See the  \/payments endpoint API reference for the optional fields you can send.\nComponent configuration\nPass state to your Checkout activity onActivityResult:\n\n    \n\nOptional configuration\nYou can optionally include the following properties when you configure AdyenCheckout:\n\n\n\nProperty\nDescription\nDefault\n\n\n\n\nmerchantAccount\nYour Google Merchant ID. This can be anything for testing. Before you go live, get your Google Merchant ID from the Google Pay &amp; Wallet Console.\nThe corresponding merchant ID value from the brands array in the  \/paymentMethods response.\n\n\nallowedCardNetworks\nThe list of allowed card networks in capital letters. The allowed networks are automatically configured based on your account settings, but you can override this here.\n-\n\n\nallowedAuthMethods\nThe list of fields that are supported to authenticate a card transaction. Possible values:- PAN_ONLY:associated with payment cards stored on file with the user's Google Account. Returned payment data includes personal account number (PAN) with the expiration month and the expiration year. -CRYPTOGRAM_3DS: associated with cards stored as Android device tokens. Returned payment data includes a 3D Secure cryptogram generated on the device.\n-\n\n\ntotalPriceStatus\nThe status of the total price. Possible values:- FINAL: the total price shown to the shopper doesn't change.- ESTIMATED: the total price can change based on the details of the response, such as sales tax based on the billing address.\nFINAL\n\n\nallowPrepaidCards\nSet to false to turn off support for prepaid cards.\ntrue: prepaid cards from supported card networks are supported.\n\n\nallowCreditCards\nSet to false to turn off support for credit cards.\ntrue\n\n\nbillingAddressRequired\nSet to true to require the shopper to enter their full billing address. Only request this if it is required to process a transaction.\nfalse\n\n\nbillingAddressParameters\nThe expected fields returned if billingAddressRequired is set to true. For more information on the available fields, see Google Pay API documentation on \n  billingAddressParameters\n.\n-\n\n\nemailRequired\nSet to true to require the shopper to enter their email address.\nfalse\n\n\nshippingAddressRequired\nSet to true to require the shopper to enter their shipping address.\nfalse\n\n\nshippingAddressParameters\nThe expected fields returned if shippingAddressRequired is set to true. For more information on the available fields, see Google Pay API documentation on \n  shippingAddressParameters\n.\n-\n\n\nexistingPaymentMethodRequired\nSet to true to only show the payment button if a shopper can pay with a supported payment method.The value that says if the shopper can pay with each allowed payment method comes from the IsReadyToPayResponse.paymentMethodPresent object.\nfalse\n\n\ngooglePayEnvironment\nThe environment for Google Pay. Possible values:- WalletConstants.ENVIRONMENT_TEST for test.- WalletConstants.ENVIRONMENT_TEST for live.\nThe corresponding environment to the environment you set when configuring AdyenCheckout.\n\n\n\n\nTo learn more about the optional request object options, check the Google Pay API documentation.\n\nRecurring payments\nTo make recurring Google Pay payments, you first need to create a shopper token and then make subsequent recurring transactions with the token.\nRefer to Tokenization for more information and detailed instructions.\nTest and go live\nTo start testing Google Pay, log in to a Google account and create a Google Pay wallet.\nThere are two approaches to using this wallet for testing:\n\n\nEnroll in test card suite\nEnroll your wallet in Google's test card suite. Test card suite pre-populates your wallet with a group of cards to use in the TEST environment. These are related to Adyen's collection of test cards, and cover scenarios including:\n\nCards stored as FPAN\nCards stored as DPAN (only when testing through native Android and Chrome on Android)\nCards enabled for 3DS2\n\nWhen you start the payment flow and open the list of test cards, each card is marked with the applicable scenario.\n\n\nWithout test card suite\nYou upload real credit cards to your wallet, which are mapped to one of Adyen's test cards of the same brand. Your card is not charged.\nTo test 3D Secure 2, you must use American Express or Discover cards, which trigger 3D Secure 2 challenge flows in the test environment. You cannot use any other card brands.\n\n\nYou can check the status of a Google Pay test payment in your Customer Area &gt; Transactions &gt; Payments, whether you used a card from the test card suite or or not. Remember that cards outside the test card suite are mapped to an Adyen test card of the same brand.\nFor more information, see\u00a0Google Pay's test environment for Android.\nBefore you go live\n\nWe recommend that you test the scenarios described in Google Pay\u2019s API reference for Android in your live environment.\n\n\nMake sure that your API credential has the API Clientside Encryption Payments role. Check this in your live Customer Area or ask your Admin user to verify.\nGo to your live Customer Area to configure your Google Merchant ID.\nComplete all the steps in the Google Pay API deploy to production documentation for Android.\n\n \nIn the live environment, note that Google Pay will only be available if:\n\nThe shopper is logged in to their Google account.\nThe shopper has at least one valid payment method on their Google Pay account.\n\n\n\n                    Component integration guide\n                \n                    Google Pay API\n                \n                    Tokenization\n                \n                    Google Pay error codes\n                \n                    API Explorer\n                \n","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"Google Pay","lvl3":"Google Pay Component integration"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/payment-methods","lvl2":"https:\/\/docs.adyen.com\/pt\/payment-methods\/google-pay","lvl3":"\/pt\/payment-methods\/google-pay\/react-native-component"},"levels":4,"category":"Payment method","category_color":"green","tags":["Google","Component","integration"]}}
