fun collectSetupIntentPaymentMethod(intent: SetupIntent, customerConsentCollected: Boolean, callback: SetupIntentCallback): Cancelable

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.


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



The SetupIntent to which the payment method should be attached


Whether customer consent has been collected to save their card.


The SetupIntentCallback to be invoked when the command completes