-
- All Implemented Interfaces:
public class CardPaymentMethodJsonBuilder
This class provides methods to build
PaymentMethod
with type CARD in JSON format.
-
-
Field Summary
Fields Modifier and Type Field Description private JSONArray
allowedAuthMethods
private JSONArray
allowedCardNetworks
private Boolean
allowPrepaidCards
private Boolean
allowCreditCards
private Boolean
assuranceDetailsRequired
private Boolean
billingAddressRequired
private String
gatewayMerchantId
private String
gateway
-
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 tofalse
if 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 tofalse
if you don't support credit cards.
-
setAssuranceDetailsRequired
CardPaymentMethodJsonBuilder setAssuranceDetailsRequired(boolean assuranceDetailsRequired)
Optional. Sets if assurance details are required.
- Parameters:
assuranceDetailsRequired
- Set totrue
to requestassuranceDetails
.
-
setBillingAddressRequired
CardPaymentMethodJsonBuilder setBillingAddressRequired(boolean billingAddressRequired)
Optional. Sets if billing address is required.
- Parameters:
billingAddressRequired
- Set totrue
if 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
billingAddressRequired
is set totrue
.- Parameters:
format
- Billing address format required to complete the transaction.phoneNumberRequired
- Set totrue
if a phone number is required to process the transaction.
-
toJson
@NonNull() JSONObject toJson()
Returns the
PaymentMethod
as JSONObject.
-
-
-
-