Google Pay – Push Provisioning
The Nium Push Pay SDK supports in-app push provisioning, allowing eligible cardholders to add their cards to Google Wallet without manually entering card details. Your Android application manages the user experience while the SDK supports the provisioning integration.
This guide covers Android SDK installation, configuration, checking whether cards have already been provisioned, and initiating provisioning.
Before you begin
- Obtain the approved Nium Android SDK distribution and integration instructions from your Nium representative.
- Use an AndroidX project. The existing SDK documentation specifies Android API level 21 or later and Java 8 or Kotlin; confirm current SDK compatibility before release.
- Confirm card and program eligibility for Google Wallet push provisioning, along with any required app or wallet configuration.
- Confirm the SDK's authentication model before integrating credentials into your application.
The existing SDK interface lists an apiSecret initialization parameter. Do not embed a confidential server-side API secret in an Android application. Confirm with Nium Engineering whether this parameter represents a mobile-safe credential or requires a different authentication flow.
Step 1: Add the Android SDK
The existing integration instructions specify the following AAR files in the application's app/libs directory:
NiumPushPay_SDK.aarplay-services-tapandpay-17.0.1.aar
The original instructions show this repository configuration:
allprojects {
repositories {
flatDir {
dirs 'libs'
}
}
}
And these application-level dependencies:
implementation(name: 'NiumPushPaySDK', ext: 'aar')
implementation(name: 'play-services-tapandpay-17.0.1', ext: 'aar')
The supplied SDK filename (NiumPushPay_SDK.aar) differs from the dependency name (NiumPushPaySDK). Also, flatDir paths depend on the Gradle project where they are declared. Confirm the correct artifact names, directory paths, dependency versions, and repository configuration with Nium Engineering before copying this example into a production project. Modern Gradle projects may manage repositories in settings.gradle rather than the root build.gradle.
Step 2: Initialize the SDK
The existing SDK documentation specifies the following initialization parameters:
initialize(application, clientHashId, customerHashId, walletHashId, apiSecret)
The parameters are:
| Parameter | Description |
|---|---|
application | Android application context or application object, as required by the SDK. |
clientHashId | Nium client identifier. |
customerHashId | Nium customer identifier. |
walletHashId | Nium wallet identifier. |
apiSecret | SDK credential parameter; confirm its permitted use in a mobile application. |
Use NiumPushPay.getInstance() to access the initialized SDK instance, as described in the existing integration instructions.
Forward activity results
The supplied integration uses onActivityResult in the activity that initializes the SDK:
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
NiumPushPay.getInstance().onActivityResult(requestCode, resultCode, data)
}
Confirm the required initialization call, lifecycle integration, and whether onActivityResult is still required for the SDK version distributed to your team. The Android Activity Result API is the modern platform pattern, but the SDK may require this legacy callback.
Step 3: Check whether a single card is already provisioned
Call checkIfCardIsAddedToWallet(cardHashId, CardResultListener) to check the card's provisioning status before showing an Add to Google Wallet action.
NiumPushPay.getInstance().checkIfCardIsAddedToWallet(
CARD_HASH_ID,
object : CardResultListener {
override fun onCardStatusSuccess(isCardAddedToWallet: Boolean) {
// Hide or disable the Add to Google Wallet action if already provisioned.
addToWalletButton.isEnabled = !isCardAddedToWallet
}
override fun onCardStatusFailure(errorEntity: ErrorEntity) {
// Show an appropriate error and allow the cardholder to retry.
Toast.makeText(context, errorEntity.errMsg, Toast.LENGTH_SHORT).show()
}
}
)
The addToWalletButton variable above represents your application's button and is illustrative; it is not an SDK-provided control.
Step 4: Check provisioning status for multiple cards
Use getCards(CardListResultListener) to retrieve provisioning status information for multiple cards.
NiumPushPay.getInstance().getCards(object : CardListResultListener {
override fun onCardStatusSuccess(cardResultEntity: List<CardResultEntity>) {
// Update the corresponding card UI using each returned card's status.
// Confirm CardResultEntity field names with the SDK documentation.
}
override fun onCardStatusFailure(errorEntity: ErrorEntity) {
Toast.makeText(context, errorEntity.errMsg, Toast.LENGTH_SHORT).show()
}
})
Do not assume every card has the same provisioning status. Use the status returned for each card to control its corresponding action.
Step 5: Add a card to Google Wallet
Call the documented addToWallet method with the card hash ID and a PushProvisioningListener.
NiumPushPay.getInstance().addToWallet(
cardHashId,
object : PushProvisioningListener {
override fun onPushProvisioningSuccess(tokenId: String, cardHashId: String) {
Toast.makeText(context, "Card added to wallet", Toast.LENGTH_SHORT).show()
// Refresh the card's provisioning status in your UI.
}
override fun onPushProvisioningFailure(errorEntity: ErrorEntity) {
Toast.makeText(context, errorEntity.errMsg, Toast.LENGTH_SHORT).show()
}
}
)
The SDK callback reports whether provisioning succeeded or failed. After success, refresh the provisioning status so the application no longer offers an unnecessary Add to Google Wallet action.
Testing and troubleshooting
Before releasing your integration, verify:
- The SDK initializes successfully using the approved authentication flow.
- An eligible, unprovisioned card can be added to Google Wallet.
- Already-provisioned cards are handled appropriately.
- Provisioning errors and cancellations produce a clear user experience.
- The app correctly handles activity lifecycle events and provisioning callbacks.
- SDK and Google Wallet availability are validated on supported test devices.
The supplied documentation does not specify SDK initialization code, current SDK/AAR versions, supported error codes, or the full Google Wallet eligibility and test-environment requirements. Obtain these details from Nium before treating the examples as production-ready.