-
- All Implemented Interfaces:
public class TransactionInfoJsonBuilder
This class provides methods to build
TransactionInfo
in JSON format.
-
-
Field Summary
Fields Modifier and Type Field Description private String
currencyCode
private String
countryCode
private String
transactionId
private String
totalPriceStatus
private String
totalPrice
private String
totalPriceLabel
private String
checkoutOption
-
Method Summary
Modifier and Type Method Description TransactionInfoJsonBuilder
setCurrencyCode(@NonNull() String currencyCode)
Required. TransactionInfoJsonBuilder
setCountryCode(@NonNull() String countryCode)
Optional (required for EEA countries). TransactionInfoJsonBuilder
setTransactionId(@NonNull() String transactionId)
Optional. TransactionInfoJsonBuilder
setTotalPriceStatus(@NonNull() String totalPriceStatus)
Required. TransactionInfoJsonBuilder
setTotalPrice(@NonNull() String totalPrice)
Required. TransactionInfoJsonBuilder
setTotalPriceLabel(@NonNull() String totalPriceLabel)
Optional. TransactionInfoJsonBuilder
setCheckoutOption(@NonNull() String checkoutOption)
Optional. JSONObject
toJson()
Returns the TransactionInfo
as JSONObject.-
-
Method Detail
-
setCurrencyCode
TransactionInfoJsonBuilder setCurrencyCode(@NonNull() String currencyCode)
Required. Sets the currency code.
- Parameters:
currencyCode
- The ISO 4217 alphabetic currency code.
-
setCountryCode
TransactionInfoJsonBuilder setCountryCode(@NonNull() String countryCode)
Optional (required for EEA countries). Sets the country code.
- Parameters:
countryCode
- The ISO 3166-1 alpha-2 country code where the transaction is processed.
-
setTransactionId
TransactionInfoJsonBuilder setTransactionId(@NonNull() String transactionId)
Optional. Sets the transaction id.
- Parameters:
transactionId
- A unique ID that identifies a transaction attempt.
-
setTotalPriceStatus
TransactionInfoJsonBuilder setTotalPriceStatus(@NonNull() String totalPriceStatus)
Required. Sets the status of the total price used: NOT_CURRENTLY_KNOWN: Use this property for a capability check. ESTIMATED: Total price might adjust based on the details of the response, such as sales tax collected that's based on a billing address. FINAL: Total price doesn't change from the amount presented to the shopper.
- Parameters:
totalPriceStatus
- The status of the total price.
-
setTotalPrice
TransactionInfoJsonBuilder setTotalPrice(@NonNull() String totalPrice)
Required. Sets the total price.
- Parameters:
totalPrice
- Total monetary value of the transaction with an optional decimal precision of two decimal places.
-
setTotalPriceLabel
TransactionInfoJsonBuilder setTotalPriceLabel(@NonNull() String totalPriceLabel)
Optional. Sets the total price label.
- Parameters:
totalPriceLabel
- Custom label for the total price within the display items.
-
setCheckoutOption
TransactionInfoJsonBuilder setCheckoutOption(@NonNull() String checkoutOption)
Optional. Sets the checkout option, affects the submit button text displayed in the Google Pay payment sheet. DEFAULT: Standard text applies for the given totalPriceStatus (default). COMPLETE_IMMEDIATE_PURCHASE: The selected payment method is charged immediately after the payer confirms their selections. This option is only available when totalPriceStatus is set to FINAL.
- Parameters:
checkoutOption
- The checkout option.
-
toJson
@NonNull() JSONObject toJson()
Returns the
TransactionInfo
as JSONObject.
-
-
-
-