Skip to content

mateuszorzechowski/smart-tap-sample-app

 
 

Repository files navigation

Google Wallet Smart Tap sample app

The Smart Tap sample app is a simple Android application that invokes the get smart tap data flow with the Smart Tap 2.1 protocol. The app reads the smartTapRedemptionValue property of a Google Wallet pass object stored on an Android-powered device. This includes the cryptographic operations needed to authenticate the terminal and decrypt the payload.

For more information on the different data flows, see Data flow.

Prerequisites

You will need two different Android-powered devices to test the sample app. The devices are listed below for reference.

  • Terminal device: On this device, you will install the sample app
  • User device: On this device, you will add a sample pass to the Google Wallet app
    • Make sure the device supports NFC (see this support article for additional troubleshooting tips)

You will also need the latest version of Android Studio on your local workstation.

About the sample app

This application contains the needed configuration to retrieve the demo pass added to the user device:

  • Private key
  • Key version
  • Collector ID

User device setup

On the user device, open the following link to add the demo loyalty pass to the Google Wallet app:

Demo pass Add to Google Wallet link

Run the sample app

  1. Clone this repository
  2. Open Android Studio and import the repository folder
  3. Connect your terminal device for debugging (for instructions on how to do so, see the Android Studio documentation)
  4. Run the sample app in debugging mode on the terminal device
  5. Gently tap the user device to the terminal device
    • The tap location may depend on the location of the NFC antenna on each device, so you may need to try tapping in several different locations

Once the devices connect via NFC, the terminal device will display the flow of Smart Tap commands and responses, as well as the decrypted payload (2018). This is the value stored in the pass object's smartTapRedemptionValue property. The user device will show that the pass was successfully transmitted to the terminal device.

Note: If you would like to inspect the flow further, set several breakpoints at different locations in the sample terminal app and restart debugging.

Support

Feel free to submit an issue to this repository with any questions.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%