Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add PaymentMethod object on PaymentOptionCallback #8071

Open
Hospes opened this issue Mar 8, 2024 · 4 comments
Open

[Feature] Add PaymentMethod object on PaymentOptionCallback #8071

Hospes opened this issue Mar 8, 2024 · 4 comments
Labels
feature triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@Hospes
Copy link

Hospes commented Mar 8, 2024

Is your feature request related to a problem? Please describe.

I've implemented payment flow like described in this article paymentsheet-flowcontroller. Docs says that after using flowController.presentPaymentOptions() we will handle selected PaymentOption through PaymentOptionCallback to update our own UI if needed. In my case it's needed but PaymentOption doesn't contain all needed information. It has only label and icon but in my case I need to know what type of PaymentMethod was selected like paypal/klarna/card/etc...

Describe the solution you'd like

Add more usefull information about selected payment to PaymentOption, mostly needed information are exists in PaymentMethod class like type/id.

Describe alternatives you've considered

Would be perfect if we can receive and PaymentOption and PaymentMethod at the same time, so we can update our UI according to selected type of payment

Additional context

Currently to properly update our UI I have to fake start payment process and pass invalid clientSecret on CreateIntentCallback because I want to receive PaymentMethod and then I'm updating our UI with adjusted prices and then I'm again doing reconfig of FlowController and then I'm waiting for user starts payment process. I would like to avoid any fake actions

@Hospes Hospes added the feature label Mar 8, 2024
@jaynewstrom-stripe
Copy link
Collaborator

Hi @Hospes we recently added something similar on iOS: stripe/stripe-ios#3165

Would adding the payment method type, and the billing details solve your use case?

(We don't actually create the PaymentMethod until flowController.confirm() is called, so we don't have it available in the callbacks.)

@jaynewstrom-stripe jaynewstrom-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Mar 8, 2024
@Hospes
Copy link
Author

Hospes commented Mar 8, 2024

@jaynewstrom-stripe my case - yes, if you add PaymentMethod.Type to PaymentOption will fully solve my problem.

@jaynewstrom-stripe
Copy link
Collaborator

@Hospes what if we add val paymentMethodType: String? Where the value would match PaymentMethod.Type.code?

I asked because we're also planning some upcoming features where we can't expose PaymentMethod.Type directly.

@Hospes
Copy link
Author

Hospes commented Mar 8, 2024

@jaynewstrom-stripe Yes, it's fine by me. The main idea is to have constant that will explain selected type 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature triaged Issue has been reviewed by Stripe and is being tracked internally
Projects
None yet
Development

No branches or pull requests

2 participants