GooglePayLauncher

A drop-in class that presents a Google Pay sheet to collect a customer's payment details. When successful, will return an IPaymentMethod via GooglePayResult.Completed.paymentMethod

Constructors

Link copied to clipboard
constructor(activity: ComponentActivity, config: GooglePayConfig, readyCallback: GooglePayReadyCallback? = null, resultCallback: GooglePayResultCallback? = null)

Constructor for using this class from a ComponentActivity.

constructor(fragment: Fragment, config: GooglePayConfig, readyCallback: GooglePayReadyCallback? = null, resultCallback: GooglePayResultCallback? = null)

Constructor for using this class from a Fragment.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override var config: GooglePayConfig

Configuration parameters for Google Pay. When this is set, the ready state (see isReady and readyCallback) may temporarily change to false until Google Pay gets reinitialized with the new configuration parameters

Link copied to clipboard
open override val isReady: Boolean

True if Google Pay is available and ready to present

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

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 GooglePayLauncher.present

Functions

Link copied to clipboard
open override fun present(amount: Int)
open override fun present(amount: Int, checkoutStatus: GooglePayCheckoutStatus)
open override fun present(amount: Int, checkoutStatus: GooglePayCheckoutStatus, totalPriceLabel: String?)
open override fun present(amount: Int, checkoutStatus: GooglePayCheckoutStatus, totalPriceLabel: String?, lineItems: List<GooglePayLineItem>?)
open override fun present(amount: Int, checkoutStatus: GooglePayCheckoutStatus, totalPriceLabel: String?, lineItems: List<GooglePayLineItem>?, validateLineItems: Boolean)
open override fun present(amount: Int, checkoutStatus: GooglePayCheckoutStatus, totalPriceLabel: String?, lineItems: List<GooglePayLineItem>?, validateLineItems: Boolean, transactionId: String?)

Present the Google Pay UI.