...
|
...
|
@@ -6,6 +6,8 @@ use WebPlugin\Pay\PayAbstract; |
|
|
use WebPlugin\Pay\Reqparams;
|
|
|
use WebPlugin\Pay\Rspparams;
|
|
|
use WebPlugin\Pay\Signature;
|
|
|
use WebPlugin\Pay\weixin\lib\WxPayApi;
|
|
|
use WebPlugin\Pay\weixin\lib\WxPayOrderQuery;
|
|
|
|
|
|
class Service extends PayAbstract
|
|
|
{
|
...
|
...
|
@@ -74,25 +76,33 @@ class Service extends PayAbstract |
|
|
return array('pay_url' => $payUrl);
|
|
|
}
|
|
|
|
|
|
public function parseResponse(array $arrResponse) {
|
|
|
public function parseResponse(array $data) {
|
|
|
/* 返回示例
|
|
|
* http://www.yohobuy.com/pay/notice/wechatqrcodereturn?ordercode=93465435
|
|
|
*/
|
|
|
// 组装微信支付的订单号
|
|
|
$tradeNo = 'YOHOBuy_' . $data['orderCode'];
|
|
|
$input = new WxPayOrderQuery();
|
|
|
$input->SetOut_trade_no($tradeNo);
|
|
|
$result = WxPayApi::orderQuery($input);
|
|
|
|
|
|
$rsp = new Rspparams();
|
|
|
if($arrResponse['payResult'] == 200){
|
|
|
// 支付成功
|
|
|
if(array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS"){
|
|
|
$rsp->payResult = 200;
|
|
|
$rsp->bankName = "WX";
|
|
|
$rsp->orderCode = $arrResponse['order_code'];
|
|
|
$rsp->payTime = $arrResponse["arrive_time"];
|
|
|
$rsp->totalFee = $arrResponse["amount"];
|
|
|
$rsp->orderCode = $data['orderCode'];
|
|
|
$rsp->payTime = $result["time_end"];
|
|
|
$rsp->totalFee = $result["total_fee"];
|
|
|
$rsp->resultMsg = '支付成功';
|
|
|
//添加支付订单号和交易号
|
|
|
$rsp->payOrderCode = $arrResponse["order_code"];
|
|
|
$rsp->tradeNo = "";
|
|
|
$rsp->bankBillNo = "";
|
|
|
$rsp->payOrderCode = $data["orderCode"];
|
|
|
$rsp->tradeNo = $result["out_trade_no"];
|
|
|
$rsp->bankBillNo = $result['bank_type'];
|
|
|
}else{
|
|
|
$rsp->payResult = -1;
|
|
|
}
|
|
|
|
|
|
return $rsp;
|
|
|
}
|
|
|
|
...
|
...
|
|