From 60793401623a70c9e2049428c53ab87129991241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Tue, 17 Sep 2019 11:14:22 +0200 Subject: [PATCH] Adapt changes in api --- .../Classes/Controller/AjaxFormController.php | 4 ++-- .../ep_theme/Classes/Form/BpnApiFinisher.php | 12 ++++++------ .../Classes/Service/BookingApiService.php | 3 +++ .../Private/Forms/ContactForm.form.yaml | 18 ++++++++---------- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/public/typo3conf/ext/ep_theme/Classes/Controller/AjaxFormController.php b/public/typo3conf/ext/ep_theme/Classes/Controller/AjaxFormController.php index 5f4c61fd..49440c2c 100644 --- a/public/typo3conf/ext/ep_theme/Classes/Controller/AjaxFormController.php +++ b/public/typo3conf/ext/ep_theme/Classes/Controller/AjaxFormController.php @@ -74,9 +74,9 @@ class AjaxFormController extends ActionController $addressData = [ 'name' => $contactForm->getName(), - 'vorname' => $contactForm->getFirstName(), + 'firstName' => $contactForm->getFirstName(), 'email' => $contactForm->getEmail(), - 'geschlecht' => $contactForm->getGender(), + 'gender' => $contactForm->getGender(), ]; $this->bookingApiService->registerAddress($addressData); diff --git a/public/typo3conf/ext/ep_theme/Classes/Form/BpnApiFinisher.php b/public/typo3conf/ext/ep_theme/Classes/Form/BpnApiFinisher.php index 490ac591..64ac9f17 100644 --- a/public/typo3conf/ext/ep_theme/Classes/Form/BpnApiFinisher.php +++ b/public/typo3conf/ext/ep_theme/Classes/Form/BpnApiFinisher.php @@ -28,13 +28,13 @@ class BpnApiFinisher extends AbstractFinisher $formValues = $this->finisherContext->getFormValues(); $addressData = [ 'name' => $formValues['name'], - 'vorname' => $formValues['vorname'], - 'geschlecht' => $formValues['geschlecht'], + 'firstName' => $formValues['vorname'], + 'gender' => $formValues['geschlecht'], 'email' => $formValues['email'], - 'strasse' => $formValues['strasse'], - 'plz' => $formValues['plz'], - 'ort' => $formValues['ort'], - 'telefon' => $formValues['telefon'], + 'street' => $formValues['strasse'], + 'zipCode' => $formValues['plz'], + 'city' => $formValues['ort'], + 'phone' => $formValues['telefon'], ]; $this->bookingApiService->registerAddress($addressData); } diff --git a/public/typo3conf/ext/ep_theme/Classes/Service/BookingApiService.php b/public/typo3conf/ext/ep_theme/Classes/Service/BookingApiService.php index 8ece2bb2..46c26f0d 100644 --- a/public/typo3conf/ext/ep_theme/Classes/Service/BookingApiService.php +++ b/public/typo3conf/ext/ep_theme/Classes/Service/BookingApiService.php @@ -2,6 +2,7 @@ namespace EP\EpTheme\Service; +use Symfony\Component\HttpClient\Exception\ServerException; use Symfony\Component\HttpClient\HttpClient; use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface; use TYPO3\CMS\Core\SingletonInterface; @@ -52,5 +53,7 @@ class BookingApiService implements SingletonInterface } catch (TransportExceptionInterface $e) {} + catch (ServerException $e) + {} } } \ No newline at end of file diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Forms/ContactForm.form.yaml b/public/typo3conf/ext/ep_theme/Resources/Private/Forms/ContactForm.form.yaml index d5ceb9ad..ae6fd830 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Forms/ContactForm.form.yaml +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Forms/ContactForm.form.yaml @@ -8,15 +8,13 @@ prototypeName: contactform finishers: - identifier: BpnApiFinisher - options: - apiToken: foobarbaz - options: - subject: 'Kontaktanfrage von {vorname} {name}' + subject: 'Kontaktanfrage von {firstName} {name}' recipientAddress: info@ep-reisen.de recipientName: 'E&P Reisen' senderAddress: '{email}' - senderName: '{vorname} {name}' + senderName: '{firstName} {name}' replyToAddress: info@ep-reisen.de carbonCopyAddress: '' blindCarbonCopyAddress: '' @@ -42,7 +40,7 @@ renderables: - defaultValue: '' type: Text - identifier: vorname + identifier: firstName label: Vorname properties: fluidAdditionalAttributes: @@ -74,7 +72,7 @@ renderables: fluidAdditionalAttributes: required: required type: SingleSelect - identifier: geschlecht + identifier: gender label: Gender validators: - @@ -95,7 +93,7 @@ renderables: - defaultValue: '' type: Text - identifier: strasse + identifier: street label: Straße properties: fluidAdditionalAttributes: @@ -104,17 +102,17 @@ renderables: - defaultValue: '' type: Text - identifier: plz + identifier: zipCode label: 'PLZ' - defaultValue: '' type: Text - identifier: ort + identifier: city label: 'Ort' - defaultValue: '' type: Text - identifier: telefon + identifier: phone label: Telefon - defaultValue: ''