present
fun present(currencyCode: String, amount: Int = 0, transactionId: String? = null)
Content copied to clipboard
Present the Google Pay UI.
An IllegalStateException will be thrown if Google Pay is not available or ready for usage.
Parameters
currencyCode
ISO 4217 alphabetic currency code. (e.g. "USD", "EUR")
amount
Amount intended to be collected. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). If the amount is not yet known, use 0.
transactionId
A unique ID that identifies a transaction attempt. Merchants may use an existing ID or generate a specific one for Google Pay transaction attempts. This field is required when you send callbacks to the Google Transaction Events API.