-
Notifications
You must be signed in to change notification settings - Fork 3
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
Issue while payment redirection in some hosting provider due to caching #56
Comments
Good catch, we should be able to fix that. In our PayPal gateway integration we (ab)use the REST API for this:
The advantage of the WordPress REST API is the ease of registering endpoints which automatically work with 'Plain Permalinks' (Ugly Permalink) and 'Pretty Permalinks':
We could use an endpoint like Maybe we should split this up too: flowchart TD
A[Start] --> B{HTTP or HTML?}
B -->|HTTP| C[Redirect to gateway]
B -->|HTML| D[Redirect to WordPress page]
D --> E[Auto submit HTML form]
The question then is whether we make use of a regular WordPress page for the HTML 'redirect' or opt for custom rewrite rule. I think we should go for a custom rewrite rule so that we can use 'Pretty Permalinks', something like:
|
Hello Team
I encountered another rare issue. This happens with websites on some hosting providers. Some hosting providers by default cache the homepage of the website. because of which
filter_has_var( INPUT_GET, 'payment_redirect' )
always returnsfalse
even ifpayment_redirect
andkey
are available in the URL.wp-pay-core/src/Plugin.php
Line 480 in 1d52978
I suggested 2 of my clients contact the hosting providers and remove the caching on the homepage, and this solved the issue. But most of such clients think that this is the issue with the plugin instead of hosting. because they don't contact us.
Proposed Solution: If at the function below, we will change the URL format to an SEO-friendly URL for the hosting which supports SEO-friendly URL, this issue will get resolved. If hosting does not support SEO-friendly URL, we can continue to use this method.
wp-pay-core/src/Payments/Payment.php
Line 294 in 1d52978
The same issue is there with
handle_returns
and various other functions also.What do you think? Can we fix this issue anyhow?
The text was updated successfully, but these errors were encountered: