How to get transaction information from PayPal after successful payment


My data sent to paypal is

"https://www.paypal.com/cgi-bin/webscr/cmd=_cart&upload=1& business=seller.email@something.com &currency_code=USD&bn=BusinessName&return=http://www.sellersite.com&item_number_1=55&item_name_1=battery&amount_1=55&quantity_1=2&item_number_2=52&item_name_2=bat&amount_2=5&quantity_2=3" 

And after successful payment, I want to show this sent data (item number, item name, quantity, quantity) and paypal transaction ID on "http://www.sellersite.com". (Suppose the seller has a paypal merchant account and he will enter this PayPal identifier into the database from the admin section of the website. Therefore, I will not think about his PayPal account settings, my task is to create a PayPal payment environment for seller.)

If I write a script like

 $T_ID=$_REQUEST['tx']; // or $T_ID=$_GET['tx']; **ref(tx):- "https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_html_paymentdatatransfer" $item=$_REQUEST['item_number_1']; // or $item=$_GET['item_number_1']; 

Then will I get this data from PayPal?

Tell me please.

-Thanks.

+4
source share
1 answer

It will not be that simple. You need to set up a "Payment Data Transfer" (PDT) to receive the details sent back to your URL after the buyer completes the payment.

This is useful if you are just going to display the data back to the user, but it is not recommended to update your own database, send email notifications, etc., because there is no guarantee that this page will ever be reached, so the code is not always will be launched.

For this kind of thing, you'll want to use Instant Payment Notification (IPN) . This works very similar to PDT, except that it will always be POST data for your IPN listener on your server, regardless of whether it returns it back to your return URL, and this happens outside of your validation system together .

+4
source

All Articles