Home > Mobile >  PHP(CodeIgniter)-PAYPAL IPN (unable to send the session of the current user to the ipn file of paypa
PHP(CodeIgniter)-PAYPAL IPN (unable to send the session of the current user to the ipn file of paypa

Time:07-08

My integration is working fine, even the IPN is returning the information correctly. However, im not able to send the session to the IPN file in order to add the user id to the database in addition to the info returned from paypal(price/transaction_id...). The session is shared with all other pages and functions in my application except for the notify.php(ipn file).

CodePudding user response:

IPN is a post directly from the PayPal servers to your server. It will not share any session information with users accessing your website, because users and their user agents (browsers) are not involved in the IPN communication in any way.

IPN is a very old, legacy technology that should be deprecated soon and there is no reason to use it with current PayPal checkout integrations, which offer immediate API responses of payment capture successes and failures.

However if you must continue to use the IPN service for some strange reason, the usual method was to include a custom parameter as part of the original PayPal transaction, the value of which will then be passed back as part of the IPN data. This can then be reconciled with web sessions, open orders, or whatever else you need to do.

But again, the best solution is to not use IPN at all and instead integrate the current v2/checkout/orders API, preferably never redirecting users away from your site and using the in context JS SDK approval flow.

  • Related