update SlackNotifySubscriber.php

This commit is contained in:
Marko 2023-09-29 17:27:50 +02:00
parent 034808cc67
commit 9445ec23ca
No known key found for this signature in database
3 changed files with 10 additions and 8 deletions

View File

@ -63,6 +63,8 @@ class HiltesExportCommand extends Command
foreach ($orders as $order) { foreach ($orders as $order) {
if($order->getStatus()>0) continue; if($order->getStatus()>0) continue;
$tA = $order->getData();#json_decode($order->getData()); $tA = $order->getData();#json_decode($order->getData());
$tA['orderdate'] = "2023-08-30T12:05:24.000Z";
#dd($order->getData()); #dd($order->getData());
#dd(array( #dd(array(
# 'orderdate'=> $tA['orderdate'], # 'orderdate'=> $tA['orderdate'],
@ -178,4 +180,4 @@ class HiltesExportCommand extends Command
return Command::SUCCESS; return Command::SUCCESS;
} }
} }

View File

@ -45,13 +45,9 @@ class SlackNotifySubscriber implements EventSubscriberInterface
{ {
$slack = new Client($this->slackWebhookUrl); $slack = new Client($this->slackWebhookUrl);
$order = $event->getControllerResult(); $order = $event->getControllerResult();
$method = $event->getRequest()->getMethod(); $method = $event->getRequest()->getMethod();
// $this->logger->info('SlackNotifySubscriber: ' . $method);
//$this->logger->info('SlackNotifySubscriber: ' . $order);
//wenn es keine Bestellung ist oder es kein POST Request ist, dann return //wenn es keine Bestellung ist oder es kein POST Request ist, dann return
if (!$order instanceof Order || Request::METHOD_POST !== $method) { if (!$order instanceof Order || Request::METHOD_POST !== $method) {
return; return;

View File

@ -14,15 +14,19 @@ class Hiltes
protected $current_dir_path; protected $current_dir_path;
protected $apiKey; protected $apiKey;
protected $hiltesApiHash = ''; protected $hiltesApiHash = '';
protected $hiltesUsr = 'admin'; protected $hiltesUsr;
protected $hiltesPass = '1996'; protected $hiltesPass;
protected $hiltesApiUrl = 'https://api.orangejungle.eu'; protected $hiltesApiUrl;
public function __construct() public function __construct()
{ {
$this->fsObject = new Filesystem(); $this->fsObject = new Filesystem();
$this->current_dir_path = getcwd(); $this->current_dir_path = getcwd();
$this->hiltesApiUrl = $_ENV['HILTES_API_URL'];
$this->hiltesUsr = $_ENV['HILTES_API_USER'];
$this->hiltesPass = $_ENV['HILTES_API_PASSWORD'];
} }