capacitor-community / stripe

Stripe Mobile SDK wrapper for Capacitor
MIT License
185 stars 74 forks source link

Return at least paymentMethodId when confirming setupIntent on iOS #59

Closed OrthoCube closed 3 years ago

OrthoCube commented 3 years ago

This only affects iOS.

Currently, even though the confirmSetupIntent is successful, the plugin just returns an empty JavaScript object {} upon success. It is important to get the paymentMethodId from a successful confirmation so that the paymentMethodId is registered to the Stripe User.

This Pull Request just returns the paymentMethodId when confirmSetupIntent succeeds. I don't know where to get the other data that the interface ConfirmSetupIntentResponse has, however, this should help make confirmSetupIntent at least useful in iOS.