Google Pay
Learn how to accept payments using Google Pay.
Note
As of September 2019, a regulation called Strong Customer Authentication (SCA) requires businesses in Europe to request additional authentication for online payments. Google Pay fully supports SCA as it already handles payment flows with a built-in layer of authentication (biometric or password).
Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer’s Google account.
Google Pay is fully compatible with Stripe’s products and features (for example, recurring payments), allowing you to use it in place of a traditional payment form whenever possible. Use it to accept payments for physical goods, donations, subscriptions, and so on.
Using Stripe and Google Pay versus the Google Play billing system
For sales of physical goods and services, your app can accept Google Pay or any other Stripe-supported payment method. Those payments are processed through Stripe, and you only need to pay Stripe’s processing fees. However, in-app purchases of digital products and content must use the Google Play billing system. Those payments are processed by Google and are subject to their transaction fees.
For more information about which purchases must use the Google Play billing system, see Google Play’s developer terms.
Accept a payment using Google Pay in your Android app
GooglePayLauncher
, part of the Stripe Android SDK, is the fastest and easiest way to start accepting Google Pay in your Android apps.
Prerequisites
To support Google Pay in Android, you need the following:
- A
minSdkVersion
of19
or higher. - A
compileSdkVersion
of28
or higher.
Additionally, if you wish to test with your own device, you need to add a payment method to your Google Account.
Set up your integration
To use Google Pay, first enable the Google Pay API by adding the following to the <application>
tag of your AndroidManifest.xml:
<application> ... <meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" /> </application>
This guide assumes you’re using the latest version of the Stripe Android SDK.
For more details, see Google Pay’s Set up Google Pay API for Android.
Add the Google Pay button
Add the Google Pay button to your app by following Google’s tutorial. This ensures you’re using the correct assets.
Instantiate GooglePayLauncher
Next, create an instance of GooglePayLauncher in your Activity
or Fragment
. This must be done in Activity#onCreate()
.
GooglePayLauncher.
exposes both required and optional properties that configure GooglePayLauncher
. See GooglePayLauncher.
for more details on the configuration options.
After instantiating GooglePayLauncher
, the GooglePayLauncher.
instance is called with a flag indicating whether Google Pay is available and ready to use. This flag can be used to update your UI to indicate to your customer that Google Pay is ready to be used.
Launch GooglePayLauncher
After Google Pay is available and your app has obtained a PaymentIntent
or SetupIntent
client secret, launch GooglePayLauncher
using the appropriate method. When confirming a PaymentIntent
, use GooglePayLauncher#presentForPaymentIntent(clientSecret)
. When confirming a SetupIntent
, use GooglePayLauncher#presentForSetupIntent(clientSecret)
.
Handle the result
Finally, implement GooglePayLauncher.
to handle the result of the GooglePayLauncher
operation.
The result can be GooglePayLauncher.
, GooglePayLauncher.
, or GooglePayLauncher.
.
Going live with Google Pay
Follow Google’s instructions to request production access for your app. Choose the integration type Gateway when prompted, and provide screenshots of your app for review.
After your app has been approved, test your integration in production by setting the environment to GooglePayEnvironment.
, and launching Google Pay from a signed, release build of your app. Remember to use your live mode API keys. You can use a PaymentIntent
with capture_
= manual
to process a transaction without capturing the payment.
Creating a PaymentMethod
If you confirm your payment on your server, you can use GooglePayPaymentMethodLauncher
to only collect a PaymentMethod
instead of confirm payment.
Disputes
Users must authenticate payments with their Google Pay accounts, which reduces the risk of fraud or unrecognized payments. However, users can still dispute transactions after they complete payment. You can submit evidence to contest a dispute directly. The dispute process is the same as that for card payments. Learn how to manage disputes.
Liability shift for Google Pay charges
Google Pay supports liability shift globally. This is true automatically for users on Stripe-hosted products and using Stripe.js. For Visa transactions outside of a Stripe-hosted product, you must enable liability shift in the Google Pay & Wallet Console. To do so, navigate to your Google Pay & Wallet Console, select Google Pay API in the navigation bar on the left, and then enable Fraud Liability Protection for Visa Device Tokens for liability shift protection.
There are three use cases of Google Pay transactions:
- If the user adds a card to the Google Pay app using their mobile device, this card is saved as a Device Primary Account Number (DPAN), and it supports liability shift by default.
- If the user adds a card to Chrome or a Google property (for example, YouTube or Play), this card is saved as a Funding Primary Account Number (FPAN). Liability shift is supported for all major networks, including Visa, globally when 3D Secure is performed. You can customize Stripe Radar rules to request activation of 3D Secure.
- If the user selects Google Pay as the payment method on an e-commerce site or in an app that pays with Google Pay, the cards are saved as e-commerce tokens that represent the cards on file. Neither liability shift nor 3D Secure are supported for e-commerce tokens at this time.
For Sigma users, the charges
table contains a card_
field that indicates the Google Pay transaction type. An FPAN transaction sets the card_
to fpan
. DPAN and ecommerce token transactions set the card_
to dpan_
.
Refunds
You can partially or fully refund any successful Google Pay payment. The refund process is the same as that for card payments. See Refund and cancel payments for instructions on initiating or managing refunds.