-
- All Implemented Interfaces:
public class CardPaymentMethodJsonBuilderThis class provides methods to build
PaymentMethodwith type CARD in JSON format.
-
-
Field Summary
Fields Modifier and Type Field Description private JSONArrayallowedAuthMethodsprivate JSONArrayallowedCardNetworksprivate BooleanallowPrepaidCardsprivate BooleanallowCreditCardsprivate BooleanassuranceDetailsRequiredprivate BooleanbillingAddressRequiredprivate StringgatewayMerchantIdprivate Stringgateway
-
Method Summary
-
-
Method Detail
-
setAllowedAuthMethods
CardPaymentMethodJsonBuilder setAllowedAuthMethods(@NonNull() JSONArray allowedAuthMethods)
Required. Sets the fields supported to authenticate a card transaction. PAN_ONLY: This authentication method is associated with payment cards stored on file with the user's Google Account. Returned payment data includes personal account number (PAN) with the expiration month and the expiration year. CRYPTOGRAM_3DS: This authentication method is associated with cards stored as Android device tokens. Returned payment data includes a 3-D Secure (3DS) cryptogram generated on the device.
- Parameters:
allowedAuthMethods- The allowed authentication methods.
-
setAllowedCardNetworks
CardPaymentMethodJsonBuilder setAllowedCardNetworks(@NonNull() JSONArray allowedCardNetworks)
Required. Sets one or more card networks that you support, also supported by the Google Pay API.
- Parameters:
allowedCardNetworks- The allowed card networks.
-
setAllowPrepaidCards
CardPaymentMethodJsonBuilder setAllowPrepaidCards(boolean allowPrepaidCards)
Optional. Sets if prepaid card are allowed.
- Parameters:
allowPrepaidCards- Set tofalseif you don't support prepaid cards.
-
setAllowCreditCards
CardPaymentMethodJsonBuilder setAllowCreditCards(boolean allowCreditCards)
Optional (Required for UK Gambling merchants). Sets if credit cards are allowed.
- Parameters:
allowCreditCards- Set tofalseif you don't support credit cards.
-
setAssuranceDetailsRequired
CardPaymentMethodJsonBuilder setAssuranceDetailsRequired(boolean assuranceDetailsRequired)
Optional. Sets if assurance details are required.
- Parameters:
assuranceDetailsRequired- Set totrueto requestassuranceDetails.
-
setBillingAddressRequired
CardPaymentMethodJsonBuilder setBillingAddressRequired(boolean billingAddressRequired)
Optional. Sets if billing address is required.
- Parameters:
billingAddressRequired- Set totrueif you require a billing address.
-
setGatewayMerchantId
CardPaymentMethodJsonBuilder setGatewayMerchantId(@NonNull() String gatewayMerchantId)
Required. Sets the gateway merchant id.
- Parameters:
gatewayMerchantId- The entity Id which will be used asgatewayMerchantId.
-
setGateway
CardPaymentMethodJsonBuilder setGateway(@NonNull() String gateway)
Optional. Sets the gateway name.
- Parameters:
gateway- The name of the payment gateway.
-
setBillingAddressParameters
CardPaymentMethodJsonBuilder setBillingAddressParameters(@Nullable() String format, boolean phoneNumberRequired)
Optional. Sets billing address parameters. The expected fields returned if
billingAddressRequiredis set totrue.- Parameters:
format- Billing address format required to complete the transaction.phoneNumberRequired- Set totrueif a phone number is required to process the transaction.
-
toJson
@NonNull() JSONObject toJson()
Returns the
PaymentMethodas JSONObject.
-
-
-
-