2 Commits
1.0.1 ... 1.0.2

Author SHA1 Message Date
bdf46a01ec 调整config 2021-07-22 11:06:20 +08:00
a34d344110 修改http 2021-05-26 17:14:36 +08:00
3 changed files with 38 additions and 15 deletions

View File

@@ -11,11 +11,11 @@ return [
'uri' => [
'unicom' => [
//下单
'order' => 'https://www.unicompayment.com/wappay3.0/httpservice/wapPayPageAction.do?reqcharset=UTF-8',
'order' => 'https://epay.10010.com/wappay3.0/httpservice/wapPayPageAction.do?reqcharset=UTF-8',
//查询
'query' => 'https://www.unicompayment.com/CashierWeb/query/order.htm?reqCharSet=UTF-8',
'query' => 'https://epay.10010.com/CashierWeb/query/order.htm?reqCharSet=UTF-8',
//单笔退款
'refund' => 'https://www.unicompayment.com/CashierWeb/trade/singleRefund.htm?reqCharSet=UTF-8',
'refund' => 'https://epay.10010.com/CashierWeb/trade/singleRefund.htm?reqCharSet=UTF-8',
],
'ysd' => [
'order' => env('APP_URL', 'https://card.ysd-bs.com'),

View File

@@ -315,11 +315,15 @@ class Init
parse_str($content, $data);
$this->data = $data;
if ($data['transRet'] != 'SUCCESS') {
$this->code = false;
$this->message = $data['resultDis'];
}
$this->code = true;
} else {
$this->code = false;
$this->message = '接口错误 Post';

View File

@@ -3,6 +3,9 @@
namespace XuanChen\WoUnicom;
use App\Models\Payment;
use App\Models\Welfare;
use App\Models\WelfareOrder;
use App\Models\WelfarePayment;
use Carbon\Carbon;
use XuanChen\WoUnicom\Action\Init;
use XuanChen\WoUnicom\Action\Order;
@@ -94,6 +97,20 @@ class WoUnicom
//验签成功
if ($res === true) {
//福利订单
if (str_contains($data['orderid'], 'WEAL')) {
$order = WelfareOrder::where('orderid', $data['orderid'])->first();
if ($order && $order->status == 'UNPAY') {
$payment = $order->payment;
$payment->paid([
'type' => 'UNICOM',
'payfloodid' => $data['payfloodid'],
]);
$order->paid();
}
} else {
$order = \App\Models\Order::where('orderid', $data['orderid'])->first();
if ($order && $order->state == 'UNPAY') {
$payment = \App\Models\Payment::where('orderable_type', get_class($order))
@@ -109,6 +126,8 @@ class WoUnicom
$order->paid();
}
}
return 'SUCCESS';
} else {
return '验签失败';