Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

paypal IPN get buyer transaction ID

I need the buyer transaction ID that correspond to the transaction PayPal notifies me by IPN. I'm using

$_POST['txn_id']

but this stores the transaction ID for the seller, not the transaction ID of the buyer. At the same time the buyer hasn't access to the transaction ID of the seller.

I understand that PayPal assign two different transactions ID, but the seller needs to stores the buyer transaction ID in order to be able to communicate with the user about an specific transaction.

Anyone know how I can receive (or search for) the buyer transaction ID when PayPal send a notification to my IPN script?

I only receive the follow data:

Array
(
    [mc_gross] => 7.00
    [protection_eligibility] => Ineligible
    [payer_id] => F6912JHUIIHA
    [tax] => 0.00
    [payment_date] => 10:14:55 Sep 11, 2011 PDT
    [payment_status] => Completed
    [charset] => windows-1252
    [first_name] => Name
    [mc_fee] => 2.08
    [notify_version] => 3.2
    [custom] => 
    [payer_status] => verified
    [business] => [email protected]
    [quantity] => 1
    [verify_sign] => 123232jh4i32u4u3h5n435i43u5455645
    [payer_email] => [email protected]
    [txn_id] => 123u4324324yuy4574
    [payment_type] => instant
    [btn_id] => 35428120
    [last_name] => lastname
    [receiver_email] => [email protected]
    [payment_fee] => 2.08
    [shipping_discount] => 0.00
    [insurance_amount] => 0.00
    [receiver_id] => OIUWDWUERWEU
    [txn_type] => web_accept
    [item_name] => Product name
    [discount] => 0.00
    [mc_currency] => USD
    [item_number] => PRODNum
    [residence_country] => SE
    [handling_amount] => 0.00
    [shipping_method] => Default
    [transaction_subject] => Product to sell
    [payment_gross] => 7.00
    [shipping] => 0.00
    [ipn_track_id] => ydedi23484rl4itm54oi
)
like image 484
leticia Avatar asked Sep 14 '11 15:09

leticia


People also ask

Can I look up a PayPal transaction ID?

Find my PayPal transaction ID Click Activity near the top of the page to see your most recent account activities. Search for required transaction. Click the transaction to bring up payment details including your transaction ID (t's a 17-character string made up of both letters and numbers)


2 Answers

From the looks of the list of variables paypal sends back, there is no buyer transaction id.

Another option:

Usually when you send your order information to paypal, you can include an invoice/order number, the buyer, if needed, is able to search his history by your invoice number (the same way they would search by transaction id) if you include it when you send the info to paypal.

like image 144
thegaffney Avatar answered Oct 04 '22 16:10

thegaffney


You can use the GetTransactionDetails API and pass in the buyer's transaction ID.

A sample API call would be:
METHOD=GetTransactionDetails&
TRANSACTIONID=buyers transaction ID&

See also: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetTransactionDetails

like image 27
Robert Avatar answered Oct 04 '22 14:10

Robert