present

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

Present the Google Pay UI.

Parameters

amount

The amount intended to be collected. It should be a positive integer representing how much to charge in the smallest currency unit (e.g. 100 cents to charge $1.00).

checkoutStatus

The status for the transaction. For GooglePayCheckoutStatus.FinalImmediatePurchase, the pay button text in the Google Pay sheet will be "Pay Now". For other statuses it will say "Continue"

totalPriceLabel

A custom value to override the default total price label in the Google Pay sheet

lineItems

A list of items to display in the Google Pay sheet.

validateLineItems

If true, a GooglePayException will be thrown if the sum of the line items does not equal the total amount passed in.

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 sending callbacks to the Google Transaction Events API

Throws

Thrown if Google Pay isn't ready or if the configuration is not valid


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

Present the Google Pay UI.

Parameters

amount

The amount intended to be collected. It should be a positive integer representing how much to charge in the smallest currency unit (e.g. 100 cents to charge $1.00).

checkoutStatus

The status for the transaction. For GooglePayCheckoutStatus.FinalImmediatePurchase, the pay button text in the Google Pay sheet will be "Pay Now". For other statuses it will say "Continue"

totalPriceLabel

A custom value to override the default total price label in the Google Pay sheet

lineItems

A list of items to display in the Google Pay sheet.

validateLineItems

If true, a GooglePayException will be thrown if the sum of the line items does not equal the total amount passed in.

Throws

Thrown if Google Pay isn't ready or if the configuration is not valid


open override fun present(amount: Int, checkoutStatus: GooglePayCheckoutStatus, totalPriceLabel: String?, lineItems: List<GooglePayLineItem>?)

Present the Google Pay UI.

Parameters

amount

The amount intended to be collected. It should be a positive integer representing how much to charge in the smallest currency unit (e.g. 100 cents to charge $1.00).

checkoutStatus

The status for the transaction. For GooglePayCheckoutStatus.FinalImmediatePurchase, the pay button text in the Google Pay sheet will be "Pay Now". For other statuses it will say "Continue"

totalPriceLabel

A custom value to override the default total price label in the Google Pay sheet

lineItems

A list of items to display in the Google Pay sheet. Note: The sum total of the line items will be compared to the amount parameter. If they do not match, a GooglePayException will be thrown. If this validation is not desired, use a present method that takes the validateLineItems parameter.

Throws

Thrown if Google Pay isn't ready or if the configuration is not valid


open override fun present(amount: Int, checkoutStatus: GooglePayCheckoutStatus, totalPriceLabel: String?)

Present the Google Pay UI.

Parameters

amount

The amount intended to be collected. It should be a positive integer representing how much to charge in the smallest currency unit (e.g. 100 cents to charge $1.00).

checkoutStatus

The status for the transaction. For GooglePayCheckoutStatus.FinalImmediatePurchase, the pay button text in the Google Pay sheet will be "Pay Now". For other statuses it will say "Continue"

totalPriceLabel

A custom value to override the default total price label in the Google Pay sheet

Throws

Thrown if Google Pay isn't ready or if the configuration is not valid


open override fun present(amount: Int, checkoutStatus: GooglePayCheckoutStatus)

Present the Google Pay UI.

Parameters

amount

The amount intended to be collected. It should be a positive integer representing how much to charge in the smallest currency unit (e.g. 100 cents to charge $1.00).

checkoutStatus

The status for the transaction. For GooglePayCheckoutStatus.FinalImmediatePurchase, the pay button text in the Google Pay sheet will be "Pay Now". For other statuses it will say "Continue"

Throws

Thrown if Google Pay isn't ready or if the configuration is not valid


open override fun present(amount: Int)

Present the Google Pay UI.

Parameters

amount

The amount intended to be collected. It should be a positive integer representing how much to charge in the smallest currency unit (e.g. 100 cents to charge $1.00).

Throws

Thrown if Google Pay isn't ready or if the configuration is not valid