Google Pay using eProtect

This is the recommended and typical method of implementing Google Pay for Mobile Applications on the Worldpay eCommerce platform. The steps that follow, along with FIGURE 1-11 High Level Message Flow for Google Pay using eProtect, illustrate the high level flow of messages associated with an Google Pay purchase, when utilizing the Worldpay eProtect service.

This process assumes you have integrated with Google using the method that returns the Worldpay low-value token (paypageRegistrationId) from Google following the Full Wallet request.

  1. When the consumer clicks the Google Pay button in your application, the action triggers a PaymentDataRequest to Google. In the PaymentDataRequest, you must set a new object PaymentMethodTokenizationParameters indicating that you are using Worldpay. Use the following code sample as a guide to setting this field.

Setting the PaymentMethodTokenizationParameters

PaymentMethodTokenizationParameters parameters =

PaymentMethodTokenizationParameters .newBuilder()

.setPaymentMethodTokenizationType(PaymentMethodTokenizationType.PAYMENT_GATEWAY)

  .addParameter("gateway","vantiv")

  .addParameter("vantiv:merchantPayPageId",payPageId)

  .addParameter("vantiv:merchantOrderId",orderId)

  .addParameter("vantiv:merchantTransactionId",id)

  .addParameter("vantiv:merchantReportGroup",reportGroup)

  .build();

Use the same orderId value on all calls (i.e., Google, Register Token, Authorization, Sale, etc.). By using the same orderId, customers can track their orders when using a Google-provided app.

Setting New Object in the PaymentDataRequest

PaymentDataRequest request = PaymentDataRequest.newBuilder()

  .addAllowedPaymentMethods (new List,int.(){

    WalletConstants.PAYMENT_METHOD_CARD,

    WalletConstants.PAYMENT_METHOD_TOKENIZED_CARD)

  .setMerchantName(Constants.MERCHANT_NAME)

  .setPhoneNumberRequired(true)

  .setShippingAddressRequired(true)

  .setCurrencyCode(Constants.CURRENCY_CODE_USD)

  .setEstimatedTotalPrice(cartTotal)

    .setCart(Cart.newBuilder()

    .setCurrencyCode(Constants.CURRENCY_CODE_USD)

    .setTotalPrice(cartTotal)

    .setLineItems(lineItems)

    .build())

  .setPaymentMethodTokenizationParameters(parameters)

  .build();

The information returned by Google in the PaymentDataRequest object may include a masked card number (last-four digits exposed) and shipping information. The consumer has the option of changing this information. If any info changes, Google Pay returns an updated PaymentDataRequest object.

  1. Upon confirmation of the order by the consumer your application initiates a FullWalletRequest to Google.

  2. After receiving the FullWalletRequest from your application, Google submits the card information to Worldpay eProtect. The eProtect servers return a low-value token (paypageRegistrationId).

  3. Google returns the low-value token to your application along with the Full Wallet information.

  4. Your applications sends the transaction information to your servers along with the low-value token. Your servers submit the Auth/Sale transaction to the Worldpay eComm platform. You must set the orderSource to androidpay in the transaction.

Instead of submitting a Auth/Sale transaction, you can submit a Register Token transaction to convert the low-value token to a Worldpay high-value token. You would then use the high-value token in subsequent transactions submitted to the eComm platform.

  1. Worldpay processes your transaction normally and returns the results along with a high-value token.

FIGURE 1-11 High Level Message Flow for Google Pay using eProtect