Tag Archives: google pay

Jetpack Compose Buttons for Google Pay and Google Wallet

Posted by Stephen McDonald, Developer Programs Engineer

We recently released a new Google Pay button view on Android which brings a range of new features, such as the latest Material 3 design principles, dark and light themed versions, and other new customization capabilities.

Image of the new Google Pay button view for Android
Figure 1: The new Google Pay button view for Android can be customized to make it more consistent with your checkout experience.


Jetpack Compose Buttons

We've now made the new Google Pay button available to Jetpack Compose developers with a new open source library compose-pay-button. Jetpack Compose is Android’s modern toolkit for building user interfaces when using the Kotlin language, and with this new library you can implement the Google Pay button in your Android apps with even less code than before.

Let's look at a quick example. Here you can see a typical Jetpack Compose UI, with the Google Pay button added. The button accepts a Jetpack Compose modifier for customization, and supports a variety of labels, in this case "Book with Google Pay".

setContent { Column() { PayButton( onClick = { println("Button clicked") }, allowedPaymentMethods = "<JSON serialized allowedPaymentMethods>", modifier = Modifier.width(300.dp), type = ButtonType.PAY_BOOK, ) } }


Google Wallet

Lastly, we've also released a corresponding library for Google Wallet, compose-wallet-button. The library provides a similar API to the Google Pay button, but instead bundles the same button assets available on the Google Wallet developer site, including both regular and condensed versions.

Image of the regular (left) and condensed (right) versions of the Google Wallet button
Figure 2: Both regular and condensed versions of the Google Wallet button are available in the new library.

Ready to get started? Check out the GitHub repositories for both compose-pay-button and compose-wallet-button where you can learn more about the libraries and how to add them to your Android apps!

Jetpack Compose Buttons for Google Pay and Google Wallet

Posted by Stephen McDonald, Developer Programs Engineer

We recently released a new Google Pay button view on Android which brings a range of new features, such as the latest Material 3 design principles, dark and light themed versions, and other new customization capabilities.

Image of the new Google Pay button view for Android
Figure 1: The new Google Pay button view for Android can be customized to make it more consistent with your checkout experience.


Jetpack Compose Buttons

We've now made the new Google Pay button available to Jetpack Compose developers with a new open source library compose-pay-button. Jetpack Compose is Android’s modern toolkit for building user interfaces when using the Kotlin language, and with this new library you can implement the Google Pay button in your Android apps with even less code than before.

Let's look at a quick example. Here you can see a typical Jetpack Compose UI, with the Google Pay button added. The button accepts a Jetpack Compose modifier for customization, and supports a variety of labels, in this case "Book with Google Pay".

setContent { Column() { PayButton( onClick = { println("Button clicked") }, allowedPaymentMethods = "<JSON serialized allowedPaymentMethods>", modifier = Modifier.width(300.dp), type = ButtonType.PAY_BOOK, ) } }


Google Wallet

Lastly, we've also released a corresponding library for Google Wallet, compose-wallet-button. The library provides a similar API to the Google Pay button, but instead bundles the same button assets available on the Google Wallet developer site, including both regular and condensed versions.

Image of the regular (left) and condensed (right) versions of the Google Wallet button
Figure 2: Both regular and condensed versions of the Google Wallet button are available in the new library.

Ready to get started? Check out the GitHub repositories for both compose-pay-button and compose-wallet-button where you can learn more about the libraries and how to add them to your Android apps!

Introducing the new Google Pay button view on Android

Posted by Jose Ugia – Developer Relations Engineer

The Google Pay button is your customer’s entry point to a swift and familiar checkout with Google Pay. Here are some updates we are bringing to the button to make it easier for you to use it and customize it based on your checkout design, while creating a more consistent and informative experience to help your customers fly through your checkout flows more easily.


A new look and enhanced customization capabilities

Previously, you told us about the importance of a consistent checkout experience for your business. We gave the Google Pay button a fresh new look, applying the latest Material 3 design principles. The new Google Pay button comes in two versions that make it look great on dark and light themed applications. We have also added a subtle stroke that makes the button stand out in low contrast interfaces. In addition, we are introducing new customization capabilities that make it easy to adjust the button shape and corner roundness and help you create more consistent checkout experiences.

image of the updated Pay with Google Pay button annotating the subtle stroke and adjustable rounded corners
Figure 1: The new Google Pay button view for Android can be customized to make it more consistent with your checkout experience.

A new button view for Android

We also improved the Google Pay API for Android, introducing a new button view that simplifies the integration. Now, you can configure the Google Pay button in a more familiar way and add it directly to your XML layout. You can also configure the button programmatically if you prefer. This view lets you configure properties like the button theme and corner radius, and includes graphics and translations so you don't have to download and configure them manually. Simply add the view to your interface, adjust it and that's it.

The new button API is available today in beta. Check out the updated tutorial for Android to start using the new button view.

image of an example implementation showing how you can add and configure the new button view directly to your XML layout on Android
Figure 2: An example implementation of how you can add and configure the new button view directly to your XML layout on Android.

Giving additional context to customers with cards’ last 4 digits

Earlier, we introduced the dynamic Google Pay button for Web, which previewed the card network and last four digits for the customer’s last used form of payment directly on the button. Since then, we have seen great results, with this additional context driving conversion improvements and increases of up to 40% in the number of transactions.

Later this quarter, you’ll be able to configure the new button view for Android to show your users additional information about the last card they used to complete a payment with Google Pay. We are also working to offer the Google Pay button as a UI element in Jetpack Compose, to help you build your UIs more rapidly using intuitive Kotlin APIs.

image showing an example of how the dynamic version of the new Google Pay button view will look on Android.
Figure 3: An example of how the dynamic version of the new Google Pay button view will look on Android.

Next steps

Check out the documentation to start using the new Google Pay button view on Android. Also, check out our own button integration in the sample open source application in GitHub.

Test your payments integrations end-to-end with the new test suite for Google Pay

Posted by Jose Ugia – Developer Relations Engineer

Testing is an integral part of software engineering, especially in the context of payments, where small glitches can have significant implications for your business. 

We previously introduced a set of test cards for you to use with the Google Pay API in TEST mode. These cards allow you to build simple test cases to verify that your Google Pay integration operates as expected. As much as this was a great start, a few predefined cards only let you run a limited number of happy path test scenarios, confined to the domain of your applications.

Improved testing capabilities

Today, we are introducing PSP test cards, an upgrade to Google Pay’s test suite that lets you use test cards from your favorite payment processors to build end-to-end test scenarios, enabling additional testing strategies, both manual and automated.

Image showing test cards in Google Pay TEST mode
Figure 1: Test cards from your payment processor appear in Google Pay’s payment sheet when using TEST mode.

When you select a card, the result is returned back to your application via the API, so you can use it to validate comprehensive payment flows end-to-end, including relaying payment information to your backend to complete the order with your processor. These test cards allow you to verify the behavior of your application against diverse payment outcomes, including successful and failed transactions due to fraud, declines, insufficient funds and more.

Test automation

This upgrade also supports test automation, so you can write end-to-end UI tests using familiar tools like UIAutomator and Espresso on Android, and include them in your CI/CD flows to further strengthen your checkout experiences.

The new generation of Google Pay’s test suite is currently in beta, with web support coming later this year. You’ll be able to use test cards on Android for 5 of the most widely used PSPs – Stripe, Adyen, Braintree, WorldPay and Checkout.com, and we’ll continue to add test cards from your favorite PSPs.

Next steps

Improved testing capabilities have been one of the most frequent requests from the developer community. From Google Pay, we are committed to providing you with the tools you need to harden your payment flows and improve your checkout performance.

Moving image showing automated test being run in the upgraded test suite
Figure 2: With the upgraded test suite you can run end-to-end automated tests for successful and failed payment flows.

Take a look at the documentation to start enhancing your payments tests. Also, check out the sample test suite in the Google Pay demo open source application.

When to step-up your Google Pay transactions as a PSP

Posted by Dominik Mengelt, Developer Relations Engineer, Google Pay and Nick Alteen, Technical Writer, Engineering, Wallet

What is step-up authentication?

When processing payments, step-up authentication (or simply “step-up”) is the practice of requiring additional authentication measures based on user activity and certain risk signals. For example, redirecting the user to 3D Secure to authenticate a transaction. This can help to reduce potential fraud and chargebacks. The following graphic shows the high-level flow of a transaction to determine what's to be done if step-up is needed.

graphic showing the high-level flow of a transaction
Figure 1: Trigger your Risk Engine before sending the transaction to authorization if step-up is needed

It depends! When making a transaction, the Google Pay API response will return one of the following:

  • An authenticated payload that can be processed without any further step-up or challenge. For example, when a user adds a payment card to Google Wallet. In this case, the user has already completed identity verification with their issuing bank.
  • A primary account number (PAN) that requires additional authentication measures, such as 3D Secure. For example, a user making a purchase with a payment card previously stored through Chrome Autofill.

You can use the allowedAuthMethods parameter to indicate which authentication methods you want to support for Google Pay transactions:

"allowedAuthMethods": [
    "CRYPTOGRAM_3DS",
    "PAN_ONLY"

]


In this case, you’re asking Google Pay to display the payment sheet for both types. For example, if the user selects a PAN_ONLY card (a card not tokenized, not enabled for contactless) from the payment sheet during checkout, step-up is needed. Let's have a look at two concrete scenarios:


In the first scenario, the Google Pay sheet shows a card previously added to Google Wallet. The card art and name of the user's issuing bank are displayed. If the user selects this card during the checkout process, no step-up is required because it would fall under the CRYPTOGRAM_3DS authentication method.

On the other hand, the sheet in the second scenario shows a generic card network icon. This indicates a PAN_ONLY authentication method and therefore needs step-up.

PAN_ONLY vs. CRYPTOGRAM_3DS

Whether or not you decide to accept both forms of payments is your decision. For CRYPTOGRAM_3DS, the Google Pay API additionally returns a cryptogram and, depending on the network, an eciIndicator. Make sure to use those properties when continuing with authorization.

PAN_ONLY

This authentication method is associated with payment cards from a user’s Google Account. Returned payment data includes the PAN with the expiration month and year.

CRYPTOGRAM_3DS

This authentication method is associated with cards stored as Android device tokens provided by the issuers. Returned payment data includes a cryptogram generated on the device.

When should you step-up Google Pay transactions?

When calling the loadPaymentData method, the Google Pay API will return an encrypted payment token (paymentData.paymentMethodData.tokenizationData.token). After decryption, the paymentMethodDetails object contains a property, assuranceDetails, which has the following format:

"assuranceDetails": {
    "cardHolderAuthenticated": true,
    "accountVerified": true
}

Depending on the values of cardHolderAuthenticated and accountVerified, step-up authentication may be required. The following table indicates the possible scenarios and when Google recommends step-up authentication for a transaction:

cardHolderAuthenticated

accountVerified

Step-up needed

true

true

No

false

true

Yes

Step-up can be skipped only when both cardHolderAuthenticated and accountVerified return true.

Next steps

If you are not using assuranceDetails yet, consider doing so now and make sure to step-uptransactions if needed. Also, make sure to check out our guide on Strong Customer Authentication (SCA) if you are processing payments within the European Economic Area (EEA). Follow @GooglePayDevs on Twitter for future updates. If you have questions, mention @GooglePayDevs and include #AskGooglePayDevs in your tweets.

4 ways to use Google Wallet around the world

When we launched Google Wallet earlier this year, we wanted to give as many people as possible access to a secure digital wallet. So today we’re bringing it to 12 more countries, making Wallet available in 57 countries total.

Text reads “Find Google Wallet in your corner of the world” and shows both a map and list of the 57 countries where Google Wallet is available.

We’ve already seen how handy it’s been in all the usual places you'd use a digital wallet — plus some others, like attending concerts with friends. Let’s look at four different ways you can use Google Wallet around the world.

  1. Make quick, secure payments from your watch: Last month we added Wallet to the Google Pixel Watch so you can easily make contactless payments. And starting today, anyone with a Fitbit Sense 2 or Versa 4 can pay with just a tap of their wrist.
  2. Tap and pay on public transit: If you’re one of the millions of people who commute by public transportation, you can use Wallet to tap and pay in hundreds of cities around the world. In Japan, we recently added support for PASMO on mobile devices and launched Suica on the Google Pixel Watch.
  3. Save mobile tickets for events and shows: We’re partnering with many companies — including Ticketmaster, Thaiticketmajor in Thailand, Cinemaxx in Germany and Ticketek, Humanitix and Oztix in Australia — so Android users can add mobile event tickets to their Wallet. My daughters are big Taylor Swift fans, so I’ll be trying out this feature for her tour next year.
  4. Access boarding passes: There’s so much to keep track of before a flight. So we partner with airlines like AirAsia, Air France, China Air, Ryanair and United Airlines to help travelers easily save and access their mobile boarding passes in Wallet. You can even save multiple boarding passes if you’re traveling with family or friends. Pro tip: To quickly add your boarding pass, just take a screenshot of it on your Pixel phone and tap “Add to Google Wallet.”

These are just some ways you can use Google Wallet throughout your day. As Wallet expands to more places around the world, look out for even more features to easily access what you need.

Manage your passes from Google Pay and Wallet Console

Posted by Ryan Novas, Product Manager, Google Pay’s Business Console and Jose Ugia, Developer Relations Engineer, Google Pay

Author Picture

Today, we are introducing the Google Pay & Wallet Console, a platform that helps developers discover, integrate with, and manage Google Pay and Google Wallet features for their businesses. Integrating Google Pay and Google Wallet products has become easier and faster, with features like a common business profile and a unified dashboard. Check out the new Google Wallet section in the console’s left-hand navigation bar, where you can manage all your tickets, loyalty programs, offers and other passes resources from one place. Google Pay & Wallet Console features a more familiar and intuitive user interface that helps you reuse common bits of information, like your business information, and lets you easily browse and discover products, such as the Online API.

The new Google Wallet section in Google Pay & Wallet Console lets you request access to the API and manage your passes alongside other Google Pay and Google Wallet resources.


You can also manage authentication keys for your Smart Tap integration directly from the console, and let customers use eligible passes saved to Google Pay by simply holding their phones to NFC point-of-sale terminals.

Visit Google Pay & Wallet Console today, and start managing your existing products, or discover and integrate with new ones.

Here is what early users are saying about managing passes in the console:

“The cleaner and consistent look of Google Pay & Wallet Console helps us manage our Google Pay and Google Wallet resources more intuitively." Or Maoz, Senior Director of R&D at EngagedMedia said.

The user management additions also helped EngagedMedia better represent their team in the console:

“The new user roles and controls on Google Pay & Wallet Console help us handle permissions more intuitively and accurately, and allow us to assign roles that better reflect our team structure more easily.”

We are committed to continuously evolving Google Pay & Wallet Console to make it your go-to place to discover and manage Google Pay and Google Wallet integrations. We’d love to hear about your experience. You can share feedback with us from the “Feedback” section in the console. We’re looking forward to learning how we can make Google Pay and Google Wallet even more helpful for you in the future.

Learn more

Want to learn more?