-
Notifications
You must be signed in to change notification settings - Fork 266
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
Close programatically a payment sheet #724
Comments
Is your feature request related to a problem? Please describe. Describe the solution you'd like Describe alternatives you've considered |
does anybody found a workaround? |
I have the same problem. We block the reservation slot for few minues and cancel the payment intent from server when we could not confirm the payment has complete within the time. I would like to have |
Hello @charliecruzan-stripe any news about this issue? @Liodene were you able to solve it? |
+1 on the issue |
@charliecruzan-stripe since you closed my issue, could you at least give me some update on this request from 2021. That would be really nice to have some. |
I was taking a look into it today 🙂 to clarify, is there any use case anyone is looking for that does not include calling this function inside of a timeout? What I'm wondering is if there's any situation that would not look something like:
|
@charliecruzan-stripe , i will explains as much as i can my situation. I'm not quite sure i understand what you mean so i will give you my situation and hopefully it can help you. We have limited products in our store and when we put it in our cart we have a reservation that is trigger. The customer have to purchase his products before the timer expire (15 minutes). The way the pluggin work on our end, it send the qty of the product on hold in our wordpress backend and it clear it after 15 minutes. That said, in our app when we put the item inside the cart, i start a timer of 900 seconds (15 minutes) with an interval that will make it drop to 0. Whenever that timer drop to zero there is a redux state that switch (isTimerExpired = true) so there is an useEffect that trigger a function, the product that the client hold get clear inside the app and in our backend and it is not assign to the customer anymore. So if someone else reserve it, the client end up by completing the payment and get 0 product to his order. So if a customer open the stripe payment sheet and wait for his 15 minutes to pass for any reason (e.g: getting his CC, talking to someone or whatever the case). We need a way to close the payment sheet so the user cannot complete the payments without any products assign to his orders. In my case, it would be trigger by a changing state, if that is possible. |
Thanks @ElSeniorMikael , so it sounds like your use case is also included in what I said above with |
@charliecruzan-stripe, one thing to keep in mind, i've realised this morning that Android get into background mode whenever stripe open. That said, it would mean that function coming from the app wouldn't trigger if stripe is open on the paymentSheets. In this case, if we can't trigger a function to close the Android. A timeout delay on the paymentSheets would be better in my opinion. |
Yep, that's what I was thinking as well so just trying to determine everyone's use cases here and see if that's a solution that works for all. Since we've buried it and i want to make sure people see it, I'm going to re-paste my question from earlier: is there any use case anyone is looking for that does not include calling this function inside of a timeout? What I'm wondering is if there's any situation that would not look something like:
|
@charliecruzan-stripe Hello, i was wondering if you could provide us a time frame of when it could be available, that would be great :) |
@ElSeniorMikael released in v0.24.0 |
Hello @charliecruzan-stripe, I just found this thread and first I wanted to thank you for the feature! is it possible to add UI to display the timeout? I think it will be good to have the option to give feedback to the user and let them know how much time is remaining before closing the payment sheet. |
@ff-adrian-obando I don't think that's something we'll be able to add to the payment sheet, sorry! |
Hello @charliecruzan-stripe, I had the same problem of mentioned above in this thread (the user has a certain duration to complete the payment before the reservation is rolled back), everything worked fine after I used the added timeout option to programmatically close the payment sheet, except for the case when I try to use the declined payment test cards, the payment sheet doesn't close after the specified period. |
@charliecruzan-stripe Can we have the same timeout option in the createPlatformPayPaymentMethod method as well? In my use case, users can pay using Google Pay or apple pay, and I want to close the payment intent if the user stays on the payment sheet for more than 5 or possibly 10 minutes. |
Is your feature request related to a problem? Please describe.
We have a short term expiration on our cart for business reasons, so we just stop the purchase funnel when it expires.
The problem is that if the payment sheet is open and the cart expires, we have no way to close the payment sheet programatically.
Describe the solution you'd like
I'd like to have a function available to close any open payment sheet. We could get it either from the useStripe hook or in response or the presentPaymentSheet.
Describe alternatives you've considered
We tried to use a custom flow to be able to:
The flow is less practical and a bit confusing for the user since the text displayed is about adding a card and not paying.
Moreover there are some issues inherent with the custom flow (#723) that prevents from using it at the moment.
Additional context
This feature request might relate to #447 but it's way more generic and doesn't concern only Apple Pay.
The text was updated successfully, but these errors were encountered: