GooglePayLauncher

A drop-in class that presents a Google Pay sheet to collect customer payment details and use it to confirm a PaymentIntent or SetupIntent. When successful, will return Result.Completed.

Use GooglePayLauncherContract for Jetpack Compose integrations.

See the Google Pay integration guide for more details.

Constructors

Link copied to clipboard
constructor(    activity: ComponentActivity,     config: GooglePayLauncher.Config,     readyCallback: GooglePayLauncher.ReadyCallback,     resultCallback: GooglePayLauncher.ResultCallback)

Constructor to be used when launching GooglePayLauncher from an Activity.

constructor(fragment: Fragment, config: GooglePayLauncher.Config, readyCallback: GooglePayLauncher.ReadyCallback, resultCallback: GooglePayLauncher.ResultCallback)

Constructor to be used when launching GooglePayLauncher from a Fragment.

Types

Link copied to clipboard
data class BillingAddressConfig @JvmOverloads constructor(    isRequired: Boolean = false,     format: GooglePayLauncher.BillingAddressConfig.Format = Format.Min,     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: GooglePayLauncher.BillingAddressConfig = BillingAddressConfig(),     var existingPaymentMethodRequired: Boolean = true,     var allowCreditCards: Boolean = true) : Parcelable
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 presentForPaymentIntent(clientSecret: String, label: String? = null)

Present Google Pay to collect customer payment details and use it to confirm the PaymentIntent represented by clientSecret.

Link copied to clipboard
fun presentForSetupIntent(clientSecret: String, currencyCode: String, amount: Long? = null, label: String? = null)

Present Google Pay to collect customer payment details and use it to confirm the SetupIntent represented by clientSecret.