diff --git a/.gitignore b/.gitignore index e69de29..723ef36 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/README.md b/README.md index 6f97fb8..de71db4 100755 --- a/README.md +++ b/README.md @@ -12,4 +12,19 @@ Diese Erweiterung integriert die heidelpay Zahlarten in Ihren Plentymarkets Shop This extension provides an integration of the heidelpay payment methods for your plentymarkets shop.\ * [User Guide](meta/documents/user_guide_en.md) * [Changelog](meta/documents/changelog_en.md) -* [Support Contacts](meta/documents/support_contact_en.md) \ No newline at end of file +* [Support Contacts](meta/documents/support_contact_en.md) + +## Support +For any issues or questions please get in touch with our support. + +#### Web page +https://dev.heidelpay.com/ + +#### Email +support@heidelpay.com + +#### Phone ++49 (0)6221/6471-100 + +#### Twitter +@devHeidelpay \ No newline at end of file diff --git a/meta/documents/changelog_de.md b/meta/documents/changelog_de.md index dadfcdf..986db11 100755 --- a/meta/documents/changelog_de.md +++ b/meta/documents/changelog_de.md @@ -1,5 +1,17 @@ # heidelpay Payment Gateway Changelog +## [1.1.1][1.1.1] + +### Change +- Logos ausgetauscht. +- Diverse Codingstyle-Fehler behoben. +- .gitignore aktualisiert +- Readme um Support Informationen ergänzt + +### Fixed +- Support Telefonnummer korrigiert. +- MwSt wird nun bei Auslandsgeschäften nicht mit einbezogen + ## [1.1.0][1.1.0] ### Removed @@ -20,4 +32,5 @@ - Erste Implementation. - Zahlarten Kreditkarte, Debitkarte, Sofort und Lastschrift hinzugefügt. -[1.1.0]: https://github.com/heidelpay/plentymarkets-gateway/tree/1.1.0 \ No newline at end of file +[1.1.0]: https://github.com/heidelpay/plentymarkets-gateway/tree/1.1.0 +[1.1.1]: https://github.com/heidelpay/plentymarkets-gateway/compare/1.1.0..1.1.1 \ No newline at end of file diff --git a/meta/documents/changelog_en.md b/meta/documents/changelog_en.md index 8ca9981..6b0cacb 100755 --- a/meta/documents/changelog_en.md +++ b/meta/documents/changelog_en.md @@ -1,5 +1,17 @@ # heidelpay Payment Gateway Changelog +## [1.1.1][1.1.1] + +### Change +- Replace images. +- Resolve codingstyle violations. +- Update .gitignore +- Add support information to readme + +### Fixed +- Fix support phone number. +- Fix incorrect VAT for internaational customer + ## [1.1.0][1.1.0] ### Removed @@ -20,4 +32,5 @@ - Initial implementation. - Added payment methods credit card, debit card, Sofort and direct debit. -[1.1.0]: https://github.com/heidelpay/plentymarkets-gateway/tree/1.1.0 \ No newline at end of file +[1.1.0]: https://github.com/heidelpay/plentymarkets-gateway/tree/1.1.0 +[1.1.1]: https://github.com/heidelpay/plentymarkets-gateway/compare/1.1.0..1.1.1 \ No newline at end of file diff --git a/meta/documents/support_contact_en.md b/meta/documents/support_contact_en.md index 6de96c0..918bbbc 100755 --- a/meta/documents/support_contact_en.md +++ b/meta/documents/support_contact_en.md @@ -5,7 +5,7 @@ https://dev.heidelpay.de/plentymarkets/ support@heidelpay.com ## Phone -+49 (0)6221/6471-200 ++49 (0)6221/6471-100 ## Twitter @devHeidelpay \ No newline at end of file diff --git a/meta/images/icon_author_md.png b/meta/images/icon_author_md.png index 2af187e..13821f7 100755 Binary files a/meta/images/icon_author_md.png and b/meta/images/icon_author_md.png differ diff --git a/meta/images/icon_author_sm.png b/meta/images/icon_author_sm.png index 79f410e..ed246db 100755 Binary files a/meta/images/icon_author_sm.png and b/meta/images/icon_author_sm.png differ diff --git a/meta/images/icon_author_xs.png b/meta/images/icon_author_xs.png index ffd955b..0b2b6a2 100755 Binary files a/meta/images/icon_author_xs.png and b/meta/images/icon_author_xs.png differ diff --git a/meta/images/icon_plugin_md.png b/meta/images/icon_plugin_md.png index 2af187e..13821f7 100755 Binary files a/meta/images/icon_plugin_md.png and b/meta/images/icon_plugin_md.png differ diff --git a/meta/images/icon_plugin_sm.png b/meta/images/icon_plugin_sm.png index 79f410e..ed246db 100755 Binary files a/meta/images/icon_plugin_sm.png and b/meta/images/icon_plugin_sm.png differ diff --git a/meta/images/icon_plugin_xs.png b/meta/images/icon_plugin_xs.png index ffd955b..0b2b6a2 100755 Binary files a/meta/images/icon_plugin_xs.png and b/meta/images/icon_plugin_xs.png differ diff --git a/plugin.json b/plugin.json index c6ca355..69cc630 100755 --- a/plugin.json +++ b/plugin.json @@ -13,7 +13,7 @@ }, "categories": ["3519"], "keywords": ["heidelpay", "plentymarkets", "plugin", "payment", "payment method", "credit card", "debit card", "sofort", "direct debit"], - "version": "1.1.0", + "version": "1.1.1", "license": "Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.", "price": 0.00, "author": "heidelpay GmbH", diff --git a/src/Constants/Plugin.php b/src/Constants/Plugin.php index 59de17f..68d9e12 100755 --- a/src/Constants/Plugin.php +++ b/src/Constants/Plugin.php @@ -18,5 +18,5 @@ class Plugin { const KEY = 'heidelpay'; const NAME = 'Heidelpay'; - const VERSION = '1.1.0'; + const VERSION = '1.1.1'; } diff --git a/src/Services/PaymentService.php b/src/Services/PaymentService.php index 90f7e72..3ed305d 100755 --- a/src/Services/PaymentService.php +++ b/src/Services/PaymentService.php @@ -212,6 +212,7 @@ public function executePayment(string $paymentMethod, ExecutePayment $event): ar * @param array $parameters * * @return array + * @throws \RuntimeException */ public function sendPaymentRequest( Basket $basket, @@ -270,7 +271,12 @@ public function getPaymentMethodContent( if ($methodInstance->hasToBeInitialized()) { try { - $result = $this->sendPaymentRequest($basket, $paymentMethod, $methodInstance->getTransactionType(), $mopId); + $result = $this->sendPaymentRequest( + $basket, + $paymentMethod, + $methodInstance->getTransactionType(), + $mopId + ); $value = $this->handleSyncResponse($type, $result); } catch (\RuntimeException $e) { $this->notification->error($clientErrorMessage, __METHOD__, [$type, $e->getMessage()], true); @@ -292,9 +298,12 @@ public function getPaymentMethodContent( * @param string $paymentMethod * @param int $mopId * @param string $transactionId + * @throws \RuntimeException */ private function prepareRequest(Basket $basket, string $paymentMethod, int $mopId, string $transactionId) { + $basketArray = $basket->toArray(); + /** @var BasketService $basketService */ $basketService = pluginApp(BasketService::class); @@ -307,7 +316,7 @@ private function prepareRequest(Basket $basket, string $paymentMethod, int $mopI // set customer personal information & address data $addresses = $this->getCustomerAddressData($basket); - $this->heidelpayRequest['IDENTIFICATION_SHOPPERID'] = $basket->customerId; + $this->heidelpayRequest['IDENTIFICATION_SHOPPERID'] = $basketArray['customerId']; $this->heidelpayRequest['NAME_GIVEN'] = $addresses['billing']->firstName; $this->heidelpayRequest['NAME_FAMILY'] = $addresses['billing']->lastName; $this->heidelpayRequest['CONTACT_EMAIL'] = $addresses['billing']->email; @@ -325,9 +334,16 @@ private function prepareRequest(Basket $basket, string $paymentMethod, int $mopI $this->heidelpayRequest['IDENTIFICATION_TRANSACTIONID'] = $transactionId; + // set amount to net if showNetPrice === true + if ($this->sessionStorageFactory->getCustomer()->showNetPrice) { + $basketArray['itemSum'] = $basketArray['itemSumNet']; + $basketArray['basketAmount'] = $basketArray['basketAmountNet']; + $basketArray['shippingAmount'] = $basketArray['shippingAmountNet']; + } + // set basket information (amount, currency, orderId, ...) - $this->heidelpayRequest['PRESENTATION_AMOUNT'] = $basket->basketAmount; - $this->heidelpayRequest['PRESENTATION_CURRENCY'] = $basket->currency; + $this->heidelpayRequest['PRESENTATION_AMOUNT'] = $basketArray['basketAmount']; + $this->heidelpayRequest['PRESENTATION_CURRENCY'] = $basketArray['currency']; $this->heidelpayRequest['FRONTEND_ENABLED'] = 'TRUE'; $this->heidelpayRequest['FRONTEND_LANGUAGE'] = $this->sessionStorageFactory->getLocaleSettings()->language; @@ -355,9 +371,9 @@ private function prepareRequest(Basket $basket, string $paymentMethod, int $mopI $this->heidelpayRequest['CRITERION_MOP'] = $mopId; $this->heidelpayRequest['CRITERION_SHOP_TYPE'] = 'plentymarkets 7'; $this->heidelpayRequest['CRITERION_SHOPMODULE_VERSION'] = Plugin::VERSION; - $this->heidelpayRequest['CRITERION_BASKET_ID'] = $basket->id; - $this->heidelpayRequest['CRITERION_ORDER_ID'] = $basket->orderId; - $this->heidelpayRequest['CRITERION_ORDER_TIMESTAMP'] = $basket->orderTimestamp; + $this->heidelpayRequest['CRITERION_BASKET_ID'] = $basketArray['id']; + $this->heidelpayRequest['CRITERION_ORDER_ID'] = $basketArray['orderId']; + $this->heidelpayRequest['CRITERION_ORDER_TIMESTAMP'] = $basketArray['orderTimestamp']; $this->heidelpayRequest['CRITERION_PUSH_URL'] = $this->paymentHelper->getDomain() . '/' . Routes::PUSH_NOTIFICATION_URL; @@ -528,6 +544,7 @@ public function createOrGetPlentyPayment(Transaction $txnData): Payment * * @param Payment $payment * @param int $orderId + * @throws \RuntimeException */ public function assignPlentyPayment(Payment $payment, int $orderId) {