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

createPaymentFlow does not work without defining a customerId #162

Closed
tanrax opened this issue Mar 14, 2022 · 8 comments · Fixed by #165
Closed

createPaymentFlow does not work without defining a customerId #162

tanrax opened this issue Mar 14, 2022 · 8 comments · Fixed by #165

Comments

@tanrax
Copy link

tanrax commented Mar 14, 2022

If customerId is null or not present, it does not work. However, if an empty string is assigned, it works again.

Does not work

const results = await Stripe.createPaymentFlow({
  paymentIntentClientSecret: paymentIntent.client_secret,
  customerEphemeralKeySecret: paymentIntent.id
});
await Stripe.presentPaymentFlow();

Work.

const results = await Stripe.createPaymentFlow({
  paymentIntentClientSecret: paymentIntent.client_secret,
  customerEphemeralKeySecret: paymentIntent.id,
  customerId: ''
});
await Stripe.presentPaymentFlow();
  • OS: Android
@rdlabo
Copy link
Member

rdlabo commented Mar 15, 2022

Thanks for issue. I did not envision a case where customerEphemeralKeySecret was available and customerId could not be obtained. Only a simple check is performed here.

iOS: https://github.com/capacitor-community/stripe/blob/master/ios/Plugin/PaymentFlow/PaymentFlowExecutor.swift#L16-L19
Android: https://github.com/capacitor-community/stripe/blob/master/android/src/main/java/com/getcapacitor/community/stripe/paymentflow/PaymentFlowExecutor.java#L43

What is the specific use case where customerId does not exist?

@tanrax
Copy link
Author

tanrax commented Mar 15, 2022

According to the documentation, the customer is optional with the following description:

customer optional

ID of the Customer this PaymentIntent belongs to, if one exists.
Payment methods attached to other Customers cannot be used with this PaymentIntent.

I assume, and correct me if I am wrong, that a payment can be made without a customer.

@rdlabo
Copy link
Member

rdlabo commented Mar 16, 2022

@tanrax Oh, you are right. PaymentSheet and PaymentFlow must customer optional. I will fix as soon as possible.

@rdlabo
Copy link
Member

rdlabo commented Mar 16, 2022

@tanrax I released v3.6.0-0. Please try this.

npm i @capacitor-community/[email protected]

Thanks.

@tanrax
Copy link
Author

tanrax commented Mar 16, 2022

Thanks to you for such speed and professional workflow :)

@rdlabo
Copy link
Member

rdlabo commented Mar 17, 2022

@tanrax Hi, thanks for quick response! Did you use this plugin for production? If yes, please tell us what app. This help development this plugin.

👉 #145

Thanks.

@tanrax
Copy link
Author

tanrax commented Mar 17, 2022

Not at the moment, we won't release the first beta for another month. In any case, I will keep you informed. Thank you very much, from the bottom of my heart, for the good support.

@rdlabo
Copy link
Member

rdlabo commented Mar 18, 2022

@tanrax I can't wait for your app to be released and used by the masses! I'm looking forward to hearing from you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants