GooglePayContext

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

Link copied to clipboard
constructor(activity: ComponentActivity, readyCallback: ReadyCallback? = null, resultCallback: ResultCallback? = null, merchantName: String? = null, merchantCountryCode: String? = null)

Constructor for using this class from an Activity.

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

Constructor for using this class from a Fragment.

Properties

Link copied to clipboard
open override val isReady: Boolean

True if Google Pay is available and ready to present

Link copied to clipboard
open override var readyCallback: ReadyCallback?

Optional callback to be notified when Google Pay is ready. Alternatively, you can check if Google Pay is ready by checking the isReady property

Link copied to clipboard
open override var resultCallback: ResultCallback?

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

Functions

Link copied to clipboard
open override fun present()
open override fun present(currencyCode: String)
open override fun present(currencyCode: String, amount: Int)
open override fun present(currencyCode: String, amount: Int, transactionId: String?)

Present the Google Pay UI. If isReady is false then this method is a no-op