我正在使用PayPal IPN。现在所有工作正常。我得到VERIFIED
状态。但如何检查payment_status
是不是completed
?感谢如何检查贝宝付款是否完成?
if (strcmp ($res, "VERIFIED") == 0) {
// check the payment_status is Completed
// check that txn_id has not been previously processed
// check that receiver_email is your Primary PayPal email
// check that payment_amount/payment_currency are correct
// process payment
}
else if (strcmp ($res, "INVALID") == 0) {
// log for manual investigation
}
没有名为$_POST['payment_status']
Array
(
[txn_type] => subscr_signup
[subscr_id] => I-LDEC0BD3UYL7
[last_name] => User
[residence_country] => US
[mc_currency] => USD
[item_name] => Alice's Weekly Digest
[business] => [email protected]
[amount3] => 35.00
[recurring] => 0
[verify_sign] => AkLS8p39eNu16-x1.zjarjEI8cwRAJTbKtOMbm2NinNXnj79aqkEZ5it
[payer_status] => verified
[test_ipn] => 1
[payer_email] => [email protected]
[first_name] => Test
[receiver_email] => [email protected]
[payer_id] => SWCUEE3GNET7A
[reattempt] => 1
[item_number] => DIG Weekly
[subscr_date] => 00:02:52 Aug 27, 2011 PDT
[charset] => windows-1252
[notify_version] => 3.2
[period3] => 1 M
[mc_amount3] => 35.00
[auth] => _XXXXXXX [form_charset] => UTF-8
)
我使用的是打印整个数组。 '的print_r($ _ GET)'。如果我打印这个像'print_r($ _ POST)'。它的打印空数组。 –
看到我更新的答案。 – AlphaMale
没有变量叫'$ _POST ['payment_status']'。 ''_POST ['item_name']','$ _POST ['item_number']'等存在但不是'$ _POST ['payment_status']' –