-
- All Implemented Interfaces:
public class PaymentDataRequestJsonBuilderThis class provides methods to build com.google.android.gms.wallet.PaymentDataRequest in JSON format.
-
-
Field Summary
Fields Modifier and Type Field Description private JSONArrayallowedPaymentMethodsprivate JSONObjecttransactionInfoprivate BooleanemailRequiredprivate BooleanshippingAddressRequired
-
Method Summary
Modifier and Type Method Description PaymentDataRequestJsonBuildersetAllowedPaymentMethods(@NonNull() JSONArray allowedPaymentMethods)Required. PaymentDataRequestJsonBuildersetTransactionInfo(@NonNull() JSONObject transactionInfo)Required. PaymentDataRequestJsonBuildersetEmailRequired(boolean emailRequired)Optional. PaymentDataRequestJsonBuildersetShippingAddressRequired(boolean shippingAddressRequired)Optional. PaymentDataRequestJsonBuildersetMerchantInfo(@NonNull() String merchantName)Optional. PaymentDataRequestJsonBuildersetShippingAddressParameters(@Nullable() JSONArray allowedCountryCodes, @Nullable() Boolean phoneNumberRequired)Optional. JSONObjecttoJson()Returns the com.google.android.gms.wallet.PaymentDataRequest as JSONObject. -
-
Method Detail
-
setAllowedPaymentMethods
PaymentDataRequestJsonBuilder setAllowedPaymentMethods(@NonNull() JSONArray allowedPaymentMethods)
Required. Sets one or more payment methods supported by the Google Pay API and accepted by your app. See CardPaymentMethodJsonBuilder.
- Parameters:
allowedPaymentMethods- The list of allowed payment methods.
-
setTransactionInfo
PaymentDataRequestJsonBuilder setTransactionInfo(@NonNull() JSONObject transactionInfo)
Required. Sets the details about the authorization of the transaction based upon whether the user agrees to the transaction or not. Includes total price and price status. See TransactionInfoJsonBuilder.
- Parameters:
transactionInfo- The transaction info.
-
setEmailRequired
PaymentDataRequestJsonBuilder setEmailRequired(boolean emailRequired)
Optional. Sets if email is required.
- Parameters:
emailRequired- Set totrueto request an email address.
-
setShippingAddressRequired
PaymentDataRequestJsonBuilder setShippingAddressRequired(boolean shippingAddressRequired)
Optional. Sets if shipping address is required.
- Parameters:
shippingAddressRequired- Set totrueto request a full shipping address.
-
setMerchantInfo
PaymentDataRequestJsonBuilder setMerchantInfo(@NonNull() String merchantName)
Optional. Sets the information about the merchant that requests payment data.
- Parameters:
merchantName- Merchant name encoded as UTF-8.
-
setShippingAddressParameters
PaymentDataRequestJsonBuilder setShippingAddressParameters(@Nullable() JSONArray allowedCountryCodes, @Nullable() Boolean phoneNumberRequired)
Optional. Sets shipping address restrictions.
- Parameters:
allowedCountryCodes- ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed.phoneNumberRequired- Set totrueif a phone number is required for the provided shipping address.
-
toJson
@NonNull() JSONObject toJson()
Returns the com.google.android.gms.wallet.PaymentDataRequest as JSONObject.
-
-
-
-