collectPaymentMethod

fun collectPaymentMethod(intent: PaymentIntent, config: CollectConfiguration = CollectConfiguration.Builder().build(), callback: PaymentIntentCallback): Cancelable

Collects a payment method for the given PaymentIntent.

If collecting a payment method fails, the callback will be called with an error. After resolving the error, you may call collectPaymentMethod again to either try the same card again, or try a different card.

If collecting a payment method succeeds, the callback will be called with a PaymentIntent with status REQUIRES_CONFIRMATION, indicating that you should call confirmPaymentIntent to finish the payment.

See https://stripe.com/docs/terminal/payments#collect.

Return

A Cancelable that allows the operation to be canceled at any time

Parameters

intent

The PaymentIntent to which the payment method should be attached

config

An optional CollectConfiguration to configure per-transaction overrides.

callback

The PaymentIntentCallback to be called after the command completes