redirection - malformed URL

3 weeks 1 day ago #4363 by Michael Nixson
Topic Author
Michael Nixson's Avatar
Posts: 9
I just installed and tested Stripe Checkout for Phoca Cart. Everything worked OK in processing a sandbox order except that once the Checkout plugin fully processed the payment, I was redirected to a malformed URL:

talos4.net/j4-A/j4-A/index.php/video-store/light-of-life/light-2021/info

There is duplicate path information which I've bolded in the link that doesn't below there. If you remove /j4-A, it will resolve to the correct page. Any idea how this errant path information is getting in there?
The topic has been locked.
2 weeks 5 days ago #4364 by Dmitrijs
Dmitrijs's Avatar
Posts: 1067
Hi Michael,

Probably this line of code is causing this when website is located under subfolder:
rtrim(Uri::root(), '/') . Route::_(PhocacartRoute::getInfoRoute())

What if you create a menu item leading to Phoca Cart info view?

P.S.
I will retest this line also, but I need to set up Phoca Cart test site under subfolder first.

Best regards,
Dmitrijs

Like our extensions and support?
Add your voice to the JED listing with a 5-score review: bit.ly/2ciJBqC
Thanks!
The topic has been locked.
2 weeks 5 days ago #4365 by Michael Nixson
Topic Author
Michael Nixson's Avatar
Posts: 9
I created a hidden menu item pointing to the "corrected" URL without the errant path [talos4.net/j4-A/index.php/video-store/li...life/light-2021/info]. I tried this with two orders. One in a different category of products and one out of the same category as the above path [/light-of-life/light-2021/]. Both returned the malformed URL (with the extra '/j4-A') and a 404 error. Even if I arranged to redirect the wrong URL to the correct one, that would be impractical as the correct end path is a function of the category of the product and would be different every time.
The topic has been locked.
2 weeks 5 days ago #4366 by Dmitrijs
Dmitrijs's Avatar
Posts: 1067
On my test site (it is not under subfolder) the code Route::_(PhocacartRoute::getInfoRoute()) provides URL which points to an item which is managed by a Joomla component. In my case this code outputs /index.php/phoca-cart/info. To output a correct URL I have added rtrim(Uri::root(), '/') that outputs test.site.com and concatenated both, so the final output for me is test.site.com/index.php/phoca-cart/info. As you can see I use Joomla API to create an URL and this is the expected behaviour.

It seems that the code rtrim(Uri::root(), '/') provides the path with the extra /j4-A. Why? I do not have an answer at the moment.

Best regards,
Dmitrijs

Like our extensions and support?
Add your voice to the JED listing with a 5-score review: bit.ly/2ciJBqC
Thanks!
The topic has been locked.
2 weeks 5 days ago #4367 by Michael Nixson
Topic Author
Michael Nixson's Avatar
Posts: 9
Where did you add rtrim(Uri::root(), '/' to? I'm thinking that I should wait until you have some systemic fix to this.
The topic has been locked.
2 weeks 4 days ago #4368 by Dmitrijs
Dmitrijs's Avatar
Posts: 1067

Where did you add rtrim(Uri::root(), '/' to?


It's already there - in the plugin code. I was explaining how in the plugin "Success URL" is being created and then passed to Stripe.

I'm thinking that I should wait until you have some systemic fix to this.

I am not sure that the fix exists as the plugin is using Joomla API to create URL. For some unknown reason Uri::root() is not working as expected on your set up.

Like our extensions and support?
Add your voice to the JED listing with a 5-score review: bit.ly/2ciJBqC
Thanks!
The topic has been locked.
2 weeks 1 day ago #4369 by Michael Nixson
Topic Author
Michael Nixson's Avatar
Posts: 9
I resolved this by moving the entire site into a sub domain which allows me to keep in in a non-root location while serving up the root equivalent in the sub domain now. Works like a charm now.
The topic has been locked.
1 week 5 days ago #4370 by Dmitrijs
Dmitrijs's Avatar
Posts: 1067
Glad that you have resolved it. Anyway we will make tests under subfolder to make sure it is not something your host related.

Best regards,
Dmitrijs

Like our extensions and support?
Add your voice to the JED listing with a 5-score review: bit.ly/2ciJBqC
Thanks!
The topic has been locked.
1 week 5 days ago #4371 by Eugene
Eugene's Avatar
Posts: 941
Replied by Eugene on topic redirection - malformed URL
Hi Michael,
It is nice the problem is resolved now.
Overall, how do you like Stripe checkout plugin? If you're happy with it, would you be willing to rate it on the JED, please?
extensions.joomla.org/extension/stripe-checkout-for-phoca-cart/

Best regards,
Eugene

Like our extensions and support?
Add your voice to the JED listing with a 5 score review:: bit.ly/2ciJBqC
Thanks!
The topic has been locked.

You can get our help: Monday - Friday / 09:00 to 17:00 (GMT+2). but not limited. Our staff will be pleased to provide Premium support to every paid subscriber asap, but sometimes you should be ready to wait for our reply for up to 3 days. In case of free extensions we do the best to develop and maintain them either, but their support is not necessary.

Follow us in social media