Google Pay Context
A drop-in class that presents a Google Pay sheet to collect a customer's payment details. When successful, will return an IPaymentMethod via Result.Completed.paymentMethod
Constructors
GooglePayContext
Link copied to clipboard
fun GooglePayContext(activity: ComponentActivity, readyCallback: ReadyCallback? = null, resultCallback: ResultCallback? = null, merchantName: String? = null, merchantCountryCode: String? = null)
Content copied to clipboard
Constructor for using this class from an Activity.
GooglePayContext
Link copied to clipboard
fun GooglePayContext(fragment: Fragment, readyCallback: ReadyCallback? = null, resultCallback: ResultCallback? = null, merchantName: String? = null, merchantCountryCode: String? = null)
Content copied to clipboard
Constructor for using this class from a Fragment.
Properties
readyCallback
Link copied to clipboard
Optional callback to be notified when Google Pay is ready. Alternatively, you can check if Google Pay is ready by checking the isReady property
resultCallback
Link copied to clipboard
Callback to get the results of the Google Pay flow. If this isn't set there is no way to get the resulting payment method. It can be passed in to the constructor or manually set after creation, but must be set prior to calling GooglePayContext.present