Entry point for interacting with Wallet buyflow APIs.
To allow the user to select and change the account associated with the transaction and Google
transaction ID, use
null or simply do not set it using
setAccountName(String). No special action is required when a user
changes the selected account through the UI in this case, and the Google transaction ID
associated with the transaction can continue to be used.
To specify the account and prevent the user from selecting another account, set the account
setAccountName(String). To change the account, construct a
new GoogleApiClient with the new account and do not reuse the Google transaction ID associated
with the old account - this is a new transaction.
We recommend that you apply for API access at
before starting development. During development, use the test environment by specifying
setEnvironment(int). For production access, you must specify
Public Method Summary
public abstract void changeMaskedWallet (GoogleApiClient googleApiClient, String googleTransactionId, String merchantTransactionId, int requestCode)
This method brings up a Google Wallet selector screen to allow your customer to select a new payment instrument or shipping address from their Google Wallet.
|googleApiClient||An instance of
|googleTransactionId||Required field. Must be identical to the value returned in an
|merchantTransactionId||Optional merchant identifier for the transaction. The value
will be echoed back in
|requestCode||will be passed back in onActivityResult where you can retrieve the result
public abstract void checkForPreAuthorization (GoogleApiClient googleApiClient, int requestCode)
This API checks to see if a user has previously authorized the application to access their Wallet account.
public abstract void isNewUser (GoogleApiClient googleApiClient, int requestCode)
Checks if this is a new user, i.e. if they have used Instant Buy to make a purchase for your app before or not. If the user has multiple accounts on the device, each will be checked. If any of the accounts has been used to make an Instant Buy purchase with your app, then false will be returned. True is only returned if none of the accounts on the device have used Instant Buy to make a purchase with your app.
public abstract void loadFullWallet (GoogleApiClient googleApiClient, FullWalletRequest request, int requestCode)
FullWallet, which contains the payment credentials. You can retrieve the
onActivityResult using the
you provide to this method. If there is a problem with the transaction then the Google Wallet
selector will be shown and a
MaskedWallet will be returned to reflect new selections
by the user.
This function should only be called when the customer confirms the purchase.
Important: Because the credentials are in plain text it is important to transfer the payment credentials following PCI standards.
public abstract void loadMaskedWallet (GoogleApiClient googleApiClient, MaskedWalletRequest request, int requestCode)
If an application has authorization, loadMaskedWallet() allows you to skip the Google Wallet
selector and directly request the masked payment credentials. This provides a more seamless
purchase experience for your customers. When you call this method, the Google Wallet selector
will be shown only if necessary. Either way, you can retrieve the
onActivityResult using the specified
public abstract void notifyTransactionStatus (GoogleApiClient googleApiClient, NotifyTransactionStatusRequest request)
Sends a notification to Google on whether the transaction succeeded or failed. This should always be called after payment processing as well as any failed validation checks.
|googleApiClient||An instance of