调整支付
This commit is contained in:
@@ -13,7 +13,7 @@ class CreateWoUnicomWebsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('wo_unicom_webs', function (Blueprint $table) {
|
||||
Schema::create('wounicom_webs', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('orderId')->nullable()->comment('订单号');
|
||||
$table->string('payFloodId')->nullable()->comment('交易流水号');
|
||||
@@ -34,6 +34,6 @@ class CreateWoUnicomWebsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('wo_unicom_webs');
|
||||
Schema::dropIfExists('wounicom_webs');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,6 +161,7 @@ class Init
|
||||
public function getSign(): string
|
||||
{
|
||||
$signStr = $this->getSignString();
|
||||
|
||||
$private_key = $this->getPrivate();
|
||||
$privKeyId = openssl_get_privatekey($private_key);
|
||||
|
||||
@@ -196,7 +197,9 @@ class Init
|
||||
|
||||
ksort($params);
|
||||
$signStr = $this->str2utf8(urldecode(http_build_query($params, '', '|')));
|
||||
$signStr .= '|key='.$this->key;
|
||||
$this->signStr = $signStr;
|
||||
|
||||
// $signStr .= '|key='.$this->key;
|
||||
return $signStr;
|
||||
}
|
||||
|
||||
@@ -319,8 +322,8 @@ class Init
|
||||
if ($response->getStatusCode() == 200) {
|
||||
$body = $response->getBody();
|
||||
$content = str_replace(["\r\n", "\n", "\r", '/n', "\\n",], '&', $body->getContents());
|
||||
parse_str($content, $data);
|
||||
|
||||
parse_str($content, $data);
|
||||
$this->data = $data;
|
||||
|
||||
if (isset($data['queryResult']) && $data['queryResult'] != 'SUCCESS') {
|
||||
|
||||
@@ -20,7 +20,8 @@ class Order extends Init
|
||||
{
|
||||
$this->addData();
|
||||
$this->setSignData();
|
||||
|
||||
// dump($this);
|
||||
// dump($this->params);
|
||||
return $this->getUnicomData('$');
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace XuanChen\WoUnicomWeb\Action;
|
||||
|
||||
/**
|
||||
* Class Order 查询
|
||||
*
|
||||
* @Author : 玄尘
|
||||
* @Date : 2021/4/30 9:34
|
||||
* @package XuanChen\Coupon\Action
|
||||
@@ -16,7 +17,7 @@ class Query extends Init
|
||||
$this->setIsLower(false);
|
||||
$this->addData();
|
||||
$this->setSignData();
|
||||
$url = config('wounicom.uri.unicom.query');
|
||||
$url = config('wounicomweb.uri.unicom.query');
|
||||
$this->sendPost($this->params, $url);
|
||||
|
||||
return $this->respond();
|
||||
@@ -25,17 +26,15 @@ class Query extends Init
|
||||
public function addData()
|
||||
{
|
||||
$order = $this->params;
|
||||
|
||||
$data = [
|
||||
'merNo' => $this->merNo,
|
||||
'orderNo' => $order->orderid,
|
||||
'orderDate' => $order->created_at->format('Ymd'),
|
||||
'charSet' => 'UTF-8',
|
||||
'signType' => config('wounicom.signType'),
|
||||
'signType' => config('wounicomweb.signType'),
|
||||
];
|
||||
|
||||
$this->params = $data;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Class Order 退款
|
||||
*
|
||||
* @Author : 玄尘
|
||||
* @Date : 2021/4/30 9:34
|
||||
* @package XuanChen\Coupon\Action
|
||||
@@ -18,7 +19,7 @@ class Refund extends Init
|
||||
$this->reSetParams();
|
||||
$this->setIsLower(false);
|
||||
$this->setSignData();
|
||||
$url = config('wounicom.uri.unicom.refund');
|
||||
$url = config('wounicomweb.uri.unicom.refund');
|
||||
$this->sendPost($this->params, $url);
|
||||
|
||||
return $this->respond();
|
||||
@@ -29,15 +30,15 @@ class Refund extends Init
|
||||
$order = $this->params;
|
||||
|
||||
$data = [
|
||||
'refundReqJournl' => 'R' . date('YmdHis') . sprintf('%06d', rand(1, 999999999)),
|
||||
'refundReqJournl' => 'R'.date('YmdHis').sprintf('%06d', rand(1, 999999999)),
|
||||
'merNo' => $this->merNo,
|
||||
'orderNo' => $order->orderid,
|
||||
'orderDate' => $order->created_at->format('Ymd'),
|
||||
'payJournl' => $order->payment->out_trade_no,
|
||||
'merReqTime' => Carbon::now()->format('YmdHis'),
|
||||
'amount' => $order->payment->amount * 100,
|
||||
'amount' => bcmul($order->payment->amount,100),
|
||||
'reason' => '退款',
|
||||
'signType' => 'RSA_SHA256',
|
||||
'signType' => config('wounicomweb.signType'),
|
||||
];
|
||||
|
||||
$this->params = $data;
|
||||
|
||||
Reference in New Issue
Block a user