...
|
...
|
@@ -7,6 +7,8 @@ use WebPlugin\Pay\PayAbstract; |
|
|
use WebPlugin\Pay\Reqparams;
|
|
|
use WebPlugin\Pay\Rspparams;
|
|
|
use WebPlugin\PhpLog;
|
|
|
use Api\Yohobuy;
|
|
|
use Plugin\Helpers;
|
|
|
|
|
|
class Service extends PayAbstract
|
|
|
{
|
...
|
...
|
@@ -42,19 +44,19 @@ class Service extends PayAbstract |
|
|
|
|
|
public function getPayRequestPars(Reqparams $params)
|
|
|
{
|
|
|
$baseUrl = $this->getBaseNoticeUrl($params->isTest);
|
|
|
$loseTime = intval(($params->orderTime + 7200 - time()) / 60);
|
|
|
// $baseUrl = $this->getBaseNoticeUrl($params->isTest);
|
|
|
// $loseTime = intval(($params->orderTime + 7200 - time()) / 60);
|
|
|
// $loseTime = intval((strtotime(date("Y-m-d 10:00:00", strtotime("+1 day")))-time())/60);
|
|
|
|
|
|
$parameter = array(
|
|
|
'service' => $this->config->service,
|
|
|
'partner' => $this->config->partner,
|
|
|
'_input_charset' => $this->config->input_charset,
|
|
|
'notify_url' => $baseUrl . $this->config->notify_url,
|
|
|
'return_url' => $baseUrl . $this->config->return_url,
|
|
|
'notify_url' => Yohobuy::SERVICE_URL . $this->config->notify_url,
|
|
|
'return_url' => Helpers::url($this->config->return_url),
|
|
|
/* 业务参数 */
|
|
|
'subject' => $params->goodsName,
|
|
|
'out_trade_no' => $params->orderCode . '_' . $params->paymentParameter,
|
|
|
'out_trade_no' => $params->orderCode,
|
|
|
'total_fee' => $params->totalFee / 100, //单位为元
|
|
|
'payment_type' => $this->config->payment_type,
|
|
|
'defaultbank' => $params->paymentParameter,
|
...
|
...
|
@@ -134,14 +136,8 @@ class Service extends PayAbstract |
|
|
// $outTradeNo = substr($outTradeNo, 2);
|
|
|
// }
|
|
|
//支付订单处理
|
|
|
$orderCodeArr = explode('_', $outTradeNo);
|
|
|
if (count($orderCodeArr) == 2) {
|
|
|
$rsp->orderCode = $orderCodeArr[0];
|
|
|
$rsp->bankName = $orderCodeArr[1];
|
|
|
} else {
|
|
|
$rsp->orderCode = $outTradeNo;
|
|
|
$rsp->orderCode = intval($outTradeNo);
|
|
|
$rsp->bankName = "";
|
|
|
}
|
|
|
$rsp->payResult = $this->convertResult($arrResponse["trade_status"]);
|
|
|
$rsp->payTime = isset($arrResponse["gmt_payment"]) ? $arrResponse["gmt_payment"] : time();
|
|
|
$rsp->totalFee = $arrResponse["total_fee"];
|
...
|
...
|
|