method | 说明 | 参数 | 返回值 |
---|---|---|---|
query | 支付订单查询 | string $orderSn | Collection |
refundQuery | 查询订单退款 | string $orderSn | Collection |
transQuery | 查询转账到支付宝 | array $order | Collection |
支付订单
$pay = new \fengkui\Pay\Alipay($alipayConfig);
$orderSn = 'order_snxxxxxxxx'; // 商户订单号
$result = $pay->query($orderSn); // 默认使用false商户订单号查询订单
$out_trade_no = 'out_trade_noxxxxxxxx'; // 支付宝支付订单号
$result = $pay->query($out_trade_no, true); // 商户订单号查询订单
支付返回参数
相关返回参数说明,请参考这里,查看「业务响应参数」一栏。
返回示例
{
"alipay_trade_query_response": {
"code": "10000",
"msg": "Success",
"trade_no": "2013112011001004330000121536",
"out_trade_no": "6823789339978248",
"buyer_logon_id": "159****5620",
"trade_status": "TRADE_CLOSED",
"total_amount": "88.88",
"buyer_pay_amount": "8.88",
"point_amount": "10",
"invoice_amount": "12.11",
"send_pay_date": "2014-11-27 15:45:57",
"receipt_amount": "15.25",
"store_id": "NJ_S_001",
"terminal_id": "NJ_T_001",
"buyer_user_id": "2088101117955611",
"buyer_open_id": "01501o8f93I3nJAGB1jG4ONxtxV25DCN3Gec3uggnC4CJU0",
"buyer_user_type": "PRIVATE",
"mdiscount_amount": "88.88",
},
"sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}
退款订单
$pay = new \fengkui\Pay\Alipay($alipayConfig);
$refund = [
'refund_sn' => '', // 商户退款单号
'order_sn' => 'ordersnxxxxxxxx', # 商户订单号(order_sn或trade_no两者必传其一)
'trade_no'=> 'tradenoxxxxxxxx', // 支付宝支付订单号
];
$result = $pay->queryRefund($refund);
退款返回参数
相关返回参数说明,请参考这里,查看「业务响应参数」一栏。
返回示例
{
"alipay_trade_fastpay_refund_query_response": {
"code": "10000",
"msg": "Success",
"trade_no": "2014112611001004680073956707",
"out_trade_no": "20150320010101001",
"out_request_no": "20150320010101001",
"total_amount": "100.20",
"refund_amount": "12.33",
"refund_status": "REFUND_SUCCESS",
},
"sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}
转账查询
$pay = new \fengkui\Pay\Alipay($alipayConfig);
$order = [
'order_sn' => '', // 商户转账唯一订单号
'order_id' => '', // 支付宝转账单据号。
'pay_fund_order_id' => '', // 支付宝支付资金流水号
];
// order_sn、order_id、pay_fund_order_id参数必传其一
$result = $pay->transQuery($order); // 默认使用false商家批次单号查询
// 当传 order_sn,需传以下参数
$order['product_code'] = 'TRANS_ACCOUNT_NO_PWD'; // 销售产品码,商家和支付宝签约的产品码,如果传递了out_biz_no则该字段为必传。可传值如下: STD_RED_PACKET:现金红包 TRANS_ACCOUNT_NO_PWD:单笔无密转账到支付宝账户 TRANS_BANKCARD_NO_PWD:单笔无密转账到银行卡
$order['biz_scene'] = 'DIRECT_TRANSFER'; // 描述特定的业务场景,如果传递了out_biz_no则该字段为必传。可取的业务场景如下: PERSONAL_PAY:C2C现金红包-发红包; PERSONAL_COLLECTION:C2C现金红包-领红包; REFUND:C2C现金红包-红包退回; DIRECT_TRANSFER:B2C现金红包、单笔无密转账
退款返回参数
相关返回参数说明,请参考这里,查看「业务响应参数」一栏。
返回示例
{
"alipay_fund_trans_common_query_response": {
"code": "10000",
"msg": "Success",
"order_id": "20190801110070000006380000250621",
"pay_fund_order_id": "20190801110070001506380000251556",
"out_biz_no": "201808080001",
"trans_amount": "32.00",
"status": "SUCCESS",
"pay_date": "2013-01-01 08:08:08",
"arrival_time_end": "2013-01-01 08:08:08",
"order_fee": "0.02",
"error_code": "PAYEE_CARD_INFO_ERROR",
"fail_reason": "收款方银行卡信息有误",
"sub_order_error_code": "MID_ACCOUNT_CARD_INFO_ERROR",
"sub_order_fail_reason": "收款方银行卡信息有误",
"sub_order_status": "FAIL",
"settle_serial_no": "2023052993044491260542090100400"
},
"sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}