GooglePayPaymentMethodLauncher

A drop-in class that presents a Google Pay sheet to collect a customer's payment details. When successful, will return a PaymentMethod via Result.Completed.paymentMethod.

Use GooglePayPaymentMethodLauncher for Jetpack Compose integrations.

See the Google Pay integration guide for more details.

Constructors

Link copied to clipboard

Constructor to be used when launching GooglePayPaymentMethodLauncher from an Activity. This constructor must be called no later than Activity#onCreate().

Constructor to be used when launching GooglePayPaymentMethodLauncher from a Fragment. This constructor must be called no later than Fragment#onViewCreated().

Types

Link copied to clipboard
data class BillingAddressConfig @JvmOverloads constructor(val isRequired: Boolean = false, val format: GooglePayPaymentMethodLauncher.BillingAddressConfig.Format = Format.Min, val isPhoneNumberRequired: Boolean = false) : Parcelable
Link copied to clipboard
object Companion
Link copied to clipboard
data class Config @JvmOverloads constructor(val environment: GooglePayEnvironment, val merchantCountryCode: String, val merchantName: String, var isEmailRequired: Boolean = false, var billingAddressConfig: GooglePayPaymentMethodLauncher.BillingAddressConfig = BillingAddressConfig(), var existingPaymentMethodRequired: Boolean = true, var allowCreditCards: Boolean = true) : Parcelable
Link copied to clipboard

Error codes representing the possible error types for Result.Failed. See the corresponding Result.Failed.error message for more details.

Link copied to clipboard
fun interface ReadyCallback
Link copied to clipboard
sealed class Result : Parcelable
Link copied to clipboard
fun interface ResultCallback

Functions

Link copied to clipboard
fun present(currencyCode: String, amount: Int, transactionId: String? = null)
fun present(currencyCode: String, amount: Long = 0, transactionId: String? = null, label: String? = null)

Present the Google Pay UI.