Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e640647709 | |||
| f49481ad29 |
@@ -17,7 +17,6 @@ class Sign extends Init
|
|||||||
// $signMsg = str_replace('\\', '', $signMsg);
|
// $signMsg = str_replace('\\', '', $signMsg);
|
||||||
$signMsg = str_replace(' ', '+', $signMsg);
|
$signMsg = str_replace(' ', '+', $signMsg);
|
||||||
$this->sign = $signMsg;
|
$this->sign = $signMsg;
|
||||||
info($this->sign);
|
|
||||||
|
|
||||||
return $this->checkSign();
|
return $this->checkSign();
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,13 @@
|
|||||||
|
|
||||||
namespace XuanChen\WoUnicom;
|
namespace XuanChen\WoUnicom;
|
||||||
|
|
||||||
|
use App\Models\ActivitySchoolOrder;
|
||||||
use App\Models\Payment;
|
use App\Models\Payment;
|
||||||
use App\Models\Welfare;
|
use App\Models\Welfare;
|
||||||
use App\Models\WelfareOrder;
|
use App\Models\WelfareOrder;
|
||||||
use App\Models\WelfarePayment;
|
use App\Models\WelfarePayment;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use XuanChen\WoUnicom\Action\Init;
|
use XuanChen\WoUnicom\Action\Init;
|
||||||
use XuanChen\WoUnicom\Action\Order;
|
use XuanChen\WoUnicom\Action\Order;
|
||||||
use XuanChen\WoUnicom\Action\Query;
|
use XuanChen\WoUnicom\Action\Query;
|
||||||
@@ -104,7 +106,7 @@ class WoUnicom
|
|||||||
if ($res === true) {
|
if ($res === true) {
|
||||||
|
|
||||||
//福利订单
|
//福利订单
|
||||||
if (str_contains($data['orderid'], 'WEAL')) {
|
if (Str::is('WEAL*', $data['orderid'])) {
|
||||||
$order = WelfareOrder::where('orderid', $data['orderid'])->first();
|
$order = WelfareOrder::where('orderid', $data['orderid'])->first();
|
||||||
if ($order && $order->status == 'UNPAY') {
|
if ($order && $order->status == 'UNPAY') {
|
||||||
$payment = $order->payment;
|
$payment = $order->payment;
|
||||||
@@ -116,6 +118,21 @@ class WoUnicom
|
|||||||
$order->paid();
|
$order->paid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} elseif (Str::is('AS*', $data['orderid'])) {
|
||||||
|
$order = ActivitySchoolOrder::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 {
|
} else {
|
||||||
$order = \App\Models\Order::where('orderid', $data['orderid'])->first();
|
$order = \App\Models\Order::where('orderid', $data['orderid'])->first();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user