paypal IPN get buyer transaction ID

自闭症网瘾萝莉.ら 提交于 2019-12-10 03:52:09

问题


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] => myemail@gmail.com
    [quantity] => 1
    [verify_sign] => 123232jh4i32u4u3h5n435i43u5455645
    [payer_email] => payermail@gmail.com
    [txn_id] => 123u4324324yuy4574
    [payment_type] => instant
    [btn_id] => 35428120
    [last_name] => lastname
    [receiver_email] => receiver@gmail.com
    [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
)

回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/7419268/paypal-ipn-get-buyer-transaction-id

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!