collectRefundPaymentMethod

fun collectRefundPaymentMethod(refundParams: RefundParameters, config: RefundConfiguration = RefundConfiguration.Builder().build(), callback: Callback): Cancelable

Initiates an in-person refund with a given set of RefundParameters by collecting the payment method that is to be refunded.

Some payment methods, like Interac Debit payments, require that in-person payments also be refunded while the cardholder is present. The cardholder must present the Interac card to the card reader; these payments cannot be refunded via the dashboard or the API.

For payment methods that don't require the cardholder be present, see https://stripe.com/docs/terminal/payments/refunds.

This method, along with confirmRefund, allows you to design an in-person refund flow into your app.

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

If collecting a payment method succeeds, the onSuccess method of the callback will be called. At that point, you can call confirmRefund to finish refunding the payment method.

Calling any other SDK methods between collectRefundPaymentMethod and confirmRefund will result in undefined behavior.

Note that if collectRefundPaymentMethod is canceled, the completion block will be called with a Canceled error.

Parameters

refundParams

The RefundParameters object that describes how the refund will be created.

config

An optional RefundConfiguration to configure per-refund overrides.

callback

The callback to be called when the command completes.