paypal IPN get buyer transaction ID

leticia picture leticia · Sep 14, 2011 · Viewed 11.6k times · Source

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
)

Answer

thegaffney picture thegaffney · Sep 15, 2011

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.