schivo Posted August 28, 2010 Share Posted August 28, 2010 I want to implement PayPal in my website. I'll be using ExpressCheckout method. I know there are following steps: 1. Cart page on a website 1a. Provide custom IPN URL in PayPal form (notify_url). 2. Redirect to PayPal payment page. 3a. On success redirect to my "payment confirmation" page. 3b. On false redirect to payment cancelled page. 4. Enable IPN in PayPal account. 5. Prepare payment handler page. PayPal response will be sent to this page. Everything above has been tested and it's working perfectly. Anyway, I have few questions. I need to log transactions in database 'transactions' table. So..on checkout page, I insert a row with user data, date. Now I'm wondering about one small thing. What about transaction ID? I was never implementing PayPal before, more I'm reading, I'm know less I'm testing payments in sandbox. When payment is done, it returns to provided URL with following $_GET data: ?token=EC-8JP09047FK347153S&PayerID=C9UCCD3968V52. But when I test IPN in my sandbox it return a field called txn_id. Now time for my questions: 1. Is this the same as token? 2. How transactions are usually logged in into database? What is used as 'key' when 3. Is it possible to define token and payer_id before redirecting user to PayPal checkout? 4. When checking transaction on IPN response handler, is txn_id the most important transaction field? My biggest issue is to handle IPN response. How could I know transaction ID when I do not have any key to compare? Any help will be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/211955-paypal-expresscheckout-help-needed/ Share on other sites More sharing options...
jcbones Posted August 28, 2010 Share Posted August 28, 2010 I suppose you are holding the cart and all of the available item info on your site, and only passing the total value to paypal. If so, you can send an 'item_number' over to paypal, which could be your transaction ID. This value will be passed back to you on transaction completion. Paypal variables Quote Link to comment https://forums.phpfreaks.com/topic/211955-paypal-expresscheckout-help-needed/#findComment-1104684 Share on other sites More sharing options...
schivo Posted August 29, 2010 Author Share Posted August 29, 2010 Hi, thanks for your reply. Only one question. It will be returned by IPN or it will be returned to return_url? Quote Link to comment https://forums.phpfreaks.com/topic/211955-paypal-expresscheckout-help-needed/#findComment-1104847 Share on other sites More sharing options...
jcbones Posted August 29, 2010 Share Posted August 29, 2010 I believe it returns the data back to the notify_url, which is the IPN. Quote Link to comment https://forums.phpfreaks.com/topic/211955-paypal-expresscheckout-help-needed/#findComment-1104935 Share on other sites More sharing options...
schivo Posted August 29, 2010 Author Share Posted August 29, 2010 Thanks. Will give a try and will ask if will need more help. Quote Link to comment https://forums.phpfreaks.com/topic/211955-paypal-expresscheckout-help-needed/#findComment-1105018 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.