We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Handling PayPal Cancel URL when using Structure

Development and Programming

Sean Delaney's avatar
Sean Delaney
64 posts
15 years ago
Sean Delaney's avatar Sean Delaney

I’m running EE 2.1.1 with Structure 2.1.5.

I also use Membrr with OpenGateway. The payment gateway is PayPal EC.

All pages on the website are controlled using Structure so if a page isn’t known by Structure, a 404 is issued…

The problem I’m having is that when a customer cancels their payment on PayPal EC and redirected back to my website the URL is:

http://www.domain.org/en/network/purchase/?token=EC-00E472048W399303E

Which isn’t known by Structure so therefore the user gets a nice 404 page (which is not what I want)

How can I work around this and show my cancellation page:

http://www.domain.org/en/network/cancelled/

Please advise.

Sean

       
Jack McDade's avatar
Jack McDade
425 posts
15 years ago
Jack McDade's avatar Jack McDade

You could turn off Strict URLs off so your pages won’t serve the 404 – then where needed you can use require_entry=”yes” in your channel:entries tag to force a 404 redirect.

Alternately, create the /network/purchase/ URL with Structure and point it at whatever template you’d like.

       
Sean Delaney's avatar
Sean Delaney
64 posts
15 years ago
Sean Delaney's avatar Sean Delaney

Hi Jack,

I have Strict URL’s off and ‘require_entry’ set to yes. I also have the two pages ‘purchase’ and ‘cancelled’ setup within Structure but I’m still getting a 404.

http://www.domain.org/en/network/cancelled/?token=XYZ

It’s the ?token= segment part of the URL that Structure isn’t liking and therefore returning an 404

       
Jack McDade's avatar
Jack McDade
425 posts
15 years ago
Jack McDade's avatar Jack McDade

Do you have Freebie installed by chance?

       
Sean Delaney's avatar
Sean Delaney
64 posts
15 years ago
Sean Delaney's avatar Sean Delaney

No

       
Jack McDade's avatar
Jack McDade
425 posts
15 years ago
Jack McDade's avatar Jack McDade

What’s in your .htaccess file? It’s possible that’s what’s killing the query string. Structure itself ignores query strings, so i’m pretty sure that’s not the issue.

       
Sean Delaney's avatar
Sean Delaney
64 posts
15 years ago
Sean Delaney's avatar Sean Delaney

I’ve ended up writing a plugin to check the URL for a token returning true or false. based on the results perform a redirect.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.