PaymentHandle

interface PaymentHandle

Representation of a payment process available immediately from PaymentManager.startPaymentActivity. Provides a way to interact with an ongoing payment, e.g. cancel it or select additionalPaymentMethods. Additionally, one can get idempotencyKey of the payment that was just created.

Types

Link copied to clipboard

Properties

Link copied to clipboard

Provides access to non-cardreader payment methods.

Link copied to clipboard
abstract val idempotencyKey: String

The unique key assigned to the payment immediately from PaymentManager.startPaymentActivity. Used for disaster recovery if a crash occurs before the larger set of information reported to the payment callbacks.The idempotency key is assigned very early, and does not suggest anything about the payment's success or even validity. If valid, however, it can be used to refer to the payment in other calls to Square's Connect API. For example, an incomplete payment created using PaymentParameters.autocomplete=false can be completed with a call to /v2/payments/idempotencyKey/complete.

Functions

Link copied to clipboard

Cancels a pending payment, if one exists and can be canceled. In this case, the method returns CancelResult.CANCELED and the payment callbacks will be called with PaymentErrorCode.CANCELED to indicate the cancellation.

Link copied to clipboard

Searches for a specific additional payment method by its type.