{"title":"Migrate to 5.9.x","category":"default","creationDate":1776961628,"content":"<p>You are not required to migrate, but if you do, then 5.9.0 introduced a simplified integration for Google Pay to make migration easier. This new integration excludes the use of the deprecated <code>onActivityResult<\/code> and includes the Google Pay button. Follow the steps below to migrate from previous 5.x.x versions to 5.9.x:<\/p>\n<h2>Overview<\/h2>\n<ol>\n<li>Remove deprecated Activity Result code<\/li>\n<li>Display Google Pay button<\/li>\n<li>Google Pay availability check<\/li>\n<\/ol>\n<h2>Remove deprecated Activity Result code<\/h2>\n<p>Add <code>AdyenComponentView<\/code> to your layout and attach the component to it.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Add AdyenComponentView'\" :id=\"''\" :code-data='[{\"language\":\"bash\",\"tabTitle\":\"\",\"content\":\"&lt;com.adyen.checkout.ui.core.AdyenComponentView\\nandroid:id=\\\"@+id\\\/componentView\\\"\\nandroid:layout_width=\\\"match_parent\\\"\\nandroid:layout_height=\\\"wrap_content\\\" \\\/&gt;\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Attach the component to the view'\" :id=\"''\" :code-data='[{\"language\":\"bash\",\"tabTitle\":\"\",\"content\":\"\\\/\\\/ Attach the component to the view\\nbinding.componentView.attach(googlePayComponent, lifecycleOwner)\\n\\n\\\/\\\/ Or if you use Jetpack Compose\\nAdyenComponent(googlePayComponent)\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>Now you no longer need activity result related code, so you can clean it up. For example you can remove:<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Remove'\" :id=\"''\" :code-data='[{\"language\":\"bash\",\"tabTitle\":\"\",\"content\":\"\\\/\\\/ This function can be deleted\\noverride fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {\\nsuper.onActivityResult(requestCode, resultCode, data)\\ngooglePayComponent.handleActivityResult(resultCode, data)\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2>Display Google Pay button<\/h2>\n<p>If you want to keep displaying a button yourself, then you have to replace the call to <code>googlePayComponent.startGooglePayScreen(\u2026)<\/code> with <code>googlePayComponent.submit()<\/code>.<\/p>\n<p>To let the component display the Google Pay button inside the <code>AdyenComponentView<\/code> remove your own button and adjust your configuration:<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Add a configuration object'\" :id=\"''\" :code-data='[{\"language\":\"bash\",\"tabTitle\":\"\",\"content\":\"CheckoutConfiguration(\\nenvironment = environment,\\nclientKey = clientKey,\\n\\u2026\\n) {\\n   googlePay {\\n   setSubmitButtonVisible(true)\\n   setGooglePayButtonStyling(\\u2026) \\\/\\\/ Optionally style the button\\n  }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>The <code>com.google.pay.button:compose-pay-button<\/code> dependency can now also be removed from your <code>build.gradle<\/code>.<\/p>\n<h2>Google Pay availability check<\/h2>\n<p>You no longer need to call <code>GooglePayComponent.PROVIDER.isAvailable(\u2026)<\/code>.<\/p>\n<p>The <code>GooglePayComponent<\/code> now checks if Google Pay is available when you initialize it. If Google Pay is not available, you get a <code>GooglePayUnavailableException<\/code> in <code>onError<\/code>.<\/p>","url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/google-pay\/android-component\/migrate","articleFields":{"description":"Migrate Google Pay to version 5.9.x.","never_cache_twig":true,"filters_component":true,"parameters":{"payment_method_type":"googlepay","component_class_name":"GooglePayComponent","pm_directory":"google-pay"},"filters_config_folder":"payment-methods\/google-pay\/android\/component"},"algolia":[{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/google-pay\/android-component\/migrate","title":"Migrate to 5.9.x","content":"Requirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have an existing Sessions flow Android Components integration.\n\n\n\nCheckout API\nMake sure that you use Checkout API v69 or later.\n \n\n\nSetup steps\nBefore you begin, add Google Pay in your Customer Area.\n\n\n\nAdd additional parameters to your \/sessions request\nYou do not need to add any parameters when you create a payment session.\nImport the Component for Google Pay\nTo import the library and include the module for Google Pay.\n\n\n    \n        \n        \n    \n\nAdd additional configuration for Google Pay\nAdd a configuration object with the following parameters:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nsetAllowCreditCards\n\nSet if you support credit cards. Default is true for the specified card networks. Check the Google Pay docs for more details.\n\n\nsetAllowedAuthMethods\n\nSets the supported authentication methods. Check AllowedAuthMethods for all the possible values. Default is PAN_ONLY, CRYPTOGRAM_3DS. Check the Google Pay docs for more details.\n\n\nsetAllowedCardNetworks\n\nSets the allowed card networks. The allowed networks are automatically configured based on your account settings, but you can override them here. Check AllowedCardNetworks for all the possible values. Default is AMEX, DISCOVER, INTERAC, JCB, MASTERCARD, VISA. Check the Google Pay docs for more details.\n\n\nsetAllowPrepaidCards\n\nSet if you support prepaid cards. Default is false. Check the Google Pay docs for more details.\n\n\nsetAssuranceDetailsRequired\n\nSet to true to request assurance details. Default is false. Check the Google Pay docs for more details.\n\n\nsetBillingAddressParameters\n\nSets the required billing address details. Check the Google Pay docs for more details.\n\n\nsetBillingAddressRequired\n\nSet to true if you require a billing address. Default is false. Check the Google Pay docs for more details.\n\n\nsetCountryCode\n\nSets the ISO 3166-1 alpha-2 country code where the transaction is processed. Check the Google Pay docs for more details.\n\n\nsetEmailRequired\n\nSet to true if you require an email address. Default is false. Check the Google Pay docs for more details.\n\n\nsetExistingPaymentMethodRequired\n\nDefault is false. Check the Google Pay docs for more details.\n\n\nsetGooglePayButtonStyling\n\nSet a GooglePayButtonStyling object for customization of the Google Pay button.\n\n\nsetGooglePayEnvironment\n\nSets the environment to be used by GooglePay. Should be either WalletConstants.ENVIRONMENT_TEST or WalletConstants.ENVIRONMENT_PRODUCTION. Default follows the value of the Adyen environment.\n\n\nsetMerchantAccount\n\nSets the information about the merchant requesting the payment. Check the Google Pay docs for more details.\n\n\nsetMerchantInfo\n\nSets the information about the merchant requesting the payment.\n\n\nsetShippingAddressParameters\n\nSets the required shipping address details. Check the Google Pay docs for more details.\n\n\nsetShippingAddressRequired\n\nSet to true if you require a shipping address. Default is false. Check the Google Pay docs for more details.\n\n\nsetSubmitButtonVisible\n\nSets if submit button will be visible or not. Default is false.\n\n\nsetTotalPriceStatus\n\nSets the status of the total price used. Default is \"FINAL\". Check the Google Pay docs for more details.\n\n\n\n\n    \n\nLaunch and show the Component for Google Pay\nTo create the Component for Google Pay, use the GooglePayComponent class.\n\n\n    \n        \n        \n    \n\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","type":"page","locale":"pt","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"Google Pay","lvl3":"Android Component","lvl4":"Migrate to 5.9.x"},"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":"https:\/\/docs.adyen.com\/pt\/payment-methods\/google-pay\/android-component","lvl4":"\/pt\/payment-methods\/google-pay\/android-component\/migrate"},"levels":5,"category":"Payment method","category_color":"green","tags":["Migrate","5.9.x"]},{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/google-pay\/android-component\/migrate?flow=Sessions flow&integration=Component","title":"Sessions flow Component","content":"Requirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have an existing Sessions flow Android Components integration.\n\n\n\nCheckout API\nMake sure that you use Checkout API v69 or later.\n \n\n\nSetup steps\nBefore you begin, add Google Pay in your Customer Area.\n\n\n\nAdd additional parameters to your \/sessions request\nYou do not need to add any parameters when you create a payment session.\nImport the Component for Google Pay\nTo import the library and include the module for Google Pay.\n\n\n    \n        \n        \n    \n\nAdd additional configuration for Google Pay\nAdd a configuration object with the following parameters:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nsetAllowCreditCards\n\nSet if you support credit cards. Default is true for the specified card networks. Check the Google Pay docs for more details.\n\n\nsetAllowedAuthMethods\n\nSets the supported authentication methods. Check AllowedAuthMethods for all the possible values. Default is PAN_ONLY, CRYPTOGRAM_3DS. Check the Google Pay docs for more details.\n\n\nsetAllowedCardNetworks\n\nSets the allowed card networks. The allowed networks are automatically configured based on your account settings, but you can override them here. Check AllowedCardNetworks for all the possible values. Default is AMEX, DISCOVER, INTERAC, JCB, MASTERCARD, VISA. Check the Google Pay docs for more details.\n\n\nsetAllowPrepaidCards\n\nSet if you support prepaid cards. Default is false. Check the Google Pay docs for more details.\n\n\nsetAssuranceDetailsRequired\n\nSet to true to request assurance details. Default is false. Check the Google Pay docs for more details.\n\n\nsetBillingAddressParameters\n\nSets the required billing address details. Check the Google Pay docs for more details.\n\n\nsetBillingAddressRequired\n\nSet to true if you require a billing address. Default is false. Check the Google Pay docs for more details.\n\n\nsetCountryCode\n\nSets the ISO 3166-1 alpha-2 country code where the transaction is processed. Check the Google Pay docs for more details.\n\n\nsetEmailRequired\n\nSet to true if you require an email address. Default is false. Check the Google Pay docs for more details.\n\n\nsetExistingPaymentMethodRequired\n\nDefault is false. Check the Google Pay docs for more details.\n\n\nsetGooglePayButtonStyling\n\nSet a GooglePayButtonStyling object for customization of the Google Pay button.\n\n\nsetGooglePayEnvironment\n\nSets the environment to be used by GooglePay. Should be either WalletConstants.ENVIRONMENT_TEST or WalletConstants.ENVIRONMENT_PRODUCTION. Default follows the value of the Adyen environment.\n\n\nsetMerchantAccount\n\nSets the information about the merchant requesting the payment. Check the Google Pay docs for more details.\n\n\nsetMerchantInfo\n\nSets the information about the merchant requesting the payment.\n\n\nsetShippingAddressParameters\n\nSets the required shipping address details. Check the Google Pay docs for more details.\n\n\nsetShippingAddressRequired\n\nSet to true if you require a shipping address. Default is false. Check the Google Pay docs for more details.\n\n\nsetSubmitButtonVisible\n\nSets if submit button will be visible or not. Default is false.\n\n\nsetTotalPriceStatus\n\nSets the status of the total price used. Default is \"FINAL\". Check the Google Pay docs for more details.\n\n\n\n\n    \n\nLaunch and show the Component for Google Pay\nTo create the Component for Google Pay, use the GooglePayComponent class.\n\n\n    \n        \n        \n    \n\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","type":"page","locale":"pt","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"Google Pay","lvl3":"Android Component","lvl4":"Migrate to 5.9.x"},"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":"https:\/\/docs.adyen.com\/pt\/payment-methods\/google-pay\/android-component","lvl4":"\/pt\/payment-methods\/google-pay\/android-component\/migrate"},"levels":5,"category":"Payment method","category_color":"green","tags":["Sessions flow","Component"]},{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/google-pay\/android-component\/migrate?flow=Advanced flow&integration=Component","title":"Advanced flow Component","content":"Requirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nMake sure that you have an existing Advanced flow Android Components integration.\n \n\n\nSetup steps\nBefore you begin, add Google Pay in your Customer Area.\n\n\n\nImport the Component for Google Pay\nTo import the library and include the module for Google Pay.\n\n\n    \n        \n        \n    \n\nAdd additional configuration for Google Pay\nAdd a configuration object with the following parameters:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nsetAllowCreditCards\n\nSet if you support credit cards. Default is true for the specified card networks. Check the Google Pay docs for more details.\n\n\nsetAllowedAuthMethods\n\nSets the supported authentication methods. Check AllowedAuthMethods for all the possible values. Default is PAN_ONLY, CRYPTOGRAM_3DS. Check the Google Pay docs for more details.\n\n\nsetAllowedCardNetworks\n\nSets the allowed card networks. The allowed networks are automatically configured based on your account settings, but you can override them here. Check AllowedCardNetworks for all the possible values. Default is AMEX, DISCOVER, INTERAC, JCB, MASTERCARD, VISA. Check the Google Pay docs for more details.\n\n\nsetAllowPrepaidCards\n\nSet if you support prepaid cards. Default is false. Check the Google Pay docs for more details.\n\n\nsetAssuranceDetailsRequired\n\nSet to true to request assurance details. Default is false. Check the Google Pay docs for more details.\n\n\nsetBillingAddressParameters\n\nSets the required billing address details. Check the Google Pay docs for more details.\n\n\nsetBillingAddressRequired\n\nSet to true if you require a billing address. Default is false. Check the Google Pay docs for more details.\n\n\nsetCountryCode\n\nSets the ISO 3166-1 alpha-2 country code where the transaction is processed. Check the Google Pay docs for more details.\n\n\nsetEmailRequired\n\nSet to true if you require an email address. Default is false. Check the Google Pay docs for more details.\n\n\nsetExistingPaymentMethodRequired\n\nDefault is false. Check the Google Pay docs for more details.\n\n\nsetGooglePayButtonStyling\n\nSet a GooglePayButtonStyling object for customization of the Google Pay button.\n\n\nsetGooglePayEnvironment\n\nSets the environment to be used by GooglePay. Should be either WalletConstants.ENVIRONMENT_TEST or WalletConstants.ENVIRONMENT_PRODUCTION. Default follows the value of the Adyen environment.\n\n\nsetMerchantAccount\n\nSets the information about the merchant requesting the payment. Check the Google Pay docs for more details.\n\n\nsetMerchantInfo\n\nSets the information about the merchant requesting the payment.\n\n\nsetShippingAddressParameters\n\nSets the required shipping address details. Check the Google Pay docs for more details.\n\n\nsetShippingAddressRequired\n\nSet to true if you require a shipping address. Default is false. Check the Google Pay docs for more details.\n\n\nsetSubmitButtonVisible\n\nSets if submit button will be visible or not. Default is false.\n\n\nsetTotalPriceStatus\n\nSets the status of the total price used. Default is \"FINAL\". Check the Google Pay docs for more details.\n\n\n\n\n    \n\nLaunch and show the Component for Google Pay\nTo create the Component for Google Pay, use the GooglePayComponent class.\n\n\n    \n        \n        \n    \n\nAdd additional parameters to your \/payments request\nYou do not need to add any parameters to the  \/payments request when you make a payment.\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","type":"page","locale":"pt","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"Google Pay","lvl3":"Android Component","lvl4":"Migrate to 5.9.x"},"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":"https:\/\/docs.adyen.com\/pt\/payment-methods\/google-pay\/android-component","lvl4":"\/pt\/payment-methods\/google-pay\/android-component\/migrate"},"levels":5,"category":"Payment method","category_color":"green","tags":["Advanced flow","Component"]}]}
