How to implement Google Pay merchant-initiated transactions

By Google for Developers

Share:

Key Concepts

  • Merchant-Initiated Transactions (MITs): Payments triggered by the merchant rather than the user, covering scenarios like subscriptions or automatic top-ups.
  • DPAN (Device Primary Account Number): A tokenized version of the user's card used for secure transactions.
  • Merchant Token ID: A unique identifier provided by Google Pay to link specific payment tokens to a merchant’s backend for lifecycle management.
  • Lifecycle Notifications: Alerts sent to integrators when underlying payment credentials change (e.g., card removal from Google Wallet).
  • Backwards Compatibility: The design principle ensuring new API features do not break existing implementations.

1. Overview of Merchant-Initiated Transactions (MITs)

Google Pay has expanded its API to support three primary MIT use cases:

  • Automatic Reloads: Triggering payments when a balance falls below a threshold.
  • Deferred Transactions: Handling payments for goods or services delivered at a later date.
  • Recurring Transactions: Managing subscription-based billing.

A significant upcoming update will introduce tokens not bound to a specific customer device, ensuring payment continuity even if a user switches devices or modifies their Google Wallet.

2. The Technical Workflow

The integration process follows a specific sequence to ensure secure token handling:

  1. Selection: The user selects a card on the Google Pay payment sheet.
  2. Payload Generation: Google Pay returns a DPAN and a Merchant Token ID within an encrypted payload.
  3. Integration: This payload is sent to the integrator (typically a Payment Service Provider - PSP).
  4. Storage: The PSP stores the Merchant Token ID alongside the user's payment credentials.
  5. Lifecycle Management: If the user modifies their card in Google Wallet, Google sends a lifecycle notification to the integrator using the Merchant Token ID, allowing the integrator to prompt the user to update their payment method.

3. API Implementation and Framework

The Google Pay API has been updated to include three new objects within the TransactionInfo structure. These are designed to be backwards compatible with the existing TransactionInfo object:

  • RecurringTransactionInfo
  • DeferredTransactionInfo
  • AutomaticReloadTransactionInfo

Example: Recurring Transaction Setup To implement a recurring payment (e.g., $9.99/month), the developer must:

  • Utilize the RecurringTransactionInfo object.
  • Define a RecurrenceItem specifying the recurrencePeriod and recurrencePeriodCount.
  • Set the label and the billingInitialDateTime.

Once configured, the Google Pay sheet dynamically updates to display the specific terms of the recurring transaction to the user.

4. Key Perspectives and Responsibilities

  • Role of the PSP: Dominik Mengelt emphasizes that lifecycle notifications are primarily handled by Payment Service Providers rather than the merchants themselves. The PSP acts as the intermediary responsible for reacting to credential changes.
  • Developer Experience: The update aims to reduce friction in the checkout experience by automating the handling of payment continuity.
  • Community Support: Developers are encouraged to join the official Google Pay and Wallet developer community on Discord to discuss MITs and other payment-related topics.

5. Synthesis and Conclusion

The introduction of MIT support in Google Pay represents a significant shift toward more robust, long-term payment relationships between merchants and users. By providing a standardized way to handle recurring, deferred, and automatic reload transactions—coupled with a lifecycle notification system—Google Pay enables a more seamless checkout experience. The framework relies on the secure exchange of Merchant Token IDs, allowing PSPs to maintain payment continuity even when user credentials change. Developers are advised to consult the updated API reference for specific parameter requirements and prepare for the upcoming second part of this series, which will detail the mechanics of lifecycle notifications.

Chat with this Video

AI-Powered

Hi! I can answer questions about this video "How to implement Google Pay merchant-initiated transactions". What would you like to know?

Chat is based on the transcript of this video and may not be 100% accurate.

Related Videos

Ready to summarize another video?

Summarize YouTube Video