Jump to content


Photo

Tracking returns from PayPal


  • This topic is locked This topic is locked
2 replies to this topic

#1 Guest(old)

Guest(old)

    Junior Member

  • Members
  • 312 posts

Posted 27 November 2002 - 04:30 AM

Hi,

Another question ;) This time about tracking which payment is for which basket.

I'm implementing my own basket/cart on my site and using PayPal to take the payment. So I calculate the amount of the purchase and send the Customer to PayPal to pay for it.

However one thing that occurs to me is that I would need to save the "state in time" of the items in the basket and generate a unique ID for that basket and pass it to PayPal, then capture it in the return URL to log which basket has just been paid for.

The reason being (playing Devil's advocate!) would it be possible for the following:

1. Customer adds one item to basket, goes to checkout, confirms details, and clicks link to pay to go to PayPal, but opens it in a new window. The ID of the basket is passed to PayPal.

2. Customer adds more items to their basket in the original window.

3. Customer pays at Paypal and returns to the site.

4. The site picks up the Basket ID and confirms the order to the Customer.

However - they've paid for one item but the site has logged payment for that basket so they have effectively got all the other items for free.

Hope this makes sense; I'm assuming I need a duplicate set of tables in my DB to "copy" the state of the basket and generate a separate unique ID and use this to track the payment, so when the Customer returns, the order that gets placed ONLY contains what was in the baske *at the time* they went to pay for it.

Does this sound accurate?


#2 WareFore

WareFore

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 28 November 2002 - 10:13 AM

So how could this "customer" open the link in another window? He clicks & PayPal takes over in the same window, right? Even if he could do this other-window bit, your form with all the PayPal data in hidden fields is back in the original window, so none of your data (Basket ID, &c) shows in the new window. Even if all this were to happen, if you're tracking the Basket in your database, you can compare its total to the mc_gross amount coming back from PayPal (on your IPN notify_url, probably) & see there's a difference, no?

Am I missing something here?

Glenn Gillette
WareFore Analysis
www.warefore.com

#3 paypal_pb

paypal_pb

    Advanced Member

  • Members
  • 2,960 posts

Posted 28 November 2002 - 07:41 PM

If you are sending the cart contents to PayPal, I'd suggest waiting for the payment to be made and then reading the cart contents from the IPN.

If you are not sending the cart contents to PayPal then you can use a pass-through variable such as "item_number" or "invoice" to pass in an order ID that will be echoed back to you.

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users