diff --git a/app/Http/Controllers/Gateway/Manual.php b/app/Http/Controllers/Gateway/Manual.php index e718657f..ee604ed3 100644 --- a/app/Http/Controllers/Gateway/Manual.php +++ b/app/Http/Controllers/Gateway/Manual.php @@ -50,11 +50,19 @@ class Manual extends AbstractPayment { $code = $request->input('sign'); $status = $request->input('status'); - if ($code && $status) { + if (isset($status, $code)) { $payment = Payment::findOrFail((int) string_decrypt($code)); - if ($payment && $payment->order) { - $payment->order->complete(); + if ($payment && $payment->order && $payment->order->status === 1) { + if ($status) { + $payment->order->complete(); + } else { + $payment->order->close(); + } + + exit('success'); } + exit('fail'); } + exit('No enough information'); } } diff --git a/app/Notifications/PaymentConfirm.php b/app/Notifications/PaymentConfirm.php index d0dfb733..7b8c2eed 100644 --- a/app/Notifications/PaymentConfirm.php +++ b/app/Notifications/PaymentConfirm.php @@ -30,7 +30,7 @@ class PaymentConfirm extends Notification $order = $this->order; $goods = $this->order->goods; $sign = string_encrypt($order->payment->id); - $message = sprintf("πŸ›’ δΊΊε·₯ζ”―δ»˜\nβ€”β€”β€”β€”β€”β€”β€”β€”\n\tπŸ’° ι‡‘ι’οΌš%s\n\tπŸ“¦ ε•†ε“οΌš%s\n\t", $order->amount, $goods->name ?? '余钝充值'); + $message = sprintf("πŸ›’ δΊΊε·₯ζ”―δ»˜\nβ€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”\n\t\tβ„ΉοΈθ΄¦ε·οΌš%s\n\t\tπŸ’° ι‡‘ι’οΌš%s\n\t\tπŸ“¦ ε•†ε“οΌš%s\n\t\t", $order->user->username, $order->amount, $goods->name ?? '余钝充值'); foreach (User::role('Super Admin')->get() as $admin) { if (! $admin->telegram_user_id) { continue;