laowu hace 1 semana
padre
commit
62c81cac03
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  1. 8 0
      app/Http/logic/api/PayPlusLogic.php

+ 8 - 0
app/Http/logic/api/PayPlusLogic.php

@@ -7,6 +7,7 @@ use App\dao\Pay\PayController;
 use App\Http\helper\CreateOrder;
 use App\Http\helper\NumConfig;
 use App\Jobs\Order;
+use App\Notification\TelegramBot;
 use App\Services\CreateLog;
 use App\Services\OrderServices;
 use App\Services\PayPlus;
@@ -89,6 +90,13 @@ class PayPlusLogic extends BaseApiLogic
         try {
             $result = $this->service->postPayin($payload);
             Util::WriteLog('PayPlus', 'PayPlus payment response: ' . json_encode($result));
+            if ($result['code'] !== 200) {
+                TelegramBot::getDefault()->sendProgramNotify(
+                    'PayPlus payment failed',
+                    'Response: ' . json_encode($result),
+                    null
+                );
+            }
             return $result;
             
         } catch (\Exception $exception) {