Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialGavin Murphy
10,004 Pointsintegration with paypal which can prevent the default redirect
HOw can I keep my customers on my page and display a localised shopping cart then have a checkout button to direct them to paypal. I was thinking if you included somwething like this. if($_SERVER['REQUEST_METHOD'] == post){ preventDefault(); } then further down the page you could have a 'checkout button' with a function redirect_to('myBusinessAccountWithPayPal URL');
2 Answers
Ted Sumner
Courses Plus Student 17,967 PointsUnfortunately I don't know the answer, but give it a shot. The worst that will happen is you have to change it back.
Gavin Murphy
10,004 PointsThanks Ted, |I tried it and it does prevent you from navigating but then when you try to navigate your customer to the exact same address at the checkout button, paypal won't allow it and brings you back to their home page. I am trying a new approach with their developer tools.