-
Notifications
You must be signed in to change notification settings - Fork 5
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
Long redirect #14
Comments
Can you explain differently? It doesn't make much sense. If it redirecting or not? Why 10 minutes if it's only taking 2sec? |
So BTCPay is redirecting you every 2 seconds forever? is that what you are saying? |
Yes, however there's nothing I can do with the BTC server. I just did a test on Magento side where in the ReturnAfterPayment controller I added simple exit() and it works for me. So a solution would be if I could process the whole request below 2 s. I'm just asking if anyone has faced a similar issue. |
Any idea why it is taking longer than 2 sec? Is it trying to connect to BTCPay API and getting a timeout perhaps? Not sure how long it should take, but 2sec may be an indication something is off. |
Not at the moment. I'm going to look at the issue. It might be not related to BTC pay at all. Was just curious. |
I've fixed this issue. If anyone is interested, this is how I did it. I've created a plugin for Storefront\BTCPay\Model\BTCPay\BTCPayService where I defined a different return after payment URL. This URL is just a simple controller with a template in our Magento installation. All it does is it shows a message "The payment is processing, don't close this window". There's a javascript on DOM load that redirects the customer to the original btcpay/redirect/returnafterpayment with all the needed params. The purpose of this custom URL is that it sends out the response very quickly. It takes less than a second, which cause the status check script (which runs every 2 s) not to execute anymore and our customer is shown the checkout success page with all the code that needs to execute there. |
We just released v 2.0.6. Does this help your case? |
Thanks for the info. From the quick look in diff probably not, but I'll have a look when I work with this extension on our code next time. However the solution I posted last month solves the issue. |
Has anyone experienced this problem?
When a user is redirected to the gateway (with QR code), there's a status javascript request that checks the status of the payment every 2 s. That is hardcoded in the BTC pay server, so not much we can do about it.
The user pays and the browser starts redirecting back to Magento btcpay/redirect/returnafterpayment (that's the URL ending with 61eaf8365c3629985bf582ad4a5d8e18c2c4ecf4). This redirects to checkout/onepage/success. However, these requests take more than 2 s. In the meantime, the status script sends another request back to Magento.
The result is that the browser tries redirecting for about 10 min, until it finally gives up and the user is redirected back to the success page.
Can we solve it somehow?
The text was updated successfully, but these errors were encountered: