不难发现 共同有的字段为:return_code,return_msg,result_code
就订单不存在result_code为FAIL
其次 提交了订单total_fee金额是有的 然后不同的是trade_state_desc 和trade_state
// ["return_code"] => string(7) "SUCCESS"
// ["return_msg"] => string(2) "OK"
// ["appid"] => string(18) "wxxxxxxxxxxxx"
// ["mch_id"] => string(10) "1500000021"
// ["nonce_str"] => string(16) "yQETQFFag5TTMB8d"
// ["sign"] => string(32) "F0B22FC4D1ABD05B93A357A410C042A6"
// ["result_code"] => string(7) "SUCCESS"
// ["openid"] => string(28) "oU42e4jJaLTWUc-tuJTji--Kq3WA"
// ["is_subscribe"] => string(1) "N"
// ["trade_type"] => string(5) "JSAPI"
// ["bank_type"] => string(6) "OTHERS"
// ["total_fee"] => string(2) "10"
// ["fee_type"] => string(3) "CNY"
// ["transaction_id"] => string(28) "4200000695202009244250504007"
// ["out_trade_no"] => string(17) "E2020092455515648"
// ["attach"] => NULL
// ["time_end"] => string(14) "20200924133706"
// ["trade_state"] => string(7) "SUCCESS"
// ["cash_fee"] => string(2) "10"
// ["trade_state_desc"] => string(12) "支付成功"
// ["cash_fee_type"] => string(3) "CNY"
// ["return_code"] => string(7) "SUCCESS"
// ["return_msg"] => string(2) "OK"
// ["appid"] => string(18) "wxxxxxxxxxxxx"
// ["mch_id"] => string(10) "1500000021"
// ["device_info"] => NULL
// ["nonce_str"] => string(16) "4CV1vPI5jf49qjhO"
// ["sign"] => string(32) "AE95FBFA575A33884513195F4BCC8AE0"
// ["result_code"] => string(7) "SUCCESS"
// ["total_fee"] => string(5) "31900"
// ["out_trade_no"] => string(19) "END2020110710053514"
// ["trade_state"] => string(6) "NOTPAY"
// ["trade_state_desc"] => string(15) "订单未支付"
// ["return_code"] => string(7) "SUCCESS"
// ["return_msg"] => string(2) "OK"
// ["appid"] => string(18) "wxxxxxxxxxxxx"
// ["mch_id"] => string(10) "1500000021"
// ["nonce_str"] => string(16) "S3FQCziZehwH9eRy"
// ["sign"] => string(32) "FCEF8F999EA3296B774DF93AA37C7924"
// ["result_code"] => string(4) "FAIL"
// ["err_code"] => string(13) "ORDERNOTEXIST"
// ["err_code_des"] => string(15) "订单不存在"
此文章可以转载phpQQ群:153073132