GooglePayLauncher

class 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
fun GooglePayLauncher(activity: ComponentActivity, config: GooglePayLauncher.Config, readyCallback: GooglePayLauncher.ReadyCallback, resultCallback: GooglePayLauncher.ResultCallback)

Constructor to be used when launching GooglePayLauncher from an Activity.

Link copied to clipboard
fun GooglePayLauncher(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, format: GooglePayLauncher.BillingAddressConfig.Format, isPhoneNumberRequired: Boolean) : Parcelable
Link copied to clipboard
data class Config @JvmOverloads constructor(environment: GooglePayEnvironment, merchantCountryCode: String, merchantName: String, isEmailRequired: Boolean, billingAddressConfig: GooglePayLauncher.BillingAddressConfig, existingPaymentMethodRequired: Boolean) : 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)

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)

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