我在处理我正在开发的网络应用上处理PayPal IPN消息时遇到了麻烦。我向PayPal商家技术支持部门询问了有关处理Reversed
,Canceled_Reversed
和Refunded
IPN消息的信息。下面的代码是我从他们的答案中发现的有用的。我希望它也会使用其他人:
付款:
{
"mc_gross":"5.00",
"protection_eligibility":"Ineligible",
"item_number1":"",
"payer_id":"2LMAK5CCRFC7Y",
"tax":"0.00",
"payment_date":"15:51:55 May 02, 2014 PDT",
"payment_status":"Completed",
"charset":"windows-1252",
"mc_shipping":"0.00",
"mc_handling":"0.00",
"first_name":"Roman",
"mc_fee":"0.45",
"notify_version":"3.8",
"custom":"",
"payer_status":"verified",
"num_cart_items":"1",
"mc_handling1":"0.00",
"verify_sign":"AhKjPyUAFwaeM5vZHwjU.0caZhHtAV.H1ZruV63s-yLcAYfGQU8WYTEX",
"payer_email":"XXXXXX",
"mc_shipping1":"0.00",
"tax1":"0.00",
"txn_id":"64M28299HV0955007",
"payment_type":"instant",
"last_name":"Arora",
"item_name1":"Air Pilots",
"receiver_email":"XXXXXX",
"payment_fee":"0.45",
"quantity1":"1",
"receiver_id":"XXXXXX",
"txn_type":"cart",
"mc_gross_1":"5.00",
"mc_currency":"USD",
"residence_country":"US",
"transaction_subject":"Air Pilots",
"payment_gross":"5.00",
"ipn_track_id":"dfa90ecb35b46"
}
当与paypal解决方案中心提出争议时:此IPN与初始付款的txn_id相同
{
"txn_type":"new_case",
"payment_date":"15:51:55 May 02, 2014 PDT",
"case_id":"PP-003-125-383-356",
"case_type":"dispute",
"business":"XXXXXX",
"verify_sign":"AbFfRIjxGf8ulMoIvA2Jhdo84gY5Ahewo.T-JjKYBzZxoAYuDLiZf5oK",
"payer_email":"XXXXXX",
"txn_id":"64M28299HV0955007",
"case_creation_date":"14:46:47 May 05, 2014 PDT",
"receiver_email":"XXXXXX",
"payer_id":"2LMAK5CCRFC7Y",
"receiver_id":"XXXXXX",
"reason_code":"non_receipt",
"custom":"","charset":"windows-1252",
"notify_version":"3.8",
"ipn_track_id":"6b3a7ef61a303"
}
暂停金额(payment_status
为Reversed
):初始付款的txn_id为parent_txn_id。它有一个新的txn_id。
{
"mc_gross":"-4.55",
"protection_eligibility":"Ineligible",
"item_number1":"",
"payer_id":"2LMAK5CCRFC7Y",
"payment_date":"14:47:45 May 05, 2014 PDT",
"payment_status":"Reversed",
"charset":"windows-1252",
"mc_shipping":"0.00",
"mc_handling":"0.00",
"first_name":"Roman",
"mc_fee":"-0.45",
"notify_version":"3.8",
"reason_code":"buyer_complaint",
"custom":"",
"business":"XXXXXX",
"mc_handling1":"0.00",
"verify_sign":"Aayt7rRv.9vczRke0KD5otSJgqTEA6ETzuIl3f7JWHiTh.q-Pp8Lh7QW",
"payer_email":"XXXXXX",
"mc_shipping1":"0.00",
"tax1":"0.00",
"parent_txn_id":"64M28299HV0955007",
"txn_id":"4RW75981SW305352R",
"payment_type":"instant",
"last_name":"Arora",
"item_name1":"Air Pilots",
"receiver_email":"XXXXXX",
"payment_fee":"-0.45",
"quantity1":"1",
"receiver_id":"XXXXXX",
"mc_gross_1":"5.00",
"mc_currency":"USD",
"residence_country":"US",
"transaction_subject":"Air Pilots",
"payment_gross":"-4.55",
"ipn_track_id":"ed496d8ef1d7d"
}
已发布金额(payment_status
为Canceled_Reversal
) - 商家赢得了争议:初始付款的txn_id为parent_txn_id。它具有相同的IPN的txn_id - 保持金额。
{
"mc_gross":"4.55",
"protection_eligibility":"Ineligible",
"item_number1":"",
"payer_id":"2LMAK5CCRFC7Y",
"payment_date":"14:47:45 May 05, 2014 PDT",
"payment_status":"Canceled_Reversal",
"charset":"windows-1252",
"mc_shipping":"0.00",
"mc_handling":"0.00",
"first_name":"Roman",
"mc_fee":"0.45",
"notify_version":"3.8",
"reason_code":"buyer_complaint",
"custom":"",
"business":"XXXXXX",
"mc_handling1":"0.00",
"verify_sign":"Auodxl0Yf.7io9Qqvln7PODrgOvjAbuOsf7PTpgdLQyLHk1uoYabZCsl",
"payer_email":"XXXXXX",
"mc_shipping1":"0.00",
"tax1":"0.00",
"parent_txn_id":"64M28299HV0955007",
"txn_id":"4RW75981SW305352R",
"payment_type":"instant",
"last_name":"Arora",
"item_name1":"Air Pilots",
"receiver_email":"XXXXXX",
"payment_fee":"0.45",
"quantity1":"1",
"receiver_id":"XXXXXX",
"mc_gross_1":"5.00",
"mc_currency":"USD",
"residence_country":"US",
"transaction_subject":"Air Pilots",
"payment_gross":"4.55",
"ipn_track_id":"72b0067375b5f"
}
撤消(payment_status
为Refunded
) - 商家失去了争议:初始付款的txn_id是parent_txn_id。它有新的txn_id。
{
"mc_gross":"-5.00",
"protection_eligibility":"Ineligible",
"item_number1":"",
"payer_id":"2LMAK5CCRFC7Y",
"payment_date":"10:45:49 May 06, 2014 PDT",
"payment_status":"Refunded",
"charset":"windows-1252",
"mc_shipping":"0.00",
"mc_handling":"0.00",
"first_name":"Roman",
"mc_fee":"-0.15",
"notify_version":"3.8",
"reason_code":"refund",
"custom":"",
"business":"XXXXXX",
"mc_handling1":"0.00",
"verify_sign":"AmmJ3Da6WMy0qcyvYpAIcfVWfBEgAJfGvFm8TK2MGOZV6Hc9Ll5axN.V",
"payer_email":"XXXXXX",
"mc_shipping1":"0.00",
"tax1":"0.00",
"parent_txn_id":"64M28299HV0955007",
"txn_id":"4CG08179BW957404H",
"payment_type":"instant",
"last_name":"Arora",
"item_name1":"Air Pilots",
"receiver_email":"XXXXXX",
"payment_fee":"-0.15",
"quantity1":"1",
"receiver_id":"XXXXXX",
"mc_gross_1":"5.00",
"mc_currency":"USD",
"residence_country":"US",
"transaction_subject":"Air Pilots",
"payment_gross":"-5.00",
"ipn_track_id":"54a6104f4cebb"
}