collectSetupIntentPaymentMethod
fun collectSetupIntentPaymentMethod(intent: SetupIntent, customerConsentCollected: Boolean, callback: SetupIntentCallback): Cancelable
Content copied to clipboard
Collects a payment method for a SetupIntent.
If collecting a payment method fails, the callback will be called with an error. After resolving the error, you may call collectSetupIntentPaymentMethod 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 SetupIntent with status REQUIRES_CONFIRMATION
, indicating that you should call confirmSetupIntent to finish setting up the payment.
Return
A Cancelable that allows the operation to be canceled at any time
Parameters
intent
The SetupIntent to which the payment method should be attached
customerConsentCollected
Whether customer consent has been collected to save their card.
callback
The SetupIntentCallback to be invoked when the command completes