PHP - Paypal - Auto Redirect

  • amer
  • Born
  • Born
  • No Avatar
  • Joined: Aug 07, 2010
  • Posts: 4
  • Status: Offline

Post August 7th, 2010, 10:02 am

Hi,

I need to redirect visitors back to the website in order to empty their basket.

Steps as follow:

Step 1: Add item to basket
Step 2: confirm order
Step 3: Checkout - (Go to PayPal)
Step 4: force visitors to come back to the website and empty the basket

is this possible?

Thx.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post August 7th, 2010, 10:02 am

  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 6130
  • Loc: Seattle, WA
  • Status: Online

Post August 11th, 2010, 11:50 am

It doesn't make sense to require users to have to empty their carts after completing an order. Instead, it should be emptied automatically once the purchase is complete.

If I recall correctly, PayPal lets you specify a URL to redirect to upon the completion of a transaction. One strategy would be to send the user to a "thank you" page that includes a unique identifier for the transaction in the query string. This would allow you to run cleanup for that user's cart before displaying the page.
The Beer Monocle. Classy.
  • amer
  • Born
  • Born
  • No Avatar
  • Joined: Aug 07, 2010
  • Posts: 4
  • Status: Offline

Post August 18th, 2010, 9:52 am

thank you spork,

i am aware of the "thank you" page that is provided by PayPal, however; Paypal requires 5 seconds till the redirection takes a place, if the user decides to close the browser or simply go to another URL i wont be able to clean up the basket.
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 6130
  • Loc: Seattle, WA
  • Status: Online

Post August 18th, 2010, 10:41 am

You can't go sidestepping PayPal's system or policies, so you'll have to explore other options:

1. Empty the cart before sending them to PayPal;
2. Set up a cron job to empty carts on a regular interval;
3. Choose a service other than PayPal.
The Beer Monocle. Classy.
  • amer
  • Born
  • Born
  • No Avatar
  • Joined: Aug 07, 2010
  • Posts: 4
  • Status: Offline

Post August 20th, 2010, 1:47 am

thanks spork
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post August 20th, 2010, 2:44 am

I have a feeling you're not using IPN. You get an opportunity where you can clear a shopping cart when IPN sends a notification to your server that checks out.

Paypal IPN or Instant Payment Notification might be what you're looking for.
Strong with this one, the sudo is.

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 257 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.