Package-level declarations

Types

Link copied to clipboard
data class GooglePayConfig(val gateway: String = "example", val gatewayMerchantId: String = "exampleGatewayMerchantId", val merchantName: String = "kmp-toolkit Demo", val countryCode: String = "IN", val currencyCode: String = "INR", val allowedCardNetworks: Set<CardNetwork> = setOf(CardNetwork.VISA, CardNetwork.MASTERCARD, CardNetwork.AMEX, CardNetwork.DISCOVER), val allowedAuthMethods: List<String> = listOf("PAN_ONLY", "CRYPTOGRAM_3DS"), val environment: GooglePayEnvironment = GooglePayEnvironment.TEST)

Everything the Google Pay API needs to describe what this app accepts. Field shape adapted from khalid64927/google-apple-pay's GooglePayConfig (Apache-2.0) — that repo isn't published to Maven Central, so it can't be depended on directly; this is our own implementation using its config shape as a starting point.

Link copied to clipboard

Which Google Pay backend the request is aimed at.

Link copied to clipboard
class GooglePayGateway(config: GooglePayConfig = GooglePayConfig()) : WalletGateway

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.

Link copied to clipboard

Builds the Google Pay API's IsReadyToPayRequest/PaymentDataRequest JSON. This shape is Google's own standard sample request (also mirrored by khalid64927/google-apple-pay, Apache-2.0) — there's no meaningful way to build a "different" version of this JSON, it's the documented contract every Android Google Pay integration sends.