PayPal IPN and CodeIgniter |
[eluser]YellowShadow[/eluser]
Hey all, I'm trying to email the cart contents to the user after the PayPal IPN result but it just sends a blank email. I don't think it actually gets the session data for the cart if the user is not on my website. Is there a workaround for this? Here is the current code I'm using... Code: public function ProcessOrder() Any help would be greatly appreciated! Thanks!
[eluser]Mat-Moo[/eluser]
IPN callbacks are from the Paypal server, so there is NO session data. You need to use an order number in the paypal data to process who it is for etc.
[eluser]pickupman[/eluser]
[quote author="Mat-Moo" date="1313067398"]IPN callbacks are from the Paypal server, so there is NO session data. You need to use an order number in the paypal data to process who it is for etc.[/quote] That's exactly right. In addition to that, you should be destroying your users cart once they have placed the order. Your cart shouldn't exists after you have checked out. Using the IPN posted back to you, make sure you are comparing the order id and amount against the db. Then use that order record to populate the email.
[eluser]YellowShadow[/eluser]
Alright so what would be the best way to loop through all the cart contents and add them to the PayPal shopping cart? I tried a simple foreach loop to add them before the checkout button is pressed, but it only shows one item at the PayPal screen.
[eluser]pickupman[/eluser]
Here's the information from [url="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_cart_upload#id08A3F700OYK"]Paypal[/url]. Just need to add a hidden field for each item to your form. |
Welcome Guest, Not a member yet? Register Sign In |