From 1b8f8389b990ac6c108dd7dd9ac6029681743cf6 Mon Sep 17 00:00:00 2001 From: adametz Date: Tue, 6 Nov 2018 11:45:02 +0000 Subject: [PATCH] Exporter git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3477 f459cee4-fb09-11de-96c3-f9c5f16c3c76 --- .../Controller/BookingController.php | 1 - .../Export/BookingSternToursCrmExporter.php | 1 - .../Export/SternToursCrmExporter.php | 26 +++++++++++++++---- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/trunk/src/AppBundle/Controller/BookingController.php b/trunk/src/AppBundle/Controller/BookingController.php index c615355e..d3025704 100644 --- a/trunk/src/AppBundle/Controller/BookingController.php +++ b/trunk/src/AppBundle/Controller/BookingController.php @@ -102,7 +102,6 @@ class BookingController extends Controller } } - if (!isset($travelDate)) { throw $this->createNotFoundException(); diff --git a/trunk/src/AppBundle/Export/BookingSternToursCrmExporter.php b/trunk/src/AppBundle/Export/BookingSternToursCrmExporter.php index e1614ea8..53bdc4ae 100644 --- a/trunk/src/AppBundle/Export/BookingSternToursCrmExporter.php +++ b/trunk/src/AppBundle/Export/BookingSternToursCrmExporter.php @@ -175,7 +175,6 @@ class BookingSternToursCrmExporter extends SternToursCrmExporter } $i++; } - $resp = $this->httpPostAPIv3('create_drafts', [ 'travel_program_id' => $tp->getId(), 'comfort' => $bookingRequest->getComfort(), diff --git a/trunk/src/AppBundle/Export/SternToursCrmExporter.php b/trunk/src/AppBundle/Export/SternToursCrmExporter.php index 39775bcf..95d4ba56 100644 --- a/trunk/src/AppBundle/Export/SternToursCrmExporter.php +++ b/trunk/src/AppBundle/Export/SternToursCrmExporter.php @@ -12,14 +12,19 @@ use Monolog\Logger; abstract class SternToursCrmExporter { - //const API_URL = 'http://cms-stern-tours.local/api'; + //auto + + + const API_URL_LOCAL = 'http://cms-stern-tours.local/api'; const API_URL = 'https://www.cms.stern-tours.net/api'; + const API_v3_URL_LOCAL = 'http://crm-stern-tours.local/'; + const API_v3_URL = 'https://mein.sterntours.de/'; + const API_KEY = 'f6077389c9ce710e554763a5de02c8ec'; const API_USER_ID = 15; // 'apiuser' const WEBSITE_ID = 1; // 'sterntours.de' - //const API_v3_URL = 'http://crm-stern-tours.local/'; - const API_v3_URL = 'https://mein.sterntours.de/'; + const API_v3_MAIL = 'info@mein.sterntours.de'; const API_v3_PASS = '6m9j,v2GE8px self::API_v3_MAIL, 'password' => self::API_v3_PASS, @@ -77,7 +92,7 @@ abstract class SternToursCrmExporter $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $baseUrl.'login'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_TIMEOUT, 8); + curl_setopt($ch, CURLOPT_TIMEOUT, 20); curl_setopt($ch, CURLOPT_POST, count($data)); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); @@ -96,6 +111,7 @@ abstract class SternToursCrmExporter curl_setopt($ch, CURLOPT_URL, $baseUrl.'draft/create_drafts_from_booking'); $result = curl_exec($ch); $r = json_decode($result); + //var_dump($r); if($r->success) { curl_close($ch); return $r->success;