method | 参数 | 返回值 |
---|---|---|
notify | 无/array/ServerRequestInterface | Collection |
支付回调
$pay = new \fengkui\Pay\Alipay($alipayConfig);
// 支付回调
try {
$data = $pay->notify(); // 验签并获取支付回调相关参数
if ($data) { // 支付成功
echo "success";die; // 异步通知
}
} catch (\Exception $e) {
$e->getMessage(); // 错误信息
}
// 当回调数据为空时,请打印错误信息
// $pay->notify(false); 不验证签名,直接返回支付信息
通知参数
相关通知参数说明,请参考这里,查看「异步通知参数」一栏。
{
"gmt_create": "2024-03-23 15:54:45",
"charset": "utf-8",
"gmt_payment": "2024-03-23 15:54:53",
"notify_time": "2024-03-23 15:54:55",
"subject": "可乐",
"sign": "DLHMd3oQg4PaNBcUsT5ULzcJeeNTVDneJswHzfTNzHlhwY9Gz92ml6GKFGX4BTgaCQiH3mO8Hb21nDTBINxOcbDXV8PxPmBFViviRJETAsYk+1GTMCgSP0d4IbUA83JsRg0XCjeqxdhLenkBBi93Dh/4toWAPT0+QzFTOodDtWhDKhnRWl/Bs5kZ0Xi3Cc3zdV5Yzq0j3fo9kQN8C/xuhz8xnVh9dPEgCN0VFE7Wr099wz7PQx0J9HzVSyotsp7eOwd/DD5m++lZE2jWsPxdudBYzqOX0uWnDgP3393narhh9C4YdqVXOtNDaClBBxqbE7yR8E+Lyu1WzbBaql9Yjg==",
"buyer_id": "2088722032337650",
"body": "可乐",
"invoice_amount": "1.00",
"version": "1.0",
"notify_id": "2024032301222155454037650502149544",
"fund_bill_list": "[{\"amount\":\"1.00\",\"fundChannel\":\"ALIPAYACCOUNT\"}]",
"notify_type": "trade_status_sync",
"out_trade_no": "1646046300",
"total_amount": "1.00",
"trade_status": "TRADE_SUCCESS",
"trade_no": "2024032322001437650502164295",
"auth_app_id": "9021000135649951",
"receipt_amount": "1.00",
"point_amount": "0.00",
"buyer_pay_amount": "1.00",
"app_id": "9021000135649951",
"sign_type": "RSA2",
"seller_id": "2088721032337642"
}