1 Commits
1.0.6 ... 1.0.7

Author SHA1 Message Date
b677771328 微调 2022-02-23 17:06:50 +08:00

View File

@@ -3,6 +3,7 @@
namespace XuanChen\WoUnicom;
use App\Models\ActivitySchoolOrder;
use App\Models\ActivityPetroOrder;
use App\Models\Payment;
use App\Models\Welfare;
use App\Models\WelfareOrder;
@@ -26,6 +27,7 @@ class WoUnicom
/**
* Notes: 下单
*
* @Author: 玄尘
* @Date : 2021/4/30 9:36
* @return \XuanChen\WoUnicom\Action\Order
@@ -41,6 +43,7 @@ class WoUnicom
/**
* Notes: 查询订单
*
* @Author: 玄尘
* @Date : 2021/4/30 9:39
* @return \XuanChen\WoUnicom\Action\Query
@@ -55,6 +58,7 @@ class WoUnicom
/**
* Notes: 退款
*
* @Author: 玄尘
* @Date : 2021/4/30 9:37
*/
@@ -69,6 +73,7 @@ class WoUnicom
/**
* Notes: 验签
*
* @Author: 玄尘
* @Date : 2021/5/11 11:51
* @param $params
@@ -83,6 +88,7 @@ class WoUnicom
/**
* Notes: 回调数据
*
* @Author: 玄尘
* @Date : 2021/5/11 15:54
* @param $params
@@ -133,6 +139,21 @@ class WoUnicom
$payment->save();
$order->paid();
}
} elseif (Str::is('ASO*', $data['orderid'])) {
$order = ActivityPetroOrder::where('orderid', $data['orderid'])->first();
if ($order && $order->state == 'UNPAY') {
$payment = \App\Models\Payment::where('orderable_type', get_class($order))
->where('orderable_id', $order->id)
->latest()
->first();
$payment->state = 'SUCCESS';
$payment->out_trade_no = $data['payfloodid'];
$payment->type = 'UNICOM';
$payment->paid_at = Carbon::now();
$payment->save();
$order->paid();
}
} else {
$order = \App\Models\Order::where('orderid', $data['orderid'])->first();