class NotificationController extends Controller
{
+ const OUT_DIR =
+ //"/www/media/notification";
+ "/var/www/erp24/media/notification";
public function actionTest()
{
+ $request = Yii::$app->request;
Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
Yii::$app->response->statusCode = 200;
+ $body = $request->getRawBody();
+ if (!empty($body)) {
+ $content = json_decode($body, false, 512, JSON_THROW_ON_ERROR);
+ $testCampaignId = $request->get('campaign_id', 109969229);
+ $testData = ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrdersResponse', []);
+ if (!empty($testData) && isset($testData['orders'])) {
+ $ordersData[$testCampaignId] = $testData['orders'];
+ $result = MarketplaceService::processOrders($ordersData);
+ return [
+ 'response' => 'OK (test data)',
+ 'storeCount' => count($ordersData),
+ 'result' => $result
+ ];
+ }
+ }
return [
- 'version' => '1.0.0',
- 'name' => 'БазаЦветов24',
- 'time' => gmdate('Y-m-d\TH:i:s\Z'),
+ 'response' => 'No data',
];
}