CreateWalletObjectsRequest.Builder

  • CreateWalletObjectsRequest.Builder facilitates the creation of CreateWalletObjectsRequest instances for saving objects to Google Pay.

  • It provides methods to specify the object type (gift card, loyalty, or offer) and the desired creation mode (save prompt or immediate save).

  • The build() method finalizes the request creation process.

  • While REQUEST_IMMEDIATE_SAVE can be specified, the system might still use SHOW_SAVE_PROMPT based on factors like multiple Google accounts.

  • Developers should use REQUEST_IMMEDIATE_SAVE only when the user explicitly intends to save, such as clicking a "Save to Google Pay" button.

public final class CreateWalletObjectsRequest.Builder extends Object

Builder to create a CreateWalletObjectsRequest.

Public Method Summary

CreateWalletObjectsRequest
build()
Returns the CreateWalletObjectsRequest created using the data passed to the Builder.
CreateWalletObjectsRequest.Builder
setCreateMode(int createMode)
Sets the creation mode to use.
CreateWalletObjectsRequest.Builder
setGiftCardWalletObject(GiftCardWalletObject giftCardWalletObject)
Sets the Gift Card wallet object to be created.
CreateWalletObjectsRequest.Builder
setLoyaltyWalletObject(LoyaltyWalletObject loyaltyWalletObject)
Sets the Loyalty wallet object to be created.
CreateWalletObjectsRequest.Builder
setOfferWalletObject(OfferWalletObject offerWalletObject)
Sets the Offer wallet object to be created.

Inherited Method Summary

Public Methods

public CreateWalletObjectsRequest build ()

Returns the CreateWalletObjectsRequest created using the data passed to the Builder.

public CreateWalletObjectsRequest.Builder setCreateMode (int createMode)

Sets the creation mode to use. If the value is CreateWalletObjectsRequest.SHOW_SAVE_PROMPT, a save prompt dialog appears, with a save button that the user must click before the save occurs. If the value is CreateWalletObjectsRequest.REQUEST_IMMEDIATE_SAVE, the save happens immediately, followed by a confirmation dialog to show the save is successful. Note the calling application must only use CreateWalletObjectsRequest.REQUEST_IMMEDIATE_SAVE if the user shows they intend to save the Wallet Object to Google Pay, such as by clicking a button in the calling application with the label "Save to Google Pay". Sometimes the implementation will still use CreateWalletObjectsRequest.SHOW_SAVE_PROMPT mode, even when the Caller specifies CreateWalletObjectsRequest.REQUEST_IMMEDIATE_SAVE. For example, if multiple Google accounts exist on the device, the implementation may still show the save prompt dialog in order to allow the user to select which account to save to.

public CreateWalletObjectsRequest.Builder setGiftCardWalletObject (GiftCardWalletObject giftCardWalletObject)

Sets the Gift Card wallet object to be created.

public CreateWalletObjectsRequest.Builder setLoyaltyWalletObject (LoyaltyWalletObject loyaltyWalletObject)

Sets the Loyalty wallet object to be created.

public CreateWalletObjectsRequest.Builder setOfferWalletObject (OfferWalletObject offerWalletObject)

Sets the Offer wallet object to be created.