com.google.android.gms.wallet.Payments |
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
using 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
http://getinstantbuy.withgoogle.com/
before starting development. During development, use the sandbox environment by specifying
ENVIRONMENT_SANDBOX
using
setEnvironment(int)
. For production access, you must specify
ENVIRONMENT_PRODUCTION
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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.
| |||||||||||
This API checks to see if a user has previously authorized the application to access their
Wallet account.
| |||||||||||
Requests a
FullWallet , which contains the payment credentials.
| |||||||||||
If an application has authorization, loadMaskedWallet() allows you to skip the Google Wallet
selector and directly request the masked payment credentials.
| |||||||||||
Sends a notification to Google on whether the transaction succeeded or failed.
|
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 GoogleApiClient configured to use the Wallet
API |
---|---|
googleTransactionId | Required field. Must be identical to the value returned in an
earlier MaskedWallet in the same transaction. |
merchantTransactionId | Optional merchant identifier for the transaction. The value
will be echoed back in MaskedWallet , but is not
otherwise used by the Wallet API. To omit, pass null |
requestCode | will be passed back in onActivityResult where you can retrieve the result
via EXTRA_MASKED_WALLET .
|
This API checks to see if a user has previously authorized the application to access their Wallet account.
googleApiClient | An instance of GoogleApiClient configured to use the Wallet
API |
---|---|
requestCode | will be passed back in onActivityResult where you can retrieve the result
via EXTRA_IS_USER_PREAUTHORIZED .
|
Requests a FullWallet
, which contains the payment credentials. You can retrieve the
FullWallet
in onActivityResult
using the requestCode
that
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.
googleApiClient | An instance of GoogleApiClient configured to use the Wallet
API |
---|---|
requestCode | will be passed back in onActivityResult where you can retrieve the result
via EXTRA_FULL_WALLET or
EXTRA_MASKED_WALLET if the user had to make new
selections.
|
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 MaskedWallet
in
onActivityResult
using the specified requestCode
.
googleApiClient | An instance of GoogleApiClient configured to use the Wallet
API |
---|---|
requestCode | will be passed back in onActivityResult where you can retrieve the result
via EXTRA_MASKED_WALLET .
|
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 GoogleApiClient configured to use the Wallet
API
|
---|