Tag Archives: google-wallet

Google Pay – Enabling liability shift for eligible Visa device token transactions globally

Posted by Dominik Mengelt– Developer Relations Engineer, Payments and Florin Modrea - Product Solutions Engineer, Google Pay

We are excited to announce the general availability [1] of liability shift for Visa device tokens for Google Pay.

For Mastercard device tokens the liability already lies with the issuing bank, whereas, for Visa, only eligible device tokens with issuing banks in the European region benefit from liability shift.


What is liability shift?

If liability shift is granted for a transaction, the responsibility of covering the losses from fraudulent transactions is moving from the merchant to the issuing bank. With this change, qualifying Google Pay Visa transactions done with a device token will benefit from this liability shift.


How to know if the liability was shifted to the issuing bank for my transaction?

Eligible Visa transactions will carry an eciIndicator value of 05. PSPs can access the eciIndicator value after decrypting the payment method token. Merchants can check with their PSPs to get a report on liability shift eligible transactions.

   {
    "gatewayMerchantId": "some-merchant-id",
    "messageExpiration": "1561533871082",
    "messageId": "AH2Ejtc8qBlP_MCAV0jJG7Er",
    "paymentMethod": "CARD",
    "paymentMethodDetails": {
        "expirationYear": 2028,
        "expirationMonth": 12,
        "pan": "4895370012003478",
        "authMethod": "CRYPTOGRAM_3DS",
        "eciIndicator": "05",
        "cryptogram": "AgAAAAAABk4DWZ4C28yUQAAAAAA="
    }
  }
A decrypted payment token for a Google Pay Visa transaction with an eciIndicator value of 05 (liability shifted)

Check out the following table for a full list of eciIndicator values we return for our Visa and Mastercard device token transactions:

 eciIndicator value

 Card Network

 Liable Party

 authMethod

 "" (empty)

 Mastercard

 Merchant/Acquirer

 CRYPTOGRAM_3DS

 "02"

 Mastercard

 Card issuer

 CRYPTOGRAM_3DS

 "06"

 Mastercard

 Merchant/Acquirer

 CRYPTOGRAM_3DS

 "05"

 Visa

 Card issuer

 CRYPTOGRAM_3DS

 "07"

 Visa

 Merchant/Acquirer

 CRYPTOGRAM_3DS

 "" (empty)

 Other networks

 Merchant/Acquirer

 CRYPTOGRAM_3DS

Any other eciIndicator values for VISA and Mastercard that aren't present in this table won't be returned.


How to enroll

Merchants may opt-in from within the Google Pay & Wallet console starting this month. Merchants in Europe (already benefiting from liability shift) do not need to take any actions as they will be auto enrolled.

In order for your Google Pay transaction to qualify for enabling liability shift, the following API parameters are required:

totalPrice

Make sure that totalPrice matches with the amount that you use to charge the user. Transactions with totalPrice=0 will not qualify for liability shift to the issuing bank.

totalPriceStatus

Valid values are: FINAL or ESTIMATED

Transactions with the totalPriceStatus value of NOT_CURRENTLY_KNOWN do not qualify for liability shift.

Not all transactions get liability shift


Ineligible merchants

In the US, the following MCC codes are excluded from getting liability shift:

4829

Money Transfer

5967

Direct Marketing – Inbound Teleservices Merchant

6051

Non-Financial Institutions – Foreign Currency, Non-Fiat Currency (for example: Cryptocurrency), Money Orders (Not Money Transfer), Account Funding (not Stored Value Load), Travelers Cheques, and Debt Repayment

6540

Non-Financial Institutions – Stored Value Card Purchase/Load

7801

Government Licensed On-Line Casinos (On-Line Gambling) (US Region only)

7802

Government-Licensed Horse/Dog Racing (US Region only)

7995

Betting, including Lottery Tickets, Casino Gaming Chips, Off-Track Betting, Wagers at Race Tracks and games of chance to win prizes of monetary value


Ineligible transactions

In order for your Google Pay transactions to qualify for liability shift, make sure to include the above mentioned parameters totalPrice and totalPriceStatus. Transactions with totalPrice=0 or a hard coded totalPrice (always the same amount but the users get charged a different amount) will not qualify for liability shift.

Processing transactions

Google Pay API transactions with Visa device tokens are qualified for liability shift at facilitation time if all the conditions are met, but a transaction qualified for liability shift can be downgraded by network during transaction authorization processing.


Getting started with Google Pay

Not yet using Google Pay? Refer to the documentation to start integrating Google Pay today. Learn more about the integration by taking a look at our sample application for Android on GitHub or use one of our button components for your web integration. When you are ready, head over to the Google Pay & Wallet console and submit your integration for production access.

Follow @GooglePayDevs on X (formerly Twitter) for future updates. If you have questions, tag @GooglePayDevs and include #AskGooglePayDevs in your tweets.


[1] For merchants and PSPs using dynamic price updates or other callback mechanisms the Visa device token liability shift changes will be rolled out later this year.

What’s new in Google Wallet

Posted by Jose Ugia – Developer Relations Engineer

During Google I/O 2023, and in our recent blog post, we shared some new pass types and features we’re adding to Google Wallet and discussed how you can use them to build and protect your passes more easily, and enhance the experience for your customers.

Read on for a summary of what we covered during the event, or check out the recording of our session on YouTube: What's new in Google Pay and Google Wallet.


Secure pass information with private passes

We’re glad to expand Generic Passes, adding support for sensitive data with the new generic private pass API. Generic private passes on Google Wallet are one more way we’re protecting users’ information, keeping their sensitive digital items safe. These types of passes require you to verify it’s you to view private passes. To do that, they can use the fingerprint sensor, a passcode, or other authentication methods. This is helpful when you create a pass with sensitive information, for example in the healthcare industry.

The Google Wallet Developer Documentation contains detailed steps to help you add a private pass to Google Wallet.

image showing the definition for a private pass in JSON format.
Figure 1: The definition for a private pass in JSON format.

Enable fast pass development with Demo Mode

With Demo mode, you can go to the Google Pay & Wallet Console, sign up for API access, and integrate it with your code immediately after following the prerequisites available in the Google Wallet developer documentation.

When you sign up for a Google Wallet Issuer account for the first time, your account is automatically in Demo Mode. Demo mode includes the same features and functionality as publishing mode. To better differentiate between the demo and publish environments, passes created by issuers in Demo Mode contain visual elements to indicate their test nature. This distinction is removed when the issuer is approved to operate in publishing mode.

When you’re done with your tests and you’re ready to start issuing passes to your users, complete your business information and request publishing access from the Wallet API section in the console. Our console team will get in touch via email with additional instructions.

image illustrating Demo Mode in Google Pay & Wallet console.
Figure 2: Demo Mode in Google Pay & Wallet console.

Enhance security with rotating barcodes and Account-restricted passes

We are increasing the security of your passes with the introduction of a new API to rotate barcodes. With rotating barcodes you can pre-create a batch of barcodes and sync them with Google Wallet. The barcodes you create will rotate at a predefined interval and will be shown and updated in your user’s wallet. Rotating barcodes enable a range of use cases where issuers need to protect their passes, such as long duration transit tickets, events tickets, and more.

We’ve also announced Account Restricted passes, a new feature that lets issuers associate some pass objects with Google accounts. To use this feature, simply include the user’s email address in the pass object when you issue the pass. This triggers an additional check when a user attempts to add the pass to Google Wallet, which only succeeds if the email address specified in the pass matches the account of the currently logged-in user. Account Restricted passes let you protect your passes from theft, reselling, transfer or other restricted uses.

Design your passes using the pass builder

Making your passes consistent with your brand and design guidelines is a process that requires becoming acquainted with the Google Wallet API. During last year’s Google I/O, we introduced a dynamic template that accepts configuration to generate an approximate preview of your pass.

This year, we introduced the new generation of this tool, and graduate it into a fully functional pass builder. You can now configure and style your passes using a real-time preview to help you understand how passes are styled, and connect each visual element with their respective property in the API. The new pass builder also generates classes and objects in JSON format that you can use to make calls directly against the API, making it easier to configure your passes and removing the visual uncertainty of working with text-based configuration to style your passes. The new pass builder is available today for generic passes, tickets and pass types under retail.

image showing a demo of the new pass builder for the Google Wallet API.
Figure 3: A demo of the new pass builder for the Google Wallet API.

Get started with the Google Wallet API

Take a look at the documentation to start integrating Google Wallet today.

Learn more about the integration by taking a look at our sample source application in GitHub.

When you are ready, head over to the Google Pay & Wallet console and submit your integration for production access.

What’s next?

Shortly after Google I/O we announced 5 new ways to add more to Google Wallet. One of them is to save your ID to Google Wallet. And soon, you’ll be able to accept IDs from Google Wallet to securely and seamlessly verify a person's information. Some use cases include:

  • Age Verification: Request age to verify before purchasing age-restricted items or access to age-restricted venues.
  • Identity Verification: Request name to verify the person associated with an account.
  • Driving Privileges: Verify a person's ability to drive (e.g. when renting a car).

If you’re interested in using Google Wallet's in-app verification APIs, please fill out this form.

What’s new in Google Pay

Posted by Jose Ugia – Developer Relations Engineer

During Google I/O 2023, we shared some of the new features we’re adding to Google Pay and discussed how you can use them to simplify and strengthen your integrations, and add value to your customers making payments in your application or website.

Read on for a summary of what we covered during the event, or check out the recording of our session on YouTube: What's new in Google Pay and Google Wallet.


Liability shift on eligible transactions with Google Pay

Google Pay is expanding its zero fraud liability protection on Android devices for eligible transactions leveraging leading payment network security capabilities. Before today, online payments made with a Mastercard were guaranteed by this protection. Today, we are announcing that we are expanding this benefit by rolling out merchant liability protection to eligible Visa online transactions that are made using Google Pay.

In addition, we're making it easy to verify and add forms of payments to Google Pay. As just one example, Google Pay has added support for card authentication both before and after a payment transaction. Google Pay users are now able to verify their saved card via an OTP code or their banking app which creates a device-bound token that supports secure and seamless transactions both online and offline.


Reduce fraud with Google Pay

As part of our mission to help you reduce fraud and improve authorization rates without increasing user friction, we're actively working on a new service — Secure Payment Authentication, a service built to help with risk and compliance based authentication needs. This service can be used for eligible payment transactions that require additional verification, and use secure and high performing device bound tokens to meet two-factor authentication.

We are using this opportunity to engage with businesses like you as part of an early access program, to understand how it can help you boost authorization performance. If fraud is a challenge for your business today, contact us to tailor your authentication strategy with Secure Payment Authentication.

Image illustrating authentication flow using Secure Payment Authentication
Figure 1: Example authentication flow using Secure Payment Authentication.

The new dynamic button

We are giving 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 both dark and light themed applications.

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

We're also introducing a new button view that simplifies the integration on Android. This view lets you configure properties like the button theme and corner radius directly in your XML layout. The new button API is available today in beta. Check out the updated tutorial for Android to start using the new button view today.

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.

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

An improved test suite with payment service provider cards

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. With this upgrade, you’ll now see specific test cards from your processor populate in Google Pay’s payment sheet, enabling additional testing strategies, both manual and automated.

Image of a test card in Google Pay’s payment sheet in TEST mode
Figure 4: Test cards from your payment processor appear in Google Pay’s payment sheet when using TEST mode.

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.


Virtual cards, autofill and more

Last year we introduced virtual cards on Android and Chrome. Since then, we’ve seen great adoption, providing secure and frictionless online checkout experiences for millions of users. Customers using virtual cards have enjoyed faster checkouts, reported less fraudulent spend, and made online transactions that were declined less often.

Autofill is receiving visual improvements to reduce checkout friction, and will soon let your customers complete payment flows using bank accounts in Europe. For developers using autofill, we are introducing recommendations in Chrome DevTools to help you improve checkout performance. We are also improving autofill to better fill forms across frames, helping you facilitate payments more securely.

Check out the Google I/O keynote for Google Pay and Google Wallet to learn more.


What’s ahead

We are determined to grow the number of verified forms of payment across the Google ecosystem, and continue to push for simple, helpful, and secure online payments, offering you a way to empower other businesses, and accelerate that change for consumers.

Later this quarter, you’ll be able to configure the new button view in your Android applications, to show your users additional information about the last card they used to complete a payment with Google Pay. We are also working on bringing the same customization capabilities announced for Android to your websites later this year.


Get started with Google Pay

Take a look at the documentation to start integrating Google Pay today.

Learn more about the integration by taking a look at our sample source application in GitHub.

When you are ready, head over to the Google Pay & Wallet console and submit your integration for production access.

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!

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!

Enable fast pass development with Google Wallet demo mode

Posted by Google Pay Developers team

What is demo mode?

We want to make it easier for you to develop and test Google Wallet passes so that you can create new, engaging experiences for your customers. Today, you can sign up in the Google Pay & Wallet Console and start using the Google Wallet API immediately in “demo mode.”

When you sign up for a Google Wallet Issuer account for the first time, your account will be in demo mode. Demo mode includes the same features and functionality as publishing mode. However, access to issue Google Wallet passes to users is restricted to any “test users” you add in the console. While in demo mode, any user who is not included in your list of test users will not be able to add a pass you create to their Google Wallet app. By default, all administrators and developers who have access to your Issuer account are already test users. The passes created by issuers in demo mode will contain the text “[TEST ONLY]” in the top of the pass until the issuer is approved to be in publishing mode.

While in demo mode, you can do any of the following:

When you are in the Google Pay & Wallet Console, you will see two different indicators that your Issuer account is in demo mode.

On the Dashboard page, the Google Wallet API integration card will include a Demo mode tag.
Google Wallet API integration card on the console dashboard
Figure 1 - The Google Wallet API integration card on the console dashboard

On the Google Wallet API page, on the Manage tab, you will see a larger notice stating “You’re in demo mode,” along with additional information and a link to learn more.
The demo mode notice on the Google Wallet API console page
Figure 2 - The demo mode notice on the Google Wallet API console page

How can developers use the Google Wallet API?

It’s simple! Just follow the below steps and you’ll have access to your issuer account in demo.

  1. Create a business in the Google Pay & Wallet Console
  2. Select Google Wallet API
  3. Select Build your first pass
  4. Agree to the Google Wallet API Terms of Service

Some additional steps differ depending on whether you use the Android SDK or Web API. Please refer to the Google Wallet Developer Documentation for these other steps. After you’ve completed the steps, you’ll be ready to create your own classes and issue passes to your test users.

How does demo mode affect new and existing accounts?

If you have an existing account and have requested publishing access by submitting a support request, no changes are required on your end. Your Issuer account is already in publishing mode and this will be reflected in the console.

For new accounts, this will depend on two factors:

  • The user or service account is associated with an existing Issuer account
  • The new account is being created using the issuer.insert method or the Google Pay & Wallet Console

No existing account

Existing account
(demo mode)
Existing account
(publishing mode)
ConsoleDemo mode

Demo modePublishing mode

issuer.insert

Request fails*

Request fails*

Publishing mode

*Note - Issuer accounts in demo mode are unable to create additional accounts using the issuer.insert method.

How are test users managed?

To add and/or remove test users without granting them access to your Issuer account, follow the below steps:

  1. Navigate to the Google Pay & Wallet Console
  2. Select Google Wallet API
  3. In the Manage tab, select Set up test accounts
  4. Add each test user’s Google Account email address on a separate line
Select Update testers
The test accounts window
Figure 3 - The test accounts window where you can add test users

How do developers go to publishing mode?

When you’re ready to go to start issuing passes to real users, you will need to complete the following before you are able to request publishing access:

  • Create at least one pass class
  • Complete your business profile
Once complete, you can submit the publishing access request form. A Google contact will reach out to you requesting screenshots of the pass classes and objects you are creating to ensure they adhere to our brand guidelines and acceptable use policy. This can take up to two business days to process. You will be notified by email when your request is approved, and your Issuer account will be converted to publishing mode. The status of your pass classes will not change, and any pass classes that are in APPROVED state will be available for issuing pass objects to users.

Next steps

Try creating a Generic pass class and object by following the Web or Android codelabs! In these codelabs, you will have the option to create a new Issuer account and try out demo mode. Follow @GooglePayDevs on Twitter for future updates. If you have questions, tag @GooglePayDevs and include #AskGooglePayDevs in your tweets.

Introducing the Google Wallet API

Posted by Petra Cross, Engineer, Google Wallet and Jose Ugia, Google Developer Relations Engineer

Google Pay API for Passes is now called Google Wallet API

Formerly known as Google Pay API for Passes, the Google Wallet API lets you digitize everything from boarding passes to loyalty programs, and engage your customers with notifications and real-time updates.

New features in Google Wallet API

Support for Generic Pass Type

The Google Pay API for Passes supported 7 types of passes: offers, loyalty cards, gift cards, event tickets, boarding passes, transit tickets and vaccine cards. But what if you want to issue passes or cards that do not fit into any of these categories, such as membership cards, or insurance cards?

We are thrilled to announce support for generic passes to the Google Wallet API so you can customize your pass objects to adapt to your program characteristics. The options are endless. If it is a card and has some text, a barcode or a QR code, it can be saved as a generic card.

You now have the flexibility to control the look and design of the card itself, by providing a card template that can contain up to 3 rows with 1-3 fields per row. You can also configure a number of attributes such as the barcode, QR code, or a hero image. Check out our documentation to learn more about how to create generic passes.

While generic passes can be used to mimic the appearance of any existing supported pass type (such as a loyalty card), we recommend you to continue to use specialized pass types when available. For example, when you use the boarding pass type for boarding passes your users receive flight delay notifications.

Grouping passes and mixing pass types

With the new Google Wallet API, you can also group passes to offer a better experience to your users when multiple passes are needed. For example, you can group the entry ticket, a parking pass, and food vouchers for a concert.

In your user’s list of passes, your users see a pass tile with a badge showing the number of items in the group. When they tap on this tile, a carousel with all passes appears, allowing them to easily swipe between all passes in the group.


Here is an example JSON Web Token payload showing one offer and one event ticket, mixed together and sharing the same groupingId. Later, if you need to add or remove passes to/from the group, you can use the REST API to update the grouping information.

{

  "iss""OWNER_EMAIL_ADDRESS",

  "aud""google",

  "typ""savetowallet",

  "iat""UNIX_TIME",

  "origins": [],

  "payload": {

    "offerObjects": [

      {

        "classId""YOUR_ISSUER_ID.OFFER_CLASS_ID",

        "id""YOUR_ISSUER_ID.OFFER_ID",

        "groupingInfo": {

          "groupingId""groupId1",

          "sortIndex"2

        }

      }

    ],

    "eventTicketObjects": [

      {

        "classId""YOUR_ISSUER_ID.EVENT_CLASS_ID",

        "id""YOUR_ISSUER_ID.EVENT_ID",

        "groupingInfo": {

          "groupingId""groupId1",

          "sortIndex"1

        }

      }

    ] 

  }

}


A note about Google Pay API for Passes:

Although we are introducing the Google Wallet API, all existing developer integrations with the previous Google Pay Passes API will continue to work. When the Google Wallet app is launched in just a few weeks, make sure to use the new “Add to Google Wallet” button in the updated button guidelines.

We’re really excited to build a great digital wallet experience with you, and can’t wait to see how you use the Google Wallet API to enhance your user experience.

Learn more

Simpler Google Wallet integration for Android developers

Posted by Petra Cross, Engineer, Google Wallet and Jose Ugia, Google Developer Relations Engineer

Today more than ever, consumers expect to be able to digitize their physical wallet, from payments and loyalty to tickets and IDs. At Google I/O we announced Google Wallet, which allows users to do exactly that. Consumers can securely store and manage their payment and loyalty cards, board a flight, access a gym and much more, all with just their Android phone.

For Android developers, who manage their own digital passes, Google Wallet offers a fast and secure entry point, especially when quick access is needed. Google Wallet will be quickly accessible from the device lock screen on Pixel devices and from the pulldown shade. Your users will be able to quickly access their passes when they need them - all in one place.

Integrating with Google Wallet became even easier and more flexible. We’ve summarized the news of what you can expect as an Android developer.

New Android SDK

The existing Android SDK supports saving three types of passes: offers, loyalty cards, and gift cards. You asked us to add support for other pass types, and we’ve heard you. Today, we are announcing a new, more extensible API and Android SDK, that in addition to tickets, boarding passes, and transit tickets, and additional pass types, includes support for the new generic pass, which lets your users store any pass or card to Google Wallet. The Android SDK lets you create passes using JSON or JSON Web Token as a payload without a backend integration.

Using the Android SDK is straightforward. First, you create a payload with information about the pass. You can either build it directly in your Android app, or retrieve it from your backend stack. Then, you call the savePasses or savePassesJwt method in the "PayClient" to add the pass to Google Wallet.

Here is how you define and save a sample generic pass object:

{

  "id""ISSUER_ID.OBJECT_ID",

  "classId""CLASS_ID",

  "genericType""GENERIC_TYPE_UNSPECIFIED",

  "cardTitle": {

    "defaultValue": {

      "language""en",

      "value""Your Program Name"

    }

  },

  "header": {

    "defaultValue": {

      "language""en",

      "value""Alex McJacobs"

    }

  }

}


private val addToGoogleWalletRequestCode = 1000

private val walletClientPayClient = Pay.getClient(application)

private val jwtString = "" // Fetch a previously created JWT with pass data

walletClient.savePassesJwt(jwtString, thisaddToGoogleWalletRequestCode)

Once your app calls savePassesJwt, the process guides your users through the flow of adding a pass to Google Wallet, and allows them to preview the pass before confirming the save operation.

Developer documentation, samples and codelabs

You can find the new Wallet API documentation on developers.google.com/wallet. We customized our developer guides for each pass type to make all the information easily accessible for your specific needs. You will also find plenty of code samples demonstrating how to check for availability of the Google Wallet API on the Android device, how to handle errors, and how to add the “Add to Google Wallet” button to your app.

Don’t forget to play with our interactive passes visual demo, which lets you fill in the fields and create your own custom pass prototype without writing a single line of code. The tool also generates code samples that you can use to build this pass’ data structures which we call “classes” and “objects”.

We’re really excited to build a great digital wallet experience with you, and can’t wait to see how you use the Google Wallet API to enrich your customer experience. Take a look at our hands-on workshop "Digitize any wallet object with the Google Wallet API" to see a full integration tutorial on Android.

Learn more