GooglePayJsonFactory

@Singleton
class GooglePayJsonFactory(googlePayConfig: GooglePayConfig, isJcbEnabled: Boolean = false)

A factory for generating Google Pay JSON request objects for Google Pay API version 2.0.

Constructors

Link copied to clipboard
fun GooglePayJsonFactory(context: Context, isJcbEnabled: Boolean = false)

PaymentConfiguration must be instantiated before calling this.

Link copied to clipboard
fun GooglePayJsonFactory(googlePayConfig: GooglePayConfig, isJcbEnabled: Boolean = false)

Types

Link copied to clipboard
data class BillingAddressParameters @JvmOverloads constructor(    isRequired: Boolean = false,     format: GooglePayJsonFactory.BillingAddressParameters.Format = Format.Min,     isPhoneNumberRequired: Boolean = false) : Parcelable
Link copied to clipboard
data class MerchantInfo(merchantName: String? = null) : Parcelable
Link copied to clipboard
data class ShippingAddressParameters @JvmOverloads constructor(    isRequired: Boolean = false,     allowedCountryCodes: Set<String> = emptySet(),     phoneNumberRequired: Boolean = false) : Parcelable
Link copied to clipboard
data class TransactionInfo @JvmOverloads constructor(    currencyCode: String,     totalPriceStatus: GooglePayJsonFactory.TransactionInfo.TotalPriceStatus,     countryCode: String? = null,     transactionId: String? = null,     totalPrice: Int? = null,     totalPriceLabel: String? = null,     checkoutOption: GooglePayJsonFactory.TransactionInfo.CheckoutOption? = null) : Parcelable

Functions

Link copied to clipboard
fun createIsReadyToPayRequest(    billingAddressParameters: GooglePayJsonFactory.BillingAddressParameters? = null,     existingPaymentMethodRequired: Boolean? = null,     allowCreditCards: Boolean? = null): JSONObject
Link copied to clipboard
fun createPaymentDataRequest(    transactionInfo: GooglePayJsonFactory.TransactionInfo,     billingAddressParameters: GooglePayJsonFactory.BillingAddressParameters? = null,     shippingAddressParameters: GooglePayJsonFactory.ShippingAddressParameters? = null,     isEmailRequired: Boolean = false,     merchantInfo: GooglePayJsonFactory.MerchantInfo? = null,     allowCreditCards: Boolean? = null): JSONObject