GooglePayGateway

class GooglePayGateway(config: GooglePayConfig = GooglePayConfig()) : WalletGateway(source)

Google Pay — a wallet method riding a payment gateway underneath (here, a "example"/TEST tokenization gateway; production would set gateway = "stripe" + the real Stripe account's gatewayMerchantId, since Google Pay hands back an encrypted token for a processor to charge, it doesn't settle payments itself). ENVIRONMENT_TEST needs no live merchant account, so this ships SANDBOX_READY — genuinely runnable by anyone with a Google account and a test card on file.

docs: https://developers.google.com/pay/api/android/guides/tutorial

Request-JSON shape adapted from khalid64927/google-apple-pay (Apache-2.0) — see GooglePayRequestBuilder doc for why that repo can't be depended on directly. The Activity-callback → coroutine bridge below is this module's own pattern (mirrors com.siddharth.kmp.paymentsapi.AndroidPaymentHost usage in the Razorpay/Stripe providers), not ported from that repo's Fragment-based resolver.

Constructors

Link copied to clipboard
constructor(config: GooglePayConfig = GooglePayConfig())

Properties

Link copied to clipboard
open override val id: GatewayId
Link copied to clipboard
Link copied to clipboard
open override val meta: GatewayMeta

Functions

Link copied to clipboard
open suspend override fun availability(host: PaymentHost): WalletAvailability

Whether a Google Pay button may be drawn, asked before anything is drawn.

Link copied to clipboard
open suspend override fun pay(host: PaymentHost, prepared: PreparedPayment): PaymentResult
Link copied to clipboard
open suspend override fun prepare(created: CreatedOrder): PreparedPayment