GooglePayContext

fun GooglePayContext(activity: ComponentActivity, readyCallback: ReadyCallback? = null, resultCallback: ResultCallback? = null, merchantName: String? = null, merchantCountryCode: String? = null)

Constructor for using this class from an Activity.


Important:

This must be called no later than ComponentActivity.onCreate

Parameters

activity

The activity that is launching Google Pay

readyCallback

Called after determining whether Google Pay is available and ready on the device

resultCallback

Called with the final result of the Google Pay payment operation

merchantName

Specify this if you want to override the name set up when intiializing the SDK

merchantCountryCode

Specify this if you want to override the country code set up when initializing the SDK

Throws

Thrown if Google Pay wasn't configured when initializing the SDK


fun GooglePayContext(fragment: Fragment, readyCallback: ReadyCallback? = null, resultCallback: ResultCallback? = null, merchantName: String? = null, merchantCountryCode: String? = null)

Constructor for using this class from a Fragment.


####Important:

_ This must be called no later than Fragment.onViewCreated_

Parameters

fragment

The fragment that is launching Google Pay

readyCallback

Called after determining whether Google Pay is available and ready on the device

resultCallback

Called with the final result of the Google Pay payment operation

merchantName

Specify this if you want to override the name set up when initializing the SDK

merchantCountryCode

Specify this if you want to override the country code set up when initializing the SDK

Throws

Thrown if Google Pay wasn't configured when initializing the SDK