]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
add cron/cloudpayments during moving api1 to yii
authorAlexander Smirnov <fredeom@mail.ru>
Wed, 27 Dec 2023 12:57:12 +0000 (15:57 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Wed, 27 Dec 2023 12:57:12 +0000 (15:57 +0300)
erp24/api1/actions/cron/CloudPaymentsAction.php [new file with mode: 0644]
erp24/api1/controllers/CronController.php

diff --git a/erp24/api1/actions/cron/CloudPaymentsAction.php b/erp24/api1/actions/cron/CloudPaymentsAction.php
new file mode 100644 (file)
index 0000000..51212a9
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+
+namespace app\actions\cron;
+
+use yii\base\Action;
+
+class CloudPaymentsAction extends Action
+{
+    public function run() {
+
+        include_once(dirname(__DIR__, 3) . "/startup.php");
+        include_once(dirname(__DIR__, 3) . "/inc/db.php");
+        include_once(dirname(__DIR__, 3) . "/inc/cloudpayments.php");
+
+        if($_GET["token_cloud"]!="iC04295J9HyD2H3GJF3btky") exit();
+
+        // https://api.bazacvetov24.ru/cron/cloudpayments/?token_cloud=iC04295J9HyD2H3GJF3btky
+        import_cloudpayments();
+
+        return $this->controller->asJson(['response' => true]);
+    }
+}
\ No newline at end of file
index d8241b4968ea3c897829f646db8c2b730962f0e0..d2baaac654086c3fc8801a3ae90d6c847a9e80e7 100644 (file)
@@ -11,6 +11,7 @@ class CronController extends BaseController
         return [
             '1c' => \app\actions\cron\OneCAction::class,
             'amo142' => \app\actions\cron\Amo142Action::class,
+            'cloudpayments' => \app\actions\cron\CloudPaymentsAction::class,
         ];
     }
 }