GooglePayLauncher

constructor(fragment: Fragment, callback: GooglePayLauncherCallback)

Used to launch the Google Pay payment sheet from within an Android Fragment. This class must be instantiated before the Fragment is created.

Parameters

fragment

the Android Fragment from which you will launch the Google Pay payment sheet

callback

a GooglePayLauncherCallback to receive the result of the Google Pay payment flow


constructor(activity: ComponentActivity, callback: GooglePayLauncherCallback)

Used to launch the Google Pay payment sheet from within an Android Activity. This class must be instantiated before the Activity is created.

Parameters

activity

the Android Activity from which you will launch the Google Pay payment sheet

callback

a GooglePayLauncherCallback to receive the result of the Google Pay payment flow


constructor(registry: ActivityResultRegistry, lifecycleOwner: LifecycleOwner, context: Context, callback: GooglePayLauncherCallback)

Used to launch the Google Pay payment sheet from a composable, or anywhere else a Fragment or ComponentActivity reference is not available. This class must be instantiated before the lifecycleOwner reaches the CREATED state.

Parameters

registry

the ActivityResultRegistry to use for launching the Google Pay payment sheet

lifecycleOwner

the LifecycleOwner used to control when the launcher is registered

context

an Android Context

callback

a GooglePayLauncherCallback to receive the result of the Google Pay payment flow