GooglePayRequestBuilder

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.

Built with kotlinx.serialization rather than org.json. Not a style preference: org.json is an Android system class stubbed to throw on the JVM, which is why the tests for this file used to need Robolectric to assert on a string. The Play Services API takes the JSON as text (PaymentDataRequest.fromJson), so it never sees which library produced it.

docs: https://developers.google.com/pay/api/android/reference/request-objects

Constructors

Link copied to clipboard
constructor(config: GooglePayConfig)

Functions

Link copied to clipboard

Whether the device even has a usable card on file — call before showing a Google Pay button.

Link copied to clipboard

The full checkout request — amount, currency, merchant info, tokenization spec.