How to implement Google Pay merchant-initiated transactions

How to implement Google Pay merchant-initiated transactions

Google for Developers

0:00 DOMINIK MENGELT: Hello, developer.

0:01 Do you remember the video where I

0:03 talked about recurring transactions with Google Pay?

0:07 Well, I have some fantastic news, the Google Pay Sheet now

0:11 supports various merchant-initiated transactions use cases.

0:15 These include automatic reloads, deferred, and recurring transactions.

0:20 This is part one out of two, where I'm going to introduce you

0:24 to merchant-initiated transactions with Google Pay.

0:27 [MUSIC PLAYING] With this feature, you can receive payment tokens, including,

0:35 with a later release, tokens not bound to a customer-specific device.

0:41 This will ensure payment continuity and prevent interruptions,

0:45 even when a customer switches their device

0:48 in the future or modifies their Wallet.

0:52 Finally, you will be able to receive lifecycle notifications

0:55 for Google Pay payment tokens for underlying credential changes.

1:00 Details on how you can receive lifecycle

1:03 notifications will be discussed in part two.

1:06 First, let's have a look at the high-level

1:08 flow on how to set up merchant-initiated transactions,

1:12 and at a later stage, receive lifecycle notifications.

1:16 So a user selects a card on the payment sheet, and Google Pay returns a DPAN

1:21 and a merchant token ID within an encrypted payload.

1:26 This payload then gets sent over to the integrator.

1:29 In most cases, this is a payment service provider.

1:32 The payment service provider stores the merchant

1:35 token ID alongside existing payment credentials.

1:39 At a later stage, when the underlying payment credentials change,

1:42 for example, if the user removes their card from Google Wallet,

1:46 Google sends an update lifecycle notification

1:49 to the integrator with the merchant token ID.

1:52 The integrator can now react to this notification.

1:56 One possible way to do this would be to send

1:59 an email to the user to update their payment method.

2:02 Note, it is very important to understand that in most cases,

2:05 lifecycle notifications are received and handled

2:08 by the payment service providers instead of merchants.

2:12 Let me quickly give you a high-level overview of the changes

2:15 in the Google Pay API to support merchant-initiated transactions.

2:20 You might be familiar with the TransactionInfo object.

2:23 This object usually contains information like total price, currency,

2:27 and country code of a transaction and maybe an optional label.

2:32 We are adding three more transaction types

2:34 to the Google Pay API payload— RecurringTransactionInfo,

2:38 DeferredTransactionInfo, and AutomaticReloadTransactionInfo.

2:43 The existing TransactionInfo object is still supported.

2:47 Like this, we make sure that all

2:49 those changes are completely backwards compatible.

2:52 All you need to do is to decide for a specific transaction type.

2:57 To give you a clear understanding on how this works,

3:00 let me walk you through a simple example.

3:03 Let's say we run an online business where our basic package is $9.99.

3:09 And the recurrence frequency is once per month.

3:12 We use the RecurringTransactionInfo object and set the recurrence item.

3:16 Within the RecurrenceItem,

3:18 We specify the recurrence period and the recurrence period count.

3:22 Once a month, in this case.

3:24 Finally, we set a label and define the billing initial date and time.

3:29 And just like that, Google Pay will show a different payment sheet

3:32 to your users with all the important information for your recurring transaction.

3:37 Now, when using one of the merchant-initiated transaction types,

3:41 the decrypted payload the payment service

3:43 provider receives contains a merchant token ID.

3:47 The payment service provider stores this ID in order to find

3:50 the right token later on when receiving lifecycle management notifications.

3:55 We know that merchant-initiated transaction scenarios

3:58 can be more complex than this.

4:00 Make sure to check out our newly updated API reference,

4:04 where you can find the new input parameters for deferred,

4:07 recurring, and automatic reload transactions.

4:10 We can't wait to hear how you use merchant-initiated

4:12 transactions with Google Pay to upgrade your checkout experience.

4:17 Stay tuned for part two of this series,

4:19 where we will further explore how you can receive lifecycle

4:23 notifications if the underlying payment credentials of a token change.

4:27 If you are interested to chat about MITs

4:30 with Google Pay or payment topics in general,

4:33 make sure to join the official Google Pay

4:35 and Wallet developer community in the Payments channel on Discord.

4:39 Find my information and links to other

4:42 resources around Google Pay in the video description.

4:45 Thank you for watching and until next time.

4:48 [MUSIC PLAYING]

Study with Looplines Download Captions Watch on YouTube