You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using PaymentSheet.FlowController.
I initialise it using PaymentSheet.FlowController.create which takes a paymentOptionCallback
Any time when user taps the pay button on my activity, I call configureWithIntentConfiguration() on the flow controller.
It has a ConfigCallback which returns success or an error.
In case of success, I call presentPaymentOptions() method on the flow controller.
Now on the payment sheet if I don't select anything and tap cross, the payment sheet dismisses and the paymentOptionCallback is triggered which shows the paymentOption as null.
Now if reopen the payment sheet, and select a payment method, lets say "Pay with link", then paymentOptionCallback is triggered and has a paymentOption and then I trigger confirm() method of the flow controller which then takes me to the browser where it asks me for login details. At this point if I just don't fill anything and close browser, then the payment option is not null anymore and paymentResultCallback is called as Canceled.
Now the user is back to the app. At this point if I open then payment sheet again and just tap cross, the paymentOptionCallback is triggered and it still shows the paymentOption as the stripe link and then it takes me to the browser again asking me for login details for "Pay with link". Because in paymentOptionCallback I trigger confirm() method of the flow controller.
In paymentOptionCallback how can I distinguish if the user actually just closed the payment sheet or has actually started the flow again with the said option?
Don't you think that if I just tap cross on the payment sheet, then it shouldn't trigger anything even if any other payment option was selected earlier which was not successful?
Would be great if someone can shed some light on this.
The text was updated successfully, but these errors were encountered:
Hey @omertanveer! Seems like you have an integration error with FlowController. The intention of FlowController is to allow you to show the selected payment option in your UI before proceeding with payment. Inside your own UI, you would have your own Pay button that would call confirm.
In this case, it seems you call confirm on every paymentOptionCallback call which isn't right. The Canceled will return a payment option because there is a chance the original selected payment option was removed if the selected option was a saved card for instance.
If you don't plan on showing the payment option inside of your own UI, you can instead use PaymentSheet rather than PaymentSheet.FlowController which handles the entire payment flow process within the sheet itself. See instructions on how to implement it here.
Well initially I started using Paymentsheet instead of the FlowController.
But there are some challenges with using the PaymentSheet itself. It normally closes only in case of a full successful flow. So there were scenarios where we wanted to close it via code but there seemed to be no possibility. Also in case of authentication, if the user tapped "Fail", there was no callback returned at all. So had to switch to FlowController.
Yes with the FlowController I am calling confirm() on every paymentOptionCallback. I see what you mean by the intention of the FlowController. That's why on my activity the button that I show says "Continue to payment" (along with the order total) and tapping on this triggers the configureWithIntentConfiguration of the flowController and once the callback is success we call the presentPaymentOptions of the flow controller. Also the primaryButtonLabel that I am using in the configuration says "Place order". So when the user actually selects a payment method like credit card and fill in their card details with valid info, then tapping on the "Place order" then actually triggers the call to process the order.
Hi
I am using PaymentSheet.FlowController.
I initialise it using PaymentSheet.FlowController.create which takes a paymentOptionCallback
Any time when user taps the pay button on my activity, I call configureWithIntentConfiguration() on the flow controller.
It has a ConfigCallback which returns success or an error.
In case of success, I call presentPaymentOptions() method on the flow controller.
Now on the payment sheet if I don't select anything and tap cross, the payment sheet dismisses and the paymentOptionCallback is triggered which shows the paymentOption as null.
Now if reopen the payment sheet, and select a payment method, lets say "Pay with link", then paymentOptionCallback is triggered and has a paymentOption and then I trigger confirm() method of the flow controller which then takes me to the browser where it asks me for login details. At this point if I just don't fill anything and close browser, then the payment option is not null anymore and paymentResultCallback is called as Canceled.
Now the user is back to the app. At this point if I open then payment sheet again and just tap cross, the paymentOptionCallback is triggered and it still shows the paymentOption as the stripe link and then it takes me to the browser again asking me for login details for "Pay with link". Because in paymentOptionCallback I trigger confirm() method of the flow controller.
In paymentOptionCallback how can I distinguish if the user actually just closed the payment sheet or has actually started the flow again with the said option?
Don't you think that if I just tap cross on the payment sheet, then it shouldn't trigger anything even if any other payment option was selected earlier which was not successful?
Would be great if someone can shed some light on this.
The text was updated successfully, but these errors were encountered: