From 8c005b7f97c15bff588f5fd58ce182fd58f34668 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Fri, 3 May 2019 13:26:53 +0200 Subject: [PATCH 01/59] [fix] Display payment description text in checkout payment selection. --- includes/gateways/class-wc-heidelpay-gateway-dd.php | 1 + includes/gateways/class-wc-heidelpay-gateway-ivpg.php | 1 + 2 files changed, 2 insertions(+) diff --git a/includes/gateways/class-wc-heidelpay-gateway-dd.php b/includes/gateways/class-wc-heidelpay-gateway-dd.php index df58ea2..87f8c27 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-dd.php +++ b/includes/gateways/class-wc-heidelpay-gateway-dd.php @@ -106,6 +106,7 @@ public function payment_fields() $accountHolder = wc()->customer->get_billing_first_name() . ' ' . wc()->customer->get_billing_last_name(); echo '
'; + parent::payment_fields(); echo ''; echo ' '; diff --git a/includes/gateways/class-wc-heidelpay-gateway-ivpg.php b/includes/gateways/class-wc-heidelpay-gateway-ivpg.php index 48742b9..840e2dd 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-ivpg.php +++ b/includes/gateways/class-wc-heidelpay-gateway-ivpg.php @@ -235,6 +235,7 @@ public function payment_fields() echo '
'; + parent::payment_fields(); echo '' . From 3da07771c8603c8014c47ed3109d2541bde81015 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Tue, 19 Nov 2019 14:24:58 +0100 Subject: [PATCH 02/59] [refactor] update Vendor versions and composer.json --- composer.json | 12 +- vendor/composer/installed.json | 45 +-- .../php-message-code-mapper/LICENSE.txt | 2 +- .../php-message-code-mapper/README.md | 19 +- .../php-message-code-mapper/composer.json | 4 +- .../Exceptions/MissingLocaleFileException.php | 10 +- .../lib/Helpers/FileSystem.php | 10 +- .../lib/MessageCodeMapper.php | 10 +- .../tests/unit/MessageCodeMapperTest.php | 6 +- vendor/heidelpay/php-payment-api/.travis.yml | 2 - vendor/heidelpay/php-payment-api/CHANGELOG.md | 57 ++- vendor/heidelpay/php-payment-api/LICENSE.txt | 4 +- vendor/heidelpay/php-payment-api/README.md | 35 +- .../heidelpay/php-payment-api/composer.json | 25 +- .../example/CreditCardRegistration.php | 4 +- .../example/DebitCardDebit.php | 4 +- .../example/DirectDebitRegistration.php | 2 +- .../php-payment-api/example/EasyCredit.php | 141 ++++++++ .../EasyCredit/EasyCreditConstants.php | 25 ++ .../EasyCredit/EasyCreditReservation.php | 116 +++++++ .../example/EasyCredit/EasyCreditResponse.php | 89 +++++ .../EasyCredit/EasyCreditResponseParams.txt | 0 .../FactoringInvoiceConstants.php | 29 ++ .../FactoringInvoiceResponse.php | 116 +++++++ .../FactoringInvoiceResponseParams.txt | 0 .../FactoringInvoiceReversal.php | 121 +++++++ .../FactoringInvoiceB2CSecuredAuthorize.php | 157 +++++++++ .../example/InvoiceAuthorize.php | 2 +- .../example/InvoiceB2BSecuredAuthorize.php | 162 +++++++++ .../example/InvoiceB2CSecuredAuthorize.php | 2 +- .../php-payment-api/example/PayPalDebit.php | 2 +- .../example/PostFinanceCardAuthorize.php | 2 +- .../example/PrepaymentAuthorize.php | 2 +- .../example/Przelewy24Authorize.php | 2 +- .../example/SantanderAuthorize.php | 2 +- .../SantanderHp/SantanderHpConstants.php | 25 ++ .../SantanderHp/SantanderHpReservation.php | 126 +++++++ .../SantanderHp/SantanderHpResponse.php | 77 ++++ .../SantanderHp/SantanderHpResponseParams.txt | 0 .../example/SantanderHpInitialize.php | 157 +++++++++ .../example/_HeidelpayConstants.php | 10 + .../example/js/creditCardFrame.js | 4 +- .../php-payment-api/example/style.css | 2 +- .../php-payment-api/lib/AbstractMethod.php | 328 ++++++++++++------ .../lib/Constants/ApiConfig.php | 2 +- .../php-payment-api/lib/Constants/Brand.php | 2 + .../lib/Constants/CommercialSector.php | 61 ++++ .../lib/Constants/ExecutiveFunction.php | 25 ++ .../lib/Constants/FrontendMode.php | 20 ++ .../lib/Constants/RegistrationType.php | 21 ++ .../lib/Constants/ReversalType.php | 22 ++ .../lib/Constants/TransactionMode.php | 4 +- .../ParameterGroups/CompanyParameterGroup.php | 283 +++++++++++++++ .../ParameterGroups/ConfigParameterGroup.php | 2 +- .../CustomerParameterGroup.php | 44 +++ .../ExecutiveParameterGroup.php | 246 +++++++++++++ .../FrontendParameterGroup.php | 25 +- .../ParameterGroups/HomeParameterGroup.php | 142 ++++++++ .../IdentificationParameterGroup.php | 22 ++ .../LocationParameterGroup.php | 168 +++++++++ .../ParameterGroups/PaymentParameterGroup.php | 22 ++ .../RiskInformationParameterGroup.php | 38 +- .../ParameterGroups/UserParameterGroup.php | 2 +- .../CreditCardPaymentMethod.php | 8 +- .../PaymentMethods/DebitCardPaymentMethod.php | 8 +- .../InvoiceB2BSecuredPaymentMethod.php | 41 +++ .../SantanderHirePurchasePaymentMethod.php | 43 +++ vendor/heidelpay/php-payment-api/lib/Push.php | 28 ++ .../lib/PushMapping/Company.php | 41 +++ .../lib/PushMapping/Executive.php | 42 +++ .../php-payment-api/lib/PushMapping/Home.php | 40 +++ .../lib/PushMapping/Identification.php | 1 + .../lib/PushMapping/Location.php | 41 +++ .../lib/PushMapping/Payment.php | 20 ++ .../heidelpay/php-payment-api/lib/Request.php | 61 +++- .../ReversalTransactionType.php | 6 +- .../tests/Helper/Authentication.php | 7 +- .../tests/Helper/BasePaymentMethodTest.php | 7 +- .../php-payment-api/tests/Helper/Company.php | 137 ++++++++ .../Constraints/ArraysMatchConstraint.php | 7 +- .../php-payment-api/tests/Helper/Customer.php | 9 +- .../tests/Helper/Executive.php | 57 +++ ...DirectDebitB2CSecuredPaymentMethodTest.php | 2 +- .../EasyCreditPaymentMethodTest.php | 2 +- .../InvoiceB2BSecuredPaymentMethodTest.php | 269 ++++++++++++++ .../InvoiceB2CSecuredFactoringTest.php | 305 ++++++++++++++++ .../InvoiceB2CSecuredPaymentMethodTest.php | 2 +- .../PayPalPaymentMethodTest.php | 2 +- .../PrepaymentPaymentMethodTest.php | 2 +- ...SantanderHirePurchasePaymentMethodTest.php | 115 ++++++ .../SantanderInvoicePaymentMethodTest.php | 91 ++++- .../SofortPaymentMethodTest.php | 2 +- .../tests/unit/Adapter/CurlAdapterTest.php | 3 +- .../CompanyParameterGroupTest.php | 204 +++++++++++ .../ExecutiveParameterGroupTest.php | 149 ++++++++ .../FrontendParameterGroupTest.php | 13 +- .../HomeParameterGroupTest.php | 96 +++++ .../IdentificationParameterGroupTest.php | 28 ++ .../LocationParameterGroupTest.php | 109 ++++++ .../PaymentParameterGroupTest.php | 30 +- .../RiskInformationParameterGroupTest.php | 12 +- .../TransactionParameterGroupTest.php | 2 +- .../CreditCardPaymentMethodTest.php | 47 ++- .../DebitCardPaymentMethodTest.php | 35 ++ .../GenericPaymentMethodTest.php | 22 ++ .../InvoiceB2BSecuredPaymentMethodTest.php | 217 ++++++++++++ .../PaymentMethodFactoringTest.php | 181 ++++++++++ .../PaymentMethodTransactionTest.php | 50 +-- ...SantanderHirePurchasePaymentMethodTest.php | 153 ++++++++ .../php-payment-api/tests/unit/PushTest.php | 171 ++++++++- .../tests/unit/RequestTest.php | 52 ++- .../tests/unit/ResponseTest.php | 91 ++++- 112 files changed, 5810 insertions(+), 352 deletions(-) create mode 100644 vendor/heidelpay/php-payment-api/example/EasyCredit.php create mode 100644 vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditConstants.php create mode 100644 vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditReservation.php create mode 100644 vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditResponse.php create mode 100644 vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditResponseParams.txt create mode 100644 vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceConstants.php create mode 100644 vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceResponse.php create mode 100644 vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceResponseParams.txt create mode 100644 vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceReversal.php create mode 100644 vendor/heidelpay/php-payment-api/example/FactoringInvoiceB2CSecuredAuthorize.php create mode 100644 vendor/heidelpay/php-payment-api/example/InvoiceB2BSecuredAuthorize.php create mode 100644 vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpConstants.php create mode 100644 vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpReservation.php create mode 100644 vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpResponse.php create mode 100644 vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpResponseParams.txt create mode 100644 vendor/heidelpay/php-payment-api/example/SantanderHpInitialize.php create mode 100644 vendor/heidelpay/php-payment-api/example/_HeidelpayConstants.php create mode 100644 vendor/heidelpay/php-payment-api/lib/Constants/CommercialSector.php create mode 100644 vendor/heidelpay/php-payment-api/lib/Constants/ExecutiveFunction.php create mode 100644 vendor/heidelpay/php-payment-api/lib/Constants/FrontendMode.php create mode 100644 vendor/heidelpay/php-payment-api/lib/Constants/RegistrationType.php create mode 100644 vendor/heidelpay/php-payment-api/lib/Constants/ReversalType.php create mode 100644 vendor/heidelpay/php-payment-api/lib/ParameterGroups/CompanyParameterGroup.php create mode 100644 vendor/heidelpay/php-payment-api/lib/ParameterGroups/CustomerParameterGroup.php create mode 100644 vendor/heidelpay/php-payment-api/lib/ParameterGroups/ExecutiveParameterGroup.php create mode 100644 vendor/heidelpay/php-payment-api/lib/ParameterGroups/HomeParameterGroup.php create mode 100644 vendor/heidelpay/php-payment-api/lib/ParameterGroups/LocationParameterGroup.php create mode 100644 vendor/heidelpay/php-payment-api/lib/PaymentMethods/InvoiceB2BSecuredPaymentMethod.php create mode 100644 vendor/heidelpay/php-payment-api/lib/PaymentMethods/SantanderHirePurchasePaymentMethod.php create mode 100644 vendor/heidelpay/php-payment-api/lib/PushMapping/Company.php create mode 100644 vendor/heidelpay/php-payment-api/lib/PushMapping/Executive.php create mode 100644 vendor/heidelpay/php-payment-api/lib/PushMapping/Home.php create mode 100644 vendor/heidelpay/php-payment-api/lib/PushMapping/Location.php create mode 100644 vendor/heidelpay/php-payment-api/tests/Helper/Company.php create mode 100644 vendor/heidelpay/php-payment-api/tests/Helper/Executive.php create mode 100644 vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php create mode 100644 vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredFactoringTest.php create mode 100644 vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php create mode 100644 vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/CompanyParameterGroupTest.php create mode 100644 vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/ExecutiveParameterGroupTest.php create mode 100644 vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/HomeParameterGroupTest.php create mode 100644 vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/LocationParameterGroupTest.php create mode 100644 vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php create mode 100644 vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodFactoringTest.php create mode 100644 vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php diff --git a/composer.json b/composer.json index a44d2b6..d146dc1 100644 --- a/composer.json +++ b/composer.json @@ -10,14 +10,18 @@ "authors": [ { "name": "Daniel Kraut", - "email": "github@bnoob.eu" + "email": "Developer" }, { "name": "Florian Evertz", - "email": "florian.evertz@googlemail.com" + "role": "Developer" }, { - "name": "David Owusu" + "name": "David Owusu", + "role": "Developer" } - ] + ], + "support": { + "email": "development@heidelpay.com" + } } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 25979f5..a9344b8 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,17 +1,17 @@ [ { "name": "heidelpay/php-message-code-mapper", - "version": "v1.0.1", - "version_normalized": "1.0.1.0", + "version": "v1.0.2", + "version_normalized": "1.0.2.0", "source": { "type": "git", "url": "https://github.com/heidelpay/php-message-code-mapper.git", - "reference": "d19a61e5f079d1e66169aefcbbaae227bff64130" + "reference": "4d9390b8a271b2eda98e411cbf1624e4f5cf7947" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/heidelpay/php-message-code-mapper/zipball/d19a61e5f079d1e66169aefcbbaae227bff64130", - "reference": "d19a61e5f079d1e66169aefcbbaae227bff64130", + "url": "https://api.github.com/repos/heidelpay/php-message-code-mapper/zipball/4d9390b8a271b2eda98e411cbf1624e4f5cf7947", + "reference": "4d9390b8a271b2eda98e411cbf1624e4f5cf7947", "shasum": "" }, "require": { @@ -23,7 +23,7 @@ "heidelpay/phpdocumentor": "^2.9.1", "phpunit/phpunit": "~5.7" }, - "time": "2018-03-01T07:22:04+00:00", + "time": "2019-02-04T15:13:31+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -54,20 +54,21 @@ }, { "name": "heidelpay/php-payment-api", - "version": "v1.5.0", - "version_normalized": "1.5.0.0", + "version": "v1.7.1", + "version_normalized": "1.7.1.0", "source": { "type": "git", "url": "https://github.com/heidelpay/php-payment-api.git", - "reference": "f3bea9bb5af0f0fc498f9d20c58e1c04efac13a9" + "reference": "30b5be4a784de8c6ee67931a251fffa77a30ab4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/heidelpay/php-payment-api/zipball/f3bea9bb5af0f0fc498f9d20c58e1c04efac13a9", - "reference": "f3bea9bb5af0f0fc498f9d20c58e1c04efac13a9", + "url": "https://api.github.com/repos/heidelpay/php-payment-api/zipball/30b5be4a784de8c6ee67931a251fffa77a30ab4b", + "reference": "30b5be4a784de8c6ee67931a251fffa77a30ab4b", "shasum": "" }, "require": { + "ext-json": "*", "ext-simplexml": "*", "lib-curl": "*", "lib-openssl": "*", @@ -81,16 +82,17 @@ }, "require-dev": { "codacy/coverage": "^1.4", - "codeception/aspect-mock": "~2.1.1", + "codeception/aspect-mock": "~3.0.0", "codeception/codeception": "~2.3.9", "friendsofphp/php-cs-fixer": "^2.0", + "heidelpay/php-basket-api": "^1.0", "heidelpay/phpdocumentor": "2.9.1" }, "suggest": { "heidelpay/php-basket-api": "Use this package to transmit basket information.", "heidelpay/php-message-code-mapper": "You can use this package to provide user-friendly messages instead of error codes." }, - "time": "2018-04-13T07:21:22+00:00", + "time": "2019-02-25T15:29:11+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -102,23 +104,6 @@ "license": [ "proprietary" ], - "authors": [ - { - "name": "Jens Richter" - }, - { - "name": "Ronja Wann" - }, - { - "name": "Stephano Vogel" - }, - { - "name": "Daniel Kraut" - }, - { - "name": "Simon Gabriel" - } - ], "description": "New client library for heidelpay payments replacing heidelpay/php-api.", "homepage": "http://dev.heidelpay.com", "keywords": [ diff --git a/vendor/heidelpay/php-message-code-mapper/LICENSE.txt b/vendor/heidelpay/php-message-code-mapper/LICENSE.txt index 1cb85b7..5ea8db4 100644 --- a/vendor/heidelpay/php-message-code-mapper/LICENSE.txt +++ b/vendor/heidelpay/php-message-code-mapper/LICENSE.txt @@ -3,7 +3,7 @@ Lizenzvereinbarung Plug-in I. Präambel -Diese Lizenzvereinbarung Plug-in (nachfolgend – „Vereinbarung“) bildet einen Vertrag zwischen dem Nutzer des Plug-ins und der Heidelberger Payment GmbH (nachfolgend „heidelpay“). +Diese Lizenzvereinbarung Plug-in (nachfolgend – „Vereinbarung“) bildet einen Vertrag zwischen dem Nutzer des Plug-ins und der heidelpay GmbH (nachfolgend „heidelpay“). Das Plug-in von heidelpay ist ein Software-Programm, welches die Schnittstelle zum Payment-System von heidelpay mit einer Anwendung (zum Beispiel: Shopsystem, Warenwirtschaft, Debitorenmanagement etc.) verbindet. Das Plug-in dient dem Datenaustausch zwischen dem Payment-System von heidelpay und der Anwendung. Das Plug-in erweitert den Funktionsumfang der Anwendung hinsichtlich der mit heidelpay gesondert vertraglich vereinbarten Leistungen. diff --git a/vendor/heidelpay/php-message-code-mapper/README.md b/vendor/heidelpay/php-message-code-mapper/README.md index 3245499..c22968f 100644 --- a/vendor/heidelpay/php-message-code-mapper/README.md +++ b/vendor/heidelpay/php-message-code-mapper/README.md @@ -7,9 +7,9 @@ [![PHP 7.1](https://img.shields.io/badge/php-7.1-blue.svg)](http://www.php.net) [![PHP 7.2](https://img.shields.io/badge/php-7.2-blue.svg)](http://www.php.net) -![Logo](https://dev.heidelpay.de/devHeidelpay_400_180.jpg) +![Logo](http://dev.heidelpay.com/devHeidelpay_400_180.jpg) -**heidelpay message code mapper** +## heidelpay message code mapper This library provides user-friendly output of (error)-messages coming from the heidelpay API. @@ -72,3 +72,18 @@ Now you can return or print out the message by calling the `getMessage()` method ```echo $instance->getMessage($errorcode);``` Error codes are accepted in either the 'XXX.XXX.XXX' or 'HP-Error-XXX.XXX.XXX' format. + +## 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/vendor/heidelpay/php-message-code-mapper/composer.json b/vendor/heidelpay/php-message-code-mapper/composer.json index efad51d..50df935 100644 --- a/vendor/heidelpay/php-message-code-mapper/composer.json +++ b/vendor/heidelpay/php-message-code-mapper/composer.json @@ -7,13 +7,13 @@ "authors": [ { "name": "Stephano Vogel", - "email": "development@heidelpay.de" + "email": "development@heidelpay.com" } ], "support" : { "email" : "development@heidelpay.de" }, - "homepage" : "https://dev.heidelpay.de", + "homepage" : "http://dev.heidelpay.com", "autoload" : { "psr-4": { "Heidelpay\\MessageCodeMapper\\": "lib" diff --git a/vendor/heidelpay/php-message-code-mapper/lib/Exceptions/MissingLocaleFileException.php b/vendor/heidelpay/php-message-code-mapper/lib/Exceptions/MissingLocaleFileException.php index d675bbc..73ed577 100644 --- a/vendor/heidelpay/php-message-code-mapper/lib/Exceptions/MissingLocaleFileException.php +++ b/vendor/heidelpay/php-message-code-mapper/lib/Exceptions/MissingLocaleFileException.php @@ -8,15 +8,13 @@ * This class is used for indicating a missing locale file for the library usage. * * @license Use of this software requires acceptance of the License Agreement. See LICENSE file. - * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved. + * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved. * - * @link https://dev.heidelpay.de/php-messages-code-mapper + * @link http://dev.heidelpay.com/php-messages-code-mapper * - * @author Stephano Vogel + * @author Stephano Vogel * - * @package heidelpay - * @subpackage php-messages-code-mapper - * @category php-messages-code-mapper + * @package heidelpay\php-message-code-mapper\exceptions */ class MissingLocaleFileException extends Exception { diff --git a/vendor/heidelpay/php-message-code-mapper/lib/Helpers/FileSystem.php b/vendor/heidelpay/php-message-code-mapper/lib/Helpers/FileSystem.php index 94a9801..2476658 100644 --- a/vendor/heidelpay/php-message-code-mapper/lib/Helpers/FileSystem.php +++ b/vendor/heidelpay/php-message-code-mapper/lib/Helpers/FileSystem.php @@ -6,15 +6,13 @@ * This class provides the functionality for reading the locale files. * * @license Use of this software requires acceptance of the License Agreement. See LICENSE file. - * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved. + * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved. * - * @link https://dev.heidelpay.de/php-messages-code-mapper + * @link http://dev.heidelpay.com/php-messages-code-mapper * - * @author Stephano Vogel + * @author Stephano Vogel * - * @package heidelpay - * @subpackage php-messages-code-mapper - * @category php-messages-code-mapper + * @package heidelpay\php-message-code-mapper */ class FileSystem { diff --git a/vendor/heidelpay/php-message-code-mapper/lib/MessageCodeMapper.php b/vendor/heidelpay/php-message-code-mapper/lib/MessageCodeMapper.php index fb1ae09..6659096 100644 --- a/vendor/heidelpay/php-message-code-mapper/lib/MessageCodeMapper.php +++ b/vendor/heidelpay/php-message-code-mapper/lib/MessageCodeMapper.php @@ -13,15 +13,13 @@ * The path is important when own implementations have to be used. * * @license Use of this software requires acceptance of the License Agreement. See LICENSE file. - * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved. + * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved. * - * @link https://dev.heidelpay.de/php-messages-code-mapper + * @link http://dev.heidelpay.com/php-messages-code-mapper * - * @author Stephano Vogel + * @author Stephano Vogel * - * @package heidelpay - * @subpackage php-messages-code-mapper - * @category php-messages-code-mapper + * @package heidelpay\php-message-code-mapper */ class MessageCodeMapper { diff --git a/vendor/heidelpay/php-message-code-mapper/tests/unit/MessageCodeMapperTest.php b/vendor/heidelpay/php-message-code-mapper/tests/unit/MessageCodeMapperTest.php index d93e619..38b472b 100644 --- a/vendor/heidelpay/php-message-code-mapper/tests/unit/MessageCodeMapperTest.php +++ b/vendor/heidelpay/php-message-code-mapper/tests/unit/MessageCodeMapperTest.php @@ -10,11 +10,11 @@ * This class provides unit tests for the CustomerMessage implementation. * * @license Use of this software requires acceptance of the License Agreement. See LICENSE file. - * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved. + * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved. * - * @link https://dev.heidelpay.de/php-messages-code-mapper + * @link http://dev.heidelpay.com/php-messages-code-mapper * - * @author Stephano Vogel + * @author Stephano Vogel * * @package heidelpay * @subpackage php-messages-code-mapper diff --git a/vendor/heidelpay/php-payment-api/.travis.yml b/vendor/heidelpay/php-payment-api/.travis.yml index 35d5f72..91a512a 100644 --- a/vendor/heidelpay/php-payment-api/.travis.yml +++ b/vendor/heidelpay/php-payment-api/.travis.yml @@ -3,8 +3,6 @@ dist: trusty matrix: fast_finish: true include: - - php: 5.6 - env: deps=no - php: 7.0 env: deps=no - php: 7.0 diff --git a/vendor/heidelpay/php-payment-api/CHANGELOG.md b/vendor/heidelpay/php-payment-api/CHANGELOG.md index 1b1f2c8..0c391f6 100644 --- a/vendor/heidelpay/php-payment-api/CHANGELOG.md +++ b/vendor/heidelpay/php-payment-api/CHANGELOG.md @@ -3,6 +3,58 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [v1.7.1][v1.7.1] + +### Added +- Support for factoring. + +## [v1.7.0][v1.7.0] + +### Fixed +- Santanter Invoice integration tests. + +### Added +- Payment method for B2B invoice secured and corresponding tests. +- Missing parameter CUSTOMER.OptIn_2 for Santander Invoice. +- Example implementation for Santander paying by instalments. + +### Changed +- Used BasketApi to enable additional integration tests for Santander IV. + +## [v1.6.2][v1.6.2] + +### Fixed +- Path to autoloader in EasyCredit example. + +## [v1.6.1][v1.6.1] + +### Added +- Example implementation for easyCredit payment method. +- Json extension dependency to composer.json. + +### Changed +- Updated readme file. + +## [v1.6.0][v1.6.0] + +### Added +- Payment method 'Santander Hire Purchase' and corresponding tests (unit and integration). +- Missing unit tests. + +### Changed +- Replaced warning suppression in mapFromPost method. +- Visibility of *Parent methods in `CreditCardPaymentMethod` and `DebitCardPaymentMethods` +- Prohibit setting the mode parameter of the frontend group. +- Renamed 'Heidelberger Payment GmbH' to 'heidelpay GmbH'. +- Re-enabled test deactivated due to error with aspect-mock package. + +### Fixed +- Parameter names in riskinformation group. +- Fix test data. + +### Removed +- Php 5.6 from travis workflow. + ## [v1.5.0][v1.5.0] ### Added - New unit test to cover finalize payment method. @@ -109,4 +161,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [v1.3.0]: https://github.com/heidelpay/php-payment-api/compare/v1.2.0...v1.3.0 [v1.4.0]: https://github.com/heidelpay/php-payment-api/compare/v1.3.0...v1.4.0 [v1.4.1]: https://github.com/heidelpay/php-payment-api/compare/v1.4.0...v1.4.1 -[v1.5.0]: https://github.com/heidelpay/php-payment-api/compare/v1.4.0...v1.5.0 +[v1.5.0]: https://github.com/heidelpay/php-payment-api/compare/v1.4.1...v1.5.0 +[v1.6.0]: https://github.com/heidelpay/php-payment-api/compare/v1.5.0...v1.6.0 +[v1.6.1]: https://github.com/heidelpay/php-payment-api/compare/v1.6.0...v1.6.1 +[v1.6.2]: https://github.com/heidelpay/php-payment-api/compare/v1.6.1...v1.6.2 diff --git a/vendor/heidelpay/php-payment-api/LICENSE.txt b/vendor/heidelpay/php-payment-api/LICENSE.txt index 1328017..698d371 100644 --- a/vendor/heidelpay/php-payment-api/LICENSE.txt +++ b/vendor/heidelpay/php-payment-api/LICENSE.txt @@ -5,7 +5,7 @@ Lizenzvereinbarung Plug-in I. Präambel - Diese Lizenzvereinbarung Plug-in (nachfolgend – „Vereinbarung“) bildet einen Vertrag zwischen dem Nutzer des Plug-ins und der Heidelberger Payment GmbH (nachfolgend „heidelpay“). + Diese Lizenzvereinbarung Plug-in (nachfolgend – „Vereinbarung“) bildet einen Vertrag zwischen dem Nutzer des Plug-ins und der heidelpay GmbH (nachfolgend „heidelpay“). Das Plug-in von heidelpay ist ein Software-Programm, welches die Schnittstelle zum Payment-System von heidelpay mit einer Anwendung (zum Beispiel: Shopsystem, Warenwirtschaft, Debitorenmanagement etc.) verbindet. Das Plug-in dient dem Datenaustausch zwischen dem Payment-System von heidelpay und der Anwendung. Das Plug-in erweitert den Funktionsumfang der Anwendung hinsichtlich der mit heidelpay gesondert vertraglich vereinbarten Leistungen. @@ -90,7 +90,7 @@ Plug-in Licence Agreement I. Introduction - This Plug-in Licence Agreement (hereinafter 'Agreement') constitutes a contract between the plug-in user and Heidelberger Payment GmbH (hereinafter 'heidelpay'). + This Plug-in Licence Agreement (hereinafter 'Agreement') constitutes a contract between the plug-in user and heidelpay GmbH (hereinafter 'heidelpay'). The plug-in from heidelpay is a software programme which links the heidelpay payment system interface to an application (for example, shop system, merchandise management, debtor management etc.). The plug-in is used to exchange data between the heidelpay payment system and the application. The plug-in expands the range of features in the application with regard to the services agreed separately with heidelpay. diff --git a/vendor/heidelpay/php-payment-api/README.md b/vendor/heidelpay/php-payment-api/README.md index 9407036..5df91db 100644 --- a/vendor/heidelpay/php-payment-api/README.md +++ b/vendor/heidelpay/php-payment-api/README.md @@ -28,8 +28,10 @@ This is the php payment api for heidelpay. The library will help you to easily i * EPS * invoice * invoice secured b2c +* invoice secured b2b * direct debit secured b2c * Santander invoice +* Santander hire purchase * easyCredit * Payolution invoice @@ -45,6 +47,21 @@ application takes care of sql injection, cross-site-scripting (xss) and so on. T You can find a copy of this license in [LICENSE.txt](LICENSE.txt). +## 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 + ## Documentation Please visit [http://dev.heidelpay.com/heidelpay-php-payment-api/](http://dev.heidelpay.com/heidelpay-php-payment-api/) for the developer documentation. @@ -54,19 +71,25 @@ Please visit [http://dev.heidelpay.com/heidelpay-php-payment-api/](http://dev.he This library comes with a set of unit and integration tests. Please do not run the integration tests on each build. Run prior to tests: -`codecept build` +`vendor/bin/codecept build` Run unit tests: -`codecept run unit` +`vendor/bin/codecept run unit` Run unit tests with code coverage report: -`codecept run unit --coverage --coverage-html` +`vendor/bin/codecept run unit --coverage --coverage-html` Run integration tests: -`codecept run integration` +`vendor/bin/codecept run integration` Run integration tests with debug output: -`codecept run integration --debug` +`vendor/bin/codecept run integration --debug` + +Run all integration test of a specific class: +`vendor/bin/codecept run tests/integration/PaymentMethods/EasyCreditPaymentMethodTest` + +Run a specific integration test: +`vendor/bin/codecept run tests/integration/PaymentMethods/EasyCreditPaymentMethodTest:initialRequest` For coverage analysis results see: `./tests/_output/coverage/index.html` @@ -85,3 +108,5 @@ to Please make sure to switch it off again, after you launch your application. +To enable the easyCredit example you might have to change the file permissions for the file "example/EasyCredit/EasyCreditResponseParams.txt".\ +It will be used to store the post-parameters send asynchronously by the payment which otherwise would not be accessable in the client session. diff --git a/vendor/heidelpay/php-payment-api/composer.json b/vendor/heidelpay/php-payment-api/composer.json index 9def072..b43019c 100644 --- a/vendor/heidelpay/php-payment-api/composer.json +++ b/vendor/heidelpay/php-payment-api/composer.json @@ -2,35 +2,20 @@ "name": "heidelpay/php-payment-api", "description": "New client library for heidelpay payments replacing heidelpay/php-api.", "license": "proprietary", - "authors": [ - { - "name": "Jens Richter" - }, - { - "name": "Ronja Wann" - }, - { - "name": "Stephano Vogel" - }, - { - "name": "Daniel Kraut" - }, - { - "name": "Simon Gabriel" - } - ], "require": { "php": ">=5.6.0", "lib-curl": "*", "lib-openssl": "*", - "ext-SimpleXML": "*" + "ext-SimpleXML": "*", + "ext-json": "*" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.0", "heidelpay/phpdocumentor": "2.9.1", "codeception/codeception": "~2.3.9", - "codeception/aspect-mock": "~2.1.1", - "codacy/coverage": "^1.4" + "codeception/aspect-mock": "~3.0.0", + "codacy/coverage": "^1.4", + "heidelpay/php-basket-api": "^1.0" }, "suggest": { "heidelpay/php-message-code-mapper": "You can use this package to provide user-friendly messages instead of error codes.", diff --git a/vendor/heidelpay/php-payment-api/example/CreditCardRegistration.php b/vendor/heidelpay/php-payment-api/example/CreditCardRegistration.php index 1b2e628..6b271b9 100644 --- a/vendor/heidelpay/php-payment-api/example/CreditCardRegistration.php +++ b/vendor/heidelpay/php-payment-api/example/CreditCardRegistration.php @@ -88,7 +88,7 @@ ); /** - * Set necessary parameters for Heidelpay payment Frame and send a registration request + * Set necessary parameters for heidelpay payment Frame and send a registration request */ $CreditCard->registration( HEIDELPAY_PHP_PAYMENT_API_URL, @@ -97,7 +97,7 @@ // PreventAsyncRedirect - this will tell the payment weather it should redirect the customer or not HEIDELPAY_PHP_PAYMENT_API_URL . HEIDELPAY_PHP_PAYMENT_API_FOLDER . - 'style.css' // CSSPath - css url to style the Heidelpay payment frame + 'style.css' // CSSPath - css url to style the heidelpay payment frame ); ?> diff --git a/vendor/heidelpay/php-payment-api/example/DebitCardDebit.php b/vendor/heidelpay/php-payment-api/example/DebitCardDebit.php index d3c0ee3..891bfa3 100644 --- a/vendor/heidelpay/php-payment-api/example/DebitCardDebit.php +++ b/vendor/heidelpay/php-payment-api/example/DebitCardDebit.php @@ -88,13 +88,13 @@ ); /** - * Set necessary parameters for Heidelpay payment Frame and send a registration request + * Set necessary parameters for heidelpay payment Frame and send a registration request */ $DebitCard->debit( HEIDELPAY_PHP_PAYMENT_API_URL, // PaymentFrameOrigin - uri of your application like https://dev.heidelpay.com 'FALSE', // PreventAsyncRedirect - this will tell the payment weather it should redirect the customer or not HEIDELPAY_PHP_PAYMENT_API_URL . - HEIDELPAY_PHP_PAYMENT_API_FOLDER // CSSPath - css url to style the Heidelpay payment frame + HEIDELPAY_PHP_PAYMENT_API_FOLDER // CSSPath - css url to style the heidelpay payment frame ); ?> diff --git a/vendor/heidelpay/php-payment-api/example/DirectDebitRegistration.php b/vendor/heidelpay/php-payment-api/example/DirectDebitRegistration.php index 8fed576..6a31a75 100644 --- a/vendor/heidelpay/php-payment-api/example/DirectDebitRegistration.php +++ b/vendor/heidelpay/php-payment-api/example/DirectDebitRegistration.php @@ -88,7 +88,7 @@ ); /** - * Set necessary parameters for Heidelpay payment Frame and send a registration request + * Set necessary parameters for heidelpay payment Frame and send a registration request */ $DirectDebit->registration(); ?> diff --git a/vendor/heidelpay/php-payment-api/example/EasyCredit.php b/vendor/heidelpay/php-payment-api/example/EasyCredit.php new file mode 100644 index 0000000..f570cd7 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/EasyCredit.php @@ -0,0 +1,141 @@ +EasyCredit example'; + echo 'File: ' . RESPONSE_FILE_NAME . ' is not writable or does not exist. Please change permissions.'; + exit; +} + +//####### 1. Create an instance of the easyCredit payment method. ###################################################### +/** + * Load a new instance of the payment method + */ + $easyCredit = new EasyCreditPaymentMethod(); + +//####### 2. Prepare and send an initialization request. ###################################################### +//####### The response will provide a redirectUrl to a form where the customer can select the payment plan # +//####### And an opt-in text the customer needs to agree to before redirecting him to the redirectUrl. # +//####### Please make sure to set the riskinformation (see below) in order to increase acceptance rate. # + +/** + * Set up your authentification data for Heidepay api + * + * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten + */ +$easyCredit->getRequest()->authentification( + '31HA07BC8181E8CCFDAD64E8A4B3B766', // SecuritySender + '31ha07bc8181e8ccfdad73fd513d2a53', // UserLogin + '4B2D4BE3', // UserPassword + '31HA07BC8179C95F6B59366492FD253D', // TransactionChannel credit card without 3d secure + true // Enable sandbox mode +); + +/** + * Set up asynchronous request parameters + */ +$easyCredit->getRequest()->async( + 'EN', // Language code for the Frame + RESPONSE_URL // Response url from your application +); + +/** + * Set up customer information required for risk checks + */ +$easyCredit->getRequest()->customerAddress( + 'Heidel', // Given name + 'Berger-Payment', // Family name + null, // Company Name + '12344', // Customer id of your application + 'Vagerowstr. 18', // Billing address street + 'DE-BW', // Billing address state + '69115', // Billing address post code + 'Heidelberg', // Billing address city + 'DE', // Billing address country code + 'support@heidelpay.com' // Customer mail address +); + +/** + * Set up basket or transaction information + */ +$easyCredit->getRequest()->basketData( + '2843294932', // Reference Id of your application + 203.12, // Amount of this request + 'EUR', // Currency code of this request + '39542395235ßfsokkspreipsr' // A secret passphrase from your application +); + +/** + * Set up risk information. + */ +$easyCredit->getRequest()->getRiskInformation() + ->setCustomerGuestCheckout('false') + ->setCustomerOrderCount('23') + ->setCustomerSince('2005-08-12'); + +/** + * Set necessary parameters for heidelpay payment and send the request + */ +$easyCredit->initialize(); + +?> + + + EasyCredit example + + +EasyCredit example'; +$response = $easyCredit->getResponse(); +if ($response->isSuccess()) { + echo '
'; + echo '

'; + echo '

'; + echo ''; + echo '
'; + } else { + echo '
'. print_r($response->getError(), 1).'
'; + } + ?> + + diff --git a/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditConstants.php b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditConstants.php new file mode 100644 index 0000000..39b6d70 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditConstants.php @@ -0,0 +1,25 @@ + + * + * @package heidelpay/${Package} + */ + +require_once __DIR__ . '/../_enableExamples.php'; +if (defined('HEIDELPAY_PHP_PAYMENT_API_EXAMPLES') && HEIDELPAY_PHP_PAYMENT_API_EXAMPLES !== true) { + exit(); +} + +const EXAMPLE_BASE_FOLDER = HEIDELPAY_PHP_PAYMENT_API_URL . HEIDELPAY_PHP_PAYMENT_API_FOLDER; +define('RESPONSE_URL', EXAMPLE_BASE_FOLDER . 'EasyCredit/EasyCreditResponse.php'); +define('RESERVATION_URL', EXAMPLE_BASE_FOLDER . 'EasyCredit/EasyCreditReservation.php'); +define('RESPONSE_FILE_NAME', __DIR__ . '/EasyCreditResponseParams.txt'); +define('HEIDELPAY_SUCCESS_PAGE', EXAMPLE_BASE_FOLDER . 'HeidelpaySuccess.php'); +define('HEIDELPAY_FAILURE_PAGE', EXAMPLE_BASE_FOLDER . 'HeidelpayError.php'); diff --git a/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditReservation.php b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditReservation.php new file mode 100644 index 0000000..dee1116 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditReservation.php @@ -0,0 +1,116 @@ +getRequest(); + +/** + * Set up your authentification data for Heidepay api + * + * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten + */ +$request->authentification( + '31HA07BC8181E8CCFDAD64E8A4B3B766', // SecuritySender + '31ha07bc8181e8ccfdad73fd513d2a53', // UserLogin + '4B2D4BE3', // UserPassword + '31HA07BC8179C95F6B59366492FD253D', // TransactionChannel credit card without 3d secure + true // Enable sandbox mode +); + +//####### 11.1. This time we do a sync request rather than an async request as before. We do this for the sake of the ## +//####### readability of the example. This results in the payment server sending the response to the request # +//####### immediately in the http-response of this request rather then sending it asyncronuously to the responseUrl # +//####### (as seen before). +/** + * Set up asynchronous request parameters + */ +$request->getFrontend()->setEnabled('FALSE'); + +/** + * Set up customer information required for risk checks + */ +$request->customerAddress( + 'Heidel', // Given name + 'Berger-Payment', // Family name + null, // Company Name + '12344', // Customer id of your application + 'Vagerowstr. 18', // Billing address street + 'DE-BW', // Billing address state + '69115', // Billing address post code + 'Heidelberg', // Billing address city + 'DE', // Billing address country code + 'support@heidelpay.com' // Customer mail address +); + +/** + * Set up basket or transaction information + */ +$request->basketData( + '2843294932', // Reference Id of your application + 203.12, // Amount of this request + 'EUR', // Currency code of this request + '39542395235ßfsokkspreipsr' // A secret passphrase from your application +); + +/** + * Set up risk information. + */ +$request->getRiskInformation() + ->setCustomerGuestCheckout('false') + ->setCustomerOrderCount('23') + ->setCustomerSince('2005-08-12'); + +//####### 11.2. This time we call the method authorizeOnRegistration passing along the uniqueId of the previous ####### +//####### initialization as a reference to let the payment server know which payment plan to use. # +/** + * Set necessary parameters for heidelpay payment and send the request + */ +$easyCredit->authorizeOnRegistration($response->getIdentification()->getUniqueId()); +$authorizationResponse = $easyCredit->getResponse(); + +//####### 12. Now we redirect to the success or error page depending on the result of the request. ##################### +//####### Keep in mind there are three possible results: Success, Pending and Error. # +//####### Since both pending and success indicate a successful handling by the payment server both should # +//####### redirect to the success page. # +$url = HEIDELPAY_SUCCESS_PAGE; +if ($authorizationResponse->isError()) { + $url = HEIDELPAY_FAILURE_PAGE . '?errorMessage=' . $authorizationResponse->getError()['message']; +} + +header('Location: ' . $url); // perform the redirect +?> diff --git a/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditResponse.php b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditResponse.php new file mode 100644 index 0000000..c192c77 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditResponse.php @@ -0,0 +1,89 @@ + + + + EasyCredit example + + +EasyCredit example'; +if ($response->isSuccess()) { + echo 'Please approve your payment plan: ' . '
'; + $amortisationtext = $response->getCriterion()->get('EASYCREDIT_AMORTISATIONTEXT'); + $precontractInformationUrl = $response->getCriterion()->get('EASYCREDIT_PRECONTRACTINFORMATIONURL'); + echo $amortisationtext . '

'; + echo 'Download the precontract information here...
'; + echo 'Order total: ' . $response->getCriterion()->get('EASYCREDIT_TOTALORDERAMOUNT') . '
'; + echo 'Interest: '. $response->getCriterion()->get('EASYCREDIT_ACCRUINGINTEREST') . '
'; + echo 'Total incl. interest: '. $response->getCriterion()->get('EASYCREDIT_TOTALAMOUNT') . '
'; + + echo'

Place order...'; +} else { + echo '
'. print_r($response->getError(), 1).'
'; +} +?> + + diff --git a/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditResponseParams.txt b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditResponseParams.txt new file mode 100644 index 0000000..e69de29 diff --git a/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceConstants.php b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceConstants.php new file mode 100644 index 0000000..81fae4f --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceConstants.php @@ -0,0 +1,29 @@ + + * + * @package heidelpay/${Package} + */ + +require_once __DIR__ . '/../_enableExamples.php'; +if (defined('HEIDELPAY_PHP_PAYMENT_API_EXAMPLES') && HEIDELPAY_PHP_PAYMENT_API_EXAMPLES !== true) { + exit(); +} + +const EXAMPLE_BASE_FOLDER = HEIDELPAY_PHP_PAYMENT_API_URL . HEIDELPAY_PHP_PAYMENT_API_FOLDER; +define('RESPONSE_URL', EXAMPLE_BASE_FOLDER . 'FactoringInvoice/FactoringInvoiceResponse.php'); +define('REVERSAL_URL', EXAMPLE_BASE_FOLDER . 'FactoringInvoice/FactoringInvoiceReversal.php'); +define('RESPONSE_FILE_NAME', __DIR__ . '/FactoringInvoiceResponseParams.txt'); +define('HEIDELPAY_SUCCESS_PAGE', EXAMPLE_BASE_FOLDER . 'HeidelpaySuccess.php'); +define('HEIDELPAY_FAILURE_PAGE', EXAMPLE_BASE_FOLDER . 'HeidelpayError.php'); + +define('HEIDELPAY_TRANSACTION_CHANNEL', '31HA07BC8129FBA7AF65A35EC4E540C2'); + +require_once __DIR__ . '/../_HeidelpayConstants.php'; \ No newline at end of file diff --git a/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceResponse.php b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceResponse.php new file mode 100644 index 0000000..8d4a9bc --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceResponse.php @@ -0,0 +1,116 @@ + + + + Factoring example + + +Invoice Factoring example'; +if ($response->isSuccess()) { + $paymentCode = explode('.', $response->getPayment()->getCode()); + if($paymentCode[1] === 'PA') { + echo 'Reservation Sucessful: ' . '
'; + echo 'The Customer journey ends here.' . '
'; + + /** ####### 9. Here finalize the order directly after successful reservation. In your case this should happen + * together with the shipping. + */ + + $basketData = [ + '2843294932', + $response->getPresentation()->getAmount(), + $response->getPresentation()->getCurrency(), + '39542395235ßfsokkspreipsr' + ]; + + $invoicePaymentMethod = new InvoiceB2CSecuredPaymentMethod(); + $invoicePaymentMethod->getRequest()->basketData(...$basketData); + $invoicePaymentMethod->getRequest()->authentification( + HEIDELPAY_SECURITY_SENDER, // SecuritySender + HEIDELPAY_USER_LOGIN, // UserLogin + HEIDELPAY_USER_PASSWORD, // UserPassword + HEIDELPAY_TRANSACTION_CHANNEL, // TransactionChannel + true // Enable sandbox mode + ); + + /** + * Following steps are done by the Merchant: + * Order was shipped and finalized automatically. + * Insurance is active from now on. + * Sometimes a reversal is necessary. + */ + $invoicePaymentMethod->finalize($response->getPaymentReferenceId()); + $finalizeResponse = $invoicePaymentMethod->getResponse(); + if ($finalizeResponse->isSuccess() || $finalizeResponse->getError()['cod'] === '700.400.800') { + echo"

Following steps are done by the Merchant: \n + Usually the merchant finalizes the order with the shipping. In this example we did this automatically.
+ Insurance is active from now on. +

"; + + echo '

Sometimes a reversal is necessary. This can be done here. Continue with Reversal +

'; + } else { + echo '
'. print_r($finalizeResponse->getError(), 1).'
'; + } + } + +} else { + echo '
'. print_r($response->getError(), 1).'
'; +} +?> + + diff --git a/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceResponseParams.txt b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceResponseParams.txt new file mode 100644 index 0000000..e69de29 diff --git a/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceReversal.php b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceReversal.php new file mode 100644 index 0000000..31d82c5 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceReversal.php @@ -0,0 +1,121 @@ +getIdentification()->getShortId() . ' and the amount of ' + . $response->getPresentation()->getAmount() .' ' . $response->getPresentation()->getCurrency() + . ' be reversed?'; + echo '
'; + echo ''; + echo '
'; + return; +} + +// Check whether reversal was confirmed my merchant. +if(empty($_POST['reversal_last_transaction'])) { + echo print_r($_POST, 1); + return; +} + +//####### 11.1 We now prepare a reversal request however this has a few differences: ############### +/** + * Load a new instance of the payment method + */ +$factoringInvoice = new InvoiceB2CSecuredPaymentMethod(); + +/** + * Set up your authentification data for heidepay api + * + * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten + */ +$factoringInvoice->getRequest()->authentification( + HEIDELPAY_SECURITY_SENDER, // SecuritySender + HEIDELPAY_USER_LOGIN, // UserLogin + HEIDELPAY_USER_PASSWORD, // UserPassword + HEIDELPAY_TRANSACTION_CHANNEL, // TransactionChannel credit card without 3d secure + true // Enable sandbox mode +); + + /** + * ####### 11.1. This time we do a sync request rather than an async request as before. We do this for the sake of the + * ####### readability of the example. This results in the payment server sending the response to the request + * ####### immediately in the http-response of this request rather then sending it asynchronously to the responseUrl + * ####### (as seen before). + * + * Set up synchronous request parameters + */ +$factoringInvoice->getRequest()->getFrontend()->setEnabled('FALSE'); + +// Set up basket for transaction information. The amount that is set here will be the amount of the reversal. +$factoringInvoice->getRequest()->basketData( + '2843294932', // Reference Id of your application + $response->getPresentation()->getAmount(), // Amount of reversal: + $response->getPresentation()->getCurrency(), // Currency code of this request + '39542395235ßfsokkspreipsr' // A secret passphrase from your application +); + +/* ###### 11.2. This time we call the method reversal passing along the uniqueId of the previous ####### + * ###### reservation as a reference to let the payment server know which payment we want to reversal. + * ###### The difference to a normal reversal is the additional Parameter $reversalType + * ###### The api provides a Class to provide the available reversal types as constants. + * + * + */ + +// Set necessary parameters for heidelpay payment and send the request. +// For an other reversalType please enable code below. (only one reversal at a time) +$factoringInvoice->reversal($response->getPaymentReferenceId(), ReversalType::RT_CANCEL); +//$factoringInvoice->reversal($response->getPaymentReferenceId(), ReversalType::RT_CREDIT); +//$factoringInvoice->reversal($response->getPaymentReferenceId(), ReversalType::RT_RETURN); + +$reversalResponse = $factoringInvoice->getResponse(); + +//####### 12. Now we redirect to the success or error page depending on the result of the request. ##################### +//####### Keep in mind there are three possible results: Success, Pending and Error. # +//####### Since both pending and success indicate a successful handling by the payment server both should # +//####### redirect to the success page. # +$url = HEIDELPAY_SUCCESS_PAGE; +if ($reversalResponse->isError()) { + $url = HEIDELPAY_FAILURE_PAGE . '?errorMessage=' . $reversalResponse->getError()['message']; +} + +// Clear transaction. This is only necessary for this for this example since we only safe the one transaction at a time. +if ($reversalResponse->isSuccess()) { + file_put_contents (RESPONSE_FILE_NAME, null); +} + +header('Location: ' . $url); // perform the redirect diff --git a/vendor/heidelpay/php-payment-api/example/FactoringInvoiceB2CSecuredAuthorize.php b/vendor/heidelpay/php-payment-api/example/FactoringInvoiceB2CSecuredAuthorize.php new file mode 100644 index 0000000..90d7bf2 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/FactoringInvoiceB2CSecuredAuthorize.php @@ -0,0 +1,157 @@ +Factoring Examle example'; + echo 'File: ' . RESPONSE_FILE_NAME . ' is not writable or does not exist. Please change permissions.'; + exit; +} + +/** + * Require the composer autoloader file + */ +require_once __DIR__ . '/../../../autoload.php'; + +//####### 1. Create an instance of the InvoiceB2CSecured payment method. ############################################### +/** + * Load a new instance of the payment method + */ +$invoice = new InvoiceB2CSecuredPaymentMethod(); + + +//####### 2. Prepare and send an initialization request. ###################################################### +//####### The response will provide a redirectUrl to where the customer can be redirected to. # + +/** + * Set up your authentification data for Heidepay api. The Constants are defined in FactoringInvoiceConstants.php + * + * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten + */ +$invoice->getRequest()->authentification( + HEIDELPAY_SECURITY_SENDER, // SecuritySender + HEIDELPAY_USER_LOGIN, // UserLogin + HEIDELPAY_USER_PASSWORD, // UserPassword + HEIDELPAY_TRANSACTION_CHANNEL, // TransactionChannel credit card without 3d secure + true // Enable sandbox mode +); +/** + * Set up asynchronous request parameters + */ +$invoice->getRequest()->async( + 'EN', // Language code for the Frame + RESPONSE_URL // Response url from your application +); + +/** + * Set up customer information required for risk checks + */ +$invoice->getRequest()->customerAddress( + 'Heidel', // Given name + 'Berger-Payment', // Family name + null, // Company Name + '12344', // Customer id of your application + 'Vagerowstr. 18', // Billing address street + 'DE-BW', // Billing address state + '69115', // Billing address post code + 'Heidelberg', // Billing address city + 'DE', // Billing address country code + 'support@heidelpay.com' // Customer mail address +); + +/********************************************************************************************************************''' + * ###### Call factoring function to set necessary parameters. + * ###### Second parameter $shopperId is not needed here since it is already set with function call customerAddress(). + * ###### If not you can call the factoring() as you you can see below in the + * ###### commend. + * + * The InvoiceID has to be unique for the merchant. + */ +$invoice->getRequest()->factoring('iv' . date('YmdHis')); +//$invoice->getRequest()->factoring('iv' . date('YmdHis'), '1234'); + +/** + * Set up basket or transaction information + */ +$invoice->getRequest()->basketData( + '2843294932', // Reference Id of your application + 23.12, // Amount of this request + 'EUR', // Currency code of this request + '39542395235ßfsokkspreipsr' // A secret passphrase from your application +); + +/** + * For secured payment methods it is necessary to add additional customer + * information. For a better exception rate please also provide the basket details + * by using the basket api. + */ +$invoice->getRequest()->b2cSecured( + 'MR', // Customer salutation + '1982-07-12', // Customer birth date + null // Basket api id +); + + +/** + * Set necessary parameters for heidelpay payment and send the request + */ +$invoice->authorize(); +?> + + + Invoice authorize with factoring example + + +getResponse()->isSuccess()) { + echo 'place Invoice'; +} else { + echo '
' . print_r($invoice->getResponse()->getError(), 1) . '
'; +} +?> +

It is not necessary to show the redirect url to your customer. You can + use php header to forward your customer directly.
+ For example:
+ header('Location: '.$Invoice->getResponse()->getPaymentFromUrl()); +

+

Note: If you can not provide the customer details for secured invoice form your + application. You can build a form using getPaymentFormUrl() and provide NAME.SALUTATION + and NAME.BIRTHDATE as input fields. +

+ + diff --git a/vendor/heidelpay/php-payment-api/example/InvoiceAuthorize.php b/vendor/heidelpay/php-payment-api/example/InvoiceAuthorize.php index cd97d36..b063545 100644 --- a/vendor/heidelpay/php-payment-api/example/InvoiceAuthorize.php +++ b/vendor/heidelpay/php-payment-api/example/InvoiceAuthorize.php @@ -88,7 +88,7 @@ ); /** - * Set necessary parameters for Heidelpay payment and send the request + * Set necessary parameters for heidelpay payment and send the request */ $Invoice->authorize(); ?> diff --git a/vendor/heidelpay/php-payment-api/example/InvoiceB2BSecuredAuthorize.php b/vendor/heidelpay/php-payment-api/example/InvoiceB2BSecuredAuthorize.php new file mode 100644 index 0000000..d262564 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/InvoiceB2BSecuredAuthorize.php @@ -0,0 +1,162 @@ + + * + * @category example + */ + +/** + * For security reason all examples are disabled by default. + */ + +use Heidelpay\PhpPaymentApi\Constants\CommercialSector; +use Heidelpay\PhpPaymentApi\Constants\RegistrationType; +use Heidelpay\PhpPaymentApi\PaymentMethods\InvoiceB2BSecuredPaymentMethod; + +require_once './_enableExamples.php'; +if (defined('HEIDELPAY_PHP_PAYMENT_API_EXAMPLES') and HEIDELPAY_PHP_PAYMENT_API_EXAMPLES !== true) { + exit(); +} + + +/** + * Require the composer autoloader file + */ +require_once __DIR__ . '/../../../autoload.php'; + +/** + * Load a new instance of the payment method + */ +$invoice = new InvoiceB2BSecuredPaymentMethod(); + +/** + * Set up your authentification data for Heidepay api + * + * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten + */ +$invoice->getRequest()->authentification( + '31HA07BC8142C5A171745D00AD63D182', // SecuritySender + '31ha07bc8142c5a171744e5aef11ffd3', // UserLogin + '93167DE7', // UserPassword + '31HA07BC8129FBA7AF655AB2C27E5B3C', // TransactionChannel credit card without 3d secure + true // Enable sandbox mode +); +/** + * Set up asynchronous request parameters + */ +$invoice->getRequest()->async( + 'EN', // Language code for the Frame + HEIDELPAY_PHP_PAYMENT_API_URL . + HEIDELPAY_PHP_PAYMENT_API_FOLDER . + 'HeidelpayResponse.php' // Response url from your application +); + +/** + * Set up customer information required for risk checks + */ +$invoice->getRequest()->customerAddress( + 'Heidel', // Given name + 'Berger-Payment', // Family name + null, // Company Name + '12344', // Customer id of your application + 'Vangerowstr. 18', // Billing address street + null, // Billing address state + '69115', // Billing address post code + 'Heidelberg', // Billing address city + 'DE', // Billing address country code + 'support@heidelpay.com' // Customer mail address +); + +/** + * Set up basket or transaction information + */ +$invoice->getRequest()->basketData( + '2843294932', // Reference Id of your application + round(23.199, 2), // Amount of this request + 'EUR', // Currency code of this request + '39542395235ßfsokkspreipsr' // A secret passphrase from your application +); + +/** + * Set up company information necessary for B2B. + */ +$companyArray = [ + 'heidelpay GmbH', // Company name + null, // Address postbox + 'Vangerowstr. 18', // Address street + '69115', // Address zip + 'Heidelberg', // Address city + 'DE', // Address country + CommercialSector::AIR_TRANSPORT, // CommercialSector provides + RegistrationType::NOT_REGISTERED, // Registration Type + '123123', // commercial register number. Necessary if registration type is "REGISTERED" + '123456' // Vat id +]; + +/** + * Set up executive Information. Executive is necessary if registration type is "NOT_REGISTERED" + */ +$executive = [ + 'Herr', // Salutation + 'Testkäufer', // Given name + 'Händler', // Family name + '1988-12-12', // Birthdate + 'example@email.de', // Email address + '062216471400', // Phone number + 'Vangerowstr. 18', // Address street + '69115', // Address zip + 'Heidelberg', // Address city + 'DE', // Address country +]; + +/** + * Set request data für B2B. + */ +$invoice->getRequest()->company(...$companyArray); +$invoice->getRequest()->getCompany()->addExecutive(...$executive); + +/** + * Set necessary parameters for heidelpay payment and send the request + */ +$invoice->authorize(); + +?> + + + Invoice authorize example + + +getResponse()->isSuccess()) { + echo 'place Invoice
'; +} else { + echo '
' . print_r($invoice->getResponse()->getError(), 1) . '
'; +} +?> +

It is not necessary to show the redirect url to your customer. You can + use php header to forward your customer directly.
+ For example:
+ header('Location: '.$Invoice->getResponse()->getPaymentFromUrl()); +

+

Note: If you can not provide the customer details for secured invoice form your + application. You can build a form using getPaymentFormUrl() and provide NAME.SALUTATION + and NAME.BIRTDATE as input fields. +

+ + + + + diff --git a/vendor/heidelpay/php-payment-api/example/InvoiceB2CSecuredAuthorize.php b/vendor/heidelpay/php-payment-api/example/InvoiceB2CSecuredAuthorize.php index 71a1a1d..e866007 100644 --- a/vendor/heidelpay/php-payment-api/example/InvoiceB2CSecuredAuthorize.php +++ b/vendor/heidelpay/php-payment-api/example/InvoiceB2CSecuredAuthorize.php @@ -100,7 +100,7 @@ /** - * Set necessary parameters for Heidelpay payment and send the request + * Set necessary parameters for heidelpay payment and send the request */ $Invoice->authorize(); ?> diff --git a/vendor/heidelpay/php-payment-api/example/PayPalDebit.php b/vendor/heidelpay/php-payment-api/example/PayPalDebit.php index c6f0fb5..0683f09 100644 --- a/vendor/heidelpay/php-payment-api/example/PayPalDebit.php +++ b/vendor/heidelpay/php-payment-api/example/PayPalDebit.php @@ -88,7 +88,7 @@ ); /** - * Set necessary parameters for Heidelpay payment Frame and send a registration request + * Set necessary parameters for heidelpay payment Frame and send a registration request */ $PayPal->debit(); ?> diff --git a/vendor/heidelpay/php-payment-api/example/PostFinanceCardAuthorize.php b/vendor/heidelpay/php-payment-api/example/PostFinanceCardAuthorize.php index a60d1cf..0bb313e 100644 --- a/vendor/heidelpay/php-payment-api/example/PostFinanceCardAuthorize.php +++ b/vendor/heidelpay/php-payment-api/example/PostFinanceCardAuthorize.php @@ -9,7 +9,7 @@ * * * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. - * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved. + * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved. * * @link http://dev.heidelpay.com/heidelpay-php-payment-api/ * diff --git a/vendor/heidelpay/php-payment-api/example/PrepaymentAuthorize.php b/vendor/heidelpay/php-payment-api/example/PrepaymentAuthorize.php index bc66430..c401d6c 100644 --- a/vendor/heidelpay/php-payment-api/example/PrepaymentAuthorize.php +++ b/vendor/heidelpay/php-payment-api/example/PrepaymentAuthorize.php @@ -88,7 +88,7 @@ ); /** - * Set necessary parameters for Heidelpay payment and send the request + * Set necessary parameters for heidelpay payment and send the request */ $Prepayment->authorize(); ?> diff --git a/vendor/heidelpay/php-payment-api/example/Przelewy24Authorize.php b/vendor/heidelpay/php-payment-api/example/Przelewy24Authorize.php index eabc61e..7fea2c1 100644 --- a/vendor/heidelpay/php-payment-api/example/Przelewy24Authorize.php +++ b/vendor/heidelpay/php-payment-api/example/Przelewy24Authorize.php @@ -9,7 +9,7 @@ * * * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. - * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved. + * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved. * * @link http://dev.heidelpay.com/heidelpay-php-payment-api/ * diff --git a/vendor/heidelpay/php-payment-api/example/SantanderAuthorize.php b/vendor/heidelpay/php-payment-api/example/SantanderAuthorize.php index d3c78df..af6c2f4 100644 --- a/vendor/heidelpay/php-payment-api/example/SantanderAuthorize.php +++ b/vendor/heidelpay/php-payment-api/example/SantanderAuthorize.php @@ -100,7 +100,7 @@ /** - * Set necessary parameters for Heidelpay payment and send the request + * Set necessary parameters for heidelpay payment and send the request */ $Invoice->authorize(); diff --git a/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpConstants.php b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpConstants.php new file mode 100644 index 0000000..cde8240 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpConstants.php @@ -0,0 +1,25 @@ + + * + * @package heidelpay/${Package} + */ + +require_once __DIR__ . '/../_enableExamples.php'; +if (defined('HEIDELPAY_PHP_PAYMENT_API_EXAMPLES') && HEIDELPAY_PHP_PAYMENT_API_EXAMPLES !== true) { + exit(); +} + +const EXAMPLE_BASE_FOLDER = HEIDELPAY_PHP_PAYMENT_API_URL . HEIDELPAY_PHP_PAYMENT_API_FOLDER; +define('RESPONSE_URL', EXAMPLE_BASE_FOLDER . 'SantanderHp/SantanderHpResponse.php'); +define('RESERVATION_URL', EXAMPLE_BASE_FOLDER . 'SantanderHp/SantanderHpReservation.php'); +define('RESPONSE_FILE_NAME', __DIR__ . '/SantanderHpResponseParams.txt'); +define('HEIDELPAY_SUCCESS_PAGE', EXAMPLE_BASE_FOLDER . 'HeidelpaySuccess.php'); +define('HEIDELPAY_FAILURE_PAGE', EXAMPLE_BASE_FOLDER . 'HeidelpayError.php'); diff --git a/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpReservation.php b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpReservation.php new file mode 100644 index 0000000..bec459a --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpReservation.php @@ -0,0 +1,126 @@ +getRequest(); + +/** + * Set up your authentification data for Heidepay api + * + * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten + */ +$santanderHp->getRequest()->authentification( + '31HA07BC8142C5A171745D00AD63D182', // SecuritySender + '31ha07bc8142c5a171744e5aef11ffd3', // UserLogin + '93167DE7', // UserPassword + '31HA07BC81302E8725994B52D85F062E', // TransactionChannel credit card without 3d secure + true // Enable sandbox mode +); + +//####### 11.1. This time we do a sync request rather than an async request as before. We do this for the sake of the ## +//####### readability of the example. This results in the payment server sending the response to the request # +//####### immediately in the http-response of this request rather then sending it asyncronuously to the responseUrl # +//####### (as seen before). +/** + * Set up asynchronous request parameters + */ +$santanderHp->getRequest()->getFrontend()->setEnabled('FALSE'); + +/** + * Set up customer information required for risk checks + */ +$santanderHp->getRequest()->customerAddress( + 'Ampel', // Given name + 'Grün', // Family name + null, // Company Name + '12345', // Customer id of your application + 'Lichtweg 2', // Billing address street + null, // Billing address state + '12345', // Billing address post code + 'Laterne', // Billing address city + 'DE', // Billing address country code + 'g.ampel@test.de' // Customer mail address +); + +/** + * Set up basket or transaction information. Please ensure that you do not have divergent amounts between initialize and + * reservation transaction + */ +$santanderHp->getRequest()->basketData( + '2843294932', // Reference Id of your application + 203.12, // Amount of this request + 'EUR', // Currency code of this request + '39542395235ßfsokkspreipsr' // A secret passphrase from your application +); + +/** + * Set up risk information. + */ +$santanderHp->getRequest()->getRiskInformation() + ->setCustomerGuestCheckout('false') + ->setCustomerOrderCount('23') + ->setCustomerSince('2005-08-12'); + +//####### 11.2. This time we call the method authorizeOnRegistration passing along the uniqueId of the previous ####### +//####### initialization as a reference to let the payment server know which payment plan to use. # +/** + * Set necessary parameters for heidelpay payment and send the request + */ +$santanderHp->authorizeOnRegistration($response->getIdentification()->getUniqueId()); +$authorizationResponse = $santanderHp->getResponse(); + +//####### 12. Now we redirect to the success or error page depending on the result of the request. ##################### +//####### Keep in mind there are three possible results: Success, Pending and Error. # +//####### Since both pending and success indicate a successful handling by the payment server both should # +//####### redirect to the success page. # +$url = HEIDELPAY_SUCCESS_PAGE; +if ($authorizationResponse->isError()) { + $url = HEIDELPAY_FAILURE_PAGE . '?errorMessage=' . $authorizationResponse->getError()['message']; +} + +header('Location: ' . $url); // perform the redirect + + +//####### 13. After placing that order / reservation transaction you have to report the shiping. ###################### +//####### to faciliate this example, this is just an example of code because you can also trigger this transaction via # +//####### heidelpay-Hip # + +//$santanderHp->finalize($paymentReferenceIdOfReservationTransaction); +?> + diff --git a/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpResponse.php b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpResponse.php new file mode 100644 index 0000000..ca75b01 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpResponse.php @@ -0,0 +1,77 @@ + + + + Santander HP example + + +Santander Hire Purchase example'; +if ($response->isSuccess()) { + echo 'Please approve your payment plan: ' . '
'; + echo 'Download the precontract information here...
'; + echo'

Place order...'; +} else { + echo '
'. print_r($response->getError(), 1).'
'; +} +?> + + diff --git a/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpResponseParams.txt b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpResponseParams.txt new file mode 100644 index 0000000..e69de29 diff --git a/vendor/heidelpay/php-payment-api/example/SantanderHpInitialize.php b/vendor/heidelpay/php-payment-api/example/SantanderHpInitialize.php new file mode 100644 index 0000000..1359ab9 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/SantanderHpInitialize.php @@ -0,0 +1,157 @@ +Santander Hire Purchase example'; + echo 'File: ' . RESPONSE_FILE_NAME . ' is not writable or does not exist. Please change permissions.'; + exit; +} + +//####### 1. Create an instance of the SantandeHirePurchase payment method. ###################################################### +/** + * Load a new instance of the payment method + */ +$santanderHp = new SantanderHirePurchasePaymentMethod(); + +//####### 2. Prepare and send an initialization request. ###################################################### +//####### The response will provide a redirectUrl to a site where the customer can select the payment plan # +//####### Please make sure to set the riskinformation (see below) in order to increase acceptance rate. # + +/** + * Set up your authentification data for Heidepay api + * + * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten + */ +$santanderHp->getRequest()->authentification( + '31HA07BC8142C5A171745D00AD63D182', // SecuritySender + '31ha07bc8142c5a171744e5aef11ffd3', // UserLogin + '93167DE7', // UserPassword + '31HA07BC81302E8725994B52D85F062E', // TransactionChannel credit card without 3d secure + true // Enable sandbox mode +); + +/** + * Set up asynchronous request parameters + */ +$santanderHp->getRequest()->async( + 'DE', // Language code for the Frame + RESPONSE_URL // Response url from your application +); + +/** + * Set up customer information required for risk checks. For a declined transaction please enable code below. + */ +$santanderHp->getRequest()->customerAddress( + 'Grün', // Given name + 'Ampel', // Family name + null, // Company Name + '12345', // Customer id of your application + 'Lichtweg 2', // Billing address street + null, // Billing address state + '12345', // Billing address post code + 'Laterne', // Billing address city + 'DE', // Billing address country code + 'g.ampel@test.de' // Customer mail address +); +//$santanderHp->getRequest()->customerAddress( +// 'Rot', // Given name +// 'Ampel', // Family name +// null, // Company Name +// '12345', // Customer id of your application +// 'Lichtweg 2', // Billing address street +// null, // Billing address state +// '12345', // Billing address post code +// 'Laterne', // Billing address city +// 'DE', // Billing address country code +// 'r.ampel@test.de' // Customer mail address +//); + +/** + * Set up basket or transaction information + */ +$santanderHp->getRequest()->basketData( + '2843294932', // Reference Id of your application + 203.12, // Amount of this request + 'EUR', // Currency code of this request + '39542395235ßfsokkspreipsr' // A secret passphrase from your application +); + +/** + * Set up risk information. + */ +$santanderHp->getRequest()->getRiskInformation() + ->setCustomerGuestCheckout('false') + ->setCustomerOrderCount('23') + ->setCustomerSince('2005-08-12'); + +/** + * Set up Customer-specific data for Santander hire purchase (salutation and bithdate) + */ +$santanderHp->getRequest()->getName()->setBirthdate("1987-12-12"); +$santanderHp->getRequest()->getName()->setSalutation("MR"); + +/** + * Set necessary parameters for heidelpay payment and send the request + */ +$santanderHp->initialize(); + +?> + + + Santander Hire Purchase example + + +Santander Hire Purchase example'; +$responseHpIn = $santanderHp->getResponse(); + +if ($responseHpIn->isSuccess()) { + // Logo has to be Shown to the customer + echo 'Santander-Logo
'; + echo ''; +} else { + echo '
'. print_r($responseHpIn->getError(), 1).'
'; +} +?> + + + diff --git a/vendor/heidelpay/php-payment-api/example/_HeidelpayConstants.php b/vendor/heidelpay/php-payment-api/example/_HeidelpayConstants.php new file mode 100644 index 0000000..a5fed27 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/example/_HeidelpayConstants.php @@ -0,0 +1,10 @@ + + /** * Account getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\AccountParameterGroup + * @return AccountParameterGroup */ public function getAccount() { @@ -164,7 +111,7 @@ public function getAccount() /** * Address getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\AddressParameterGroup + * @return AddressParameterGroup */ public function getAddress() { @@ -178,7 +125,7 @@ public function getAddress() /** * Basket getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\BasketParameterGroup + * @return BasketParameterGroup */ public function getBasket() { @@ -189,10 +136,24 @@ public function getBasket() return $this->basket; } + /** + * Company getter + * + * @return \Heidelpay\PhpPaymentApi\ParameterGroups\CompanyParameterGroup + */ + public function getCompany() + { + if ($this->company === null) { + return $this->company = new CompanyParameterGroup(); + } + + return $this->company; + } + /** * Config getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\ConfigParameterGroup + * @return ConfigParameterGroup */ public function getConfig() { @@ -206,7 +167,7 @@ public function getConfig() /** * Contact getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\ContactParameterGroup + * @return ContactParameterGroup */ public function getContact() { @@ -220,7 +181,7 @@ public function getContact() /** * Criterion getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\CriterionParameterGroup + * @return CriterionParameterGroup */ public function getCriterion() { @@ -234,7 +195,7 @@ public function getCriterion() /** * Frondend getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\FrontendParameterGroup + * @return FrontendParameterGroup */ public function getFrontend() { @@ -248,7 +209,7 @@ public function getFrontend() /** * Identification getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\IdentificationParameterGroup + * @return IdentificationParameterGroup */ public function getIdentification() { @@ -259,10 +220,20 @@ public function getIdentification() return $this->identification; } + /** + * company location getter + * + * @return ParameterGroups\LocationParameterGroup + */ + public function getLocation() + { + return $this->getCompany()->getLocation(); + } + /** * Name getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\NameParameterGroup + * @return NameParameterGroup */ public function getName() { @@ -276,7 +247,7 @@ public function getName() /** * Payment getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\PaymentParameterGroup + * @return PaymentParameterGroup */ public function getPayment() { @@ -290,7 +261,7 @@ public function getPayment() /** * Presentation getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\PresentationParameterGroup + * @return PresentationParameterGroup */ public function getPresentation() { @@ -304,7 +275,7 @@ public function getPresentation() /** * Request getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\RequestParameterGroup + * @return RequestParameterGroup */ public function getRequest() { @@ -318,7 +289,7 @@ public function getRequest() /** * RiskInformation getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\RiskInformationParameterGroup + * @return RiskInformationParameterGroup */ public function getRiskInformation() { @@ -332,7 +303,7 @@ public function getRiskInformation() /** * Security getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\SecurityParameterGroup + * @return SecurityParameterGroup */ public function getSecurity() { @@ -346,7 +317,7 @@ public function getSecurity() /** * Transaction getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\TransactionParameterGroup + * @return TransactionParameterGroup */ public function getTransaction() { @@ -360,7 +331,7 @@ public function getTransaction() /** * User getter * - * @return \Heidelpay\PhpPaymentApi\ParameterGroups\UserParameterGroup + * @return UserParameterGroup */ public function getUser() { @@ -371,6 +342,20 @@ public function getUser() return $this->user; } + /** + * @return CustomerParameterGroup + */ + public function getCustomer() + { + if ($this->customer === null) { + return $this->customer = new CustomerParameterGroup(); + } + + return $this->customer; + } + + // + /** * @inheritdoc */ @@ -401,12 +386,42 @@ public function toArray($doSort = false) ksort($paramValues); } - foreach ($paramValues as $parameterLastName => $parameterValue) { - if ($parameterValue === null) { - continue; - } + $result[] = $this->buildSubParameterArray($parameterValues, $parameterGroup); + } + $result = array_merge(...$result); + return $result; + } - $result[strtoupper($parameterGroup . '.' . $parameterLastName)] = $parameterValue; + /** + * Build an array for subParameterGroups like Company->location + * + * @param mixed $requestParameter Is whether a parametergroup, array or string + * @param $parentParameterName + * + * @return array + */ + public function buildSubParameterArray($requestParameter, $parentParameterName) + { + $result = []; + if (!($requestParameter instanceof AbstractParameterGroup || is_array($requestParameter))) { + // If $requestParameter is no subGroup set the array parameter + if ($requestParameter !== null) { + $result[strtoupper($parentParameterName)] = $requestParameter; + return $result; + } + } else { + // handle subParameterGroup + if (is_object($requestParameter)) { + $requestParameter = get_object_vars($requestParameter); + } + foreach ($requestParameter as $parameterName => $parameterSubValue) { + $parameterName = is_numeric($parameterName)?$parameterName+1:$parameterName; + $tempResult = $result; + $result = array_merge( + $tempResult, + $this->buildSubParameterArray($parameterSubValue, + $parentParameterName . '.' . $parameterName) + ); } } return $result; @@ -469,10 +484,60 @@ protected function mapFromJson($json) $parameterGroupGetterFunc = 'get' . ucfirst($parameterGroupName); if (!empty($parameterGroupObject) && is_callable([$this, $parameterGroupGetterFunc])) { foreach ($parameterGroupObject as $property => $value) { - $this->{$parameterGroupGetterFunc}()->set($property, $value); + if (!(is_object($value) || is_array($value))) { + //echo print_r($value, 1) . "\n\t"; + $this->{$parameterGroupGetterFunc}()->set($property, $value); + } else { + $this->mapFromJsonSubGroups($this->{$parameterGroupGetterFunc}(), $property, $value); + } + } + } + } + } + + /** + * Maps subparametergroups of JSON object + * + * @param AbstractParameterGroup $parameterGroup + * @param string $propertyName + * @param mixed $content + */ + protected function mapFromJsonSubGroups($parameterGroup, $propertyName, $content) + { + $getterFunction = 'get' . ucfirst($propertyName); + $addFunction = 'add' . ucfirst($propertyName); + + if (is_callable([$parameterGroup, $getterFunction])) { + $subParameterGroup = $parameterGroup->{$getterFunction}(); + if (is_object($content)) { + foreach ($content as $subParameterName => $subValue) { + $this->mapFromJsonSubGroups($subParameterGroup, $subParameterName, $subValue); } + return; + } + if (is_array($content)) { + foreach ($content as $index => $value) { + if ($index+1 > count($subParameterGroup)) { + $className = 'Heidelpay\PhpPaymentApi\ParameterGroups\\'.ucfirst($propertyName) . "ParameterGroup"; + $subParameterGroup[] = new $className(); + $parameterGroup->set($propertyName, $subParameterGroup); + } + + if ($value == null) { + continue; + } + + foreach ($value as $arrayParameter => $arrayParameterValue) { + if (!empty($subParameterGroup[$index])) { + $this->mapFromJsonSubGroups($subParameterGroup[$index], $arrayParameter, $arrayParameterValue); + } + } + } + return; } } + + $parameterGroup->set($propertyName, $content); } /** @@ -487,11 +552,64 @@ protected function mapFromPost(array $post) } foreach ($post as $paramGroupKey => $value) { - @list($paramGroupName, $paramGroupProp) = explode('_', strtolower($paramGroupKey), 2); + $values = explode('_', strtolower($paramGroupKey), 2); + if (count($values) < 2) { + continue; + } + + list($paramGroupName, $paramGroupProp) = $values; $parameterGroupGetterFunc = 'get' . ucfirst($paramGroupName); if ($paramGroupProp !== null && is_callable([$this, $parameterGroupGetterFunc])) { - $this->{$parameterGroupGetterFunc}()->set($paramGroupProp, $value); + $parameterGroup = $this->{$parameterGroupGetterFunc}(); + //If property exists in parameter group set the value. + if (array_key_exists($paramGroupProp, get_object_vars($parameterGroup)) || $parameterGroup instanceof CriterionParameterGroup) { + $parameterGroup->set($paramGroupProp, $value); + } else { + // call function to map subParameterGroups + $this->mapSubGroupsFromPost($parameterGroup, $paramGroupProp, $value); + } + } + } + } + + /** + * Map response array attributes to sub parameter classes recursively + * + * @param mixed $parameterGroup + * @param string $paramGroupProp + * @param string $value + */ + protected function mapSubGroupsFromPost($parameterGroup, $paramGroupProp, $value) + { + $values = explode('_', strtolower($paramGroupProp), 2); + + if (count($values) < 2) { + //set the parameter of the given subgroup + if ($parameterGroup instanceof AbstractParameterGroup && is_callable([$parameterGroup, 'get' . ucfirst($paramGroupProp)])) { + $parameterGroup->set($paramGroupProp, $value); + } + } else { + // look for subParameterGroup and call this function on it + list($paramGroupName, $paramGroupString) = $values; + $parameterGroupGetterFunc = 'get' . ucfirst($paramGroupName); + if ($paramGroupProp !== null && is_callable([$parameterGroup, $parameterGroupGetterFunc])) { + $parameterGroup = $parameterGroup->{$parameterGroupGetterFunc}(); + if (is_array($parameterGroup)) { + $parameterGroup = $paramGroupName; + } + $this->mapSubGroupsFromPost($parameterGroup, $paramGroupString, $value); + } + + //Handle executive parametergroup + if (is_numeric($paramGroupName) && $parameterGroup === 'executive') { + if ((int)$paramGroupName > count(($this->getCompany()->executive))) { + $executives = $this->getCompany()->getExecutive(); + $executives[] = new ExecutiveParameterGroup(); + $this->getCompany()->setExecutive($executives); + } + $executive = $this->getCompany()->getExecutive()[$paramGroupName-1]; + $this->mapSubGroupsFromPost($executive, $paramGroupString, $value); } } } diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/ApiConfig.php b/vendor/heidelpay/php-payment-api/lib/Constants/ApiConfig.php index 41e4dfa..f885c2a 100644 --- a/vendor/heidelpay/php-payment-api/lib/Constants/ApiConfig.php +++ b/vendor/heidelpay/php-payment-api/lib/Constants/ApiConfig.php @@ -18,7 +18,7 @@ */ class ApiConfig { - const SDK_VERSION = 'v1.5.0'; + const SDK_VERSION = 'v1.7.1'; const LIVE_URL = 'https://heidelpay.hpcgw.net/ngw/post'; const TEST_URL = 'https://test-heidelpay.hpcgw.net/ngw/post'; diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/Brand.php b/vendor/heidelpay/php-payment-api/lib/Constants/Brand.php index 2295960..f555fdb 100644 --- a/vendor/heidelpay/php-payment-api/lib/Constants/Brand.php +++ b/vendor/heidelpay/php-payment-api/lib/Constants/Brand.php @@ -50,6 +50,7 @@ class Brand const BILLSAFE = 'BILLSAFE'; const PAYOLUTION_DIRECT = 'PAYOLUTION_DIRECT'; const SANTANDER = 'SANTANDER'; + const UNIVERSUM_B2B = 'UNIVERSUM_B2B'; // Online Transfer const EPS = 'EPS'; @@ -76,4 +77,5 @@ class Brand // Hire Purchase const EASYCREDIT = 'EASYCREDIT'; + const SANTANDER_HP = 'SANTANDER_HP'; } diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/CommercialSector.php b/vendor/heidelpay/php-payment-api/lib/Constants/CommercialSector.php new file mode 100644 index 0000000..996d562 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/Constants/CommercialSector.php @@ -0,0 +1,61 @@ + + * + * @package heidelpay\php-payment-api\constants + */ +class CommercialSector +{ + const OTHERS_COMMERCIAL_SECTORS = 'OTHERS_COMMERCIAL_SECTORS'; + const WHOLESALE_TRADE_EXCEPT_VEHICLE_TRADE = 'WHOLESALE_TRADE_EXCEPT_VEHICLE_TRADE'; + const RETAIL_TRADE_EXCEPT_VEHICLE_TRADE = 'RETAIL_TRADE_EXCEPT_VEHICLE_TRADE'; + const WATER_TRANSPORT = 'WATER_TRANSPORT'; + const AIR_TRANSPORT = 'AIR_TRANSPORT'; + const WAREHOUSING_AND_SUPPORT_ACTIVITIES_FOR_TRANSPORTATION = 'WAREHOUSING_AND_SUPPORT_ACTIVITIES_FOR_TRANSPORTATION'; + const POSTAL_AND_COURIER_ACTIVITIES = 'POSTAL_AND_COURIER_ACTIVITIES'; + const ACCOMMODATION = 'ACCOMMODATION'; + const FOOD_AND_BEVERAGE_SERVICE_ACTIVITIES = 'FOOD_AND_BEVERAGE_SERVICE_ACTIVITIES'; + const MOTION_PICTURE_PRODUCTION_AND_SIMILAR_ACTIVITIES = 'FOOD_AND_BEVERAGE_SERVICE_ACTIVITIES'; + const TELECOMMUNICATIONS = 'TELECOMMUNICATIONS'; + const COMPUTER_PROGRAMMING_CONSULTANCY_AND_RELATED_ACTIVITIES = 'COMPUTER_PROGRAMMING_CONSULTANCY_AND_RELATED_ACTIVITIES'; + const INFORMATION_SERVICE_ACTIVITIES = 'INFORMATION_SERVICE_ACTIVITIES'; + const RENTAL_AND_LEASING_ACTIVITIES = 'RENTAL_AND_LEASING_ACTIVITIES'; + const TRAVEL_AGENCY_AND_RELATED_ACTIVITIES = 'TRAVEL_AGENCY_AND_RELATED_ACTIVITIES'; + const SERVICES_TO_BUILDINGS_AND_LANDSCAPE_ACTIVITIES = 'SERVICES_TO_BUILDINGS_AND_LANDSCAPE_ACTIVITIES'; + const LIBRARIES_AND_SIMILAR_CULTURAL_ACTIVITIES = 'LIBRARIES_AND_SIMILAR_CULTURAL_ACTIVITIES'; + const SPORTS_ACTIVITIES_AND_AMUSEMENT_AND_RECREATION_ACTIVITIES = 'SPORTS_ACTIVITIES_AND_AMUSEMENT_AND_RECREATION_ACTIVITIES'; + const OTHER_PERSONAL_SERVICE_ACTIVITIES = 'OTHER_PERSONAL_SERVICE_ACTIVITIES'; + const NON_RESIDENTIAL_REAL_ESTATE_ACTIVITIES = 'NON_RESIDENTIAL_REAL_ESTATE_ACTIVITIES'; + const MANAGEMENT_CONSULTANCY_ACTIVITIES = 'MANAGEMENT_CONSULTANCY_ACTIVITIES'; + const ELECTRICITY_GAS_AND_STEAM_SUPPLY = 'ELECTRICITY_GAS_AND_STEAM_SUPPLY'; + const WATER_COLLECTION_TREATMENT_AND_SUPPLY = 'WATER_COLLECTION_TREATMENT_AND_SUPPLY'; + const SEWERAGE = 'SEWERAGE'; + + const MANUFACTURE_OF_FOOD_PRODUCTS = 'MANUFACTURE_OF_FOOD_PRODUCTS'; + const MANUFACTURE_OF_BEVERAGES = 'MANUFACTURE_OF_BEVERAGES'; + const MANUFACTURE_OF_TEXTILES = 'MANUFACTURE_OF_TEXTILES'; + const MANUFACTURE_OF_WEARING_APPAREL = 'MANUFACTURE_OF_WEARING_APPAREL'; + const MANUFACTURE_OF_LEATHER_AND_RELATED_PRODUCTS = 'MANUFACTURE_OF_LEATHER_AND_RELATED_PRODUCTS'; + const MANUFACTURE_OF_PHARMACEUTICAL_PRODUCTS = 'MANUFACTURE_OF_PHARMACEUTICAL_PRODUCTS'; + + const REPAIR_AND_INSTALLATION_OF_MACHINERY_AND_EQUIPMENT = 'REPAIR_AND_INSTALLATION_OF_MACHINERY_AND_EQUIPMENT'; + const TRADE_AND_REPAIR_OF_MOTOR_VEHICLES = 'TRADE_AND_REPAIR_OF_MOTOR_VEHICLES'; + const PUBLISHING_ACTIVITIES = 'PUBLISHING_ACTIVITIES'; + const REPAIR_OF_COMPUTERS_AND_GOODS = 'REPAIR_OF_COMPUTERS_AND_GOODS'; + const PRINTING_AND_REPRODUCTION_OF_RECORDED_MEDIA = 'PRINTING_AND_REPRODUCTION_OF_RECORDED_MEDIA'; + const MANUFACTURE_OF_FURNITURE = 'MANUFACTURE_OF_FURNITURE'; + const OTHER_MANUFACTURING = 'OTHER_MANUFACTURING'; + const ADVERTISING_AND_MARKET_RESEARCH = 'ADVERTISING_AND_MARKET_RESEARCH'; + const OTHER_PROFESSIONAL_SCIENTIFIC_AND_TECHNICAL_ACTIVITIES = 'OTHER_PROFESSIONAL_SCIENTIFIC_AND_TECHNICAL_ACTIVITIES'; + const ARTS_ENTERTAINMENT_AND_RECREATION = 'ARTS_ENTERTAINMENT_AND_RECREATION'; +} diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/ExecutiveFunction.php b/vendor/heidelpay/php-payment-api/lib/Constants/ExecutiveFunction.php new file mode 100644 index 0000000..72d2027 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/Constants/ExecutiveFunction.php @@ -0,0 +1,25 @@ + + * + * @package heidelpay\php-payment-api\constants + */ +class ExecutiveFunction +{ + const OWNER = 'OWNER'; + const PARTNER = 'PARTNER'; + const SHAREHOLDER = 'SHAREHOLDER'; + const DIRECTOR = 'DIRECTOR'; + const MANAGER = 'MANAGER'; + const REGISTERED_MANAGER = 'REGISTERED_MANAGER'; +} diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/FrontendMode.php b/vendor/heidelpay/php-payment-api/lib/Constants/FrontendMode.php new file mode 100644 index 0000000..a12671c --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/Constants/FrontendMode.php @@ -0,0 +1,20 @@ + + * + * @package heidelpay\php-payment-api\constants + */ +class FrontendMode +{ + const FRONTEND_MODE_WHITELABEL = 'WHITELABEL'; +} diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/RegistrationType.php b/vendor/heidelpay/php-payment-api/lib/Constants/RegistrationType.php new file mode 100644 index 0000000..564a6eb --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/Constants/RegistrationType.php @@ -0,0 +1,21 @@ + + * + * @package heidelpay\php-payment-api\constants + */ +class RegistrationType +{ + const REGISTERED = 'REGISTERED'; + const NOT_REGISTERED = 'NOT_REGISTERED'; +} diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/ReversalType.php b/vendor/heidelpay/php-payment-api/lib/Constants/ReversalType.php new file mode 100644 index 0000000..e1e51f0 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/Constants/ReversalType.php @@ -0,0 +1,22 @@ + + * + * @package heidelpay\php-payment-api\constants + */ +class ReversalType +{ + const RT_CANCEL = 'CANCEL'; + const RT_RETURN = 'RETURN'; + const RT_CREDIT = 'CREDIT'; +} diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/TransactionMode.php b/vendor/heidelpay/php-payment-api/lib/Constants/TransactionMode.php index 805c998..6f6a34c 100644 --- a/vendor/heidelpay/php-payment-api/lib/Constants/TransactionMode.php +++ b/vendor/heidelpay/php-payment-api/lib/Constants/TransactionMode.php @@ -10,11 +10,9 @@ * * @link http://dev.heidelpay.com/php-payment-api * - * @author Stephano Vogel + * @author David Owusu * * @package heidelpay\php-payment-api\constants - * - * @since 1.3.0 First time this was introduced. */ class TransactionMode { diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/CompanyParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/CompanyParameterGroup.php new file mode 100644 index 0000000..c6e9432 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/CompanyParameterGroup.php @@ -0,0 +1,283 @@ +setFunction(!empty($function) && is_string($function) ?$function: ExecutiveFunction::OWNER); + $newExecutive->setSalutation($salutation); + $newExecutive->setGiven($given); + $newExecutive->setFamily($family); + $newExecutive->setBirthdate($birthdate); + $newExecutive->setEmail($email); + $newExecutive->setPhone($phone); + + $home = $newExecutive->getHome(); + + $home->street = $homeStreet; + $home->city = $homeCity; + $home->country =$homeCountry; + $home->zip = $homeZip; + + $executives = $this->getExecutive(); + $executives[] = $newExecutive; + $this->setExecutive($executives); + + return $this; + } + + /** + * Company executive getter + * + * @return array + * + * @param null|mixed $index + */ + public function getExecutive($index = null) + { + if ($this->executive === null) { + return $this->executive = []; + } + + if ($index !== null) { + if (!is_bool($index) && isset($this->executive[$index])) { + return $this->executive[$index]; + } else { + return null; + } + } + + return $this->executive; + } + + /** + * Setter for company executive + * + * @param array $executive + */ + public function setExecutive($executive) + { + $this->executive = $executive; + return $this; + } + + /** + * Company location getter + * + * @return LocationParameterGroup + */ + public function getLocation() + { + if ($this->location === null) { + return $this->location = new LocationParameterGroup(); + } + return $this->location; + } + + /** + * Setter for company location + * + * @param LocationParameterGroup $location + */ + public function setLocation($location) + { + $this->location = $location; + return $this; + } + + /** + * Companyname getter + * + * @return string | null + */ + public function getCompanyname() + { + return $this->companyname; + } + + /** + * Setter for companyname + * + * @param string $companyname + */ + public function setCompanyname($companyname) + { + $this->companyname = $companyname; + return $this; + } + + /** + * Company registrationtype getter + * + * @return string | null + */ + public function getRegistrationtype() + { + return $this->registrationtype; + } + + /** + * Setter for company registrationtype + * + * @param string $registrationtype + */ + public function setRegistrationtype($registrationtype) + { + $this->registrationtype = $registrationtype; + return $this; + } + + /** + * Commercialregistrnumber getter + * + * @return string | null + */ + public function getCommercialregisternumber() + { + return $this->commercialregisternumber; + } + + /** + * Setter for commercialregistrnumber + * + * @param string $commercialregisternumber + */ + public function setCommercialregisternumber($commercialregisternumber) + { + $this->commercialregisternumber = $commercialregisternumber; + return $this; + } + + /** + * Company vatid getter + * + * @return string | null + */ + public function getVatid() + { + return $this->vatid; + } + + /** + * Setter for vatid + * + * @param string $vatid + */ + public function setVatid($vatid) + { + $this->vatid = $vatid; + return $this; + } + + /** + * Commercialsector getter + * + * @return string | null + */ + public function getCommercialSector() + { + return $this->commercialsector; + } + + /** + * Setter commerialSector + * + * @param string $commercialSector + */ + public function setCommercialSector($commercialSector) + { + $this->commercialsector = $commercialSector; + return $this; + } +} diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ConfigParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ConfigParameterGroup.php index 585487f..713db09 100644 --- a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ConfigParameterGroup.php +++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ConfigParameterGroup.php @@ -52,7 +52,7 @@ public function getBankCountry() /** * Config brands getter * - * @return string + * @return array */ public function getBrands() { diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/CustomerParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/CustomerParameterGroup.php new file mode 100644 index 0000000..03ab230 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/CustomerParameterGroup.php @@ -0,0 +1,44 @@ + + + /** + * @return bool + */ + public function isOptIn2() + { + return $this->optIn_2 === 'TRUE'; + } + + /** + * @param bool $optIn_2 + * + * @return CustomerParameterGroup + */ + public function setOptIn2($optIn_2) + { + $this->optIn_2 = $optIn_2 ? 'TRUE' : 'FALSE'; + return $this; + } + + // +} diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ExecutiveParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ExecutiveParameterGroup.php new file mode 100644 index 0000000..74b8e5f --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ExecutiveParameterGroup.php @@ -0,0 +1,246 @@ +function; + } + + /** + * Setter for executive function + * + * @param mixed $function + */ + public function setFunction($function) + { + $this->function = $function; + return $this; + } + + /** + * Executive salutation getter + * + * @return string | null + */ + public function getSalutation() + { + return $this->salutation; + } + + /** + * Setter for executive salutation + * + * @param mixed $salutation + */ + public function setSalutation($salutation) + { + $this->salutation = $salutation; + return $this; + } + + /** + * Executive name given getter + * + * @return string | null + */ + public function getGiven() + { + return $this->given; + } + + /** + * Setter for executive name given + * + * @param mixed $given + */ + public function setGiven($given) + { + $this->given = $given; + return $this; + } + + /** + * Executive family name getter + * + * @return string | null + */ + public function getFamily() + { + return $this->family; + } + + /** + * Setter for executive family name + * + * @param mixed $family + */ + public function setFamily($family) + { + $this->family = $family; + return $this; + } + + /** + * Executive birthdate getter + * + * @return string | null + */ + public function getBirthdate() + { + return $this->birthdate; + } + + /** + * Setter for executive birthdate + * + * @param string $birthdate format:YYYY-MMM-DD + */ + public function setBirthdate($birthdate) + { + $this->birthdate = $birthdate; + return $this; + } + + /** + * Executive email getter + * + * @return string | null + */ + public function getEmail() + { + return $this->email; + } + + /** + * Setter for executive email + * + * @param string $email + */ + public function setEmail($email) + { + $this->email = $email; + return $this; + } + + /** + * Executive phone number getter + * + * @return string | null + */ + public function getPhone() + { + return $this->phone; + } + + /** + * Setter for executive phone number + * + * @param mixed $phone + */ + public function setPhone($phone) + { + $this->phone = $phone; + return $this; + } + + /** + * Executive home getter + * + * @return HomeParameterGroup + */ + public function getHome() + { + if ($this->home === null) { + return $this->home = new HomeParameterGroup(); + } + return $this->home; + } + + /** + * Setter for executive home + * + * @param HomeParameterGroup $home + */ + public function setHome($home) + { + $this->home = $home; + return $this; + } +} diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/FrontendParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/FrontendParameterGroup.php index b0ad65c..7ed8e43 100644 --- a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/FrontendParameterGroup.php +++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/FrontendParameterGroup.php @@ -2,6 +2,8 @@ namespace Heidelpay\PhpPaymentApi\ParameterGroups; +use Heidelpay\PhpPaymentApi\Constants\FrontendMode; + /** * This class provides every api parameter used for frontend settings like language etc. * @@ -42,7 +44,7 @@ class FrontendParameterGroup extends AbstractParameterGroup * * @var string always set to withelabel on ngw (mandatory) */ - public $mode = 'WHITELABEL'; + public $mode = FrontendMode::FRONTEND_MODE_WHITELABEL; /** * FrontendPaymentFrameOrigin @@ -230,10 +232,11 @@ public function setLanguage($language) * @param string $mode * * @return \Heidelpay\PhpPaymentApi\ParameterGroups\FrontendParameterGroup + * + * @deprecated Change of the mode propertie is prohibited since ngw-api needs WHITELABLE mode. */ public function setMode($mode) { - $this->mode = $mode; return $this; } @@ -301,4 +304,22 @@ public function setRedirectUrl($redirect_url) $this->redirect_url = $redirect_url; return $this; } + + /** + * Override magic setter to prohibit change of specific properties. + * + * @param string $key + * @param string $value + * + * @return $this|AbstractParameterGroup + */ + public function set($key, $value) + { + $unchangeableProperties = ['mode']; + if (in_array(strtolower($key), $unchangeableProperties)) { + return $this; + } + + return parent::set($key, $value); + } } diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/HomeParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/HomeParameterGroup.php new file mode 100644 index 0000000..b036b0d --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/HomeParameterGroup.php @@ -0,0 +1,142 @@ +street = $street; + $this->zip = $zip; + $this->city = $city; + $this->country = $country; + } + + /** + * Executive home street getter + * + * @return string | null + */ + public function getStreet() + { + return $this->street; + } + + /** + * Setter for executive home street + * + * @param string $street + */ + public function setStreet($street) + { + $this->street = $street; + return $this; + } + + /** + * Executive home zip getter + * + * @return string | null + */ + public function getZip() + { + return $this->zip; + } + + /** + * Setter for executive home zip + * + * @param string $zip + */ + public function setZip($zip) + { + $this->zip = $zip; + return $this; + } + + /** + * Executive home city getter + * + * @return string | null + */ + public function getCity() + { + return $this->city; + } + + /** + * Setter for executive home city + * + * @param string $city + */ + public function setCity($city) + { + $this->city = $city; + return $this; + } + + /** + * Executive home country getter + * + * @return string | null + */ + public function getCountry() + { + return $this->country; + } + + /** + * Setter for executive home country + * + * @param string $country + */ + public function setCountry($country) + { + $this->country = $country; + return $this; + } +} diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/IdentificationParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/IdentificationParameterGroup.php index 35da4e8..749e1b9 100644 --- a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/IdentificationParameterGroup.php +++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/IdentificationParameterGroup.php @@ -23,6 +23,11 @@ class IdentificationParameterGroup extends AbstractParameterGroup */ public $creditor_id; + /** + * @var string $invoiceid + */ + public $invoiceid; + /** * IdentificationShopperId * @@ -180,4 +185,21 @@ public function setReferenceid($referenceid) $this->referenceid = $referenceid; return $this; } + + /** + * @return string + */ + public function getInvoiceid() + { + return $this->invoiceid; + } + + /** + * @param string $invoiceid + */ + public function setInvoiceid($invoiceid) + { + $this->invoiceid = $invoiceid; + return $this; + } } diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/LocationParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/LocationParameterGroup.php new file mode 100644 index 0000000..45bd750 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/LocationParameterGroup.php @@ -0,0 +1,168 @@ +pobox; + } + + /** + * Setter for company location pobox + * + * @param $pobox + * + * @return $this + */ + public function setPobox($pobox) + { + $this->pobox = $pobox; + return $this; + } + + /** + * Company location street getter + * + * @return string + */ + public function getStreet() + { + return $this->street; + } + + /** + * Setter for company location street + * + * @param $street + * + * @return $this + */ + public function setStreet($street) + { + $this->street = $street; + return $this; + } + + /** + * Company location zip getter + * + * @return string + */ + public function getZip() + { + return $this->zip; + } + + /** + * Setter for company location pobox + * + * @param $zip + * + * @return $this + */ + public function setZip($zip) + { + $this->zip = $zip; + return $this; + } + + /** + * Company location city getter + * + * @return string + */ + public function getCity() + { + return $this->city; + } + + /** + * Setter for company location city + * + * @param $city + * + * @return $this + */ + public function setCity($city) + { + $this->city = $city; + return $this; + } + + /** + * Company location country getter + * + * @return string + */ + public function getCountry() + { + return $this->country; + } + + /** + * Setter for company location country + * + * @param $country + * + * @return $this + */ + public function setCountry($country) + { + $this->country = $country; + return $this; + } +} diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/PaymentParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/PaymentParameterGroup.php index 40449f7..39ec1e9 100644 --- a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/PaymentParameterGroup.php +++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/PaymentParameterGroup.php @@ -33,6 +33,11 @@ class PaymentParameterGroup extends AbstractParameterGroup */ public $code; + /** + * @var string $reversaltype available options are "CANCEL, RETURN or CREDIT" + */ + public $reversaltype; + /** * PamyentCode getter * @@ -55,4 +60,21 @@ public function setCode($code) $this->code = $code; return $this; } + + /** + * @return string + */ + public function getReversaltype() + { + return $this->reversaltype; + } + + /** + * @param string|null $reversaltype + */ + public function setReversaltype($reversaltype) + { + $this->reversaltype = $reversaltype; + return $this; + } } diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/RiskInformationParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/RiskInformationParameterGroup.php index 6fa3328..1b77c78 100644 --- a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/RiskInformationParameterGroup.php +++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/RiskInformationParameterGroup.php @@ -19,26 +19,26 @@ class RiskInformationParameterGroup extends AbstractParameterGroup /** * @var bool if guest checkout (true/false) (optional) */ - public $guestcheckout; + public $customerGuestCheckout; /** * @var string first date of customers relationship (YYYY-MM-DD) (optional) */ - public $since; + public $customerSince; /** * @var integer of customer's order count (optional) */ - public $ordercount; + public $customerOrderCount; /** * Guestcheckout getter * * @return bool state */ - public function getGuestcheckout() + public function getCustomerGuestCheckout() { - return $this->guestcheckout; + return $this->customerGuestCheckout; } /** @@ -46,9 +46,9 @@ public function getGuestcheckout() * * @return string since */ - public function getSince() + public function getCustomerSince() { - return $this->since; + return $this->customerSince; } /** @@ -56,47 +56,47 @@ public function getSince() * * @return int ordercount */ - public function getOrdercount() + public function getCustomerOrderCount() { - return $this->ordercount; + return $this->customerOrderCount; } /** - * setter for is quest checkout + * setter for is guest checkout * - * @param string $guestcheckout + * @param string $customerGuestCheckout * * @return \Heidelpay\PhpPaymentApi\ParameterGroups\RiskInformationParameterGroup */ - public function setGuestCheckout($guestcheckout) + public function setCustomerGuestCheckout($customerGuestCheckout) { - $this->guestcheckout = $guestcheckout; + $this->customerGuestCheckout = $customerGuestCheckout; return $this; } /** * setter for customer since * - * @param string $since + * @param string $customerSince * * @return \Heidelpay\PhpPaymentApi\ParameterGroups\RiskInformationParameterGroup */ - public function setSince($since) + public function setCustomerSince($customerSince) { - $this->since = $since; + $this->customerSince = $customerSince; return $this; } /** * setter for order count * - * @param int $ordercount + * @param int $customerOrderCount * * @return \Heidelpay\PhpPaymentApi\ParameterGroups\RiskInformationParameterGroup */ - public function setOrderCount($ordercount) + public function setCustomerOrderCount($customerOrderCount) { - $this->ordercount = $ordercount; + $this->customerOrderCount = $customerOrderCount; return $this; } } diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/UserParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/UserParameterGroup.php index 8382ae0..3745d58 100644 --- a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/UserParameterGroup.php +++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/UserParameterGroup.php @@ -27,7 +27,7 @@ class UserParameterGroup extends AbstractParameterGroup /** * UserPwd * - * The Passwort of the payment account + * The password of the payment account * * @var string pwd (mandatory) */ diff --git a/vendor/heidelpay/php-payment-api/lib/PaymentMethods/CreditCardPaymentMethod.php b/vendor/heidelpay/php-payment-api/lib/PaymentMethods/CreditCardPaymentMethod.php index c82c470..a3bcb0d 100644 --- a/vendor/heidelpay/php-payment-api/lib/PaymentMethods/CreditCardPaymentMethod.php +++ b/vendor/heidelpay/php-payment-api/lib/PaymentMethods/CreditCardPaymentMethod.php @@ -30,16 +30,16 @@ class CreditCardPaymentMethod implements PaymentMethodInterface { use BasicPaymentMethodTrait; use RegistrationTransactionType { - registration as registrationParent; + registration as protected registrationParent; } use ReregistrationTransactionType { - reregistration as reregistrationParent; + reregistration as protected reregistrationParent; } use AuthorizeTransactionType { - authorize as authorizeParent; + authorize as protected authorizeParent; } use DebitTransactionType { - debit as debitParent; + debit as protected debitParent; } use AuthorizeOnRegistrationTransactionType; use DebitOnRegistrationTransactionType; diff --git a/vendor/heidelpay/php-payment-api/lib/PaymentMethods/DebitCardPaymentMethod.php b/vendor/heidelpay/php-payment-api/lib/PaymentMethods/DebitCardPaymentMethod.php index aec0986..3ac10db 100644 --- a/vendor/heidelpay/php-payment-api/lib/PaymentMethods/DebitCardPaymentMethod.php +++ b/vendor/heidelpay/php-payment-api/lib/PaymentMethods/DebitCardPaymentMethod.php @@ -30,16 +30,16 @@ class DebitCardPaymentMethod implements PaymentMethodInterface { use BasicPaymentMethodTrait; use RegistrationTransactionType { - registration as registrationParent; + registration as protected registrationParent; } use ReregistrationTransactionType { - reregistration as reregistrationParent; + reregistration as protected reregistrationParent; } use AuthorizeTransactionType { - authorize as authorizeParent; + authorize as protected authorizeParent; } use DebitTransactionType { - debit as debitParent; + debit as protected debitParent; } use AuthorizeOnRegistrationTransactionType; use DebitOnRegistrationTransactionType; diff --git a/vendor/heidelpay/php-payment-api/lib/PaymentMethods/InvoiceB2BSecuredPaymentMethod.php b/vendor/heidelpay/php-payment-api/lib/PaymentMethods/InvoiceB2BSecuredPaymentMethod.php new file mode 100644 index 0000000..c3889b8 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/PaymentMethods/InvoiceB2BSecuredPaymentMethod.php @@ -0,0 +1,41 @@ + Account::class, AddressParameterGroup::class => Address::class, + CompanyParameterGroup::class => Company::class, ConnectorParameterGroup::class => Connector::class, ContactParameterGroup::class => Contact::class, FrontendParameterGroup::class => Frontend::class, IdentificationParameterGroup::class => Identification::class, + LocationParameterGroup::class => Location::class, NameParameterGroup::class => Name::class, PaymentParameterGroup::class => Payment::class, PresentationParameterGroup::class => Presentation::class, @@ -157,6 +166,25 @@ private function parseXmlResponse() } } + // set Executives + if (isset($xml->Transaction, $xml->Transaction->Customer->Company->Executive)) { + $xmlExecutive = $xml->Transaction->Customer->Company->Executive; + $executivesCount = $xmlExecutive->count(); + + $executiveMapper = new Executive(); + $homeMapper = new Home(); + + for ($index = 0; $index < $executivesCount; $index++) { + if (!isset($this->response->getCompany()->getExecutive()[$index])) { + $executive = $this->response->getCompany()->getExecutive(); + $executive[] = new ExecutiveParameterGroup(); + $this->response->getCompany()->setExecutive($executive); + } + $this->setParameterGroupProperties($this->response->getCompany()->getExecutive()[$index], $executiveMapper, $xmlExecutive[$index]); + $this->setParameterGroupProperties($this->response->getCompany()->getExecutive()[$index]->getHome(), $homeMapper, $xmlExecutive[$index]); + } + } + // set the criterion data if (isset($xml->Transaction, $xml->Transaction->Analysis->Criterion)) { foreach ($xml->Transaction->Analysis->Criterion as $criterion) { diff --git a/vendor/heidelpay/php-payment-api/lib/PushMapping/Company.php b/vendor/heidelpay/php-payment-api/lib/PushMapping/Company.php new file mode 100644 index 0000000..f1e1b1e --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/PushMapping/Company.php @@ -0,0 +1,41 @@ + 'companyname', + 'RegistrationType' => 'registrationtype', + 'CommercialRegisterNumber' => 'commercialregisternumber', + 'VatID' => 'vatid', + 'CommercialSector' => 'commercialsector', + ]; + + /** + * @inheritdoc + */ + public function getXmlObjectField(\SimpleXMLElement $xmlElement, $field) + { + if (isset($xmlElement->Transaction, $xmlElement->Transaction->Customer->Company->$field)) { + return (string)$xmlElement->Transaction->Customer->Company->$field; + } + + return null; + } +} diff --git a/vendor/heidelpay/php-payment-api/lib/PushMapping/Executive.php b/vendor/heidelpay/php-payment-api/lib/PushMapping/Executive.php new file mode 100644 index 0000000..fb0c0c1 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/PushMapping/Executive.php @@ -0,0 +1,42 @@ + 'given', + 'Family' => 'family', + 'Birthdate' => 'birthdate', + 'Phone' => 'phone', + 'Email' => 'email', + 'Function' => 'function', + ]; + + /** + * @inheritdoc + */ + public function getXmlObjectField(\SimpleXMLElement $xmlElement, $field) + { + if (isset($xmlElement->$field)) { + return (string)$xmlElement->$field; + } + + return null; + } +} diff --git a/vendor/heidelpay/php-payment-api/lib/PushMapping/Home.php b/vendor/heidelpay/php-payment-api/lib/PushMapping/Home.php new file mode 100644 index 0000000..0df962b --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/PushMapping/Home.php @@ -0,0 +1,40 @@ + 'city', + 'Country' => 'country', + 'Street' => 'street', + 'Zip' => 'zip', + ]; + + /** + * @inheritdoc + */ + public function getXmlObjectField(\SimpleXMLElement $xmlElement, $field) + { + if (isset($xmlElement->Home, $xmlElement->Home->$field)) { + return (string) $xmlElement->Home->$field; + } + + return null; + } +} diff --git a/vendor/heidelpay/php-payment-api/lib/PushMapping/Identification.php b/vendor/heidelpay/php-payment-api/lib/PushMapping/Identification.php index cc0fe91..4a4b1c2 100644 --- a/vendor/heidelpay/php-payment-api/lib/PushMapping/Identification.php +++ b/vendor/heidelpay/php-payment-api/lib/PushMapping/Identification.php @@ -21,6 +21,7 @@ class Identification extends AbstractPushMapper */ public $fields = [ 'CreditorID' => 'creditor_id', + 'InvoiceID' => 'invoiceid', 'ReferenceID' => 'referenceid', 'ShopperID' => 'shopperid', 'ShortID' => 'shortid', diff --git a/vendor/heidelpay/php-payment-api/lib/PushMapping/Location.php b/vendor/heidelpay/php-payment-api/lib/PushMapping/Location.php new file mode 100644 index 0000000..ab54cd6 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/lib/PushMapping/Location.php @@ -0,0 +1,41 @@ + 'city', + 'RegistrationType' => 'registrationtype', + 'Country' => 'country', + 'Street' => 'street', + 'Zip' => 'zip', + ]; + + /** + * @inheritdoc + */ + public function getXmlObjectField(\SimpleXMLElement $xmlElement, $field) + { + if (isset($xmlElement->Transaction, $xmlElement->Transaction->Customer->Company->Location->$field)) { + return (string) $xmlElement->Transaction->Customer->Company->Location->$field; + } + + return null; + } +} diff --git a/vendor/heidelpay/php-payment-api/lib/PushMapping/Payment.php b/vendor/heidelpay/php-payment-api/lib/PushMapping/Payment.php index f60ac30..2917d95 100644 --- a/vendor/heidelpay/php-payment-api/lib/PushMapping/Payment.php +++ b/vendor/heidelpay/php-payment-api/lib/PushMapping/Payment.php @@ -16,6 +16,10 @@ */ class Payment extends AbstractPushMapper { + public $fields = [ + 'ReversalType' => 'reversaltype' + ]; + /** * @inheritdoc */ @@ -34,4 +38,20 @@ public function getXmlObjectProperty(\SimpleXMLElement $xmlElement, $property) return null; } + + /** + * Only map fields that are listed here. + * + * @inheritdoc + */ + public function getXmlObjectField(\SimpleXMLElement $xmlElement, $field) + { + if (isset($xmlElement->Transaction->Payment, $field)) { + $xmlField = $xmlElement->Transaction->Payment->$field; + if (array_key_exists($xmlField->getName(), $this->fields)) { + return (string)$xmlField; + } + } + return null; + } } diff --git a/vendor/heidelpay/php-payment-api/lib/Request.php b/vendor/heidelpay/php-payment-api/lib/Request.php index 1242429..c425f0f 100644 --- a/vendor/heidelpay/php-payment-api/lib/Request.php +++ b/vendor/heidelpay/php-payment-api/lib/Request.php @@ -84,19 +84,63 @@ public function async($languageCode = 'EN', $responseUrl = null) return $this; } + /** + * Set all necessary parameter for company. + * + * The executive array can be created beforehand or kept empty and be added later + * + * @param string $companyName + * @param string $poBox + * @param string $street + * @param string $zip + * @param string $city + * @param string $country + * @param string $CommercialSector + * @param string $registrationType + * @param string $commercialRegisterNumber + * @param string $vatId + * @param array $executives + */ + public function company( + $companyName = null, + $poBox = null, + $street = null, + $zip = null, + $city = null, + $country = null, + $CommercialSector = null, + $registrationType = null, + $commercialRegisterNumber = null, + $vatId = null, + $executives = null + ) { + $this->getCompany()->setCompanyname($companyName) + ->setRegistrationtype($registrationType) + ->setCommercialregisternumber($commercialRegisterNumber) + ->setVatid($vatId) + ->setCommercialSector($CommercialSector) + ->setExecutive($executives) + ->getLocation() + ->setPobox($poBox) + ->setStreet($street) + ->setZip($zip) + ->setCity($city) + ->setCountry($country); + } + /** * Set all necessary customer parameter for a request * * @param string $nameGiven customer given name, e.g. John * @param string $nameFamily customer family name, e.g. Doe - * @param string $nameCompany company name, e.g. Heidelpay + * @param string $nameCompany company name, e.g. heidelpay * @param string $shopperId customer id in your application, e.g. 1249 * @param string $addressStreet address street of the customer, e.g. Vagerowstr. * @param string $addressState address state ot the customer, e.g. Bayern * @param string $addressZip address zip code, e.g. 69115 * @param string $addressCity address city, e.g. Heidelberg * @param string $addressCountry address country code 2 letters, e.g. DE - * @param string $contactMail email adress of the customer, e.g. ab@mail.de + * @param string $contactMail email address of the customer, e.g. ab@mail.de * * @return \Heidelpay\PhpPaymentApi\Request */ @@ -126,6 +170,19 @@ public function customerAddress( return $this; } + /** + * @param string $shopperId + * @param string $invoiceId + * @param string $reversaltype string $reversaltype "CANCLE, RETURN or CREDIT" + */ + public function factoring($invoiceId, $shopperId = null) + { + $this->getIdentification()->setInvoiceid($invoiceId); + if ($shopperId !== null) { + $this->getIdentification()->setShopperid($shopperId); + } + } + /** * Set all basket or order information * diff --git a/vendor/heidelpay/php-payment-api/lib/TransactionTypes/ReversalTransactionType.php b/vendor/heidelpay/php-payment-api/lib/TransactionTypes/ReversalTransactionType.php index 879f666..a173cf1 100644 --- a/vendor/heidelpay/php-payment-api/lib/TransactionTypes/ReversalTransactionType.php +++ b/vendor/heidelpay/php-payment-api/lib/TransactionTypes/ReversalTransactionType.php @@ -29,15 +29,17 @@ trait ReversalTransactionType * it back to the given account. This can be used to lower an amount on an * invoice for example. * - * @param mixed $paymentReferenceId payment reference id (unique id of the authorisation) + * @param mixed $paymentReferenceId payment reference id (unique id of the authorisation) + * @param null|mixed $reversalType * * @return $this * * @throws \Heidelpay\PhpPaymentApi\Exceptions\UndefinedTransactionModeException */ - public function reversal($paymentReferenceId) + public function reversal($paymentReferenceId, $reversalType = null) { $this->getRequest()->getPayment()->setCode($this->getPaymentCode() . '.' . TransactionType::REVERSAL); + $this->getRequest()->getPayment()->setReversaltype($reversalType); $this->getRequest()->getFrontend()->setEnabled('FALSE'); $this->getRequest()->getIdentification()->setReferenceId($paymentReferenceId); $this->prepareRequest(); diff --git a/vendor/heidelpay/php-payment-api/tests/Helper/Authentication.php b/vendor/heidelpay/php-payment-api/tests/Helper/Authentication.php index ced1006..ff24182 100644 --- a/vendor/heidelpay/php-payment-api/tests/Helper/Authentication.php +++ b/vendor/heidelpay/php-payment-api/tests/Helper/Authentication.php @@ -1,10 +1,5 @@ companyName, + $this->poBox, + $this->street, + $this->zip, + $this->city, + $this->country, + $this->commercialSector, + $this->registrationType, + $this->commercialRegisterNumber, + $this->vatId, + $this->executive + ]; + } + + /** + * @param null $companyName + */ + public function setCompanyName($companyName) + { + $this->companyName = $companyName; + return $this; + } + + /** + * @param null $poBox + */ + public function setPoBox($poBox) + { + $this->poBox = $poBox; + return $this; + } + + /** + * @param null $street + */ + public function setStreet($street) + { + $this->street = $street; + return $this; + } + + /** + * @param null $zip + */ + public function setZip($zip) + { + $this->zip = $zip; + return $this; + } + + /** + * @param null $city + */ + public function setCity($city) + { + $this->city = $city; + return $this; + } + + /** + * @param null $country + */ + public function setCountry($country) + { + $this->country = $country; + return $this; + } + + /** + * @param null $commercialSector + */ + public function setCommercialSector($commercialSector) + { + $this->commercialSector = $commercialSector; + return $this; + } + + /** + * @param null $registrationType + */ + public function setRegistrationType($registrationType) + { + $this->registrationType = $registrationType; + return $this; + } + + /** + * @param null $commercialRegisterNumber + */ + public function setCommercialRegisterNumber($commercialRegisterNumber) + { + $this->commercialRegisterNumber = $commercialRegisterNumber; + return $this; + } + + /** + * @param null $vatId + */ + public function setVatId($vatId) + { + $this->vatId = $vatId; + return $this; + } + + /** + * @param array $executive + */ + public function setExecutive($executive) + { + $this->executive = $executive; + return $this; + } +} diff --git a/vendor/heidelpay/php-payment-api/tests/Helper/Constraints/ArraysMatchConstraint.php b/vendor/heidelpay/php-payment-api/tests/Helper/Constraints/ArraysMatchConstraint.php index c69001b..7c6eed6 100644 --- a/vendor/heidelpay/php-payment-api/tests/Helper/Constraints/ArraysMatchConstraint.php +++ b/vendor/heidelpay/php-payment-api/tests/Helper/Constraints/ArraysMatchConstraint.php @@ -1,10 +1,5 @@ executiveOneArray = [ + null, + 'Testkäufer', + 'Händler', + '1988-12-12', + 'example@email.de', + '062216471400', + 'Vangerowstr. 18', + '69115', + 'Heidelberg', + 'DE', + 'OWNER', + ]; + + $this->executiveTwoArray = [ + '', + '', + '', + '123', + '', + '', + 'null', + 'null', + 'null', + 'null', + 'OWNER', + ]; + } + + protected $executiveOneArray; + + /** + * @return array + */ + public function getExecutiveOneArray() + { + return $this->executiveOneArray; + } + + /** + * @return array + */ + public function getExecutiveTwoArray() + { + return $this->executiveTwoArray; + } + + protected $executiveTwoArray; +} diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/DirectDebitB2CSecuredPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/DirectDebitB2CSecuredPaymentMethodTest.php index ab0258a..30c1336 100644 --- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/DirectDebitB2CSecuredPaymentMethodTest.php +++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/DirectDebitB2CSecuredPaymentMethodTest.php @@ -13,7 +13,7 @@ * This does not have to mean that your integration is broken. Please verify the given debug information * * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. - * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved. + * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved. * * @link http://dev.heidelpay.com/heidelpay-php-api/ * diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/EasyCreditPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/EasyCreditPaymentMethodTest.php index 50fc21d..c72b8be 100644 --- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/EasyCreditPaymentMethodTest.php +++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/EasyCreditPaymentMethodTest.php @@ -9,7 +9,7 @@ * easyCredit Tests * * @license Use of this software requires acceptance of the License Agreement. See LICENSE file. - * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved. + * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved. * * @link http://dev.heidelpay.com/heidelpay-php-api/ * diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php new file mode 100644 index 0000000..d1b0c53 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php @@ -0,0 +1,269 @@ + + + /** + * Transaction currency + * + * @var string currency + */ + protected $currency = 'EUR'; + /** + * Secret + * + * The secret will be used to generate a hash using + * transaction id + secret. This hash can be used to + * verify the the payment response. Can be used for + * brute force protection. + * + * @var string secret + */ + protected $secret = 'Heidelpay-PhpPaymentApi'; + + /** + * PaymentObject + * + * @var \Heidelpay\PhpPaymentApi\PaymentMethods\InvoiceB2CSecuredPaymentMethod + */ + protected $paymentObject; + + /** + * @var string $authorizeReference + */ + protected $authorizeReference; + + protected $companyData; + + protected $executiveData; + + /** + * Constructor used to set timezone to utc + */ + public function __construct() + { + date_default_timezone_set('UTC'); + parent::__construct(); + + $this->companyData = new Company(); + $this->executiveData = new Executive(); + } + + // + + // + + /** + * Set up function will create a invoice object for each test case + * + * @see PHPUnit_Framework_TestCase::setUp() + */ + // @codingStandardsIgnoreStart + public function _before() + { + // @codingStandardsIgnoreEnd + $authentication = $this->authentication + ->setTransactionChannel('31HA07BC8129FBA7AF655AB2C27E5B3C') + ->getAuthenticationArray(); + + $customerDetails = $this->customerData->getCustomerDataArray(); + $companyDetails = $this->companyData->getCompanyDataArray(); + + $Invoice = new Invoice(); + $Invoice->getRequest()->authentification(...$authentication); + $Invoice->getRequest()->customerAddress(...$customerDetails); + $Invoice->getRequest()->company(...$companyDetails); + $this->paymentObject = $Invoice; + } + + // + + // + + /** + * Test case for a single invoice authorisation + * + * @return string payment reference id for the invoice authorize transaction + * @group connectionTest + * + * @test + * + * @throws \Exception + */ + public function authorize() + { + $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s'); + $this->paymentObject->getRequest()->basketData($timestamp, 23.12, $this->currency, $this->secret); + $this->paymentObject->getRequest()->getFrontend()->setEnabled('FALSE'); + + $this->paymentObject->getRequest()->b2cSecured('MRS', '1982-07-12'); + + $this->setCompanyNotRegistered(); + + $this->paymentObject->authorize(); + + /* verify response */ + $this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp)); + + /* transaction result */ + $this->assertTrue( + $this->paymentObject->getResponse()->isSuccess(), + 'Transaction failed : ' . print_r($this->paymentObject->getResponse(), 1) + ); + $this->assertFalse($this->paymentObject->getResponse()->isPending(), 'authorize is pending'); + $this->assertFalse( + $this->paymentObject->getResponse()->isError(), + 'authorize failed : ' . print_r($this->paymentObject->getResponse()->getError(), 1) + ); + $this->assertEquals($this->paymentObject->getRequest()->getCompany(), $this->paymentObject->getResponse()->getCompany(), + 'request\'s company object differs from respons\'s company object'); + + $this->logDataToDebug(); + + return $this->authorizeReference = (string)$this->paymentObject->getResponse()->getPaymentReferenceId(); + } + + /** + * Test case for a invoice finalize of a existing authorisation + * + * @param $referenceId string payment reference id of the invoice authorisation + * + * @return string payment reference id for the prepayment reversal transaction + * @depends authorize + * @group connectionTest + * + * @test + * + * @throws \Exception + */ + public function finalize($referenceId) + { + $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s'); + $this->paymentObject->getRequest()->basketData($timestamp, 23.12, $this->currency, $this->secret); + + $this->paymentObject->finalize($referenceId); + + /* verify response */ + $this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp)); + + /* transaction result */ + $this->assertTrue( + $this->paymentObject->getResponse()->isSuccess(), + 'Transaction failed : ' . print_r($this->paymentObject->getResponse(), 1) + ); + $this->assertFalse($this->paymentObject->getResponse()->isPending(), 'reversal is pending'); + $this->assertFalse( + $this->paymentObject->getResponse()->isError(), + 'reversal failed : ' . print_r($this->paymentObject->getResponse()->getError(), 1) + ); + + $this->logDataToDebug(); + + return $referenceId; + } + + /** + * Test case for a invoice reversal of a existing authorisation + * + * @param $referenceId + * + * @return string payment reference id for the prepayment reversal transaction + * @depends authorize + * @group connectionTest + * + * @test + * + * @throws \Exception + */ + public function reversal($referenceId) + { + $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s'); + $this->paymentObject->getRequest()->basketData($timestamp, 23.12, $this->currency, $this->secret); + + /* the refund can not be processed because there will be no receipt automatically on the sandbox */ + + $this->paymentObject->reversal($referenceId); + + /* verify response */ + $this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp)); + + /* transaction result */ + $this->assertTrue( + $this->paymentObject->getResponse()->isSuccess(), + 'Transaction failed : ' . print_r($this->paymentObject->getResponse(), 1) + ); + $this->assertFalse($this->paymentObject->getResponse()->isPending(), 'reversal is pending'); + $this->assertFalse( + $this->paymentObject->getResponse()->isError(), + 'reversal failed : ' . print_r($this->paymentObject->getResponse()->getError(), 1) + ); + + $this->logDataToDebug(); + + return (string)$this->paymentObject->getResponse()->getPaymentReferenceId(); + } + + /** + * Test case for invoice refund + * + * @param string $referenceId reference id of the invoice to refund + * + * @depends authorize + * @test + * + * @group connectionTest + * + * @throws \Heidelpay\PhpPaymentApi\Exceptions\UndefinedTransactionModeException + */ + public function refund($referenceId = null) + { + $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s'); + $this->paymentObject->getRequest()->basketData($timestamp, 3.54, $this->currency, $this->secret); + + /* the refund can not be processed because there will be no receipt automatically on the sandbox */ + $this->paymentObject->dryRun = true; + + $this->paymentObject->refund((string)$referenceId); + + $this->assertEquals(PaymentMethod::INVOICE . '.' . TransactionType::REFUND, $this->paymentObject->getRequest()->getPayment()->getCode()); + + $this->logDataToDebug(); + } + + public function setCompanyNotRegistered() + { + $executiveDetails = $this->executiveData->getExecutiveOneArray(); + + $this->paymentObject->getRequest()->getCompany()->setRegistrationtype(RegistrationType::NOT_REGISTERED); + $this->paymentObject->getRequest()->getCompany()->setVatid(null); + $this->paymentObject->getRequest()->getCompany()->addExecutive(...$executiveDetails); + } + + // +} diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredFactoringTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredFactoringTest.php new file mode 100644 index 0000000..ff06354 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredFactoringTest.php @@ -0,0 +1,305 @@ + + + /** + * Transaction currency + * + * @var string currency + */ + protected $currency = 'EUR'; + /** + * Secret + * + * The secret will be used to generate a hash using + * transaction id + secret. This hash can be used to + * verify the the payment response. Can be used for + * brute force protection. + * + * @var string secret + */ + protected $secret = 'Heidelpay-PhpPaymentApi'; + + /** + * PaymentObject + * + * @var \Heidelpay\PhpPaymentApi\PaymentMethods\InvoiceB2CSecuredPaymentMethod + */ + protected $paymentObject; + + /** + * @var string $authorizeReference + */ + protected $authorizeReference; + + /** + * Constructor used to set timezone to utc + */ + public function __construct() + { + date_default_timezone_set('UTC'); + parent::__construct(); + } + + // + + // + + /** + * Set up function will create a invoice object for each test case + * + * @see PHPUnit_Framework_TestCase::setUp() + */ + // @codingStandardsIgnoreStart + public function _before() + { + // @codingStandardsIgnoreEnd + $authentication = $this->authentication + ->setTransactionChannel('31HA07BC8129FBA7AF65A35EC4E540C2') + ->getAuthenticationArray(); + $customerDetails = $this->customerData->getCustomerDataArray(); + + $Invoice = new Invoice(); + $Invoice->getRequest()->authentification(...$authentication); + $Invoice->getRequest()->customerAddress(...$customerDetails); + $this->paymentObject = $Invoice; + } + + // + + // + + /** + * Test case for a single invoice authorisation + * + * @return string payment reference id for the invoice authorize transaction + * @group connectionTest + * + * @dataProvider authorizeDataProvider + * @test + * + * @throws \Exception + */ + public function authorize() + { + $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s'); + $this->paymentObject->getRequest()->basketData($timestamp, 23.12, $this->currency, $this->secret); + $this->paymentObject->getRequest()->getFrontend()->setEnabled('FALSE'); + + $this->paymentObject->getRequest()->b2cSecured('MRS', '1982-07-12'); + $this->paymentObject->getRequest()->factoring('iv' . date('YmdHis'), 'shopperId'); + + $this->paymentObject->authorize(); + + /* verify response */ + $this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp)); + + /* transaction result */ + $this->assertTrue( + $this->paymentObject->getResponse()->isSuccess(), + 'Transaction failed : ' . print_r($this->paymentObject->getResponse(), 1) + ); + $this->assertFalse($this->paymentObject->getResponse()->isPending(), 'authorize is pending'); + $this->assertFalse( + $this->paymentObject->getResponse()->isError(), + 'authorize failed : ' . print_r($this->paymentObject->getResponse()->getError(), 1) + ); + + $this->logDataToDebug(); + + return $this->authorizeReference = (string)$this->paymentObject->getResponse()->getPaymentReferenceId(); + } + + public function authorizeDataProvider() + { + return [ + + ]; + } + + /** + * Test case for a invoice finalize of a existing authorisation + * + * @param $referenceId string payment reference id of the invoice authorisation + * + * @return string payment reference id for the prepayment reversal transaction + * @depends authorize + * @group connectionTest + * + * @test + * + * @throws \Exception + */ + public function finalize($referenceId) + { + $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s'); + $this->paymentObject->getRequest()->basketData($timestamp, 23.12, $this->currency, $this->secret); + + $this->paymentObject->finalize($referenceId); + + /* verify response */ + $this->successResponseAssertion($timestamp); + + return $referenceId; + } + + /** + * Test case for a invoice reversal (type REVERSAL)of a existing authorisation + * + * @param $referenceId + * + * @return string payment reference id for the prepayment reversal transaction + * @depends finalize + * @group connectionTest + * + * @test + * + * @throws \Exception + */ + public function reversalCancel($referenceId) + { + $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d-H-i-s'); + $this->paymentObject->getRequest()->basketData($timestamp, 10, $this->currency, $this->secret); + + /* the refund can not be processed because there will be no receipt automatically on the sandbox */ + + $this->paymentObject->reversal($referenceId, ReversalType::RT_CANCEL); + + /* verify response */ + $this->successResponseAssertion($timestamp); + + return (string)$this->paymentObject->getResponse()->getPaymentReferenceId(); + } + + /** + * Test case for a invoice reversal (type CREDIT) of a existing authorisation + * + * @param $referenceId + * + * @return string payment reference id for the prepayment reversal transaction + * @depends finalize + * @group connectionTest + * + * @test + * + * @throws \Exception + */ + public function reversalCredit($referenceId) + { + $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d-H-i-s'); + $this->paymentObject->getRequest()->basketData($timestamp, 10, $this->currency, $this->secret); + + /* the refund can not be processed because there will be no receipt automatically on the sandbox */ + + $this->paymentObject->reversal($referenceId, ReversalType::RT_CREDIT); + + /* verify response */ + $this->successResponseAssertion($timestamp); + + return (string)$this->paymentObject->getResponse()->getPaymentReferenceId(); + } + + /** + * Test case for a invoice reversal (type RETURN)of a existing authorisation + * + * @param $referenceId + * + * @return string payment reference id for the prepayment reversal transaction + * @depends finalize + * @group connectionTest + * + * @test + * + * @throws \Exception + */ + public function reversalReturn($referenceId) + { + $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d-H-i-s'); + $this->paymentObject->getRequest()->basketData($timestamp, 3.12, $this->currency, $this->secret); + + /* the refund can not be processed because there will be no receipt automatically on the sandbox */ + + $this->paymentObject->reversal($referenceId, ReversalType::RT_RETURN); + $this->successResponseAssertion($timestamp); + + return (string)$this->paymentObject->getResponse()->getPaymentReferenceId(); + } + + /** + * Test case for invoice refund + * + * @param string $referenceId reference id of the invoice to refund + * + * @depends authorize + * @test + * + * @group connectionTest + * + * @throws \Heidelpay\PhpPaymentApi\Exceptions\UndefinedTransactionModeException + */ + public function refund($referenceId = null) + { + $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s'); + $this->paymentObject->getRequest()->basketData($timestamp, 3.54, $this->currency, $this->secret); + + /* the refund can not be processed because there will be no receipt automatically on the sandbox */ + $this->paymentObject->dryRun = true; + + $this->paymentObject->refund((string)$referenceId); + + $this->assertEquals(PaymentMethod::INVOICE . '.' . TransactionType::REFUND, $this->paymentObject->getRequest()->getPayment()->getCode()); + + $this->logDataToDebug(); + } + + /** + * @param $timestamp + * + * @throws \Heidelpay\PhpPaymentApi\Exceptions\HashVerificationException + */ + protected function successResponseAssertion($timestamp) + { + /* verify response */ + $this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp)); + + /* transaction result */ + $this->assertTrue( + $this->paymentObject->getResponse()->isSuccess(), + 'Transaction failed : ' . print_r($this->paymentObject->getResponse(), 1) + ); + $this->assertFalse($this->paymentObject->getResponse()->isPending(), 'reversal is pending'); + $this->assertFalse( + $this->paymentObject->getResponse()->isError(), + 'reversal failed : ' . print_r($this->paymentObject->getResponse()->getError(), 1) + ); + + $this->logDataToDebug(); + } + + // +} diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredPaymentMethodTest.php index 158eedc..1115e5b 100644 --- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredPaymentMethodTest.php +++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredPaymentMethodTest.php @@ -79,7 +79,7 @@ public function _before() { // @codingStandardsIgnoreEnd $authentication = $this->authentication - ->setTransactionChannel('31HA07BC81856CAD6D8E05CDDE7E2AC8') + ->setTransactionChannel('31HA07BC8129FBA7AF65934626B0F907') ->getAuthenticationArray(); $customerDetails = $this->customerData->getCustomerDataArray(); diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PayPalPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PayPalPaymentMethodTest.php index 398e728..ec24dc4 100644 --- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PayPalPaymentMethodTest.php +++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PayPalPaymentMethodTest.php @@ -13,7 +13,7 @@ * This does not have to mean that your integration is broken. Please verify the given debug information * * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. - * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved. + * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved. * * @link http://dev.heidelpay.com/heidelpay-php-api/ * diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PrepaymentPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PrepaymentPaymentMethodTest.php index 7f1ccb1..6f635e0 100644 --- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PrepaymentPaymentMethodTest.php +++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PrepaymentPaymentMethodTest.php @@ -14,7 +14,7 @@ * This does not have to mean that your integration is broken. Please verify the given debug information * * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. - * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved. + * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved. * * @link http://dev.heidelpay.com/heidelpay-php-api/ * diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php new file mode 100644 index 0000000..ac4c20f --- /dev/null +++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php @@ -0,0 +1,115 @@ +authentication + ->setSecuritySender('31HA07BC8142C823FFA6831A1C7A39EF') + ->setUserLogin('31ha07bc8142c823ffa666acb95d3b3f') + ->setUserPassword('81C93566') + ->setTransactionChannel('31HA07BC8142C823FFA60C952A9C414D') + ->getAuthenticationArray(); + $customerDetails = $this->customerData->getCustomerDataArray(); + + $santander = new SantanderHirePurchasePaymentMethod(); + + $santander->getRequest()->authentification(...$authentication); + $santander->getRequest()->customerAddress(...$customerDetails); + $santander->getRequest()->b2cSecured('MR', '1970-01-01'); + $santander->getRequest()->async('DE', 'https://dev.heidelpay.com'); + + $santander->getRequest()->getRiskInformation()->set('guestcheckout', false); + $santander->getRequest()->getRiskInformation()->set('since', '2013-01-01'); + $santander->getRequest()->getRiskInformation()->set('ordercount', 3); + + $santander->getRequest()->basketData( + 'santanderHirePurchaseTest', + 500.98, + $this->currency, + $this->secret + ); + + $this->paymentObject = $santander; + } + + /** + * @test + * + * @throws \Heidelpay\PhpPaymentApi\Exceptions\UndefinedTransactionModeException + */ + public function initialRequest() + { + $this->paymentObject->initialize(); + + $response = $this->paymentObject->getResponse(); + + $this->assertTrue($response->isSuccess(), 'Response is not successful.'); + + // following field is essential for santander hire purchase, so it must not be null. + $this->assertNotNull($response->getFrontend()->getRedirectUrl(), 'RedirectUrl is null.'); + + $this->logDataToDebug(); + } +} diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderInvoicePaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderInvoicePaymentMethodTest.php index a69cf2e..c6ba1f1 100644 --- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderInvoicePaymentMethodTest.php +++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderInvoicePaymentMethodTest.php @@ -2,6 +2,9 @@ namespace Heidelpay\Tests\PhpPaymentApi\Integration\PaymentMethods; +use Heidelpay\PhpBasketApi\Request as BasketRequest; +use Heidelpay\PhpBasketApi\Response as BasketResponse; +use Heidelpay\PhpBasketApi\Object\BasketItem; use Heidelpay\PhpPaymentApi\Constants\PaymentMethod; use Heidelpay\PhpPaymentApi\Constants\TransactionType; use Heidelpay\PhpPaymentApi\PaymentMethods\SantanderInvoicePaymentMethod; @@ -14,7 +17,7 @@ * This does not have to mean that your integration is broken. Please verify the given debug information * * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. - * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved. + * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved. * * @link http://dev.heidelpay.com/heidelpay-php-api/ * @@ -95,12 +98,16 @@ public function _before() */ public function authorize() { + $basketReferenceId = $this->createTestBasket(); + $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s'); $this->paymentObject->getRequest()->basketData($timestamp, 123.12, $this->currency, $this->secret); $this->paymentObject->getRequest()->b2cSecured('MRS', '1982-07-12'); $this->paymentObject->getRequest()->async('DE', 'https://dev.heidelpay.com'); $this->paymentObject->getRequest()->getFrontend()->setEnabled('FALSE'); + $this->paymentObject->getRequest()->getCustomer()->setOptIn2(true); + $this->paymentObject->getRequest()->getBasket()->setId($basketReferenceId); $this->paymentObject->authorize(); @@ -124,24 +131,27 @@ public function authorize() } /** - * Test case for a invoice finalize of a existing authorisation + * Test case for a invoice reversal of a existing authorisation * - * @param $referenceId string payment reference id of the invoice authorisation * * @return string payment reference id for the prepayment reversal transaction - * @depends authorize * @group connectionTest + * @depends authorize * * @test * * @throws \Exception + * + * @param mixed $referenceId */ - public function finalize($referenceId) + public function reversal($referenceId) { $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s'); - $this->paymentObject->getRequest()->basketData($timestamp, 82.12, $this->currency, $this->secret); + $this->paymentObject->getRequest()->basketData($timestamp, 23.54, $this->currency, $this->secret); - $this->paymentObject->finalize($referenceId); + /* the refund can not be processed because there will be no receipt automatically on the sandbox */ + + $this->paymentObject->reversal($referenceId); /* verify response */ $this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp)); @@ -163,26 +173,28 @@ public function finalize($referenceId) } /** - * Test case for a invoice reversal of a existing authorisation + * Test case for a invoice finalize of a existing authorisation * + * @param $referenceId string payment reference id of the invoice authorisation * * @return string payment reference id for the prepayment reversal transaction - * @depends finalize * @group connectionTest * * @test * * @throws \Exception */ - public function reversal() + public function finalize() { + $basketReferenceId = $this->createTestBasket(); $referenceId = $this->authorize(); + $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s'); - $this->paymentObject->getRequest()->basketData($timestamp, 23.54, $this->currency, $this->secret); + $this->paymentObject->getRequest()->basketData($timestamp, 123.12, $this->currency, $this->secret); + $this->paymentObject->getRequest()->getBasket()->setId($basketReferenceId); - /* the refund can not be processed because there will be no receipt automatically on the sandbox */ - $this->paymentObject->reversal($referenceId); + $this->paymentObject->finalize($referenceId); /* verify response */ $this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp)); @@ -200,7 +212,7 @@ public function reversal() $this->logDataToDebug(); - return (string)$this->paymentObject->getResponse()->getPaymentReferenceId(); + return $referenceId; } /** @@ -208,7 +220,7 @@ public function reversal() * * @param string $referenceId reference id of the invoice to refund * - * @depends authorize + * @depends finalize * @test * * @group connectionTest @@ -225,8 +237,55 @@ public function refund($referenceId = null) $this->paymentObject->refund((string)$referenceId); - $this->assertEquals(PaymentMethod::INVOICE . '.' . TransactionType::REFUND, $this->paymentObject->getRequest()->getPayment()->getCode()); + $this->assertEquals( + PaymentMethod::INVOICE . '.' . TransactionType::REFUND, + $this->paymentObject->getRequest()->getPayment()->getCode() + ); $this->logDataToDebug(); } + + /** + * @return string + * + * @throws \Heidelpay\PhpBasketApi\Exception\BasketException + * @throws \Heidelpay\PhpBasketApi\Exception\CurlAdapterException + * @throws \Heidelpay\PhpBasketApi\Exception\InvalidBasketitemPositionException + * @throws \Heidelpay\PhpBasketApi\Exception\ParameterOverflowException + * @throws \PHPUnit\Framework\AssertionFailedError + */ + public function createTestBasket() + { + $basketRequest = new BasketRequest(); + + $basketItem = (new BasketItem()) + ->setBasketItemReferenceId('refId') + ->setTitle('item name') + ->setAmountNet(12312) + ->setAmountPerUnit(12312) + ->setQuantity(1); + + $basketRequest->getBasket() + ->setCurrencyCode('EUR') + ->setBasketReferenceId('123456') + ->addBasketItem($basketItem) + ->setAmountTotalNet(12312); + + $basketRequest->setAuthentication( + $this->authentication->getUserLogin(), + $this->authentication->getUserPassword(), + $this->authentication->getSecuritySender() + ); + + $basketRequest->setIsSandboxMode(true); + + /** @var BasketResponse $basketResponse */ + $basketResponse = $basketRequest->addNewBasket(); + + $this->logDataToDebug($basketResponse); + + $this->assertTrue($basketResponse->isSuccess()); + + return $basketResponse->getBasketId(); + } } diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SofortPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SofortPaymentMethodTest.php index c730d42..f3e01d7 100644 --- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SofortPaymentMethodTest.php +++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SofortPaymentMethodTest.php @@ -15,7 +15,7 @@ * This does not have to mean that your integration is broken. Please verify the given debug information * * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. - * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved. + * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved. * * @link http://dev.heidelpay.com/heidelpay-php-api/ * diff --git a/vendor/heidelpay/php-payment-api/tests/unit/Adapter/CurlAdapterTest.php b/vendor/heidelpay/php-payment-api/tests/unit/Adapter/CurlAdapterTest.php index 944268c..e25326d 100644 --- a/vendor/heidelpay/php-payment-api/tests/unit/Adapter/CurlAdapterTest.php +++ b/vendor/heidelpay/php-payment-api/tests/unit/Adapter/CurlAdapterTest.php @@ -12,6 +12,7 @@ use Heidelpay\Tests\PhpPaymentApi\Helper\Constraints\ArraysMatchConstraint; use PHPUnit\Framework\Constraint\Constraint; use Heidelpay\PhpPaymentApi\Constants\TransactionMode; +use Heidelpay\PhpPaymentApi\Constants\FrontendMode; /** * Unit test for the curl adapter @@ -161,7 +162,7 @@ public function simplePost() 'TRANSACTION.MODE' => TransactionMode::CONNECTOR_TEST, 'TRANSACTION.CHANNEL' => '31HA07BC8142C5A171744F3D6D155865', 'PAYMENT.CODE' => PaymentMethod::CREDIT_CARD . '.' . TransactionType::REGISTRATION, - 'FRONTEND.MODE' => 'WHITELABEL', + 'FRONTEND.MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL, 'FRONTEND.ENABLED' => 'TRUE', 'FRONTEND.LANGUAGE' => 'EN', 'FRONTEND.RESPONSE_URL' => 'http://dev.heidelpay.com', diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/CompanyParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/CompanyParameterGroupTest.php new file mode 100644 index 0000000..a6537ab --- /dev/null +++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/CompanyParameterGroupTest.php @@ -0,0 +1,204 @@ +company = new Company(); + $executive = new Executive(); + + $this->company->addExecutive(...$executive->getExecutiveOneArray()); + $this->company->addExecutive(...$executive->getExecutiveTwoArray()); + $this->company->addExecutive(...$executive->getExecutiveOneArray()); + } + + /** + * Tear down function will remove all registered test doubles (i.e. Mocks) + */ + // @codingStandardsIgnoreStart + public function _after() + { + // @codingStandardsIgnoreEnd + $this->company = null; + } + + /** + * companyName getter/setter test + * + * @test + */ + public function companyName() + { + $value = 'company name'; + $this->company->setCompanyname($value); + + $this->assertEquals($value, $this->company->getCompanyname()); + } + + /** + * registrationType getter/setter test + * + * @test + */ + public function registrationType() + { + $value = 'REGISTRED'; + $this->company->setRegistrationType($value); + + $this->assertEquals($value, $this->company->getRegistrationType()); + } + + /** + * commercialRegisterNumber getter/setter test + * + * @test + */ + public function commercialRegisterNumber() + { + $value = 'company name'; + $this->company->setCommercialRegisterNumber($value); + + $this->assertEquals($value, $this->company->getCommercialRegisterNumber()); + } + + /** + * vatId getter/setter test + * + * @test + */ + public function vatId() + { + $value = 'company name'; + $this->company->setVatId($value); + + $this->assertEquals($value, $this->company->getVatId()); + } + + /** + * executive getter/setter test + * + * @test + */ + public function executive() + { + $value = [ + new ExecutiveParameterGroup() + ]; + + $this->company->setExecutive($value); + $this->assertEquals($value, $this->company->getExecutive()); + } + + /** + * @param ExecutiveParameterGroup $expected + * @param mixed $index + * @dataProvider executiveGetterIndexShouldWorkAsExpectedDataProvider + * @test + */ + public function executiveGetterIndexShouldWorkAsExpected($expected, $index) + { + $this->assertEquals($expected, $this->company->getExecutive($index)); + } + + public function executiveGetterIndexShouldWorkAsExpectedDataProvider() + { + $executiveFixture = new Executive(); + + $testCompany = new CompanyParameterGroup(); + $testCompany->addExecutive(...$executiveFixture->getExecutiveOneArray()); + $testCompany->addExecutive(...$executiveFixture->getExecutiveTwoArray()); + $testCompany->addExecutive(...$executiveFixture->getExecutiveOneArray()); + + return [ + 'index exists' => [$testCompany->executive[0], 0], + 'index of second executive' => [$testCompany->executive[1], 1], + 'last element exists' => [$testCompany->executive[2], 2], + 'index element doesnt exists' => [null, 3], + 'negative index' => [null, -3], + 'index is boolean true' => [null, true], + 'index is boolean false' => [null, false], + ]; + } + + /** + * CommercialSector getter/setter test + * + * @test + */ + public function commercialSector() + { + $value = CommercialSector::COMPUTER_PROGRAMMING_CONSULTANCY_AND_RELATED_ACTIVITIES; + $this->company->setCommercialSector($value); + + $this->assertEquals($value, $this->company->getCommercialSector()); + } + + /** + * location getter/setter test + * + * @test + */ + public function location() + { + $value = new Location(); + $this->company->setLocation($value); + + $this->assertEquals($value, $this->company->getLocation()); + } + + /** + * @dataProvider functionShouldBeSetAsExpectedDataProvider + * @test + * + * @param mixed $expected + * @param mixed $function + */ + public function functionShouldBeSetAsExpected($expected, $function) + { + $company = new Company(); + $company->addExecutive('', '', '', '', '', '', '', '', '', '', $function); + + $this->assertEquals($expected, $company->getExecutive()[0]->getFunction()); + } + + public function functionShouldBeSetAsExpectedDataProvider() + { + return [ + 'function is null' => ['OWNER', null], + 'function is empty string' => ['OWNER', ''], + 'function is false' => ['OWNER', false], + 'function is true' => ['OWNER', true], + 'function is string' => ['hello world', 'hello world'], + 'function is number' => ['OWNER', 42], + ]; + } +} diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/ExecutiveParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/ExecutiveParameterGroupTest.php new file mode 100644 index 0000000..4328a13 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/ExecutiveParameterGroupTest.php @@ -0,0 +1,149 @@ +executive = new Executive(); + } + + /** + * Tear down function will remove all registered test doubles (i.e. Mocks) + */ + // @codingStandardsIgnoreStart + public function _after() + { + // @codingStandardsIgnoreEnd + $this->executive = null; + } + + /** + * function getter/setter test + * + * @test + */ + public function functionTest() + { + $value = 'company name'; + $this->executive->setFunction($value); + + $this->assertEquals($value, $this->executive->getFunction()); + } + + /** + * salutation getter/setter test + * + * @test + */ + public function salutation() + { + $value = 'company name'; + $this->executive->setSalutation($value); + + $this->assertEquals($value, $this->executive->getSalutation()); + } + + /** + * given getter/setter test + * + * @test + */ + public function given() + { + $value = 'company name'; + $this->executive->setGiven($value); + + $this->assertEquals($value, $this->executive->getGiven()); + } + + /** + * family getter/setter test + * + * @test + */ + public function family() + { + $value = 'company name'; + $this->executive->setFamily($value); + + $this->assertEquals($value, $this->executive->getFamily()); + } + + /** + * birthdate getter/setter test + * + * @test + */ + public function birthdate() + { + $value = 'company name'; + $this->executive->setBirthdate($value); + + $this->assertEquals($value, $this->executive->getBirthdate()); + } + + /** + * email getter/setter test + * + * @test + */ + public function email() + { + $value = 'company name'; + $this->executive->setEmail($value); + + $this->assertEquals($value, $this->executive->getEmail()); + } + + /** + * phone getter/setter test + * + * @test + */ + public function phone() + { + $value = 'company name'; + $this->executive->setPhone($value); + + $this->assertEquals($value, $this->executive->getPhone()); + } + + /** + * home getter/setter test + * + * @test + */ + public function home() + { + $value = new HomeParameterGroup(); + $this->executive->setHome($value); + + $this->assertEquals($value, $this->executive->getHome()); + } +} diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/FrontendParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/FrontendParameterGroupTest.php index d105ed8..9642c65 100644 --- a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/FrontendParameterGroupTest.php +++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/FrontendParameterGroupTest.php @@ -3,8 +3,8 @@ namespace Heidelpay\Tests\PhpPaymentApi\Unit\ParameterGroup; use Codeception\TestCase\Test; +use Heidelpay\PhpPaymentApi\Constants\FrontendMode; use Heidelpay\PhpPaymentApi\ParameterGroups\FrontendParameterGroup as Frontend; -use Heidelpay\PhpPaymentApi\Constants\TransactionMode; /** * Unit test for FrontendParameterGroup @@ -81,18 +81,19 @@ public function responseUrl() } /** - *Frontend mode getter/setter test + * Frontend mode getter/setter test * * @test */ - public function mode() + public function modeShouldNotBeChangeable() { $frontend = new Frontend(); - $value = TransactionMode::CONNECTOR_TEST; - $frontend->setMode($value); + $frontend->setMode('DEFAULT'); + $this->assertEquals(FrontendMode::FRONTEND_MODE_WHITELABEL, $frontend->getMode()); - $this->assertEquals($value, $frontend->getMode()); + $frontend->set('mode', 'OTHERMODE'); + $this->assertEquals(FrontendMode::FRONTEND_MODE_WHITELABEL, $frontend->getMode()); } /** diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/HomeParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/HomeParameterGroupTest.php new file mode 100644 index 0000000..30f28a3 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/HomeParameterGroupTest.php @@ -0,0 +1,96 @@ +home = new Home(); + } + + /** + * Tear down function will remove all registered test doubles (i.e. Mocks) + */ + // @codingStandardsIgnoreStart + public function _after() + { + // @codingStandardsIgnoreEnd + $this->home = null; + } + + /** + * street getter/setter test + * + * @test + */ + public function street() + { + $value = 'company name'; + $this->home->setStreet($value); + + $this->assertEquals($value, $this->home->getStreet()); + } + + /** + * zip getter/setter test + * + * @test + */ + public function zip() + { + $value = 'company name'; + $this->home->setZip($value); + + $this->assertEquals($value, $this->home->getZip()); + } + + /** + * city getter/setter test + * + * @test + */ + public function city() + { + $value = 'company name'; + $this->home->setCity($value); + + $this->assertEquals($value, $this->home->getCity()); + } + + /** + * country getter/setter test + * + * @test + */ + public function country() + { + $value = 'company name'; + $this->home->setCountry($value); + + $this->assertEquals($value, $this->home->getCountry()); + } +} diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/IdentificationParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/IdentificationParameterGroupTest.php index 90f616d..defd60d 100644 --- a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/IdentificationParameterGroupTest.php +++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/IdentificationParameterGroupTest.php @@ -19,6 +19,21 @@ */ class IdentificationParameterGroupTest extends Test { + /** + * @var Identification + */ + protected $identification; + + public function _before() + { + $this->identification = new Identification(); + } + + public function _after() + { + $this->identification = null; + } + /** * Creditor id getter/setter test * @@ -108,4 +123,17 @@ public function uniqueId() $this->assertEquals($value, $identification->getUniqueId()); } + + /** + * Invoice id getter/setter test + * + * @test + */ + public function invoiceId() + { + $value = '132456'; + $this->identification->setInvoiceid($value); + + $this->assertEquals($value, $this->identification->getInvoiceid()); + } } diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/LocationParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/LocationParameterGroupTest.php new file mode 100644 index 0000000..281dcf1 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/LocationParameterGroupTest.php @@ -0,0 +1,109 @@ +location = new Location(); + } + + /** + * Tear down function will remove all registered test doubles (i.e. Mocks) + */ + // @codingStandardsIgnoreStart + public function _after() + { + // @codingStandardsIgnoreEnd + $this->location = null; + } + + /** + * pobox getter/setter test + * + * @test + */ + public function pobox() + { + $value = 'company name'; + $this->location->setPobox($value); + + $this->assertEquals($value, $this->location->getPobox()); + } + + /** + * street getter/setter test + * + * @test + */ + public function street() + { + $value = 'company name'; + $this->location->setStreet($value); + + $this->assertEquals($value, $this->location->getStreet()); + } + + /** + * zip getter/setter test + * + * @test + */ + public function zip() + { + $value = 'company name'; + $this->location->setZip($value); + + $this->assertEquals($value, $this->location->getZip()); + } + + /** + * city getter/setter test + * + * @test + */ + public function city() + { + $value = 'company name'; + $this->location->setCity($value); + + $this->assertEquals($value, $this->location->getCity()); + } + + /** + * country getter/setter test + * + * @test + */ + public function country() + { + $value = 'company name'; + $this->location->setCountry($value); + + $this->assertEquals($value, $this->location->getCountry()); + } +} diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/PaymentParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/PaymentParameterGroupTest.php index 897b6ee..5182ed9 100644 --- a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/PaymentParameterGroupTest.php +++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/PaymentParameterGroupTest.php @@ -4,6 +4,7 @@ use Codeception\TestCase\Test; use Heidelpay\PhpPaymentApi\Constants\PaymentMethod; +use Heidelpay\PhpPaymentApi\Constants\ReversalType; use Heidelpay\PhpPaymentApi\Constants\TransactionType; use Heidelpay\PhpPaymentApi\ParameterGroups\PaymentParameterGroup as Payment; @@ -21,16 +22,37 @@ */ class PaymentParameterGroupTest extends Test { + /** + * @var Payment + */ + protected $payment; + + public function _before() + { + $this->payment = new Payment(); + } + /** * Payment code setter/getter test */ public function testCode() { - $Payment = new Payment(); - $value = PaymentMethod::INVOICE . '.' . TransactionType::RESERVATION; - $Payment->setCode($value); + $this->payment->setCode($value); + + $this->assertEquals($value, $this->payment->getCode()); + } + + /** + * reversal type getter/setter test + * + * @test + */ + public function reversalType() + { + $value = ReversalType::RT_CREDIT; + $this->payment->setReversaltype($value); - $this->assertEquals($value, $Payment->getCode()); + $this->assertEquals($value, $this->payment->getReversaltype()); } } diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/RiskInformationParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/RiskInformationParameterGroupTest.php index 9e745c2..a7e5f62 100644 --- a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/RiskInformationParameterGroupTest.php +++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/RiskInformationParameterGroupTest.php @@ -29,9 +29,9 @@ public function guestcheckout() $riskInformation = new RiskInformation(); $guestcheckout = false; - $riskInformation->setGuestCheckout($guestcheckout); + $riskInformation->setCustomerGuestCheckout($guestcheckout); - $this->assertFalse($riskInformation->getGuestcheckout(), 'guestcheckout should be false'); + $this->assertFalse($riskInformation->getCustomerGuestCheckout(), 'guestcheckout should be false'); } /** @@ -44,9 +44,9 @@ public function since() $riskInformation = new RiskInformation(); $since = '1984-05-23'; - $riskInformation->setSince($since); + $riskInformation->setCustomerSince($since); - $this->assertEquals($since, $riskInformation->getSince()); + $this->assertEquals($since, $riskInformation->getCustomerSince()); } /** @@ -59,8 +59,8 @@ public function ordercount() $riskInformation = new RiskInformation(); $ordercount = 5; - $riskInformation->setOrderCount($ordercount); + $riskInformation->setCustomerOrderCount($ordercount); - $this->assertEquals($ordercount, $riskInformation->getOrdercount()); + $this->assertEquals($ordercount, $riskInformation->getCustomerOrderCount()); } } diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/TransactionParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/TransactionParameterGroupTest.php index 2c00ea7..4e7ded3 100644 --- a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/TransactionParameterGroupTest.php +++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/TransactionParameterGroupTest.php @@ -10,7 +10,7 @@ * Unit test for TransactionParameterGroup * * @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. - * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved. + * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved. * * @link http://dev.heidelpay.com/heidelpay-php-payment-api/ * diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/CreditCardPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/CreditCardPaymentMethodTest.php index edc93c4..d2808d8 100644 --- a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/CreditCardPaymentMethodTest.php +++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/CreditCardPaymentMethodTest.php @@ -9,6 +9,7 @@ use Heidelpay\Tests\PhpPaymentApi\Helper\BasePaymentMethodTest; use Heidelpay\PhpPaymentApi\Constants\TransactionType; use Heidelpay\PhpPaymentApi\Constants\TransactionMode; +use Heidelpay\PhpPaymentApi\Constants\FrontendMode; /** * This test class verifies the special functionality of the CreditCardPaymentMethod not covered in @@ -142,6 +143,23 @@ public function _after() // + // + + /** + * @return array + */ + public static function traitImportedParentMethods() + { + return [ + ['authorizeParent'], + ['debitParent'], + ['registrationParent'], + ['reregistrationParent'], + ]; + } + + // + // /** @@ -199,7 +217,7 @@ public function registrationParametersShouldBeSetUpAsExpected() 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION, 'FRONTEND.CSS_PATH' => self::CSS_PATH, 'FRONTEND.ENABLED' => 'FALSE', - 'FRONTEND.MODE' => 'WHITELABEL', + 'FRONTEND.MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL, 'FRONTEND.PAYMENT_FRAME_ORIGIN' => self::PAYMENT_FRAME_ORIGIN, 'FRONTEND.PREVENT_ASYNC_REDIRECT' => $preventAsyncRedirect, 'IDENTIFICATION.SHOPPERID' => $shopperId, @@ -281,7 +299,7 @@ public function reregistrationParametersShouldBeSetUpAsExpected() 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION, 'FRONTEND.CSS_PATH' => self::CSS_PATH, 'FRONTEND.ENABLED' => 'FALSE', - 'FRONTEND.MODE' => 'WHITELABEL', + 'FRONTEND.MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL, 'FRONTEND.PAYMENT_FRAME_ORIGIN' => self::PAYMENT_FRAME_ORIGIN, 'FRONTEND.PREVENT_ASYNC_REDIRECT' => $preventAsyncRedirect, 'IDENTIFICATION.SHOPPERID' => $shopperId, @@ -357,7 +375,7 @@ public function authorizeParametersShouldBeSetUpAsExpected() 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION, 'FRONTEND.CSS_PATH' => self::CSS_PATH, 'FRONTEND.ENABLED' => $frontendEnabled, - 'FRONTEND.MODE' => 'WHITELABEL', + 'FRONTEND.MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL, 'FRONTEND.PAYMENT_FRAME_ORIGIN' => self::PAYMENT_FRAME_ORIGIN, 'FRONTEND.PREVENT_ASYNC_REDIRECT' => $preventAsyncRedirect, 'IDENTIFICATION.SHOPPERID' => $shopperId, @@ -456,7 +474,7 @@ public function debitParametersShouldBeSetUpAsExpected() 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION, 'FRONTEND.CSS_PATH' => self::CSS_PATH, 'FRONTEND.ENABLED' => $frontendEnabled, - 'FRONTEND.MODE' => 'WHITELABEL', + 'FRONTEND.MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL, 'FRONTEND.PAYMENT_FRAME_ORIGIN' => self::PAYMENT_FRAME_ORIGIN, 'FRONTEND.PREVENT_ASYNC_REDIRECT' => $preventAsyncRedirect, 'IDENTIFICATION.SHOPPERID' => $shopperId, @@ -551,5 +569,26 @@ public function reregistrationShouldNotOverwriteParametersWhenCalledWithNoArgume $this->assertEquals($this->paymentObject->getRequest()->getFrontend()->getCssPath(), self::CSS_PATH); } + /** + * Verify that the imported but overwritten trait methods declared as *parent + * are not callable from the instance itself. + * + * @dataProvider traitImportedParentMethods + * @test + * + * @param string $methodName + */ + public function parentTraitMethodShouldNotBeCallable($methodName) + { + $this->log(' Testing visibility for method ' . $methodName . ' on ' . get_class($this->paymentObject) . ' ...'); + + $this->assertNotInternalType( + 'callable', + [$this->paymentObject, $methodName], + $methodName . ' is callable but should not be!'); + + $this->success(); + } + // } diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/DebitCardPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/DebitCardPaymentMethodTest.php index e479ccb..cbb3c45 100644 --- a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/DebitCardPaymentMethodTest.php +++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/DebitCardPaymentMethodTest.php @@ -138,6 +138,23 @@ public function _after() // + // + + /** + * @return array + */ + public static function traitImportedParentMethods() + { + return [ + ['authorizeParent'], + ['debitParent'], + ['registrationParent'], + ['reregistrationParent'], + ]; + } + + // + // /** @@ -571,5 +588,23 @@ public function reregistrationShouldNotOverwriteParametersWhenCalledWithNoArgume $this->assertEquals($this->paymentObject->getRequest()->getFrontend()->getCssPath(), self::CSS_PATH); } + /** + * Verify that the imported but overwritten trait methods declared as *parent + * are not callable from the instance itself. + * + * @dataProvider traitImportedParentMethods + * @test + * + * @param string $methodName + */ + public function parentTraitMethodShouldNotBeCallable($methodName) + { + $this->log(' Testing visibility for method ' . $methodName . ' on ' . get_class($this->paymentObject) . ' ...'); + + $this->assertNotInternalType('callable', [$this->paymentObject, $methodName], ' is callable but should not be!'); + + $this->success(); + } + // } diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/GenericPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/GenericPaymentMethodTest.php index 37450c2..e58a8a5 100644 --- a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/GenericPaymentMethodTest.php +++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/GenericPaymentMethodTest.php @@ -5,6 +5,7 @@ use AspectMock\Test as test; use Heidelpay\PhpPaymentApi\Constants\PaymentMethod; use Heidelpay\PhpPaymentApi\Constants\TransactionType; +use Heidelpay\PhpPaymentApi\PaymentMethods\BasicPaymentMethodTrait; use Heidelpay\Tests\PhpPaymentApi\Helper\BasePaymentMethodTest; /** @@ -153,5 +154,26 @@ public function verifyPaymentMethodPresentsAsExpected($paymentMethodClass, $paym $this->success(); } + /** + * Verify getPaymentCode returns null if the property 'paymentCode' does not exist. + * + * @test + */ + public function basicPaymentMethodTraitShouldReturnNullWhenAPropertyIsNotDefined() + { + $paymentMethod = new DummyPaymentMethod(); + $this->assertNull($paymentMethod->getPaymentCode()); + } + // } + +/** + * This class is used to test the perform trait test. + * + * @package Heidelpay\Tests\PhpPaymentApi\Unit\PaymentMethods + */ +class DummyPaymentMethod +{ + use BasicPaymentMethodTrait; +} diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php new file mode 100644 index 0000000..7f4c479 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php @@ -0,0 +1,217 @@ +company = new Company(); + } + + /** + * Set up function will create a payment method object for each test case + * + * @throws \Exception + */ + // @codingStandardsIgnoreStart + public function _before() + { + // @codingStandardsIgnoreEnd + $this->authentication->setTransactionChannel('31HA07BC8142C5A171744F3D6D155865'); + + $paymentObject = new InvoiceB2CSecuredPaymentMethod(); + + $request = $paymentObject->getRequest(); + $request->authentification(...$this->authentication->getAuthenticationArray()); + $request->customerAddress(...$this->customerData->getCustomerDataArray()); + $request->company(...$this->company->getCompanyDataArray()); + + $executive = new Executive(); + + $executiveOne = $executive->getExecutiveOneArray(); + $executiveTwo = $executive->getExecutiveTwoArray(); + + $request->getCompany()->addExecutive(...$executiveOne); + $request->getCompany()->addExecutive(...$executiveTwo); + $paymentObject->dryRun = false; + + $this->paymentObject = $paymentObject; + + $this->mockCurlAdapter(); + } + + /** + * Tear down function will remove all registered test doubles (i.e. Mocks) + */ + // @codingStandardsIgnoreStart + public function _after() + { + // @codingStandardsIgnoreEnd + $this->paymentObject = null; + test::clean(); + } + + /** + * Prepare request company. + * This test will convert the request object to post array format + * + * @test + */ + public function companyParametersShouldBeSetAsExpected() + { + $expectedRequestArray = [ + 'COMPANY.COMPANYNAME' => 'heidelpay GmbH', + 'COMPANY.REGISTRATIONTYPE' => RegistrationType::REGISTERED, + 'COMPANY.COMMERCIALREGISTERNUMBER' => 'HRB 702091', + 'COMPANY.VATID' => 'DE 253 689 876', + 'COMPANY.COMMERCIALSECTOR' => CommercialSector::AIR_TRANSPORT, + 'CRITERION.SDK_NAME' => 'Heidelpay\PhpPaymentApi', + 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION, + 'FRONTEND.ENABLED' => 'TRUE', + 'FRONTEND.MODE' => 'WHITELABEL', + 'REQUEST.VERSION' => '1.0', + 'TRANSACTION.MODE' => 'CONNECTOR_TEST', + 'COMPANY.LOCATION.STREET' => 'Vangerowstr. 18', + 'COMPANY.LOCATION.ZIP' => '69115', + 'COMPANY.LOCATION.CITY' => 'Heidelberg', + 'COMPANY.LOCATION.COUNTRY' => 'DE', + 'COMPANY.EXECUTIVE.1.FUNCTION' => 'OWNER', + 'COMPANY.EXECUTIVE.1.BIRTHDATE' => '1988-12-12', + 'COMPANY.EXECUTIVE.1.GIVEN' => 'Testkäufer', + 'COMPANY.EXECUTIVE.1.FAMILY' => 'Händler', + 'COMPANY.EXECUTIVE.1.EMAIL' => 'example@email.de', + 'COMPANY.EXECUTIVE.1.PHONE' => '062216471400', + 'COMPANY.EXECUTIVE.1.HOME.STREET' => 'Vangerowstr. 18', + 'COMPANY.EXECUTIVE.1.HOME.ZIP' => '69115', + 'COMPANY.EXECUTIVE.1.HOME.CITY' => 'Heidelberg', + 'COMPANY.EXECUTIVE.1.HOME.COUNTRY' => 'DE', + 'COMPANY.EXECUTIVE.2.FUNCTION' => 'OWNER', + 'COMPANY.EXECUTIVE.2.SALUTATION' => '', + 'COMPANY.EXECUTIVE.2.BIRTHDATE' => '123', + 'COMPANY.EXECUTIVE.2.GIVEN' => '', + 'COMPANY.EXECUTIVE.2.FAMILY' => '', + 'COMPANY.EXECUTIVE.2.EMAIL' => '', + 'COMPANY.EXECUTIVE.2.PHONE' => '', + 'COMPANY.EXECUTIVE.2.HOME.STREET' => 'null', + 'COMPANY.EXECUTIVE.2.HOME.ZIP' => 'null', + 'COMPANY.EXECUTIVE.2.HOME.CITY' => 'null', + 'COMPANY.EXECUTIVE.2.HOME.COUNTRY' => 'null', + 'ADDRESS.CITY' => 'Heidelberg', + 'ADDRESS.COUNTRY' => 'DE', + 'ADDRESS.STATE' => 'DE-BW', + 'ADDRESS.STREET' => 'Vangerowstr. 18', + 'ADDRESS.ZIP' => '69115', + 'CONTACT.EMAIL' => 'development@heidelpay.com', + 'IDENTIFICATION.SHOPPERID' => '1234', + 'NAME.GIVEN' => 'Heidel', + 'NAME.FAMILY' => 'Berger-Payment', + 'SECURITY.SENDER' => '31HA07BC8142C5A171745D00AD63D182', + 'TRANSACTION.CHANNEL' => '31HA07BC8142C5A171744F3D6D155865', + 'USER.LOGIN' => '31ha07bc8142c5a171744e5aef11ffd3', + 'USER.PWD' => '93167DE7', + ]; + + $request = $this->paymentObject->getRequest(); + + $this->assertThat($request->toArray(), $this->arraysMatchExactly($expectedRequestArray)); + } + + /** + * @dataProvider requestPostArrayShouldBeMappedAsExpectedDataProvider + * @test + * + * @param mixed $parameterArray + */ + public function requestPostArrayShouldBeMappedAsExpected($parameterArray) + { + $postResponse = [ + 'COMPANY_COMPANYNAME' => 'heidelpay GmbH', + 'COMPANY_COMMERCIALREGISTERNUMBER' => 'HRB 702091', + 'COMPANY_COMMERCIALSECTOR' => 'AIR_TRANSPORT', + 'COMPANY_EXECUTIVE_1_BIRTHDATE' => '1988-12-12', + 'COMPANY_EXECUTIVE_1_EMAIL' => 'example@email.de', + 'COMPANY_EXECUTIVE_1_FAMILY' => 'Händler', + 'COMPANY_EXECUTIVE_1_FUNCTION' => 'OWNER', + 'COMPANY_EXECUTIVE_1_GIVEN' => 'Testkäufer', + 'COMPANY_EXECUTIVE_1_HOME_CITY' => 'Heidelberg', + 'COMPANY_EXECUTIVE_1_HOME_COUNTRY' => 'DE', + 'COMPANY_EXECUTIVE_1_HOME_STREET' => 'Vangerowstr. 18', + 'COMPANY_EXECUTIVE_1_HOME_ZIP' => '69115', + 'COMPANY_EXECUTIVE_1_PHONE' => '062216471400', + 'COMPANY_EXECUTIVE_2_FUNCTION' => 'OWNER', + 'COMPANY_EXECUTIVE_2_SALUTATION' => '', + 'COMPANY_EXECUTIVE_2_BIRTHDATE' => '123', + 'COMPANY_EXECUTIVE_2_GIVEN' => '', + 'COMPANY_EXECUTIVE_2_FAMILY' => '', + 'COMPANY_EXECUTIVE_2_EMAIL' => '', + 'COMPANY_EXECUTIVE_2_PHONE' => '', + 'COMPANY_EXECUTIVE_2_HOME_STREET' => 'null', + 'COMPANY_EXECUTIVE_2_HOME_ZIP' => 'null', + 'COMPANY_EXECUTIVE_2_HOME_CITY' => 'null', + 'COMPANY_EXECUTIVE_2_HOME_COUNTRY' => 'null', + 'COMPANY_LOCATION_STREET' => 'Vangerowstr. 18', + 'COMPANY_LOCATION_ZIP' => '69115', + 'COMPANY_LOCATION_CITY' => 'Heidelberg', + 'COMPANY_LOCATION_COUNTRY' => 'DE', + 'COMPANY_REGISTRATIONTYPE' => 'REGISTERED', + 'COMPANY_VATID' => 'DE 253 689 876', + ]; + + $postResponse = array_merge($postResponse, $parameterArray); + + $this->assertEquals( + $this->paymentObject->getRequest()->getCompany(), + Request::fromPost($postResponse)->getCompany() + ); + } + + public function requestPostArrayShouldBeMappedAsExpectedDataProvider() + { + $invalidParameterkeys = [ + 'COMPANY_EXECUTIVE_1' => '1988-12-12', + 'COMPANY_EXECUTIVE_EMAIL' => 'example@email.de', + 'COMPANY_EXECUTIVE_HOME' => 'home', + 'COMPANY_EXECUTIVE_1_' => 'home', + ]; + return [ + 'only default array used' => [[]], + 'non existing parameter' => [$invalidParameterkeys], + ]; + } + + /** + * @test + */ + public function fromJsonShouldBeMappedAsExpected() + { + $request = new Request(); + + $executive = new Executive(); + $company = new Company(); + + $company->getCompanyDataArray(); + $request->company(...$company->getCompanyDataArray()); + $request->getCompany()->addExecutive(...$executive->getExecutiveOneArray()); + $request->getCompany()->addExecutive(...$executive->getExecutiveTwoArray()); + + $mappedRequest = Request::fromJson($request->toJson()); + $this->assertEquals($request, $mappedRequest); + } +} diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodFactoringTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodFactoringTest.php new file mode 100644 index 0000000..10172c1 --- /dev/null +++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodFactoringTest.php @@ -0,0 +1,181 @@ + + + /** + * Transaction currency + * + * @var string $currency + */ + protected $currency = 'EUR'; + /** + * Secret + * + * The secret will be used to generate a hash using + * transaction id + secret. This hash can be used to + * verify the the payment response. Can be used for + * brute force protection. + * + * @var string $secret + */ + protected $secret = 'Heidelpay-PhpPaymentApi'; + + /** + * PaymentObject + * + * @var DirectDebitB2CSecuredPaymentMethod $paymentObject + */ + protected $paymentObject; + + // + + // + + /** + * Set up function will create a payment method object for each test case + * + * @throws \Exception + */ + // @codingStandardsIgnoreStart + public function _before() + { + $invoiceB2CSecured = new InvoiceB2CSecuredPaymentMethod(); + $request = $invoiceB2CSecured->getRequest(); + + $request->getIdentification()->setShopperid('OriginalShopperId'); + $request->getIdentification()->setInvoiceid('OriginalInvoiceId'); + $invoiceB2CSecured->dryRun = false; + $this->paymentObject = $invoiceB2CSecured; + + $this->mockCurlAdapter(); + } + + /** + * Tear down function will remove all registered test doubles (i.e. Mocks) + */ + // @codingStandardsIgnoreStart + public function _after() + { + // @codingStandardsIgnoreEnd + $this->paymentObject = null; + test::clean(); + } + + // + + // + + /** + * @return array + */ + public static function transactionCodeProvider() + { + return [ + ['finalize', null, TransactionType::FINALIZE] + ]; + } + + /** + * @dataProvider FactoringParameterShouldBeSetAsExpectedDataProvider + * @test + * + * @param $invoiceId + * @param $shopperId + * @param $expectedInvoiceId + * @param $expectedShopperId + * + * @return array + */ + public function factoringParameterShouldBeSetAsExpected($invoiceId, $shopperId, $expectedInvoiceId, $expectedShopperId) + { + $request = $this->paymentObject->getRequest(); + + $request->getIdentification()->setShopperid('OriginalShopperId'); + $request->getIdentification()->setInvoiceid('OriginalInvoiceId'); + + if ($shopperId) { + $request->factoring($invoiceId, $shopperId); + } else { + $request->factoring($invoiceId); + } + + $this->expectedRequestVars = [ + 'CRITERION.SDK_NAME' => 'Heidelpay\PhpPaymentApi', + 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION, + 'FRONTEND.ENABLED' => 'TRUE', + 'FRONTEND.MODE' => 'WHITELABEL', + 'IDENTIFICATION.INVOICEID' => $expectedInvoiceId, + 'IDENTIFICATION.SHOPPERID' => $expectedShopperId, + 'REQUEST.VERSION' => '1.0', + 'TRANSACTION.MODE' => 'CONNECTOR_TEST', + ]; + + $this->assertEquals($this->expectedRequestVars, $request->toArray()); + return $this->expectedRequestVars; + } + + public function FactoringParameterShouldBeSetAsExpectedDataProvider() + { + return [ + 'shopperid null' => ['invoice01', null, 'invoice01', 'OriginalShopperId'], + 'shopperid set separately' => ['invoice01', 'shopper01', 'invoice01', 'shopper01'], + ]; + } + + /** + * @test + * + * @param $requestArray + * + * @return mixed + */ + public function arrayShouldBeMappedToObjectAsExpected() + { + $responseArray = [ + 'CRITERION_SDK_NAME' => 'Heidelpay\PhpPaymentApi', + 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION, + 'FRONTEND_ENABLED' => 'TRUE', + 'FRONTEND_MODE' => 'WHITELABEL', + 'IDENTIFICATION_INVOICEID' => 'OriginalInvoiceId', + 'IDENTIFICATION_SHOPPERID' => 'OriginalShopperId', + 'REQUEST_VERSION' => '1.0', + 'TRANSACTION_MODE' => 'CONNECTOR_TEST', + ]; + + $this->assertEquals($this->getPaymentObject()->getRequest(), Request::fromPost($responseArray)); + return $this->paymentObject->getRequest(); + } + + // +} diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodTransactionTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodTransactionTest.php index 4493b02..43d8338 100644 --- a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodTransactionTest.php +++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodTransactionTest.php @@ -152,23 +152,23 @@ public function verifyTransactionReturnsThePaymentObject($method, $parameters) $this->assertSame($this->paymentObject, $object); } -// /** -// * Verify sendPost id called once in each payment method call. -// * -// * @dataProvider transactionCodeProvider -// * @test -// * -// * @param $method -// * @param $parameters -// */ -// public function verifySendPostIsCalledOnceInEachPaymentMethodCall($method, $parameters) -// { -// call_user_func([$this->paymentObject, $method], $parameters); -// -// /** @var InstanceProxy $adapter */ -// $adapter = $this->getAdapterMock(); -// $adapter->verifyInvokedOnce('sendPost'); -// } + /** + * Verify sendPost id called once in each payment method call. + * + * @dataProvider transactionCodeProvider + * @test + * + * @param $method + * @param $parameters + */ + public function verifySendPostIsCalledOnceInEachPaymentMethodCall($method, $parameters) + { + call_user_func([$this->paymentObject, $method], $parameters); + + /** @var InstanceProxy $adapter */ + $adapter = $this->getAdapterMock(); + $adapter->verifyInvokedOnce('sendPost'); + } // @@ -204,7 +204,7 @@ public function registrationParametersShouldBeSetUpAsExpected() // this is done to avoid syntax warnings $object = $this->paymentObject; - + $expected = [ 'ACCOUNT.HOLDER' => $this->holder, @@ -338,7 +338,7 @@ public function authorizeOnRegistrationParametersShouldBeSetUpAsExpected() // this is done to avoid syntax warnings $object = $this->paymentObject; - + $expected = [ 'ADDRESS.CITY' => $city, 'ADDRESS.COUNTRY' => $country, @@ -400,7 +400,7 @@ public function debitParametersShouldBeSetUpAsExpected() // this is done to avoid syntax warnings $object = $this->paymentObject; - + $expected = [ 'ACCOUNT.HOLDER' => $this->holder, 'ACCOUNT.IBAN' => $this->iban, @@ -467,7 +467,7 @@ public function debitOnRegistrationParametersShouldBeSetUpAsExpected() // this is done to avoid syntax warnings $object = $this->paymentObject; - + $expected = [ 'ADDRESS.CITY' => $city, 'ADDRESS.COUNTRY' => $country, @@ -528,7 +528,7 @@ public function refundParametersShouldBeSetUpAsExpected() // this is done to avoid syntax warnings $object = $this->paymentObject; - + $expected = [ 'ADDRESS.CITY' => $city, 'ADDRESS.COUNTRY' => $country, @@ -589,7 +589,7 @@ public function reversalParametersShouldBeSetUpAsExpected() // this is done to avoid syntax warnings $object = $this->paymentObject; - + $expected = [ 'ADDRESS.CITY' => $city, 'ADDRESS.COUNTRY' => $country, @@ -650,7 +650,7 @@ public function rebillParametersShouldBeSetUpAsExpected() // this is done to avoid syntax warnings $object = $this->paymentObject; - + $expected = [ 'ADDRESS.CITY' => $city, 'ADDRESS.COUNTRY' => $country, @@ -711,7 +711,7 @@ public function captureParametersShouldBeSetUpAsExpected() // this is done to avoid syntax warnings $object = $this->paymentObject; - + $expected = [ 'ADDRESS.CITY' => $city, 'ADDRESS.COUNTRY' => $country, diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php new file mode 100644 index 0000000..391221e --- /dev/null +++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php @@ -0,0 +1,153 @@ + + + /** + * Account holder + * + * @var string $holder + */ + protected $holder = 'Heidel Berger-Payment'; + + /** + * Transaction currency + * + * @var string $currency + */ + protected $currency = 'EUR'; + + /** + * Secret + * + * The secret will be used to generate a hash using + * transaction id + secret. This hash can be used to + * verify the the payment response. Can be used for + * brute force protection. + * + * @var string $secret + */ + protected $secret = 'Heidelpay-PhpPaymentApi'; + + // + + // + + /** + * Set up function will create a payment method object for each test case + */ + // @codingStandardsIgnoreStart + public function _before() + { + // @codingStandardsIgnoreEnd + $this->authentication->setTransactionChannel('31HA07BC8142C5A171744F3D6D155865'); + + $paymentObject = new SantanderHirePurchasePaymentMethod(); + $paymentObject->getRequest()->authentification(...$this->authentication->getAuthenticationArray()); + $paymentObject->getRequest()->customerAddress(...$this->customerData->getCustomerDataArray()); + $paymentObject->dryRun = false; + + $this->paymentObject = $paymentObject; + + $this->mockCurlAdapter(); + } + + /** + * Tear down function will remove all registered test doubles (i.e. Mocks) + */ + // @codingStandardsIgnoreStart + public function _after() + { + // @codingStandardsIgnoreEnd + $this->paymentObject = null; + test::clean(); + } + + // + + // + + /** + * Verify initialize parameters generated as expected + * + * @test + */ + public function initializeParametersShouldBeSetUpAsExpected() + { + $timestamp = 'EasyCreditPaymentMethodTest::initializeParametersShouldBeSetUpAsExpected 2017-11-23 11:41:54'; + $this->paymentObject->getRequest()->basketData($timestamp, self::TEST_AMOUNT, $this->currency, $this->secret); + + $this->paymentObject->initialize(); + + list($firstName, $lastName, , $shopperId, $street, $state, $zip, $city, $country, $email) = + $this->customerData->getCustomerDataArray(); + + list($securitySender, $userLogin, $userPassword, $transactionChannel, ) = + $this->authentication->getAuthenticationArray(); + + // this is done to avoid syntax warnings + $object = $this->paymentObject; + + $expected = [ + 'ACCOUNT.BRAND' => Brand::SANTANDER_HP, + 'ADDRESS.CITY' => $city, + 'ADDRESS.COUNTRY' => $country, + 'ADDRESS.STATE' => $state, + 'ADDRESS.STREET' => $street, + 'ADDRESS.ZIP' => $zip, + 'CONTACT.EMAIL' => $email, + 'CRITERION.PAYMENT_METHOD' => $object::getClassName(), + 'CRITERION.SECRET' => '8263dc9e31b5754332aa23752b0044f4f6ab716ca9ec8d94a1b74ac19d2c5b822d3b' . + '1a0d8106c93cd02f2f5654d54c510444e310576e5559e3926fbdab0af02b', + 'CRITERION.SDK_NAME' => 'Heidelpay\\PhpPaymentApi', + 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION, + 'FRONTEND.ENABLED' => 'TRUE', + 'FRONTEND.MODE' => 'WHITELABEL', + 'IDENTIFICATION.SHOPPERID' => $shopperId, + 'IDENTIFICATION.TRANSACTIONID' => $timestamp, + 'NAME.GIVEN' => $firstName, + 'NAME.FAMILY' => $lastName, + 'PAYMENT.CODE' => self::PAYMENT_METHOD_SHORT . '.' . TransactionType::INITIALIZE, + 'PRESENTATION.AMOUNT' => self::TEST_AMOUNT, + 'PRESENTATION.CURRENCY' => $this->currency, + 'REQUEST.VERSION' => '1.0', + 'SECURITY.SENDER' => $securitySender, + 'TRANSACTION.CHANNEL' => $transactionChannel, + 'TRANSACTION.MODE' => TransactionMode::CONNECTOR_TEST, + 'USER.LOGIN' => $userLogin, + 'USER.PWD' => $userPassword, + ]; + + $this->assertThat($this->paymentObject->getRequest()->toArray(), $this->arraysMatchExactly($expected)); + } + + // +} diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PushTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PushTest.php index 75f01db..e0f7ac1 100644 --- a/vendor/heidelpay/php-payment-api/tests/unit/PushTest.php +++ b/vendor/heidelpay/php-payment-api/tests/unit/PushTest.php @@ -2,10 +2,11 @@ namespace Heidelpay\Tests\PhpPaymentApi\Unit; +use Codeception\TestCase\Test; use Heidelpay\PhpPaymentApi\Constants\PaymentMethod; use Heidelpay\PhpPaymentApi\Constants\ProcessingResult; -use Heidelpay\PhpPaymentApi\Constants\TransactionMode; use Heidelpay\PhpPaymentApi\Constants\StatusCode; +use Heidelpay\PhpPaymentApi\Constants\TransactionMode; use Heidelpay\PhpPaymentApi\Constants\TransactionType; use Heidelpay\PhpPaymentApi\Exceptions\XmlResponseParserException; use Heidelpay\PhpPaymentApi\Push; @@ -14,7 +15,6 @@ use Heidelpay\PhpPaymentApi\PushMapping\Payment; use Heidelpay\PhpPaymentApi\PushMapping\Processing; use Heidelpay\PhpPaymentApi\Response; -use Codeception\TestCase\Test; use SimpleXMLElement; /** @@ -80,6 +80,20 @@ class PushTest extends Test */ protected $xmlInvalidResponse; + /** + * Example response that covers company properties + * + * @var string + */ + protected $xmlSampleCompanyResponse; + + /** + * Example response that contains properties relevant for factoring + * + * @var string + */ + protected $xmlFactoringResponse; + /** * Sets up the fixture, for example, open a network connection. */ @@ -93,6 +107,8 @@ public function _before() $this->setSampleIvRcResponse(); $this->setSamplePpPaResponse(); $this->setSampleInvalidResponse(); + $this->setSampleCompanyResponse(); + $this->setSampleFactoringResponse(); } /** @@ -448,6 +464,82 @@ public function hasValidMappedPpPaProperties() ); } + /** + * @test + * + * @throws XmlResponseParserException + */ + public function hasValidMappedCompanyProperties() + { + $push = new Push($this->xmlSampleCompanyResponse); + $response = $push->getResponse(); + + if (!($response instanceof Response)) { + throw new \RuntimeException('Response is not set!'); + } + + $company = $response->getCompany(); + $this->assertEquals('heidelpay GmbH', $company->companyname); + $this->assertEquals('REGISTERED', $company->registrationtype); + $this->assertEquals('123456789', $company->commercialregisternumber); + $this->assertEquals('123456', $company->vatid); + $this->assertEquals('AIR_TRANSPORT', $company->commercialsector); + + $this->assertEquals(null, $company->getLocation()->pobox); + $this->assertEquals('Vangerowstr. 18', $company->getLocation()->street); + $this->assertEquals('69115', $company->getLocation()->zip); + $this->assertEquals('Heidelberg', $company->getLocation()->city); + $this->assertEquals('DE', $company->getLocation()->country); + + $executive = $company->getExecutive(); + $this->assertEquals('Testkäufer', $executive[0]->given); + $this->assertEquals('Händler', $executive[0]->family); + $this->assertEquals('1988-12-12', $executive[0]->birthdate); + $this->assertEquals('062216471400', $executive[0]->phone); + $this->assertEquals('example@email.de', $executive[0]->email); + $this->assertEquals('OWNER', $executive[0]->function); + + $this->assertEquals('Vangerowstr. 18', $executive[0]->getHome()->street); + $this->assertEquals('69115', $executive[0]->getHome()->zip); + $this->assertEquals('Heidelberg', $executive[0]->getHome()->city); + $this->assertEquals('DE', $executive[0]->getHome()->country); + + + $this->assertEquals('Testkäufer-2', $executive[1]->given); + $this->assertEquals('Händler-2', $executive[1]->family); + $this->assertEquals('1988-02-02', $executive[1]->birthdate); + $this->assertEquals('062216471400', $executive[1]->phone); + $this->assertEquals('example@email.de', $executive[1]->email); + $this->assertEquals(null, $executive[1]->function); + + $this->assertEquals(null, $executive[1]->getHome()->street); + $this->assertEquals(null, $executive[1]->getHome()->zip); + $this->assertEquals(null, $executive[1]->getHome()->city); + $this->assertEquals(null, $executive[1]->getHome()->country); + + $this->assertNotNull($executive[2]); + + codecept_debug('response: ' . print_r($response, 1)); + } + + /** + * @test + */ + public function hasValidMappedFactoringProperties() + { + $push = new Push($this->xmlFactoringResponse); + $response = $push->getResponse(); + + + $this->assertEquals('1', $response->getIdentification()->getShopperId()); + $this->assertEquals('123456', $response->getIdentification()->getInvoiceid()); + $this->assertEquals('CANCEL', $response->getPayment()->getReversaltype()); + + if (!($response instanceof Response)) { + throw new \RuntimeException('Response is not set!'); + } + } + /** * @test */ @@ -889,6 +981,81 @@ private function setSampleInvalidResponse() +XML; + } + + private function setSampleCompanyResponse() + { + $this->xmlSampleCompanyResponse = << + + + + B2B + + heidelpay GmbH + + Vangerowstr. 18 + 69115 + Heidelberg + DE + + REGISTERED + 123456789 + 123456 + + Testkäufer + Händler + 1988-12-12 + 062216471400 + example@email.de + OWNER + + Vangerowstr. 18 + 69115 + Heidelberg + DE + + + + Testkäufer-2 + Händler-2 + 1988-02-02 + 062216471400 + example@email.de + + + + + + + + AIR_TRANSPORT + + + + +XML; + } + + public function setSampleFactoringResponse() + { + $this->xmlFactoringResponse = << + + + + 1 + 123456 + + + CANCEL + + + XML; } } diff --git a/vendor/heidelpay/php-payment-api/tests/unit/RequestTest.php b/vendor/heidelpay/php-payment-api/tests/unit/RequestTest.php index e4d436a..f1a4eb7 100644 --- a/vendor/heidelpay/php-payment-api/tests/unit/RequestTest.php +++ b/vendor/heidelpay/php-payment-api/tests/unit/RequestTest.php @@ -2,12 +2,14 @@ namespace Heidelpay\Tests\PhpPaymentApi\Unit; +use AspectMock\Test as aspectMockTest; use Codeception\TestCase\Test; +use Heidelpay\PhpPaymentApi\Constants\ApiConfig; +use Heidelpay\PhpPaymentApi\Constants\FrontendMode; use Heidelpay\PhpPaymentApi\Constants\TransactionMode; use Heidelpay\PhpPaymentApi\Exceptions\JsonParserException; -use Heidelpay\PhpPaymentApi\Request; use Heidelpay\PhpPaymentApi\ParameterGroups\CriterionParameterGroup; -use AspectMock\Test as aspectMockTest; +use Heidelpay\PhpPaymentApi\Request; /** * @@ -164,7 +166,7 @@ public function compareToArrayWithInputArray() $referenceVars = array( 'CRITERION.SECRET' => '209022666cd4706e5f451067592b6be1aff4a913d5bb7f8249f7418ee25c91b318ebac66f41a6692539c8923adfdad6aae26138b1b3a7e37a197ab952be57876', 'FRONTEND.ENABLED' => 'TRUE', - 'FRONTEND.MODE' => 'WHITELABEL', + 'FRONTEND.MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL, 'IDENTIFICATION.TRANSACTIONID' => '2843294932', 'PRESENTATION.AMOUNT' => 23.12, 'PRESENTATION.CURRENCY' => 'EUR', @@ -177,6 +179,50 @@ public function compareToArrayWithInputArray() $this->assertEquals($referenceVars, $request->toArray()); } + /** + * @dataProvider FactoringParameterShouldBeSetAsExpectedDataProvider + * @test + * + * @param mixed $invoiceId + * @param mixed $shopperId + * @param mixed $expectedInvoiceId + * @param mixed $expectedShopperId + */ + public function FactoringParameterShouldBeSetAsExpected($invoiceId, $shopperId, $expectedInvoiceId, $expectedShopperId) + { + $request = new Request(); + + $request->getIdentification()->setShopperid('OriginalShopperId'); + $request->getIdentification()->setInvoiceid('OriginalInvoiceId'); + + if ($shopperId) { + $request->factoring($invoiceId, $shopperId); + } else { + $request->factoring($invoiceId); + } + + $expectedRequestVars = [ + 'CRITERION.SDK_NAME' => 'Heidelpay\PhpPaymentApi', + 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION, + 'FRONTEND.ENABLED' => 'TRUE', + 'FRONTEND.MODE' => 'WHITELABEL', + 'IDENTIFICATION.INVOICEID' => $expectedInvoiceId, + 'IDENTIFICATION.SHOPPERID' => $expectedShopperId, + 'REQUEST.VERSION' => '1.0', + 'TRANSACTION.MODE' => 'CONNECTOR_TEST', + ]; + + $this->assertEquals($expectedRequestVars, $request->toArray()); + } + + public function FactoringParameterShouldBeSetAsExpectedDataProvider() + { + return [ + 'shopperid null' => ['invoice01', null, 'invoice01', 'OriginalShopperId'], + 'shopperid set separately' => ['invoice01', 'shopper01', 'invoice01', 'shopper01'], + ]; + } + /** * Basket parameter group getter test * diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ResponseTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ResponseTest.php index 9f10c1c..ce5af66 100644 --- a/vendor/heidelpay/php-payment-api/tests/unit/ResponseTest.php +++ b/vendor/heidelpay/php-payment-api/tests/unit/ResponseTest.php @@ -11,6 +11,7 @@ use Heidelpay\PhpPaymentApi\Exceptions\HashVerificationException; use Heidelpay\PhpPaymentApi\Constants\TransactionMode; use Heidelpay\PhpPaymentApi\Constants\ProcessingResult; +use Heidelpay\PhpPaymentApi\Constants\FrontendMode; /** * @@ -86,7 +87,7 @@ public function _before() 'IDENTIFICATION_SHOPPERID' => '12344', 'PROCESSING_RETURN_CODE' => '000.100.112', 'PROCESSING_RESULT' => ProcessingResult::ACK, - 'FRONTEND_MODE' => 'WHITELABEL', + 'FRONTEND_MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL, 'IDENTIFICATION_UNIQUEID' => '31HA07BC8108A9126F199F2784552637', 'CRITERION_SECRET' => '209022666cd4706e5f451067592b6be1aff4a913d5bb7f8249f7418ee25c91b3' . '18ebac66f41a6692539c8923adfdad6aae26138b1b3a7e37a197ab952be57876', @@ -104,15 +105,17 @@ public function _before() 'FRONTEND_LANGUAGE' => 'DE', 'PAYMENT_CODE' => PaymentMethod::CREDIT_CARD . '.' . TransactionType::REGISTRATION, 'BASKET_ID' => '31HA07BC8129FBB819367B2205CD6FB4', - 'RISKINFORMATION_SINCE' => '2017-01-01', - 'RISKINFORMATION_ORDERCOUNT' => '5', - 'RISKINFORMATION_GUESTCHECKOUT' => 'FALSE', + 'RISKINFORMATION_CUSTOMERSINCE' => '2017-01-01', + 'RISKINFORMATION_CUSTOMERORDERCOUNT' => '5', + 'RISKINFORMATION_CUSTOMERGUESTCHECKOUT' => 'FALSE', 'CONNECTOR_ACCOUNT_HOLDER' => 'Test Account Holder', 'CRITERION_TEST_VALUE' => 'Test Value', 'INVALID_PROP' => 'Invalid', 'lang' => 'de' ); + ksort($this->responseArray); + $this->responseObject = new Response($this->responseArray); } @@ -444,4 +447,84 @@ public function staticFromPostMethodShouldReturnNewResponseInstanceOnEmptyArray( $reponse = Response::fromPost([]); $this->assertEquals(Response::class, get_class($reponse)); } + + /** + * Assert the object is being updated with the given rawResponseParameters and then returned. + * + * @test + */ + public function splitArrayShouldUpdateAndReturnTheResponseObjectUsingTheGivenResponseArray() + { + $this->compareResponseArrayToActualArray($this->responseArray); + + // change all parameters of the response + $manipulatedResponseArray = $this->getManipulatedArray(); + $this->responseObject->splitArray($manipulatedResponseArray); + + $this->compareResponseArrayToActualArray($manipulatedResponseArray); + } + + /** + * Return a response array with manipulated values. + * + * @return array + */ + private function getManipulatedArray() + { + $manipulatedResponseArray = []; + + foreach ($this->responseArray as $key => $item) { + switch (true) { + case is_float($item): + $item = 123.45; + break; + case is_bool($item): + $item = !$item; + break; + case is_string($item): + if ($key !== 'FRONTEND_MODE') { + $item .= '--' . $key; + } + break; + default: + // do nothing + break; + } + + $manipulatedResponseArray[$key] = $item; + } + + return $manipulatedResponseArray; + } + + /** + * Replaces the underscore of the raw response with a period to make it comparable. + * + * @return array + */ + private function getComparableArray(array $responseArray = []) + { + $comparableResponseArray = []; + foreach ($responseArray as $key => $item) { + $comparableResponseArray[preg_replace('/_/', '.', $key, 1)] = $item; + } + return $comparableResponseArray; + } + + /** + * Compares a given rawResponse with the properties of the response object by converting it back into an array. + * + * @param $responseArray + */ + private function compareResponseArrayToActualArray($responseArray) + { + $comparableResponseArray = $this->getComparableArray($responseArray); + $responseObjectArray = $this->responseObject->toArray(true); + + foreach ($comparableResponseArray as $key => $item) { + if (array_key_exists($key, $responseObjectArray)) { + $this->assertEquals($comparableResponseArray[$key], $responseObjectArray[$key]); + } + } + } } From 3e071600d36ed2b8e45f4ad859b1271433ff3aa9 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Tue, 19 Nov 2019 14:29:31 +0100 Subject: [PATCH 03/59] [Refactor] update phpDocs --- .../abstract-wc-heidelpay-payment-gateway.php | 2 +- .../gateways/class-wc-heidelpay-gateway-cc.php | 1 - .../trait-wc-heidelpay-subscription-gateway.php | 15 ++++++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index e82cb2f..2e8e9c0 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -465,7 +465,7 @@ protected function getErrorMessage(Response $response = null) } /** - * Funktion to log Events as a notice. It has a prefix to identify that the log entry is from heidelpay and which + * Function to log Events as a notice. It adds a context to identify that the log entry is from heidelpay and which * function has created it. * @param string|array $logData */ diff --git a/includes/gateways/class-wc-heidelpay-gateway-cc.php b/includes/gateways/class-wc-heidelpay-gateway-cc.php index d0ce2eb..e876ccb 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-cc.php +++ b/includes/gateways/class-wc-heidelpay-gateway-cc.php @@ -50,7 +50,6 @@ public function init_form_fields() */ public function setPayMethod() { - /** @var \Heidelpay\PhpPaymentApi\PaymentMethods\CreditCardPaymentMethod payMethod */ $this->payMethod = new CreditCardPaymentMethod(); $this->id = 'hp_cc'; $this->name = __('Credit Card', 'woocommerce-heidelpay'); diff --git a/includes/traits/trait-wc-heidelpay-subscription-gateway.php b/includes/traits/trait-wc-heidelpay-subscription-gateway.php index 9a55a92..7068d65 100644 --- a/includes/traits/trait-wc-heidelpay-subscription-gateway.php +++ b/includes/traits/trait-wc-heidelpay-subscription-gateway.php @@ -17,6 +17,9 @@ trait WC_Heidelpay_Subscription_Gateway { + /** + * constructor for subscription support + */ public function constructorAddon() { if (class_exists('WC_Subscriptions_Order')) { @@ -36,6 +39,9 @@ public function constructorAddon() } } + /** + * additional formfields for admin backend + */ public function initFormFieldsAddon() { if (class_exists('WC_Subscriptions_Order')) { @@ -52,7 +58,7 @@ public function initFormFieldsAddon() * @param $amount float * @param $renewalOrder WC_Order * @return array|null - * @throws \Heidelpay\PhpPaymentApi\Exceptions\PaymentFormUrlException + * @throws Exception */ public function scheduledSubscriptionPayment($amount, $renewalOrder) { @@ -69,14 +75,17 @@ public function scheduledSubscriptionPayment($amount, $renewalOrder) return null; } - /** @var \Heidelpay\PhpPaymentApi\Response $response */ + /** @var Response $response */ $response = $this->payMethod->getResponse(); if ($this->payMethod->getResponse()->isSuccess()) { $renewalOrder->payment_complete($response->getIdentification()->getShortId()); } if ($this->payMethod->getResponse()->isError()) { - wc_get_logger()->log(WC_Log_Levels::DEBUG, print_r($this->payMethod->getResponse()->getError(), 1)); + wc_get_logger()->error( + print_r($this->payMethod->getResponse()->getError(), 1), + array('source' => 'heidelpay') + ); } return null; } From d1382676e5dcecdfc08dfe15f98a42b2667f67ca Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Tue, 19 Nov 2019 14:31:02 +0100 Subject: [PATCH 04/59] [Feature] Add context to logger to generate heidelpay logfiles --- .../abstract-wc-heidelpay-iframe-gateway.php | 6 ++-- .../abstract-wc-heidelpay-payment-gateway.php | 33 ++++++++++++------- includes/class-wc-heidelpay-push.php | 9 +++-- includes/class-wc-heidelpay-response.php | 7 ++-- ...rait-wc-heidelpay-subscription-gateway.php | 2 +- 5 files changed, 36 insertions(+), 21 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php b/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php index ca6223a..983862c 100644 --- a/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php @@ -174,8 +174,7 @@ protected function getIFrame(WC_Order $order) $this->addPaymentError($this->getErrorMessage()); wc_print_notices(); - wc_get_logger()->log( - WC_Log_Levels::ERROR, + wc_get_logger()->error( htmlspecialchars( print_r( $this->plugin_id . ' - ' . $this->id . __( @@ -184,7 +183,8 @@ protected function getIFrame(WC_Order $order) ) . $bookingAction, 1 ) - ) + ), + array('source' => 'heidelpay') ); return null; } diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 2e8e9c0..2eb3e07 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -36,10 +36,7 @@ abstract class WC_Heidelpay_Payment_Gateway extends WC_Payment_Gateway * @var string $bookingAction */ public $bookingAction; - - /** - * @var string $name - */ + public $wcLogger; protected $name; /** @@ -49,6 +46,7 @@ abstract class WC_Heidelpay_Payment_Gateway extends WC_Payment_Gateway public function __construct() { + $this->wcLogger = wc_get_logger(); $this->has_fields = false; $this->bookingAction = 'debit'; $this->messageMapper = new MessageCodeMapper(get_locale()); @@ -360,7 +358,10 @@ public function performRequest($order, $uid = null) try { $this->handleFormPost($_POST); } catch (\Exception $e) { - wc_get_logger()->log(WC_Log_Levels::DEBUG, htmlspecialchars(print_r($e->getMessage(), 1))); + $this->wcLogger->debug( + htmlspecialchars(print_r($e->getMessage(), 1)), + array('source' => 'heidelpay') + ); return null; } } @@ -376,7 +377,10 @@ public function performRequest($order, $uid = null) try { $this->payMethod->$action($uid); } catch (Exception $e) { - wc_get_logger()->log(WC_Log_Levels::DEBUG, htmlspecialchars(print_r($e->getMessage(), 1))); + $this->wcLogger->debug( + htmlspecialchars(print_r($e->getMessage(), 1)), + array('source' => 'heidelpay') + ); $this->addPaymentError($this->getErrorMessage()); @@ -398,8 +402,7 @@ public function performRequest($order, $uid = null) } else { $this->addPaymentError($this->getErrorMessage()); - wc_get_logger()->log( - WC_Log_Levels::ERROR, + $this->wcLogger->error( htmlspecialchars( print_r( $this->plugin_id . ' - ' . $this->id . __( @@ -408,7 +411,8 @@ public function performRequest($order, $uid = null) ) . $this->bookingAction, 1 ) - ) + ), + array('source' => 'heidelpay') ); return null; @@ -472,8 +476,10 @@ protected function getErrorMessage(Response $response = null) protected function paymentLog($logData) { $callers = debug_backtrace(); - wc_get_logger()->log(WC_Log_Levels::NOTICE, print_r('heidelpay - ' . - $callers [1] ['function'] . ': ' . print_r($logData, 1), 1)); + $this->wcLogger->notice( + print_r($callers[1]['function'] . ': ' . print_r($logData, 1), 1), + array('source' => 'heidelpay') + ); } /** @@ -500,7 +506,10 @@ public function performAfterRegistrationRequest($order, $uid) try { $this->payMethod->debitOnRegistration($uid); } catch (Exception $e) { - wc_get_logger()->log(WC_Log_Levels::DEBUG, htmlspecialchars(print_r($e->getMessage(), 1))); + $this->wcLogger->debug( + htmlspecialchars(print_r($e->getMessage(), 1)), + array('source' => 'heidelpay') + ); $this->addPaymentError($this->getErrorMessage()); } diff --git a/includes/class-wc-heidelpay-push.php b/includes/class-wc-heidelpay-push.php index 9629d16..cbf8198 100644 --- a/includes/class-wc-heidelpay-push.php +++ b/includes/class-wc-heidelpay-push.php @@ -45,9 +45,12 @@ public function init($rawPayload, $secret) $response->verifySecurityHash($secret, $response->getIdentification()->getTransactionId()); } catch (\Exception $e) { $callers = debug_backtrace(); - wc_get_logger()->log(WC_Log_Levels::NOTICE, print_r('Heidelpay - ' . + wc_get_logger()->notice( + print_r('Heidelpay - ' . $callers [0] ['function'] . ': Invalid push hash from ' . - $_SERVER ['REMOTE_ADDR'] . ', suspecting manipulation', 1)); + $_SERVER ['REMOTE_ADDR'] . ', suspecting manipulation', 1), + array('source' => 'heidelpay') + ); exit(); //error } $this->handlePush($response); @@ -62,7 +65,7 @@ public function handlePush($response) $order = wc_get_order($orderID); $payCode = explode('.', strtoupper($response->getPayment()->getCode())); - wc_get_logger()->log(WC_Log_Levels::DEBUG, $order->get_status()); + wc_get_logger()->debug($order->get_status(), array('source' => 'heidelpay')); if ($payCode[0] === 'IV') { if ($response->isSuccess()) { diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index 2e6210b..5698af5 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -48,9 +48,12 @@ public function init(array $post_data, $secret) self::$response->verifySecurityHash($secret, $identificationTransactionId); } catch (\Exception $exception) { $callers = debug_backtrace(); - wc_get_logger()->log(WC_Log_Levels::NOTICE, print_r("Heidelpay - " . + wc_get_logger()->notice( + print_r("Heidelpay - " . $callers [0] ['function'] . ": Invalid response hash from " . - $_SERVER ['REMOTE_ADDR'] . ", suspecting manipulation", 1)); + $_SERVER ['REMOTE_ADDR'] . ", suspecting manipulation", 1), + array('source' => 'heidelpay') + ); exit(); //error } diff --git a/includes/traits/trait-wc-heidelpay-subscription-gateway.php b/includes/traits/trait-wc-heidelpay-subscription-gateway.php index 7068d65..cd145da 100644 --- a/includes/traits/trait-wc-heidelpay-subscription-gateway.php +++ b/includes/traits/trait-wc-heidelpay-subscription-gateway.php @@ -71,7 +71,7 @@ public function scheduledSubscriptionPayment($amount, $renewalOrder) try { $this->payMethod->debitOnRegistration($order->get_meta('heidelpay-Registration')); } catch (Exception $e) { - wc_get_logger()->log(WC_Log_Levels::DEBUG, $e); + wc_get_logger()->error($e, array('source' => 'heidelpay')); return null; } From c6eed2a5ee00a7abe48642e2d5197c39305c144b Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Tue, 19 Nov 2019 14:31:45 +0100 Subject: [PATCH 05/59] [Feature] Add Subscriptions Support to change amount and date --- includes/traits/trait-wc-heidelpay-subscription-gateway.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/traits/trait-wc-heidelpay-subscription-gateway.php b/includes/traits/trait-wc-heidelpay-subscription-gateway.php index cd145da..1ebab14 100644 --- a/includes/traits/trait-wc-heidelpay-subscription-gateway.php +++ b/includes/traits/trait-wc-heidelpay-subscription-gateway.php @@ -28,6 +28,8 @@ public function constructorAddon() 'subscription_cancellation', 'subscription_suspension', 'subscription_reactivation', + 'subscription_amount_changes', + 'subscription_date_changes' ); add_action( From 9ea34325619e5d728214c5e9294d27acc726328a Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Tue, 19 Nov 2019 14:31:53 +0100 Subject: [PATCH 06/59] [Version] Change Version --- woocommerce-heidelpay.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/woocommerce-heidelpay.php b/woocommerce-heidelpay.php index 2798886..2889fc9 100644 --- a/woocommerce-heidelpay.php +++ b/woocommerce-heidelpay.php @@ -10,7 +10,7 @@ * Plugin Name: heidelpay WooCommerce * Plugin URI: https://dev.heidelpay.com * Description: heidelpay payment integration for WooCommerce - * Version: 1.6.0 + * Version: 1.7.0 * Author: heidelpay * Author URI: htts://www.heidelpay.com * Developer: heidelpay @@ -29,7 +29,7 @@ /** * Required minimums and constants */ - define('WC_HEIDELPAY_VERSION', '1.6.0'); + define('WC_HEIDELPAY_VERSION', '1.7.0'); define('WC_HEIDELPAY_MIN_PHP_VER', '5.6.0'); define('WC_HEIDELPAY_MIN_WC_VER', '3.0.0'); define('WC_HEIDELPAY_MAIN_FILE', __FILE__); @@ -40,7 +40,6 @@ class WC_Heidelpay { - /** * @var Singleton The reference the *Singleton* instance of this class */ From dc422e55eb7bf2d15dbe9314f3db02725f6788d3 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Tue, 19 Nov 2019 15:43:10 +0100 Subject: [PATCH 07/59] [Change] update Changelog --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da6cc24..acdfb19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Release Notes - heidelpay Payment Gateway for WooCommerce +## [1.7.0][1.7.0] + +### Added: +- Logging uses context to generate a heidelpay logfile +- Subscription now supports configuration to change amount and date + ## [1.6.0][1.6.0] ### Added: @@ -83,4 +89,5 @@ [1.3.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.2.0..1.3.0 [1.4.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.3.0..1.4.0 [1.5.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.4.0..1.5.0 -[1.6.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.5.0..1.6.0 \ No newline at end of file +[1.6.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.5.0..1.6.0 +[1.7.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.6.0..1.7.0 \ No newline at end of file From 73b65d973f2918ff036d1060c3be0912e0327908 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Mon, 2 Dec 2019 11:41:30 +0100 Subject: [PATCH 08/59] [Review] change mail attribute to role attribute --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d146dc1..0f57e3d 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "authors": [ { "name": "Daniel Kraut", - "email": "Developer" + "role": "Developer" }, { "name": "Florian Evertz", From 15fc5a6a54c8dd5d414c6224eb572c4efa369901 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Mon, 2 Dec 2019 11:45:08 +0100 Subject: [PATCH 09/59] [Review] add phpDoc to fields --- includes/abstracts/abstract-wc-heidelpay-payment-gateway.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 2eb3e07..5a362e4 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -36,7 +36,11 @@ abstract class WC_Heidelpay_Payment_Gateway extends WC_Payment_Gateway * @var string $bookingAction */ public $bookingAction; + + /** @var WC_Logger $wcLogger */ public $wcLogger; + + /** @var string $name */ protected $name; /** From d6ef671adc9107ac28fe098e9b72094c520bbffe Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Mon, 2 Dec 2019 11:56:05 +0100 Subject: [PATCH 10/59] [Review] update Changelog.md --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index acdfb19..56f2092 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,10 @@ ## [1.7.0][1.7.0] ### Added: -- Logging uses context to generate a heidelpay logfile -- Subscription now supports configuration to change amount and date +- Use context to generate a dedicated heidelpay logfile +- Support for WooCommerce Subsciptions configuration + - Change amount of subscription + - Change date of subscription ## [1.6.0][1.6.0] From 14f6bb4d476c2457506b7db60245f8389fe6cc4d Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Tue, 14 Jan 2020 15:11:47 +0100 Subject: [PATCH 11/59] [fix] Display CreditorId in paymentInfo for direct debit when using subscription. --- includes/abstracts/abstract-wc-heidelpay-payment-gateway.php | 3 ++- includes/class-wc-heidelpay-response.php | 3 ++- includes/traits/trait-wc-heidelpay-subscription-gateway.php | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 5a362e4..40d82cf 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -493,7 +493,7 @@ protected function paymentLog($logData) */ public function performNoGuiRequest($order, $uid) { - $this->performAfterRegistrationRequest($order, $uid); + return $this->performAfterRegistrationRequest($order, $uid); } /** @@ -520,6 +520,7 @@ public function performAfterRegistrationRequest($order, $uid) if ($this->payMethod->getResponse()->isError()) { $order->set_status('on-hold'); } + return $this->payMethod->getResponse(); } } diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index 5698af5..6a95a2b 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -89,7 +89,8 @@ public function handleResult($post_data, WC_Order $order) $paymethod->prepareRequest($order); $paymethod->payMethod->getRequest()->getFrontend()->setEnabled('FALSE'); $paymethod->payMethod->getRequest()->getIdentification()->setReferenceid($uid); - $paymethod->performNoGuiRequest($order, $uid); + // Use the Response of the debitOnRegiststration in order to set the correct paymentInfo + self::$response = $paymethod->performNoGuiRequest($order, $uid); } // If no money has been payed yet. diff --git a/includes/traits/trait-wc-heidelpay-subscription-gateway.php b/includes/traits/trait-wc-heidelpay-subscription-gateway.php index 1ebab14..92d5d41 100644 --- a/includes/traits/trait-wc-heidelpay-subscription-gateway.php +++ b/includes/traits/trait-wc-heidelpay-subscription-gateway.php @@ -15,6 +15,10 @@ * @category WooCommerce */ +/** + * Trait WC_Heidelpay_Subscription_Gateway + * @property \Heidelpay\PhpPaymentApi\TransactionTypes\DebitOnRegistrationTransactionType payMethod + */ trait WC_Heidelpay_Subscription_Gateway { /** From e6ad8a4ac24384b7bd238664143ee1739421770a Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Tue, 14 Jan 2020 16:20:25 +0100 Subject: [PATCH 12/59] [refactor] Move setPaymentInfo method to gateway classes. --- .../abstract-wc-heidelpay-payment-gateway.php | 36 ++++++++++ includes/class-wc-heidelpay-response.php | 65 ++----------------- .../class-wc-heidelpay-gateway-dd.php | 1 + .../class-wc-heidelpay-gateway-iv.php | 1 + .../class-wc-heidelpay-gateway-ivpg.php | 1 + .../class-wc-heidelpay-gateway-pp.php | 1 + 6 files changed, 45 insertions(+), 60 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 40d82cf..68b43d1 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -27,6 +27,7 @@ abstract class WC_Heidelpay_Payment_Gateway extends WC_Payment_Gateway { + protected $templateTextKey = ''; /** * @var \Heidelpay\PhpPaymentApi\PaymentMethods\BasicPaymentMethodTrait $payMethod */ @@ -641,6 +642,41 @@ public function emailInstructions(WC_Order $order) } } + /** + * Add payment information to the order if available. + * Information usually are set for invoice, direct debit and prepayment. + * @param WC_Order $order + * @param Response $response + * @return null + */ + public function setPaymentInfo(WC_Order $order, Response $response) + { + // Load template text for Payment information + if ($this->templateTextKey === '') { + return null; + } + + $payInfoTemplate = __($this->templateTextKey, 'woocommerce-heidelpay'); + $payInfo = $response->getConnector(); + $presentation = $response->getPresentation(); + + $paymentData = [ + '{AMOUNT}' => $presentation->getAmount(), + '{CURRENCY}' => $presentation->getCurrency(), + '{CONNECTOR_ACCOUNT_HOLDER}' => $payInfo->getAccountHolder(), + '{CONNECTOR_ACCOUNT_IBAN}' => $payInfo->getAccountIBan(), + '{CONNECTOR_ACCOUNT_BIC}' => $payInfo->getAccountBic(), + '{IDENTIFICATION_SHORTID}' => $response->getIdentification()->getShortId(), + '{Iban}' => $response->getAccount()->getIban(), + '{Ident}' => $response->getAccount()->getIdentification(), + '{CreditorId}' => $response->getIdentification()->getCreditorId(), + ]; + + $paymentText = strtr($payInfoTemplate, $paymentData); + + $order->add_meta_data('heidelpay-paymentInfo', $paymentText); + } + /** * @return array Containing the option field to select booking mode in the admin menu. */ diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index 6a95a2b..6000202 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -79,13 +79,13 @@ public function handleResult($post_data, WC_Order $order) $payCode = explode('.', strtoupper($post_data['PAYMENT_CODE'])); $note = ''; - $this->setPaymentInfo($order); + $paymethod = 'WC_Gateway_'.strtoupper($order->get_payment_method()); + $paymethod = new $paymethod; // If registration, do a debit on registration afterwards if ($payCode[1] === 'RG' || $payCode[1] === 'CF') { $order->add_meta_data('heidelpay-Registration', $uid); - $paymethod = 'WC_Gateway_HP_' . $payCode[0]; - $paymethod = new $paymethod; + /** @var WC_Heidelpay_Payment_Gateway $paymethod */ $paymethod->prepareRequest($order); $paymethod->payMethod->getRequest()->getFrontend()->setEnabled('FALSE'); $paymethod->payMethod->getRequest()->getIdentification()->setReferenceid($uid); @@ -93,6 +93,8 @@ public function handleResult($post_data, WC_Order $order) self::$response = $paymethod->performNoGuiRequest($order, $uid); } + $paymethod->setPaymentInfo($order, self::$response); + // If no money has been payed yet. if ($payCode[0] !== 'IV' && $payCode[1] === 'PA') { // If not Prepayment and Invoice payment can be captured manually @@ -134,61 +136,4 @@ public function handleResult($post_data, WC_Order $order) echo $order->get_checkout_order_received_url(); } } - - /** - * Add payment information to the order if available. - * Information usually are set for invoice, direct debit and prepayment. - * @param WC_Order $order - * @return null - */ - public function setPaymentInfo(WC_Order $order) - { - // Load template text for Payment information - $payInfoTemplate = $this->getInfoTemplate(); - if ($payInfoTemplate === null) { - return null; - } - - $response = self::$response; - $payInfo = $response->getConnector(); - $presentation = $response->getPresentation(); - - $paymentData = array( - '{AMOUNT}' => $presentation->getAmount(), - '{CURRENCY}' => $presentation->getCurrency(), - '{CONNECTOR_ACCOUNT_HOLDER}' => $payInfo->getAccountHolder(), - '{CONNECTOR_ACCOUNT_IBAN}' => $payInfo->getAccountIBan(), - '{CONNECTOR_ACCOUNT_BIC}' => $payInfo->getAccountBic(), - '{IDENTIFICATION_SHORTID}' => self::$response->getIdentification()->getShortId(), - '{Iban}' => $response->getAccount()->getIban(), - '{Ident}' => $response->getAccount()->getIdentification(), - '{CreditorId}' => $response->getIdentification()->getCreditorId(), - ); - - $paymentText = strtr($payInfoTemplate, $paymentData); - - $order->add_meta_data('heidelpay-paymentInfo', $paymentText); - } - - /** - * Provide the template text for payment information. - * @return null|string - */ - public function getInfoTemplate() - { - $payCode = explode('.', self::$response->getPayment()->getCode()); - switch (strtoupper($payCode[0])) { - case 'IV': - return __('invoice_info', 'woocommerce-heidelpay'); - break; - case 'PP': - return __('prepayment_info', 'woocommerce-heidelpay'); - break; - case 'DD': - return __('direct_debit_info', 'woocommerce-heidelpay'); - break; - default: - return null; - } - } } diff --git a/includes/gateways/class-wc-heidelpay-gateway-dd.php b/includes/gateways/class-wc-heidelpay-gateway-dd.php index 87f8c27..e3002c2 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-dd.php +++ b/includes/gateways/class-wc-heidelpay-gateway-dd.php @@ -129,6 +129,7 @@ protected function setPayMethod() $this->id = 'hp_dd'; $this->has_fields = true; $this->name = __('Direct Debit', 'woocommerce-heidelpay'); + $this->templateTextKey = 'direct_debit_info'; } /** diff --git a/includes/gateways/class-wc-heidelpay-gateway-iv.php b/includes/gateways/class-wc-heidelpay-gateway-iv.php index a6ab632..f33fbc3 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-iv.php +++ b/includes/gateways/class-wc-heidelpay-gateway-iv.php @@ -58,6 +58,7 @@ public function init_form_fields() */ protected function setPayMethod() { + $this->templateTextKey = 'invoice_info'; $this->payMethod = new InvoicePaymentMethod(); $this->id = 'hp_iv'; $this->name = __('Invoice', 'woocommerce-heidelpay'); diff --git a/includes/gateways/class-wc-heidelpay-gateway-ivpg.php b/includes/gateways/class-wc-heidelpay-gateway-ivpg.php index 840e2dd..2401bd5 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-ivpg.php +++ b/includes/gateways/class-wc-heidelpay-gateway-ivpg.php @@ -297,6 +297,7 @@ protected function setPayMethod() $this->name = __('Secured Invoice', 'woocommerce-heidelpay'); $this->has_fields = true; $this->bookingAction = 'authorize'; + $this->templateTextKey = 'invoice_info'; } diff --git a/includes/gateways/class-wc-heidelpay-gateway-pp.php b/includes/gateways/class-wc-heidelpay-gateway-pp.php index 32eee16..cfd5f07 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-pp.php +++ b/includes/gateways/class-wc-heidelpay-gateway-pp.php @@ -82,5 +82,6 @@ protected function setPayMethod() $this->name = __('Prepayment', 'woocommerce-heidelpay'); $this->has_fields = false; $this->bookingAction = 'authorize'; + $this->templateTextKey = 'prepayment_info'; } } From bbbd8e92853ee4c4e11f36851b7e1e1fdc184ee9 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Tue, 14 Jan 2020 16:56:32 +0100 Subject: [PATCH 13/59] WOO-73 [change] Subscription: Add payment info to renewal orders. --- includes/traits/trait-wc-heidelpay-subscription-gateway.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/traits/trait-wc-heidelpay-subscription-gateway.php b/includes/traits/trait-wc-heidelpay-subscription-gateway.php index 92d5d41..909c9a1 100644 --- a/includes/traits/trait-wc-heidelpay-subscription-gateway.php +++ b/includes/traits/trait-wc-heidelpay-subscription-gateway.php @@ -15,6 +15,8 @@ * @category WooCommerce */ +use Heidelpay\PhpPaymentApi\Response; + /** * Trait WC_Heidelpay_Subscription_Gateway * @property \Heidelpay\PhpPaymentApi\TransactionTypes\DebitOnRegistrationTransactionType payMethod @@ -85,6 +87,7 @@ public function scheduledSubscriptionPayment($amount, $renewalOrder) $response = $this->payMethod->getResponse(); if ($this->payMethod->getResponse()->isSuccess()) { + parent::setPaymentInfo($renewalOrder, $response); $renewalOrder->payment_complete($response->getIdentification()->getShortId()); } if ($this->payMethod->getResponse()->isError()) { From b64946d962560830adc4774ab3863c3b83778c4d Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Tue, 14 Jan 2020 17:20:37 +0100 Subject: [PATCH 14/59] WOO-73 [change] update changelog. --- CHANGELOG.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56f2092..e5867ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,13 @@ ### Added: - Use context to generate a dedicated heidelpay logfile -- Support for WooCommerce Subsciptions configuration - - Change amount of subscription - - Change date of subscription +- WooCommerce Subscriptions + - Support for configuration + - Change amount of subscription + - Change date of subscription + - Direct debit: + - Add creditorId payment information + - Payment info text for subscription renewal orders. ## [1.6.0][1.6.0] From 2ecdccefc4159f16d1f10d15748dac3d1c33295d Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Thu, 16 Jan 2020 14:44:52 +0100 Subject: [PATCH 15/59] WOO-73 [refactor] Cleanup code: - Remove duplicate function. - Add check if response is null after sync request call. --- .../abstract-wc-heidelpay-iframe-gateway.php | 9 --------- .../abstract-wc-heidelpay-payment-gateway.php | 13 ++++++++----- includes/class-wc-heidelpay-response.php | 2 +- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php b/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php index 983862c..1dcd82b 100644 --- a/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php @@ -189,15 +189,6 @@ protected function getIFrame(WC_Order $order) return null; } - /** - * @param $order - * @param $uid - */ - public function performNoGuiRequest($order, $uid) - { - parent::performAfterRegistrationRequest($order, $uid); - } - /** * @return mixed|string */ diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 68b43d1..c19ede2 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -490,7 +490,7 @@ protected function paymentLog($logData) /** * @param $order * @param $uid - * @throws WC_Data_Exception + * @return Response */ public function performNoGuiRequest($order, $uid) { @@ -500,12 +500,12 @@ public function performNoGuiRequest($order, $uid) /** * @param WC_Order $order * @param $uid - * @throws WC_Data_Exception + * @return Response */ public function performAfterRegistrationRequest($order, $uid) { if (!empty($_POST)) { - $this->handleFormPost($_POST); + $this->handleFormPost(); } if ($order->get_meta('heidelpay-Registration') !== '') { try { @@ -523,6 +523,7 @@ public function performAfterRegistrationRequest($order, $uid) } return $this->payMethod->getResponse(); } + return null; } /** @@ -550,10 +551,12 @@ public function callback_handler() } else { // Add Error Msg, debug log and redirect to cart. $this->addPaymentError($this->getErrorMessage()); - wc_get_logger()->log(WC_Log_Levels::DEBUG, + wc_get_logger()->log( + WC_Log_Levels::DEBUG, 'heidelpay - Response: There has been an error fetching the RedirectURL by the payment. ' . 'Please make sure the ResponseURL (' . $this->getResponeUrl() .')is accessible from the internet.', - array('source' => 'heidelpay')); + array('source' => 'heidelpay') + ); wp_redirect(wc_get_cart_url()); } exit(); diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index 6000202..06042b0 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -90,7 +90,7 @@ public function handleResult($post_data, WC_Order $order) $paymethod->payMethod->getRequest()->getFrontend()->setEnabled('FALSE'); $paymethod->payMethod->getRequest()->getIdentification()->setReferenceid($uid); // Use the Response of the debitOnRegiststration in order to set the correct paymentInfo - self::$response = $paymethod->performNoGuiRequest($order, $uid); + self::$response = $paymethod->performNoGuiRequest($order, $uid)??self::$response; } $paymethod->setPaymentInfo($order, self::$response); From 59ec55f15f043250ae5599f0adf944438695d76f Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Thu, 16 Jan 2020 19:24:53 +0100 Subject: [PATCH 16/59] WOO-73 [fix] Make sure to use existing instance of payment gateway to avoid multiple execution of hooks. --- includes/class-wc-heidelpay-response.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index 06042b0..e203d52 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -79,8 +79,14 @@ public function handleResult($post_data, WC_Order $order) $payCode = explode('.', strtoupper($post_data['PAYMENT_CODE'])); $note = ''; - $paymethod = 'WC_Gateway_'.strtoupper($order->get_payment_method()); - $paymethod = new $paymethod; + $availableGateways = WC_Payment_Gateways::instance()->get_available_payment_gateways(); + + $paymentMethodId = $order->get_payment_method(); + if (empty($availableGateways[$paymentMethodId])) { + return; + } + /** @var WC_Payment_Gateways $paymethod */ + $paymethod = $availableGateways[$paymentMethodId]; // If registration, do a debit on registration afterwards if ($payCode[1] === 'RG' || $payCode[1] === 'CF') { From 0ea1ec655f9f380eabacc5b0d37408e161421915 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Fri, 17 Jan 2020 11:33:29 +0100 Subject: [PATCH 17/59] WOO-73 [refactor] Avoid use of null coalescing for compatibility reason. --- includes/class-wc-heidelpay-response.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index e203d52..f6872a7 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -96,7 +96,10 @@ public function handleResult($post_data, WC_Order $order) $paymethod->payMethod->getRequest()->getFrontend()->setEnabled('FALSE'); $paymethod->payMethod->getRequest()->getIdentification()->setReferenceid($uid); // Use the Response of the debitOnRegiststration in order to set the correct paymentInfo - self::$response = $paymethod->performNoGuiRequest($order, $uid)??self::$response; + $noGuiResponse = $paymethod->performNoGuiRequest($order, $uid); + if ($noGuiResponse !== null) { + self::$response = $noGuiResponse; + } } $paymethod->setPaymentInfo($order, self::$response); From 473b639130aed053f13e3162e827946195d7e536 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Thu, 23 Apr 2020 15:12:05 +0200 Subject: [PATCH 18/59] (WOO-89)[change] workaround for lazyloading --- assets/js/creditCardFrame.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/assets/js/creditCardFrame.js b/assets/js/creditCardFrame.js index 5311922..70545d1 100644 --- a/assets/js/creditCardFrame.js +++ b/assets/js/creditCardFrame.js @@ -52,7 +52,11 @@ function sendMessage(e) { /** * Get hostname and protocol from paymentIframe */ - var targetOrigin = getDomainFromUrl(paymentFrameIframe.src); + var source = paymentFrameIframe.getAttribute("src"); + if (source === null) { + source = paymentFrameIframe.getAttribute("data-src"); + } + var targetOrigin = getDomainFromUrl(source); /** * Send html postmessage to payment frame @@ -82,12 +86,14 @@ function receiveMessage(e) { /** * Get hostname and protocol from paymentIframe */ - - var targetOrigin = getDomainFromUrl(paymentFrameIframe.src); + var source = paymentFrameIframe.getAttribute("src"); + if (source === null) { + source = paymentFrameIframe.getAttribute("data-src"); + } + var targetOrigin = getDomainFromUrl(source); if (e.origin !== targetOrigin) { return; } var antwort = JSON.parse(e.data); - //console.log(antwort); } \ No newline at end of file From d49cab5b02d61305c94182daff210add00c37b1e Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Thu, 23 Apr 2020 15:12:58 +0200 Subject: [PATCH 19/59] (WOO-89)[Refactor] add WC tested & wc require to plugin documentation --- woocommerce-heidelpay.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/woocommerce-heidelpay.php b/woocommerce-heidelpay.php index 2889fc9..4eb70c3 100644 --- a/woocommerce-heidelpay.php +++ b/woocommerce-heidelpay.php @@ -18,6 +18,9 @@ * Text Domain: woocommerce-heidelpay * Domain Path: /languages * + * WC requires at least: 3.0 + * WC tested up to: 3.8 + * * Copyright: © 2018-present heidelpay GmbH * License: see LICENSE.txt */ From 198867cb302a721e5a585aa362cd8940efd58004 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Thu, 23 Apr 2020 15:22:36 +0200 Subject: [PATCH 20/59] (WOO-89)[fix] check push body instead of post parameter --- .../abstracts/abstract-wc-heidelpay-payment-gateway.php | 8 ++++++-- includes/class-wc-heidelpay-push.php | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index c19ede2..ac40ce7 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -180,9 +180,13 @@ public function init_form_fields() */ public function pushHandler() { - if (array_key_exists('wcLogger->debug('received push', ['source' => 'heidelpay']); + $rawPayload = file_get_contents('php://input'); + if (!empty($rawPayload)) { $push = new WC_Heidelpay_Push(); - $push->init(file_get_contents('php://input'), $this->get_option('secret')); + $push->init($rawPayload, $this->get_option('secret')); + } else { + $this->wcLogger->error('Push was empty or did not process', ['source' => 'heidelpay']); } exit; } diff --git a/includes/class-wc-heidelpay-push.php b/includes/class-wc-heidelpay-push.php index cbf8198..7ed83c0 100644 --- a/includes/class-wc-heidelpay-push.php +++ b/includes/class-wc-heidelpay-push.php @@ -46,8 +46,7 @@ public function init($rawPayload, $secret) } catch (\Exception $e) { $callers = debug_backtrace(); wc_get_logger()->notice( - print_r('Heidelpay - ' . - $callers [0] ['function'] . ': Invalid push hash from ' . + print_r($callers [0] ['function'] . ': Invalid push hash from ' . $_SERVER ['REMOTE_ADDR'] . ', suspecting manipulation', 1), array('source' => 'heidelpay') ); From 906b68b73bbbf76cd1f6b3934c8bc8c265ab1ba3 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Thu, 23 Apr 2020 15:30:03 +0200 Subject: [PATCH 21/59] (WOO-89)[document] added info to changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5867ff..78b8c85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ - Add creditorId payment information - Payment info text for subscription renewal orders. +###Fixed: +- Push notifications were not processed + ## [1.6.0][1.6.0] ### Added: From 48aab9e9f2f0a6d20823f865e546f5630e8c622a Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Fri, 24 Apr 2020 11:00:29 +0200 Subject: [PATCH 22/59] (WOO-89)[refactor] reduced duplicate code --- assets/js/creditCardFrame.js | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/assets/js/creditCardFrame.js b/assets/js/creditCardFrame.js index 70545d1..685055b 100644 --- a/assets/js/creditCardFrame.js +++ b/assets/js/creditCardFrame.js @@ -49,14 +49,7 @@ function sendMessage(e) { * Get the iFrame element */ var paymentFrameIframe = document.getElementById('paymentFrameIframe'); - /** - * Get hostname and protocol from paymentIframe - */ - var source = paymentFrameIframe.getAttribute("src"); - if (source === null) { - source = paymentFrameIframe.getAttribute("data-src"); - } - var targetOrigin = getDomainFromUrl(source); + var targetOrigin = getDomainFromUrl(paymentFrameIframe); /** * Send html postmessage to payment frame @@ -64,11 +57,17 @@ function sendMessage(e) { paymentFrameIframe.contentWindow.postMessage(JSON.stringify(data), targetOrigin); } - /** * Function to get the domain from a given url */ -function getDomainFromUrl(url) { +function getDomainFromUrl(paymentIframe) { + /** + * Get hostname and protocol from paymentIframe + */ + var url = paymentIframe.getAttribute("src"); + if (url === null) { + url = paymentIframe.getAttribute("data-src"); + } var arr = url.split("/"); return arr[0] + "//" + arr[2]; } @@ -83,14 +82,7 @@ function receiveMessage(e) { * Get the iFrame element */ var paymentFrameIframe = document.getElementById('paymentFrameIframe'); - /** - * Get hostname and protocol from paymentIframe - */ - var source = paymentFrameIframe.getAttribute("src"); - if (source === null) { - source = paymentFrameIframe.getAttribute("data-src"); - } - var targetOrigin = getDomainFromUrl(source); + var targetOrigin = getDomainFromUrl(paymentFrameIframe); if (e.origin !== targetOrigin) { return; } From 5410f33492d07dd6df8a286075483c62a22e0b35 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Fri, 24 Apr 2020 11:02:02 +0200 Subject: [PATCH 23/59] (WOO-89)[change] changed errorlog to warning --- includes/abstracts/abstract-wc-heidelpay-payment-gateway.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index ac40ce7..2fd6145 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -186,7 +186,7 @@ public function pushHandler() $push = new WC_Heidelpay_Push(); $push->init($rawPayload, $this->get_option('secret')); } else { - $this->wcLogger->error('Push was empty or did not process', ['source' => 'heidelpay']); + $this->wcLogger->warning('Push was empty or did not process', ['source' => 'heidelpay']); } exit; } From 9cd7165799e882482661e2ec0bf65f0064a40442 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Mon, 27 Apr 2020 15:52:29 +0200 Subject: [PATCH 24/59] (WOO-89)[refactor] rename function for better reading --- assets/js/creditCardFrame.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/creditCardFrame.js b/assets/js/creditCardFrame.js index 685055b..e51764e 100644 --- a/assets/js/creditCardFrame.js +++ b/assets/js/creditCardFrame.js @@ -49,7 +49,7 @@ function sendMessage(e) { * Get the iFrame element */ var paymentFrameIframe = document.getElementById('paymentFrameIframe'); - var targetOrigin = getDomainFromUrl(paymentFrameIframe); + var targetOrigin = getUrlFromIframe(paymentFrameIframe); /** * Send html postmessage to payment frame @@ -60,7 +60,7 @@ function sendMessage(e) { /** * Function to get the domain from a given url */ -function getDomainFromUrl(paymentIframe) { +function getUrlFromIframe(paymentIframe) { /** * Get hostname and protocol from paymentIframe */ @@ -82,7 +82,7 @@ function receiveMessage(e) { * Get the iFrame element */ var paymentFrameIframe = document.getElementById('paymentFrameIframe'); - var targetOrigin = getDomainFromUrl(paymentFrameIframe); + var targetOrigin = getUrlFromIframe(paymentFrameIframe); if (e.origin !== targetOrigin) { return; } From 2dc7dfff755b64f3a6d5d772c7b2b9c7bf332023 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Thu, 4 Jun 2020 11:48:18 +0200 Subject: [PATCH 25/59] (WOO-95)[refactor] check for subscription class instead of subscription order class --- includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php | 2 +- includes/abstracts/abstract-wc-heidelpay-payment-gateway.php | 4 ++-- includes/traits/trait-wc-heidelpay-subscription-gateway.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php b/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php index 1dcd82b..323ce02 100644 --- a/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php @@ -143,7 +143,7 @@ protected function getIFrame(WC_Order $order) $bookingAction = $this->getBookingAction(); if (method_exists($this->payMethod, $bookingAction)) { - if (class_exists('WC_Subscriptions_Order') && wcs_order_contains_subscription($order)) { + if (class_exists('WC_Subscriptions') && wcs_order_contains_subscription($order)) { $bookingAction = 'registration'; } $this->payMethod->$bookingAction( diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 2fd6145..7bac104 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -265,7 +265,7 @@ protected function setAuthentification(WC_order $order = null) if ($this->get_option('sandbox') === 'yes') { $isSandbox = true; } - if (class_exists('WC_Subscriptions_Order')) { + if (class_exists('WC_Subscriptions')) { if ($order !== null && (wcs_order_contains_renewal($order) || wcs_order_contains_subscription($order))) { $channel = $this->get_option('transaction_channel_subscription'); } @@ -376,7 +376,7 @@ public function performRequest($order, $uid = null) } if (!empty($this->bookingAction) && method_exists($this->payMethod, $this->bookingAction)) { - if (class_exists('WC_Subscriptions_Order') && + if (class_exists('WC_Subscriptions') && wcs_order_contains_subscription($order) && empty($order->get_meta('heidelpay-Registration'))) { $action = 'registration'; diff --git a/includes/traits/trait-wc-heidelpay-subscription-gateway.php b/includes/traits/trait-wc-heidelpay-subscription-gateway.php index 909c9a1..c11785a 100644 --- a/includes/traits/trait-wc-heidelpay-subscription-gateway.php +++ b/includes/traits/trait-wc-heidelpay-subscription-gateway.php @@ -28,7 +28,7 @@ trait WC_Heidelpay_Subscription_Gateway */ public function constructorAddon() { - if (class_exists('WC_Subscriptions_Order')) { + if (class_exists('WC_Subscriptions')) { $this->supports = array( 'subscriptions', 'subscription_cancellation', From 9a93ad3e17a5467df37d74b091a6834859597769 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Thu, 4 Jun 2020 11:50:00 +0200 Subject: [PATCH 26/59] (WOO-95)[refactor] remove dead code --- includes/gateways/class-wc-heidelpay-gateway-dd.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/includes/gateways/class-wc-heidelpay-gateway-dd.php b/includes/gateways/class-wc-heidelpay-gateway-dd.php index e3002c2..db5ce95 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-dd.php +++ b/includes/gateways/class-wc-heidelpay-gateway-dd.php @@ -118,8 +118,6 @@ public function payment_fields() echo '
'; } - //payment form - /** * Set the id and PaymenMethod */ From ccc19fbb25c999f7b79707afc7ac3e1e0996e8b2 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Thu, 4 Jun 2020 11:50:45 +0200 Subject: [PATCH 27/59] (WOO-95)[refactor] change order of admin form rendering --- includes/gateways/class-wc-heidelpay-gateway-dd.php | 4 ++-- includes/gateways/class-wc-heidelpay-gateway-va.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/gateways/class-wc-heidelpay-gateway-dd.php b/includes/gateways/class-wc-heidelpay-gateway-dd.php index db5ce95..4dffc78 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-dd.php +++ b/includes/gateways/class-wc-heidelpay-gateway-dd.php @@ -74,8 +74,6 @@ public function init_form_fields() { parent::init_form_fields(); - $this->initFormFieldsAddon(); - $this->form_fields['title']['default'] = sprintf(__('%s', 'woocommerce-heidelpay'), $this->name); $this->form_fields['description']['default'] = sprintf(__('Insert payment data for %s', 'woocommerce-heidelpay'), $this->name); $this->form_fields['enabled']['label'] = sprintf(__('Enable %s', 'woocommerce-heidelpay'), $this->name); @@ -93,6 +91,8 @@ public function init_form_fields() 'default' => 'yes', 'desc_tip' => true, ); + + $this->initFormFieldsAddon(); } /** diff --git a/includes/gateways/class-wc-heidelpay-gateway-va.php b/includes/gateways/class-wc-heidelpay-gateway-va.php index 11fc8ca..7a0e315 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-va.php +++ b/includes/gateways/class-wc-heidelpay-gateway-va.php @@ -64,7 +64,6 @@ public function setPayMethod() public function init_form_fields() { parent::init_form_fields(); - $this->initFormFieldsAddon(); $this->form_fields['security_sender']['default'] = '31HA07BC8142C5A171745D00AD63D182'; $this->form_fields['user_login']['default'] = '31ha07bc8142c5a171744e5aef11ffd3'; @@ -72,6 +71,8 @@ public function init_form_fields() $this->form_fields['transaction_channel']['default'] = '31HA07BC8124365CA41D4BDA79CCCD22'; $this->form_fields['bookingmode'] = $this->getBookingSelection(); + + $this->initFormFieldsAddon(); } /** From fde0097744406c202ce6c24cf95db155e93117bd Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Thu, 4 Jun 2020 11:52:08 +0200 Subject: [PATCH 28/59] (WOO-95)[fix] add checkbox for sub activity and unset gateway if checkbos is not active --- ...rait-wc-heidelpay-subscription-gateway.php | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/includes/traits/trait-wc-heidelpay-subscription-gateway.php b/includes/traits/trait-wc-heidelpay-subscription-gateway.php index c11785a..691b6cd 100644 --- a/includes/traits/trait-wc-heidelpay-subscription-gateway.php +++ b/includes/traits/trait-wc-heidelpay-subscription-gateway.php @@ -47,18 +47,52 @@ public function constructorAddon() } } + /** + * @inheritDoc + */ + public function setAvailability($available_gateways) + { + if (class_exists('WC_Subscriptions') && + WC_Subscriptions_Cart::cart_contains_subscription() && + !$this->isSubscriptionEnabled()) { + unset($available_gateways[$this->id]); + } + return $available_gateways; + } + + /** + * Checks if Payment is enabled for Subsciptions + * + * @return bool + */ + public function isSubscriptionEnabled() + { + $enabled = false; + if ($this->get_option('activate_for_subscriptions')) { + $enabled = true; + } + return $enabled; + } + /** * additional formfields for admin backend */ public function initFormFieldsAddon() { - if (class_exists('WC_Subscriptions_Order')) { + if (class_exists('WC_Subscriptions')) { + $this->form_fields['activate_for_subscriptions'] = array( + 'title' => __('Enable/Disable Sub', 'woocommerce-heidelpay'), + 'type' => 'checkbox', + 'label' => __('Enable for Subscriptions', 'woocommerce-heidelpay'), + 'default' => 'yes' + ); $this->form_fields['transaction_channel_subscription'] = array( 'title' => __('Transaction Channel for Subscriptions', 'woocommerce-heidelpay'), 'type' => 'text', 'id' => $this->id . '_transaction_channel_subscriptions', 'description' => 'Transaction Channel for Subscriptions', - 'default' => ''); + 'default' => '' + ); } } From 060c22d519ade3a1fd925f7b95dd81f86dee1d53 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Fri, 5 Jun 2020 08:48:15 +0200 Subject: [PATCH 29/59] (WOO-95)[fix] fix option check --- includes/traits/trait-wc-heidelpay-subscription-gateway.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/traits/trait-wc-heidelpay-subscription-gateway.php b/includes/traits/trait-wc-heidelpay-subscription-gateway.php index 691b6cd..2623256 100644 --- a/includes/traits/trait-wc-heidelpay-subscription-gateway.php +++ b/includes/traits/trait-wc-heidelpay-subscription-gateway.php @@ -68,7 +68,7 @@ public function setAvailability($available_gateways) public function isSubscriptionEnabled() { $enabled = false; - if ($this->get_option('activate_for_subscriptions')) { + if ($this->get_option('activate_for_subscriptions') === 'yes') { $enabled = true; } return $enabled; From 7f26495d70b285bbcfda61078a69e4e4497933d1 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Fri, 5 Jun 2020 08:51:24 +0200 Subject: [PATCH 30/59] (WOO-95)[fix] update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78b8c85..120ea71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added: - Use context to generate a dedicated heidelpay logfile - WooCommerce Subscriptions + - Enable / Disable payment for subscription orders - Support for configuration - Change amount of subscription - Change date of subscription From 0ff552b0b856b73a6bbbf94a451e31dfe34742d5 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Fri, 5 Jun 2020 08:53:27 +0200 Subject: [PATCH 31/59] (WOO-95)[fix] update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 120ea71..585e7cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ ###Fixed: - Push notifications were not processed +- IFrame not working if lazyloading is active ## [1.6.0][1.6.0] From d6a018bf19b1023bf087d5ed1f88d36039616a10 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Fri, 5 Jun 2020 13:18:24 +0200 Subject: [PATCH 32/59] (WOO-95)[fix] update Translations --- languages/woocommerce-heidelpay-de_DE.mo | Bin 6514 -> 5466 bytes languages/woocommerce-heidelpay-de_DE.po | 282 ++++++++++++----------- languages/woocommerce-heidelpay.pot | 232 +++++++++++-------- 3 files changed, 290 insertions(+), 224 deletions(-) diff --git a/languages/woocommerce-heidelpay-de_DE.mo b/languages/woocommerce-heidelpay-de_DE.mo index 3dff71fa27aabe3b8966d8f726b0bdd1e6633ffa..597ccd86c776d0129d8faf337f10267f07d3985e 100644 GIT binary patch delta 2012 zcmZwGUu+ab9Ki88`O|VxT8b@ym8rIZ;OJ9tBf9(Q^+HB`DGdnx; zo8QdcY`pZy_?61pZz%qf{IBHy;62h(>WA5Pt)qIGw!E4(N2!H47i+KzE3g&Ia4W9H zonikWTtxeIlquiCdH4a&S880HrE)JFlc5)9UZ|gtN8O}|;#Al_YpzlYXqTf*v=Swt zheBI$DeVL<#^=KReOO8RFqU9|AG5xCi;6_Hjo#(hi?YB7w&Q-}QRgVi@e7m%zedT( zRh)&_kVpMOA>(eK1foin>Vjq1fHrQ$V;E(9bxA6C9c6+WNK9%9Wum`B%h~Qm+N)49 z^DN2^2e1yuQ093X}#!qn*ev1jLVvuZfH;&g*DN>QMJc-pfi9G5X3JKr}@~!#< zB{Nf4g>yJS3s>MW>_*vf8YRGkC;=V`-=7HIpT!60|7t$@ZzhMo(V^+6A+M6s4wQvD zQBu~2(-R?&IziEl@1vaQrO@9|j#8qQ@8_Uoq7o%wjZ1JnvZUHxPX1-UZaUbM%AkDc zhXW3yynhWPGbcko!4%J+Yv{2EFr^iQ(Ur_>xj`Q1)Gp$Bh zC>3glx+ovM6nX^Nq&kYsp-!L#b_(SvKf@;c5x3zI(!=#pX_PyaLkY|e+v6`%k;`xd z30}Q}58@e=2rr_f{xZq}f1>QPnobG02G?Q(cHkbA4ZVw!>hDo@d<*4gzL-MRTZ06a zR-38Fgh`a0J&ke%LnvqFqb&R?$|d^bSyH>a)3FC~rXi8_MH!&FvYy*(ADB2-q9Y~U&X}7`o8Y_B z)2rPfUFXZ=nY77{nZbI!)no@vZqz=YQyJGQbSHQn?4S2!wAVBA=8aPbKA+bX)JAvI z^?SDC+i6)_Z_e0`V{-aGK~3zBrXs=R`KN>93w8!m3m#q7S|5w{nNeo9di>$+pw&?v z_N{(5t}}(gs2_BcwFHODs>d5+R&2c$Yw3@*#+zH>&5y5*#p1D8wD&2i&x~b#mbDUg z!NhfA?Dkk4do13xj)9Cz+J3>BjxlE!TraM->_{f{_V%7my|J^Wy*v3tdm_=-nM!S9 zs54x&hmF;5?0j5z882@q9KB|`;v9JR&VaZcG*+TB+M6qScFx-3dU-#tozdy0-`2Q6 z&s5tSUDKx5Z3xbk?HS)?CEc`ZrQD*IHd4291U+c>GSM!p%Q(iH2~dX3Bq83=kdtv) z-_#FeUua-l!p+-RC$67&8I{i)nJaVqw0J+gMz8JphOP3kyLVI?dq*Sg#LEj$M=G|Q zpY(M5fXg|_G5W!M6|tpv+u9x}WXJAYmSja!q^!@RGfvSN_DAgEP;h9`D^0uYOpXqH zesaKg;q5VA#?BRtQ?KvDGjn^a>Faa6vZr*X>y6mHZ-QiHM{u?>QTxAl=U)L%+^Xz| N1jnjA48C0Q%s;XEZw~+f literal 6514 zcmd6rTZ|-C8OIM75l2x#MHIxd=q_^Uo*9-0i>a<^ z>oUy@qS5FBA(}{{V)TJT^ub^t!H^jC$q5g}_@KcTgGR%H#OQ+t;{_7^edkoq^z3ee z7-Ou=>3^U5clm!`eLcUv^5U;5o+j;Dnt!2E9{AM7eDF+NqSQff8e~eH0^bSV4;}ym z@N)1`@G|gQ;0@sSit(R=SI~bMlq3HFz76~b_;&E(w<`4>@bUr=f-+tK-vZ8q6X0So zehPdC{SGMS3_y`*yTC`lchi5o=syKMP5*gN?%%jnsSkhyP|kT2tb&h&?*e}b%6Y#B zMc==J7lE&X9APh&b(eDa)!^0OF>o4O0JlJq_eY?t|0#&7>KCBwd#S)bfMVCz!K2{y zY!ZD>gCf5H<(w@(#I9ceHTW1f3qA|h!9Rnd&z%_UBj6e+ei?#Sf!_dGqMiZe{^vpQ z$4@}6R=)zp4!;B63%&}LzzGK556*z1=Nc&TZGa-*r$GMH7x|ENkAbr8De!vm1yJsL z1$^WJrTzwL`k%+RV%Kkj45{yeli;(Uocl7!pZY5ww}F>%$d%xc0+&JYqX)|Vbx`b+ zf+GLt!1sY)2T?^mUCciZiXDCo%Dxwi`QH}ve+0!|uN8PDq!xW{1ZCeGxC1VMa{m<= z@k8KMpxko@D1Mv+MV`+V_$5%*f3v_RK+*3zAV;YmfO78(p!n}4@Hlt@N(*n6K;coV z=zkIve|JDcRi6RH-(Lnl3_b&jJTHP`&)Unz`H<^`_rJD1P`pAEM6=DExQ@6nkEXvcjWl zKp8&(3O|m3{HYfZ;yUmpPO}HU;kXWCj$#aM%J{LQQZ5uRsB%Y>ew@HVm>cIM6 zd@gZ5MH9ctBYu+STG|1c@IW{wkN8CLm^>xg4YXTm6`Fl?BT3?CnmaLLB-gQB~j91Gh&9(R!Tpy)1|$oyFRe`d$#SV$+K{ z#@F#cW;h||>?GK>3srTKMP55Jx+do)fl0Y8(W&X=3A=)5GY&dNRfk@X1yOf&+c^Ve zHRnYeYA#5!p6_Kw&BgHs8~U+tRIL}ssnMQp?;mty?9+qLc&RC?8kYu{u6c>C>ZToJ z?sGJdc9OvAq3S_mI+=EB8j)22`xM`*d5SLHsC&#{m}qO%O})r(#}8^No7*v24^lZp zEttgUtvJ^mFVe=HJ2FPo8N(T9U^>Bi(9zZ(Vz;uML&c%T{;cO^d<3Z;24QG@SR9r0 zOtE7N+sZ|WJ{8BcxZgKP$6)tN%$#aOv|{wUP0queP89a{Su`*SHV(JSsySC(R?R3i zNjCD0#{Qla5`!?6C3(mBe!Sy^wDPr)+xPJ{_lSUqk4wY|1Fy>*q8K4lT2@QmgZ-eN z_jR=|d{Ik5w6B|}r6g6*STDyzL7}rYj@`TcajIIDjusZg_sy=OotV~a_%y~!&Zem` z8lqbRc6z3>5$9QX_kzS=kWCj0Y2N9WG+ocbvR<_`(>cVGBYVNB=xq1ffg+a5>Vy~O znG2B;;{k?IWXvA@S(vi5#`3WlNT-R^mmeXFaQHcq}rZIw_kL<8BbSud7~~ z4r5|zoMVG9XMts=` zRp^vyv2>=VXY`iwl2ntggz(6MgxLH%2k$!s+Q>qTX&El!jn3bj8dE%VN#AUicdsd9Xw}OynHUa-XH5ikcwyj6 zx}DH{iBm7ss|%}o(AW;!!woX>6@pfDpOMvOU>5<-tn1t0V3BA0{g2kODB{k~xoihoCMviFYGj>OM&2)N^ zoW9}Z>zuJZl7jk27MyR$)*8o5J5Mr^HSeprywkHH#(tje@9E*rlUO67ILVO41d-8l z!0z~QTXby5ZMLr1$lC5SSA4h$4AJQ&CTNRl;xFk2>lsy<_BKePXw4lvUrVtH>qz5c z!*!F(hEU$6W5dO}rL-hck55$hPF&z%y|MEg2|m&%0`mqI)L2os@mkRDkJ+9P{o1Thb7N^kWgK2*o+3#p6iC_@NXQ!n~55y zEw#zL9w8m=ZFU~_4m5PDb6GGa+wP%KN&!zfxDU@hjTq1g9$RWyy$z{&~bt0lvRk zjzna6{=d-k#9+!RQ95=+txHsJ%;%D8q#=-ycDh\n" +"Language-Team: German (Germany)\n" +"Language: de-DE\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-06-13 13:37+00:00\n" -"Last-Translator: DANIEL KRAUT \n" -"Language-Team: GERMAN\n" - -msgid "invoice_info" -msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} nach Erhalt der Ware auf folgendes Konto:

" - "Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER}
" - "IBAN: {CONNECTOR_ACCOUNT_IBAN}
" - "BIC: {CONNECTOR_ACCOUNT_BIC}

" - "Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an:
" - "{IDENTIFICATION_SHORTID}" - -msgid "prepayment_info" -msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} auf folgendes Konto:

" - "Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER}
" - "IBAN: {CONNECTOR_ACCOUNT_IBAN}

" - "Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an:
" - "{IDENTIFICATION_SHORTID}" - -msgid "direct_debit_info" -msgstr "Der Betrag von {AMOUNT} {CURRENCY} wird in den nächsten Tagen von folgendem Konto abgebucht:

" - "IBAN: {Iban}

" - "Die Abbuchung enthält die Mandatsreferenz-ID: {Ident}
" - "und die Gläubiger ID: {CreditorId}

" - "
" - "Bitte sorgen Sie für ausreichende Deckung auf dem entsprechenden Konto." +"X-Loco-Source-Locale: de_DE\n" +"X-Generator: Loco https://localise.biz/\n" +"X-Domain: woocommerce-heidelpay\n" +"\n" +"X-Loco-Parser: loco_parse_po" -msgid "datePlaceholder" -msgstr "tt.mm.jjjj" +#. Plugin Name of the plugin +msgid "heidelpay WooCommerce" +msgstr "heidelpay WooCommerce" -msgid "dateFormat" -msgstr "dd.mm.yy" +#. Plugin URI of the plugin +msgid "https://dev.heidelpay.com" +msgstr "https://dev.heidelpay.com" -msgid "invalid date format" -msgstr "Ungültiges Datumsformat." +#. Description of the plugin +msgid "heidelpay payment integration for WooCommerce" +msgstr "heidelpay Zahlarten für WooCommerce" + +#. Author of the plugin +msgid "heidelpay" +msgstr "heidelpay GmbH" -#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:57 +#. Author URI of the plugin +msgid "htts://www.heidelpay.com" +msgstr "htts://www.heidelpay.com" + +#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:62 msgid "Awaiting payment" msgstr "Auf Zahlung warten" -#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:150 +#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:163 msgid "Pay Now" msgstr "Jetzt bezahlen" -#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:163 -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:329 +#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:180 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:417 msgid " Error: Paymentmethod was not found: " msgstr "Fehler: Zahlart nicht gefunden: " -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:43 -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:107 -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:67 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:84 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:60 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:77 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:77 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:47 msgid "%s" msgstr "%s" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:44 -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:391 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:61 msgid "heidelpay %s" msgstr "heidelpay %s" @@ -74,9 +66,10 @@ msgstr "heidelpay %s" msgid "Enable/Disable" msgstr "Aktivieren" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:99 -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:69 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:87 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:99 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:79 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:86 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:56 msgid "Enable %s" msgstr "%s aktivieren" @@ -96,9 +89,11 @@ msgstr "Beschreibung" msgid "Payment method description that the customer will see on your checkout." msgstr "Beschreibung der Zahlart im Checkout" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:117 -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:68 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:85 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:117 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:78 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:35 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:79 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:49 msgid "Insert payment data for %s" msgstr "Zahlungsdaten für %s einfügen" @@ -110,16 +105,6 @@ msgstr "Anweisungen" msgid "Instructions that will be added to the thank you page and emails." msgstr "Anweisungen auf der Bestellbestätigungsseite und in E-Mails" -msgid "Payment information mail" -msgstr "Zahlungsdaten per mail" - -msgid "Add payment information to e-mail" -msgstr "Fügt Zahlungsdaten der Bestätigungsmail hinzu" - -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:127 -msgid "The following account will be billed:" -msgstr "Das folgende Konto wird belastet:" - #: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:131 msgid "Security Sender" msgstr "Security Sender" @@ -148,179 +133,218 @@ msgstr "Sandbox" msgid "Enable sandbox mode" msgstr "Sandbox-Modus aktivieren" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:353 -#: includes/gateways/class-wc-heidelpay-gateway-idl.php:124 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:452 +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:104 msgid "Payment error: " msgstr "Zahlungsfehler: " -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:428 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:693 msgid "Bookingmode" msgstr "Buchungsmodus" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:431 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:696 msgid "Debit" msgstr "Direktbuchung" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:432 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:697 msgid "Authorization" msgstr "Authorisierung" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:435 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:700 msgid "Choose a bookingmode" msgstr "Buchungsmodus wählen" -#: includes/class-wc-heidelpay-response.php:74 +#: includes/class-wc-heidelpay-push.php:123 +msgid "Payment of %s %s received. Heidelpay ShortID %s" +msgstr "Zahlung über %s %s erhalten. heidelpay Short-ID %s" + +#: includes/class-wc-heidelpay-response.php:111 msgid "" "Payment reservation successful. Please use the hiP to check the payment." -msgstr "Reservierung der Zahlung erfolgreich. Bitte Zahlungseingang im hIP prüfen." +msgstr "" +"Reservierung der Zahlung erfolgreich. Bitte Zahlungseingang im hIP prüfen." -#: includes/class-wc-heidelpay-response.php:81 +#: includes/class-wc-heidelpay-response.php:119 msgid "Awaiting payment." msgstr "Auf Zahlung warten" -#: includes/gateways/class-wc-heidelpay-gateway-cc.php:33 +#: includes/gateways/class-wc-heidelpay-gateway-cc.php:55 msgid "Credit Card" msgstr "Kreditkarte" -#: includes/gateways/class-wc-heidelpay-gateway-dc.php:33 +#: includes/gateways/class-wc-heidelpay-gateway-dc.php:55 msgid "Debit Card" msgstr "Debitkarte" -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:47 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:57 msgid "You have to enter the account holder" msgstr "Bitte den Kontoinhaber eingeben" -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:54 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:64 msgid "You have to enter the IBAN" msgstr "Bitte die IBAN eingeben" -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:78 -#: includes/gateways/class-wc-heidelpay-gateway-idl.php:67 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:85 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:45 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:93 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:63 +msgid "Payment information mail" +msgstr "Zahlungsdaten per mail" + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:87 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:47 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:95 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:65 +msgid "Add payment information to e-mail" +msgstr "Fügt Zahlungsdaten der Bestätigungsmail hinzu" + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:103 +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:60 msgid "Account Holder" msgstr "Kontoinhaber" -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:79 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:104 msgid "IBAN" msgstr "IBAN" -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:104 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:129 msgid "Direct Debit" msgstr "Lastschrift" -#: includes/gateways/class-wc-heidelpay-gateway-idl.php:43 +#: includes/gateways/class-wc-heidelpay-gateway-gp.php:36 +msgid "GiroPay" +msgstr "GiroPay" + +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:36 msgid "iDeal" msgstr "iDeal" -#: includes/gateways/class-wc-heidelpay-gateway-idl.php:68 +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:61 msgid "Bank" msgstr "Bank" -#: includes/gateways/class-wc-heidelpay-gateway-idl.php:124 +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:104 msgid "Chose a bank please." msgstr "Bitte eine Bank wählen" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:47 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:249 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:38 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:82 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:52 +msgid "please send the money to IBAN BIC " +msgstr "Bitte überweisen Sie an IBAN BIC " + +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:64 +msgid "Invoice" +msgstr "Rechnungskauf" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:41 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:281 msgid "You have to be at least 18 years old in order to use secured invoice" msgstr "Der versicherte Rechnungskauf ist erst ab 18 Jahren möglich" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:53 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:47 msgid "You have to enter your salutation" msgstr "Bitte Anrede wählen" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:60 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:54 msgid "You are not allowed to use secured invoice with a company name" msgstr "Der versicherte Rechnungskauf ist nicht für Firmenkunden möglich" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:86 -msgid "please send the money to IBAN BIC " -msgstr "Bitte überweisen Sie an IBAN BIC " - -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:94 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:104 msgid "Advanced options" msgstr "Erweiterte Optionen" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:100 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:110 msgid "Minimum Amount" msgstr "Mindestbetrag" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:107 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:117 msgid "Maxmimum Amount" msgstr "Maximalbetrag" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:114 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:124 msgid "Available Countries for secured invoice" msgstr "Erlaubte Länder für den versicherten Rechnungskauf" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:116 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:126 msgid "" "Here you can enable secured Invoice for specific countries. Be aware that " "this will not enable the country in your WooCommerce settings and you have " "to enable them seperately." msgstr "" -"Hier können Sie den versicherten Rechnungskauf auf bestimmte Länder beschränken." -"Bitte beachten Sie, dass sie entsprechende Länder weiterhin in den WooCommerce Einstellungen aktivieren müssen" +"Hier können Sie den versicherten Rechnungskauf auf bestimmte Länder " +"beschränken.Bitte beachten Sie, dass sie entsprechende Länder weiterhin in " +"den WooCommerce Einstellungen aktivieren müssen" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:121 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:134 msgid "Enable Germany" msgstr "Deutschland aktivieren" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:127 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:140 msgid "Enable Austria" msgstr "Österreich aktivieren" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:202 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:221 msgid "Salutation" msgstr "Anrede" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:203 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:222 msgid "Mr" msgstr "Herr" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:204 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:223 msgid "Mrs" msgstr "Frau" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:205 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:224 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:316 msgid "Birthdate" msgstr "Geburtsdatum" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:269 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:225 +msgid "datePlaceholder" +msgstr "tt.mm.jjjj" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:226 +msgid "dateFormat" +msgstr "dd.mm.yy" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:297 msgid "Secured Invoice" msgstr "Versicherter Rechnungskauf" -#: woocommerce-heidelpay.php:213 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:317 +msgid "invalid date format" +msgstr "Ungültiges Datumsformat." + +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:82 +msgid "Prepayment" +msgstr "Vorkasse" + +#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:84 +msgid "Enable/Disable Sub" +msgstr "Abonnement aktiv" + +#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:86 +msgid "Enable for Subscriptions" +msgstr "Für Abonnements aktivieren" + +#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:90 +msgid "Transaction Channel for Subscriptions" +msgstr "Transaction Channel für Abonnements" + +#: woocommerce-heidelpay.php:236 msgid "minimal PHP version error" msgstr "PHP-Version zu niedrig" -#: woocommerce-heidelpay.php:219 +#: woocommerce-heidelpay.php:242 msgid "WooCommerce plugin not activated" msgstr "Das WooCommerce Plug-In ist nicht aktiviert" -#: woocommerce-heidelpay.php:223 +#: woocommerce-heidelpay.php:246 msgid "minimal WC version error" msgstr "WooCommerce-Version zu niedrig" -#: woocommerce-heidelpay.php:229 +#: woocommerce-heidelpay.php:252 msgid "cURL is not installed." msgstr "cURL ist nicht installiert" - -#. Plugin Name of the plugin/theme -msgid "heidelpay WooCommerce" -msgstr "heidelpay WooCommerce" - -#. Plugin URI of the plugin/theme -msgid "https://dev.heidelpay.com" -msgstr "https://dev.heidelpay.com" - -#. Description of the plugin/theme -msgid "heidelpay payment integration for WooCommerce" -msgstr "heidelpay Zahlarten für WooCommerce" - -#. Author of the plugin/theme -msgid "heidelpay" -msgstr "heidelpay GmbH" - -#. Author URI of the plugin/theme -msgid "htts://www.heidelpay.com" -msgstr "htts://www.heidelpay.com" diff --git a/languages/woocommerce-heidelpay.pot b/languages/woocommerce-heidelpay.pot index ae9f6ae..457803d 100644 --- a/languages/woocommerce-heidelpay.pot +++ b/languages/woocommerce-heidelpay.pot @@ -1,50 +1,60 @@ -# Copyright (C) 2018 heidelpay WooCommerce -# This file is distributed under the same license as the heidelpay WooCommerce package. +# Copyright (C) 2020 heidelpay +# This file is distributed under the same license as the heidelpay WooCommerce plugin. msgid "" msgstr "" -"Project-Id-Version: heidelpay WooCommerce 1.1.2\n" -"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-" -"heidelpay\n" -"POT-Creation-Date: 2018-06-15 08:21:52+00:00\n" +"Project-Id-Version: heidelpay WooCommerce 1.7.0\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-heidelpay\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"POT-Creation-Date: 2020-06-05T07:45:49+00:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.4.0\n" +"X-Domain: woocommerce-heidelpay\n" + +#. Plugin Name of the plugin +msgid "heidelpay WooCommerce" +msgstr "" + +#. Plugin URI of the plugin +msgid "https://dev.heidelpay.com" +msgstr "" -#: includes/class-wc-heidelpay-response.php:134 -msgid "invoice_info" +#. Description of the plugin +msgid "heidelpay payment integration for WooCommerce" msgstr "" -msgid "prepayment_info" +#. Author of the plugin +msgid "heidelpay" msgstr "" -msgid "direct_debit_info" +#. Author URI of the plugin +msgid "htts://www.heidelpay.com" msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:57 +#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:62 msgid "Awaiting payment" msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:150 +#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:163 msgid "Pay Now" msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:163 -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:329 +#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:180 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:417 msgid " Error: Paymentmethod was not found: " msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:43 -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:107 -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:67 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:84 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:60 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:77 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:77 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:47 msgid "%s" msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:44 -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:391 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:61 msgid "heidelpay %s" msgstr "" @@ -53,8 +63,9 @@ msgid "Enable/Disable" msgstr "" #: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:99 -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:69 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:87 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:79 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:86 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:56 msgid "Enable %s" msgstr "" @@ -75,8 +86,10 @@ msgid "Payment method description that the customer will see on your checkout." msgstr "" #: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:117 -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:68 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:85 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:78 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:35 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:79 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:49 msgid "Insert payment data for %s" msgstr "" @@ -88,10 +101,6 @@ msgstr "" msgid "Instructions that will be added to the thank you page and emails." msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:127 -msgid "The following account will be billed:" -msgstr "" - #: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:131 msgid "Security Sender" msgstr "" @@ -120,177 +129,210 @@ msgstr "" msgid "Enable sandbox mode" msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:353 -#: includes/gateways/class-wc-heidelpay-gateway-idl.php:124 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:452 +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:104 msgid "Payment error: " msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:428 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:693 msgid "Bookingmode" msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:431 -msgid "Direct debit" +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:696 +msgid "Debit" msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:432 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:697 msgid "Authorization" msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:435 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:700 msgid "Choose a bookingmode" msgstr "" -#: includes/class-wc-heidelpay-response.php:74 -msgid "" -"Payment reservation successful. Please use the hiP to check the payment." +#: includes/class-wc-heidelpay-push.php:123 +msgid "Payment of %s %s received. Heidelpay ShortID %s" +msgstr "" + +#: includes/class-wc-heidelpay-response.php:111 +msgid "Payment reservation successful. Please use the hiP to check the payment." msgstr "" -#: includes/class-wc-heidelpay-response.php:81 +#: includes/class-wc-heidelpay-response.php:119 msgid "Awaiting payment." msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-cc.php:33 +#: includes/gateways/class-wc-heidelpay-gateway-cc.php:55 msgid "Credit Card" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-dc.php:33 +#: includes/gateways/class-wc-heidelpay-gateway-dc.php:55 msgid "Debit Card" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:47 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:57 msgid "You have to enter the account holder" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:54 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:64 msgid "You have to enter the IBAN" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:78 -#: includes/gateways/class-wc-heidelpay-gateway-idl.php:67 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:85 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:45 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:93 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:63 +msgid "Payment information mail" +msgstr "" + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:87 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:47 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:95 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:65 +msgid "Add payment information to e-mail" +msgstr "" + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:103 +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:60 msgid "Account Holder" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:79 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:104 msgid "IBAN" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:104 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:129 msgid "Direct Debit" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-idl.php:43 +#: includes/gateways/class-wc-heidelpay-gateway-gp.php:36 +msgid "GiroPay" +msgstr "" + +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:36 msgid "iDeal" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-idl.php:68 +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:61 msgid "Bank" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-idl.php:124 +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:104 msgid "Chose a bank please." msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:47 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:248 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:38 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:82 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:52 +msgid "please send the money to IBAN BIC " +msgstr "" + +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:64 +msgid "Invoice" +msgstr "" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:41 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:281 msgid "You have to be at least 18 years old in order to use secured invoice" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:53 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:47 msgid "You have to enter your salutation" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:60 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:54 msgid "You are not allowed to use secured invoice with a company name" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:86 -msgid "please send the money to IBAN BIC " -msgstr "" - -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:94 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:104 msgid "Advanced options" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:100 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:110 msgid "Minimum Amount" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:107 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:117 msgid "Maxmimum Amount" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:114 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:124 msgid "Available Countries for secured invoice" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:116 -msgid "" -"Here you can enable secured Invoice for specific countries. Be aware that " -"this will not enable the country in your WooCommerce settings and you have " -"to enable them seperately." +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:126 +msgid "Here you can enable secured Invoice for specific countries. Be aware that this will not enable the country in your WooCommerce settings and you have to enable them seperately." msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:120 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:134 msgid "Enable Germany" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:126 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:140 msgid "Enable Austria" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:201 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:221 msgid "Salutation" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:202 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:222 msgid "Mr" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:203 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:223 msgid "Mrs" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:204 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:224 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:316 msgid "Birthdate" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:268 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:225 +msgid "datePlaceholder" +msgstr "" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:226 +msgid "dateFormat" +msgstr "" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:297 msgid "Secured Invoice" msgstr "" -#: woocommerce-heidelpay.php:218 -msgid "minimal PHP version error" +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:317 +msgid "invalid date format" msgstr "" -#: woocommerce-heidelpay.php:224 -msgid "WooCommerce plugin not activated" +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:82 +msgid "Prepayment" msgstr "" -#: woocommerce-heidelpay.php:228 -msgid "minimal WC version error" +#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:84 +msgid "Enable/Disable Sub" msgstr "" -#: woocommerce-heidelpay.php:234 -msgid "cURL is not installed." +#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:86 +msgid "Enable for Subscriptions" msgstr "" -#. Plugin Name of the plugin/theme -msgid "heidelpay WooCommerce" +#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:90 +msgid "Transaction Channel for Subscriptions" msgstr "" -#. Plugin URI of the plugin/theme -msgid "https://dev.heidelpay.com" +#: woocommerce-heidelpay.php:236 +msgid "minimal PHP version error" msgstr "" -#. Description of the plugin/theme -msgid "heidelpay payment integration for WooCommerce" +#: woocommerce-heidelpay.php:242 +msgid "WooCommerce plugin not activated" msgstr "" -#. Author of the plugin/theme -msgid "heidelpay" +#: woocommerce-heidelpay.php:246 +msgid "minimal WC version error" msgstr "" -#. Author URI of the plugin/theme -msgid "htts://www.heidelpay.com" +#: woocommerce-heidelpay.php:252 +msgid "cURL is not installed." msgstr "" From 9fcc46e0f0ff94eb454e6fd9c65a6b11a0a00e5d Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Fri, 5 Jun 2020 17:01:39 +0200 Subject: [PATCH 33/59] (WOO-95)[fix] get missing translations back --- languages/woocommerce-heidelpay-de_DE.po | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/languages/woocommerce-heidelpay-de_DE.po b/languages/woocommerce-heidelpay-de_DE.po index bba9b4e..08d4386 100644 --- a/languages/woocommerce-heidelpay-de_DE.po +++ b/languages/woocommerce-heidelpay-de_DE.po @@ -348,3 +348,26 @@ msgstr "WooCommerce-Version zu niedrig" #: woocommerce-heidelpay.php:252 msgid "cURL is not installed." msgstr "cURL ist nicht installiert" + +msgid "invoice_info" +msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} nach Erhalt der Ware auf folgendes Konto:

" + "Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER}
" + "IBAN: {CONNECTOR_ACCOUNT_IBAN}
" + "BIC: {CONNECTOR_ACCOUNT_BIC}

" + "Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an:
" + "{IDENTIFICATION_SHORTID}" + +msgid "prepayment_info" +msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} auf folgendes Konto:

" + "Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER}
" + "IBAN: {CONNECTOR_ACCOUNT_IBAN}

" + "Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an:
" + "{IDENTIFICATION_SHORTID}" + +msgid "direct_debit_info" +msgstr "Der Betrag von {AMOUNT} {CURRENCY} wird in den nächsten Tagen von folgendem Konto abgebucht:

" + "IBAN: {Iban}

" + "Die Abbuchung enthält die Mandatsreferenz-ID: {Ident}
" + "und die Gläubiger ID: {CreditorId}

" + "
" + "Bitte sorgen Sie für ausreichende Deckung auf dem entsprechenden Konto." \ No newline at end of file From 15d86b313cff77e3009c7853eee2dbce097398fd Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Fri, 5 Jun 2020 17:02:13 +0200 Subject: [PATCH 34/59] (WOO-95)[fix] wc-api Link fix --- includes/abstracts/abstract-wc-heidelpay-payment-gateway.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 7bac104..b09cc9d 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -707,6 +707,6 @@ protected function getBookingSelection() */ protected function getResponeUrl() { - return get_home_url() . '/wc-api/' . strtolower(get_class($this)); + return get_home_url(null, '/wc-api/' . strtolower(get_class($this))); } } From 4b8f6fe2d2bc31133ac104590d64aa15c9517d30 Mon Sep 17 00:00:00 2001 From: Florian Evertz <10667564+xBlack-Shadow@users.noreply.github.com> Date: Tue, 9 Jun 2020 12:00:04 +0200 Subject: [PATCH 35/59] Update languages/woocommerce-heidelpay-de_DE.po Co-authored-by: David Owusu <33735090+Ryouzanpaku@users.noreply.github.com> --- languages/woocommerce-heidelpay-de_DE.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/languages/woocommerce-heidelpay-de_DE.po b/languages/woocommerce-heidelpay-de_DE.po index 08d4386..5faddbc 100644 --- a/languages/woocommerce-heidelpay-de_DE.po +++ b/languages/woocommerce-heidelpay-de_DE.po @@ -351,11 +351,11 @@ msgstr "cURL ist nicht installiert" msgid "invoice_info" msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} nach Erhalt der Ware auf folgendes Konto:

" - "Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER}
" - "IBAN: {CONNECTOR_ACCOUNT_IBAN}
" - "BIC: {CONNECTOR_ACCOUNT_BIC}

" - "Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an:
" - "{IDENTIFICATION_SHORTID}" +"Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER}
" +"IBAN: {CONNECTOR_ACCOUNT_IBAN}
" +"BIC: {CONNECTOR_ACCOUNT_BIC}

" +"Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an:
" +"{IDENTIFICATION_SHORTID}" msgid "prepayment_info" msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} auf folgendes Konto:

" @@ -370,4 +370,4 @@ msgstr "Der Betrag von {AMOUNT} {CURRENCY} wird in den näc "Die Abbuchung enthält die Mandatsreferenz-ID: {Ident}
" "und die Gläubiger ID: {CreditorId}

" "
" - "Bitte sorgen Sie für ausreichende Deckung auf dem entsprechenden Konto." \ No newline at end of file + "Bitte sorgen Sie für ausreichende Deckung auf dem entsprechenden Konto." From 4ff70965099c1fb4c573a1d83abc208a68948254 Mon Sep 17 00:00:00 2001 From: Florian Evertz <10667564+xBlack-Shadow@users.noreply.github.com> Date: Tue, 9 Jun 2020 12:00:21 +0200 Subject: [PATCH 36/59] Update languages/woocommerce-heidelpay-de_DE.po Co-authored-by: David Owusu <33735090+Ryouzanpaku@users.noreply.github.com> --- languages/woocommerce-heidelpay-de_DE.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/languages/woocommerce-heidelpay-de_DE.po b/languages/woocommerce-heidelpay-de_DE.po index 5faddbc..1020fe5 100644 --- a/languages/woocommerce-heidelpay-de_DE.po +++ b/languages/woocommerce-heidelpay-de_DE.po @@ -359,10 +359,10 @@ msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} msgid "prepayment_info" msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} auf folgendes Konto:

" - "Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER}
" - "IBAN: {CONNECTOR_ACCOUNT_IBAN}

" - "Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an:
" - "{IDENTIFICATION_SHORTID}" +"Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER}
" +"IBAN: {CONNECTOR_ACCOUNT_IBAN}

" +"Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an:
" +"{IDENTIFICATION_SHORTID}" msgid "direct_debit_info" msgstr "Der Betrag von {AMOUNT} {CURRENCY} wird in den nächsten Tagen von folgendem Konto abgebucht:

" From 0327f7629bef0b7b594fe0fc7dc3c6d0d80f364f Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Tue, 9 Jun 2020 12:01:55 +0200 Subject: [PATCH 37/59] (WOO-95)[fix] resolve PR Comment --- languages/woocommerce-heidelpay-de_DE.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/languages/woocommerce-heidelpay-de_DE.po b/languages/woocommerce-heidelpay-de_DE.po index 1020fe5..957b4d0 100644 --- a/languages/woocommerce-heidelpay-de_DE.po +++ b/languages/woocommerce-heidelpay-de_DE.po @@ -366,8 +366,8 @@ msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} msgid "direct_debit_info" msgstr "Der Betrag von {AMOUNT} {CURRENCY} wird in den nächsten Tagen von folgendem Konto abgebucht:

" - "IBAN: {Iban}

" - "Die Abbuchung enthält die Mandatsreferenz-ID: {Ident}
" - "und die Gläubiger ID: {CreditorId}

" - "
" - "Bitte sorgen Sie für ausreichende Deckung auf dem entsprechenden Konto." +"IBAN: {Iban}

" +"Die Abbuchung enthält die Mandatsreferenz-ID: {Ident}
" +"und die Gläubiger ID: {CreditorId}

" +"
" +"Bitte sorgen Sie für ausreichende Deckung auf dem entsprechenden Konto." From 041079f7a3775017f08919ebce9cfe807651abb5 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Tue, 9 Jun 2020 13:12:39 +0200 Subject: [PATCH 38/59] WOO-96 [refactor] Call translations directly by key. - remove tab from english translation file. --- .../abstract-wc-heidelpay-payment-gateway.php | 27 ++++++++++++------ .../class-wc-heidelpay-gateway-dd.php | 6 +++- .../class-wc-heidelpay-gateway-iv.php | 6 +++- .../class-wc-heidelpay-gateway-ivpg.php | 6 +++- .../class-wc-heidelpay-gateway-pp.php | 6 +++- languages/woocommerce-heidelpay-en_US.po | 28 +++++++++---------- 6 files changed, 52 insertions(+), 27 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index b09cc9d..44c2157 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -659,28 +659,27 @@ public function emailInstructions(WC_Order $order) public function setPaymentInfo(WC_Order $order, Response $response) { // Load template text for Payment information - if ($this->templateTextKey === '') { - return null; + $paymentInfoTemplate = $this->getPaymentInfoTemplate(); + if (empty($paymentInfoTemplate)) { + return; } - $payInfoTemplate = __($this->templateTextKey, 'woocommerce-heidelpay'); - $payInfo = $response->getConnector(); + $connector = $response->getConnector(); $presentation = $response->getPresentation(); $paymentData = [ '{AMOUNT}' => $presentation->getAmount(), '{CURRENCY}' => $presentation->getCurrency(), - '{CONNECTOR_ACCOUNT_HOLDER}' => $payInfo->getAccountHolder(), - '{CONNECTOR_ACCOUNT_IBAN}' => $payInfo->getAccountIBan(), - '{CONNECTOR_ACCOUNT_BIC}' => $payInfo->getAccountBic(), + '{CONNECTOR_ACCOUNT_HOLDER}' => $connector->getAccountHolder(), + '{CONNECTOR_ACCOUNT_IBAN}' => $connector->getAccountIBan(), + '{CONNECTOR_ACCOUNT_BIC}' => $connector->getAccountBic(), '{IDENTIFICATION_SHORTID}' => $response->getIdentification()->getShortId(), '{Iban}' => $response->getAccount()->getIban(), '{Ident}' => $response->getAccount()->getIdentification(), '{CreditorId}' => $response->getIdentification()->getCreditorId(), ]; - $paymentText = strtr($payInfoTemplate, $paymentData); - + $paymentText = strtr($paymentInfoTemplate, $paymentData); $order->add_meta_data('heidelpay-paymentInfo', $paymentText); } @@ -709,4 +708,14 @@ protected function getResponeUrl() { return get_home_url(null, '/wc-api/' . strtolower(get_class($this))); } + + /** Default Payment info template is empty. + * Override this method in order to assign an individual Template text translation. + * + * @return string|void + */ + public function getPaymentInfoTemplate() + { + return __('', 'woocommerce-heidelpay'); + } } diff --git a/includes/gateways/class-wc-heidelpay-gateway-dd.php b/includes/gateways/class-wc-heidelpay-gateway-dd.php index 4dffc78..3495ea4 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-dd.php +++ b/includes/gateways/class-wc-heidelpay-gateway-dd.php @@ -127,7 +127,6 @@ protected function setPayMethod() $this->id = 'hp_dd'; $this->has_fields = true; $this->name = __('Direct Debit', 'woocommerce-heidelpay'); - $this->templateTextKey = 'direct_debit_info'; } /** @@ -142,4 +141,9 @@ protected function handleFormPost() $this->payMethod->getRequest()->getAccount()->setIban(htmlspecialchars($_POST['accountiban'])); } } + + public function getPaymentInfoTemplate() + { + return __('direct_debit_info', 'woocommerce-heidelpay'); + } } \ No newline at end of file diff --git a/includes/gateways/class-wc-heidelpay-gateway-iv.php b/includes/gateways/class-wc-heidelpay-gateway-iv.php index f33fbc3..f473308 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-iv.php +++ b/includes/gateways/class-wc-heidelpay-gateway-iv.php @@ -53,12 +53,16 @@ public function init_form_fields() ); } + public function getPaymentInfoTemplate() + { + return __('invoice_info', 'woocommerce-heidelpay'); + } + /** * Set the id and PaymentMethod */ protected function setPayMethod() { - $this->templateTextKey = 'invoice_info'; $this->payMethod = new InvoicePaymentMethod(); $this->id = 'hp_iv'; $this->name = __('Invoice', 'woocommerce-heidelpay'); diff --git a/includes/gateways/class-wc-heidelpay-gateway-ivpg.php b/includes/gateways/class-wc-heidelpay-gateway-ivpg.php index 2401bd5..acff381 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-ivpg.php +++ b/includes/gateways/class-wc-heidelpay-gateway-ivpg.php @@ -57,6 +57,11 @@ public function checkoutValidation() } } + public function getPaymentInfoTemplate() + { + return __('invoice_info', 'woocommerce-heidelpay'); + } + private function is18($given) { $given = strtotime($given); @@ -297,7 +302,6 @@ protected function setPayMethod() $this->name = __('Secured Invoice', 'woocommerce-heidelpay'); $this->has_fields = true; $this->bookingAction = 'authorize'; - $this->templateTextKey = 'invoice_info'; } diff --git a/includes/gateways/class-wc-heidelpay-gateway-pp.php b/includes/gateways/class-wc-heidelpay-gateway-pp.php index cfd5f07..92a48cf 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-pp.php +++ b/includes/gateways/class-wc-heidelpay-gateway-pp.php @@ -82,6 +82,10 @@ protected function setPayMethod() $this->name = __('Prepayment', 'woocommerce-heidelpay'); $this->has_fields = false; $this->bookingAction = 'authorize'; - $this->templateTextKey = 'prepayment_info'; + } + + public function getPaymentInfoTemplate() + { + return __('prepayment_info', 'woocommerce-heidelpay'); } } diff --git a/languages/woocommerce-heidelpay-en_US.po b/languages/woocommerce-heidelpay-en_US.po index 9b2fac9..be32de4 100644 --- a/languages/woocommerce-heidelpay-en_US.po +++ b/languages/woocommerce-heidelpay-en_US.po @@ -1,25 +1,25 @@ msgid "invoice_info" msgstr "Please transfer the amount of {AMOUNT} {CURRENCY} after receiving your order to the following account

" - "Holder: {CONNECTOR_ACCOUNT_HOLDER}
" - "IBAN: {CONNECTOR_ACCOUNT_IBAN}

" - "BIC: {CONNECTOR_ACCOUNT_BIC}

" - "Please use only this identification number as the descriptor :
" - "{IDENTIFICATION_SHORTID}" +"Holder: {CONNECTOR_ACCOUNT_HOLDER}
" +"IBAN: {CONNECTOR_ACCOUNT_IBAN}

" +"BIC: {CONNECTOR_ACCOUNT_BIC}

" +"Please use only this identification number as the descriptor :
" +"{IDENTIFICATION_SHORTID}" msgid "prepayment_info" msgstr "Please transfer the amount of {AMOUNT} {CURRENCY} to the following account

" - "Holder: {CONNECTOR_ACCOUNT_HOLDER}
" - "IBAN: {CONNECTOR_ACCOUNT_IBAN}

" - "Please use only this identification number as the descriptor :
" - "{IDENTIFICATION_SHORTID}" +"Holder: {CONNECTOR_ACCOUNT_HOLDER}
" +"IBAN: {CONNECTOR_ACCOUNT_IBAN}

" +"Please use only this identification number as the descriptor :
" +"{IDENTIFICATION_SHORTID}" msgid "direct_debit_info" msgstr "The amount of {AMOUNT} {CURRENCY} will be debited from this account within the next days:

" - "IBAN: {Iban}

" - "The booking contains the mandate reference ID: {Ident}
" - "and the creditor identifier: {CreditorId}

" - "
" - "Please ensure that there will be sufficient funds on the corresponding account." +"IBAN: {Iban}

" +"The booking contains the mandate reference ID: {Ident}
" +"and the creditor identifier: {CreditorId}

" +"
" +"Please ensure that there will be sufficient funds on the corresponding account." msgid "datePlaceholder" msgstr "yyyy-mm-dd" From 83494e5db6fad3355c55162e5540cb960a06d916 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Tue, 9 Jun 2020 13:46:32 +0200 Subject: [PATCH 39/59] WOO-96 [refactor] translation: Update .pot file. --- languages/woocommerce-heidelpay.pot | 73 +++++++++++++++++------------ 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/languages/woocommerce-heidelpay.pot b/languages/woocommerce-heidelpay.pot index 457803d..c9b6ee3 100644 --- a/languages/woocommerce-heidelpay.pot +++ b/languages/woocommerce-heidelpay.pot @@ -9,7 +9,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2020-06-05T07:45:49+00:00\n" +"POT-Creation-Date: 2020-06-09T11:33:32+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.4.0\n" "X-Domain: woocommerce-heidelpay\n" @@ -49,7 +49,7 @@ msgstr "" #: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:60 #: includes/gateways/class-wc-heidelpay-gateway-dd.php:77 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:77 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:82 #: includes/gateways/class-wc-heidelpay-gateway-pp.php:47 msgid "%s" msgstr "" @@ -64,7 +64,7 @@ msgstr "" #: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:99 #: includes/gateways/class-wc-heidelpay-gateway-dd.php:79 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:86 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:91 #: includes/gateways/class-wc-heidelpay-gateway-pp.php:56 msgid "Enable %s" msgstr "" @@ -88,7 +88,7 @@ msgstr "" #: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:117 #: includes/gateways/class-wc-heidelpay-gateway-dd.php:78 #: includes/gateways/class-wc-heidelpay-gateway-iv.php:35 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:79 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:84 #: includes/gateways/class-wc-heidelpay-gateway-pp.php:49 msgid "Insert payment data for %s" msgstr "" @@ -134,19 +134,19 @@ msgstr "" msgid "Payment error: " msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:693 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:692 msgid "Bookingmode" msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:696 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:695 msgid "Debit" msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:697 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:696 msgid "Authorization" msgstr "" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:700 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:699 msgid "Choose a bookingmode" msgstr "" @@ -180,14 +180,14 @@ msgstr "" #: includes/gateways/class-wc-heidelpay-gateway-dd.php:85 #: includes/gateways/class-wc-heidelpay-gateway-iv.php:45 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:93 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:98 #: includes/gateways/class-wc-heidelpay-gateway-pp.php:63 msgid "Payment information mail" msgstr "" #: includes/gateways/class-wc-heidelpay-gateway-dd.php:87 #: includes/gateways/class-wc-heidelpay-gateway-iv.php:47 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:95 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:100 #: includes/gateways/class-wc-heidelpay-gateway-pp.php:65 msgid "Add payment information to e-mail" msgstr "" @@ -222,17 +222,17 @@ msgid "Chose a bank please." msgstr "" #: includes/gateways/class-wc-heidelpay-gateway-iv.php:38 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:82 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:87 #: includes/gateways/class-wc-heidelpay-gateway-pp.php:52 msgid "please send the money to IBAN BIC " msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-iv.php:64 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:68 msgid "Invoice" msgstr "" #: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:41 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:281 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:286 msgid "You have to be at least 18 years old in order to use secured invoice" msgstr "" @@ -244,64 +244,64 @@ msgstr "" msgid "You are not allowed to use secured invoice with a company name" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:104 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:109 msgid "Advanced options" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:110 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:115 msgid "Minimum Amount" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:117 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:122 msgid "Maxmimum Amount" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:124 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:129 msgid "Available Countries for secured invoice" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:126 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:131 msgid "Here you can enable secured Invoice for specific countries. Be aware that this will not enable the country in your WooCommerce settings and you have to enable them seperately." msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:134 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:139 msgid "Enable Germany" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:140 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:145 msgid "Enable Austria" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:221 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:226 msgid "Salutation" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:222 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:227 msgid "Mr" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:223 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:228 msgid "Mrs" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:224 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:316 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:229 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:320 msgid "Birthdate" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:225 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:230 msgid "datePlaceholder" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:226 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:231 msgid "dateFormat" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:297 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:302 msgid "Secured Invoice" msgstr "" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:317 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:321 msgid "invalid date format" msgstr "" @@ -336,3 +336,18 @@ msgstr "" #: woocommerce-heidelpay.php:252 msgid "cURL is not installed." msgstr "" + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:147 +msgid "direct_debit_info" +msgstr "" + +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:58 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:62 +msgid "invoice_info" +msgstr "" + + +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:89 +msgid "prepayment_info" +msgstr "" + From 43dcded1ab4d4f85485d9d2420a147e0b9f6c420 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Tue, 9 Jun 2020 14:43:27 +0200 Subject: [PATCH 40/59] WOO-96 [refactor] translation: Update .po files. --- languages/woocommerce-heidelpay-de_DE.po | 107 ++++++++++++----------- languages/woocommerce-heidelpay-en_US.po | 42 +++++---- languages/woocommerce-heidelpay.pot | 5 +- 3 files changed, 85 insertions(+), 69 deletions(-) diff --git a/languages/woocommerce-heidelpay-de_DE.po b/languages/woocommerce-heidelpay-de_DE.po index 957b4d0..1cc9b59 100644 --- a/languages/woocommerce-heidelpay-de_DE.po +++ b/languages/woocommerce-heidelpay-de_DE.po @@ -46,14 +46,14 @@ msgstr "Auf Zahlung warten" msgid "Pay Now" msgstr "Jetzt bezahlen" -#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:180 +#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:180 #: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:417 msgid " Error: Paymentmethod was not found: " msgstr "Fehler: Zahlart nicht gefunden: " -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:60 -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:77 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:77 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:60 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:77 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:82 #: includes/gateways/class-wc-heidelpay-gateway-pp.php:47 msgid "%s" msgstr "%s" @@ -66,9 +66,9 @@ msgstr "heidelpay %s" msgid "Enable/Disable" msgstr "Aktivieren" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:99 -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:79 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:86 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:99 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:79 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:91 #: includes/gateways/class-wc-heidelpay-gateway-pp.php:56 msgid "Enable %s" msgstr "%s aktivieren" @@ -89,10 +89,10 @@ msgstr "Beschreibung" msgid "Payment method description that the customer will see on your checkout." msgstr "Beschreibung der Zahlart im Checkout" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:117 -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:78 -#: includes/gateways/class-wc-heidelpay-gateway-iv.php:35 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:79 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:117 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:78 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:35 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:84 #: includes/gateways/class-wc-heidelpay-gateway-pp.php:49 msgid "Insert payment data for %s" msgstr "Zahlungsdaten für %s einfügen" @@ -133,24 +133,24 @@ msgstr "Sandbox" msgid "Enable sandbox mode" msgstr "Sandbox-Modus aktivieren" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:452 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:452 #: includes/gateways/class-wc-heidelpay-gateway-idl.php:104 msgid "Payment error: " msgstr "Zahlungsfehler: " -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:693 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:692 msgid "Bookingmode" msgstr "Buchungsmodus" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:696 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:695 msgid "Debit" msgstr "Direktbuchung" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:697 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:696 msgid "Authorization" msgstr "Authorisierung" -#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:700 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:699 msgid "Choose a bookingmode" msgstr "Buchungsmodus wählen" @@ -184,21 +184,21 @@ msgstr "Bitte den Kontoinhaber eingeben" msgid "You have to enter the IBAN" msgstr "Bitte die IBAN eingeben" -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:85 -#: includes/gateways/class-wc-heidelpay-gateway-iv.php:45 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:93 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:85 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:45 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:98 #: includes/gateways/class-wc-heidelpay-gateway-pp.php:63 msgid "Payment information mail" msgstr "Zahlungsdaten per mail" -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:87 -#: includes/gateways/class-wc-heidelpay-gateway-iv.php:47 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:95 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:87 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:47 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:100 #: includes/gateways/class-wc-heidelpay-gateway-pp.php:65 msgid "Add payment information to e-mail" msgstr "Fügt Zahlungsdaten der Bestätigungsmail hinzu" -#: includes/gateways/class-wc-heidelpay-gateway-dd.php:103 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:103 #: includes/gateways/class-wc-heidelpay-gateway-idl.php:60 msgid "Account Holder" msgstr "Kontoinhaber" @@ -227,18 +227,18 @@ msgstr "Bank" msgid "Chose a bank please." msgstr "Bitte eine Bank wählen" -#: includes/gateways/class-wc-heidelpay-gateway-iv.php:38 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:82 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:38 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:87 #: includes/gateways/class-wc-heidelpay-gateway-pp.php:52 msgid "please send the money to IBAN BIC " msgstr "Bitte überweisen Sie an IBAN BIC " -#: includes/gateways/class-wc-heidelpay-gateway-iv.php:64 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:68 msgid "Invoice" msgstr "Rechnungskauf" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:41 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:281 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:41 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:286 msgid "You have to be at least 18 years old in order to use secured invoice" msgstr "Der versicherte Rechnungskauf ist erst ab 18 Jahren möglich" @@ -250,23 +250,23 @@ msgstr "Bitte Anrede wählen" msgid "You are not allowed to use secured invoice with a company name" msgstr "Der versicherte Rechnungskauf ist nicht für Firmenkunden möglich" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:104 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:109 msgid "Advanced options" msgstr "Erweiterte Optionen" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:110 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:115 msgid "Minimum Amount" msgstr "Mindestbetrag" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:117 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:122 msgid "Maxmimum Amount" msgstr "Maximalbetrag" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:124 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:129 msgid "Available Countries for secured invoice" msgstr "Erlaubte Länder für den versicherten Rechnungskauf" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:126 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:131 msgid "" "Here you can enable secured Invoice for specific countries. Be aware that " "this will not enable the country in your WooCommerce settings and you have " @@ -276,44 +276,44 @@ msgstr "" "beschränken.Bitte beachten Sie, dass sie entsprechende Länder weiterhin in " "den WooCommerce Einstellungen aktivieren müssen" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:134 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:139 msgid "Enable Germany" msgstr "Deutschland aktivieren" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:140 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:145 msgid "Enable Austria" msgstr "Österreich aktivieren" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:221 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:226 msgid "Salutation" msgstr "Anrede" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:222 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:227 msgid "Mr" msgstr "Herr" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:223 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:228 msgid "Mrs" msgstr "Frau" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:224 -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:316 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:229 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:320 msgid "Birthdate" msgstr "Geburtsdatum" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:225 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:230 msgid "datePlaceholder" msgstr "tt.mm.jjjj" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:226 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:231 msgid "dateFormat" msgstr "dd.mm.yy" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:297 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:302 msgid "Secured Invoice" msgstr "Versicherter Rechnungskauf" -#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:317 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:321 msgid "invalid date format" msgstr "Ungültiges Datumsformat." @@ -349,6 +349,17 @@ msgstr "WooCommerce-Version zu niedrig" msgid "cURL is not installed." msgstr "cURL ist nicht installiert" +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:147 +msgid "direct_debit_info" +msgstr "Der Betrag von {AMOUNT} {CURRENCY} wird in den nächsten Tagen von folgendem Konto abgebucht:

" +"IBAN: {Iban}

" +"Die Abbuchung enthält die Mandatsreferenz-ID: {Ident}
" +"und die Gläubiger ID: {CreditorId}

" +"
" +"Bitte sorgen Sie für ausreichende Deckung auf dem entsprechenden Konto." + +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:58 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:62 msgid "invoice_info" msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} nach Erhalt der Ware auf folgendes Konto:

" "Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER}
" @@ -357,6 +368,7 @@ msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} "Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an:
" "{IDENTIFICATION_SHORTID}" +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:89 msgid "prepayment_info" msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} auf folgendes Konto:

" "Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER}
" @@ -364,10 +376,3 @@ msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} "Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an:
" "{IDENTIFICATION_SHORTID}" -msgid "direct_debit_info" -msgstr "Der Betrag von {AMOUNT} {CURRENCY} wird in den nächsten Tagen von folgendem Konto abgebucht:

" -"IBAN: {Iban}

" -"Die Abbuchung enthält die Mandatsreferenz-ID: {Ident}
" -"und die Gläubiger ID: {CreditorId}

" -"
" -"Bitte sorgen Sie für ausreichende Deckung auf dem entsprechenden Konto." diff --git a/languages/woocommerce-heidelpay-en_US.po b/languages/woocommerce-heidelpay-en_US.po index be32de4..d9c76d5 100644 --- a/languages/woocommerce-heidelpay-en_US.po +++ b/languages/woocommerce-heidelpay-en_US.po @@ -1,3 +1,27 @@ + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:230 +msgid "datePlaceholder" +msgstr "yyyy-mm-dd" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:231 +msgid "dateFormat" +msgstr "yy-mm-dd" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:321 +msgid "invalid date format" +msgstr "Invalid date format." + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:147 +msgid "direct_debit_info" +msgstr "The amount of {AMOUNT} {CURRENCY} will be debited from this account within the next days:

" +"IBAN: {Iban}

" +"The booking contains the mandate reference ID: {Ident}
" +"and the creditor identifier: {CreditorId}

" +"
" +"Please ensure that there will be sufficient funds on the corresponding account." + +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:58 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:62 msgid "invoice_info" msgstr "Please transfer the amount of {AMOUNT} {CURRENCY} after receiving your order to the following account

" "Holder: {CONNECTOR_ACCOUNT_HOLDER}
" @@ -6,26 +30,10 @@ msgstr "Please transfer the amount of {AMOUNT} {CURRENCY} after "Please use only this identification number as the descriptor :
" "{IDENTIFICATION_SHORTID}" +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:89 msgid "prepayment_info" msgstr "Please transfer the amount of {AMOUNT} {CURRENCY} to the following account

" "Holder: {CONNECTOR_ACCOUNT_HOLDER}
" "IBAN: {CONNECTOR_ACCOUNT_IBAN}

" "Please use only this identification number as the descriptor :
" "{IDENTIFICATION_SHORTID}" - -msgid "direct_debit_info" -msgstr "The amount of {AMOUNT} {CURRENCY} will be debited from this account within the next days:

" -"IBAN: {Iban}

" -"The booking contains the mandate reference ID: {Ident}
" -"and the creditor identifier: {CreditorId}

" -"
" -"Please ensure that there will be sufficient funds on the corresponding account." - -msgid "datePlaceholder" -msgstr "yyyy-mm-dd" - -msgid "dateFormat" -msgstr "yy-mm-dd" - -msgid "invalid date format" -msgstr "Invalid date format." \ No newline at end of file diff --git a/languages/woocommerce-heidelpay.pot b/languages/woocommerce-heidelpay.pot index c9b6ee3..372470d 100644 --- a/languages/woocommerce-heidelpay.pot +++ b/languages/woocommerce-heidelpay.pot @@ -261,7 +261,10 @@ msgid "Available Countries for secured invoice" msgstr "" #: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:131 -msgid "Here you can enable secured Invoice for specific countries. Be aware that this will not enable the country in your WooCommerce settings and you have to enable them seperately." +msgid "" +"Here you can enable secured Invoice for specific countries. Be aware that " +"this will not enable the country in your WooCommerce settings and you have " +"to enable them seperately." msgstr "" #: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:139 From 9733db418452216f97c01319a4d9ff65b7020db0 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Fri, 12 Jun 2020 11:42:20 +0200 Subject: [PATCH 41/59] WOO-96 [refactor] add trlanslation for de_DE-formal (copied from de_DE) --- .../woocommerce-heidelpay-de_DE-formal.mo | Bin 0 -> 5466 bytes .../woocommerce-heidelpay-de_DE-formal.po | 378 ++++++++++++++++++ 2 files changed, 378 insertions(+) create mode 100644 languages/woocommerce-heidelpay-de_DE-formal.mo create mode 100644 languages/woocommerce-heidelpay-de_DE-formal.po diff --git a/languages/woocommerce-heidelpay-de_DE-formal.mo b/languages/woocommerce-heidelpay-de_DE-formal.mo new file mode 100644 index 0000000000000000000000000000000000000000..597ccd86c776d0129d8faf337f10267f07d3985e GIT binary patch literal 5466 zcmbW4TZ|-C8Gw&+5yuM(?gB#Oth$Q9>Y0UwT^p9zGd;UA?99@cnFU16rn>5McQMsf zZPlsioe>S;#h92FW84S4Bqk_NDn7`AnfTzm;3Jy&fI>n9HAW5U3ok~$|5Wv5b|=9& z>FKY|sdM?ye>;D_a>Lc%Qv9v(e;fZ#yj@yK{r>6+kMj63ZFzOoHA=k~UJH-FL-2j@ z1bh!%f**$uSN&gx@2CBBC`*1Hz7zfsz6(AFKLB?tzF77D5%N+0HUZH^R?X{a=7L(0&rW1AY_!1b!QeTxaS0AZ$Tde-k#~MaW0} zoUiNQFQM%BYbg476p63!H^MT!P<#a;}#uz7A#n8xWDy zn^4yIPsQsw?ESQFhoYCyK{;O=9)(*_*82_=J3I?D{26=z{uVajAqL4gAA=u-1r$3z z4G+Uz$VdH#FWLVU$W--rD0+Dl9)j0kJP+OqZ-L8D&Kp3H?+GaKJypHGRK0%=ewhAW z!Q&|KuTaxIf>K4F^HBC#grcuC=+=RJ)Fr--!yiDg=Svm;2E~pdw9LN-iXLu&BCm!w z!FwTFs&m!*#~?>iJt*_?>iv_|`>#RK%hMHq3U8(T0+jQ<24()gp~S&;e2E=zfqU=> z6uDl9x5K|c*?)$h5PKemBIkNVzhVky-j^yq1v#Sn3SK@GQIu z<={FhfZ|Uv6uI)M{Y5B#@DxOJ^Onb2M@c8m`o4|QMB7vwukS}OBewh`FriKd@`e=(*3P0GH&8XU805EO zqZee|EHXLUWjZ%OkufVuw$dmtsxkB<8ztS*ZdY{F)V!Z;s`)6hz0kKt&8O)m6Z&ar z)Iu*!bEAFT-rrgFF;5R-^gY%|Jb@oMgkX}@o>z+fvYrpYzZJ286x7VF^xr6|nrGiYEk>=JL+)bf1eoLWwD zli86yH8%5|kSLK?HY>qcLEO|3@BzGkLYvs|H2eJ&jeB^0zNBV*j2c5~Ta{Gtk)(2VU`itE&eKcr}@ z)NO8zCP!clhG?xz!W}+<<*7TBzLK72cdY#y@%S~R7$7cpbZk2JD z7eQe1yi>$A-EuCi3!Gd;=tV8jmD|sCu$&x_jWbg{t93svY#EvBr7x;=6J*8;TtJSL z>DrM+B9lla*bvVNQbIV5bGN>YEMYzDMM2NC5k%se01t~yLV0rZ4H>F7GC#?EXLh}S zITI5f)aSfpfB2l2rB~8!lqmPu^7DL{62jANI*1DfILDSv(3lC;XK)zteo1qF9H+z5 zqeN+=2&z&Lrn5a#NRaji#IjEOzH!q>-Yy<#wJ6={V<+{t@v~f$CM9N&1qo6A0SoV2 z1cS&x?B#+)#2c+YdF5A0xK}3OD+f8x$|trA&abU#>?5a)2rf>FTPewtr(Mo=kFD4b zOtofjnvt|Z_rMH@QqtKf#y1BQJGNU@E zc;bL4&1-4aoz07Z44y6Badw!d9Ni^SZ@k4!>!A>H>$PYjWPYzH9ETIdAS>Z|dv{j`rI6Yy*0BH$=R@#r#;xF)o(rt+>ei*b`^U z>pJ0VH1kt;-N(f$kEarSf%JF$I#sZIRn@BHns#9 z#-2LAaoRgM87EnyV=`|s3DS@}Qr9QBr)M7ZR?wuk&g~Q!dG=%03(W<@d(=B)61jfl z)G};rn^?w0-2ClmXO?lzl$@T_^}%MT_GpP*ti!ay1q2B|u2da?9A=J#Tsn=K*n zS=}`qiYLR8iugIpVbdt-`E63>>Al^qb;Ap8Px0ymc{8r$-0nSNqpozz6+`Y$b_%ta z4NXLP!22I^MTkj8)l?ptjL{5<{i4l)mAz*qE$hzSZpNZX83SZoW+!^h1ieI7-}H+P zYjj3ZQ1Z!ugSuRKb;h)d%!;fqh*0{|5;aO zZOU%0l-jiIa<#JFDqo<8pqH7bEk_gYm1fkjXj1!|q;O8n9($K^w8A(pnyK!lDP%${ zrNC4-TF-Q&opQa%^|x=O>dy049c@PT6hCDJ)H4-+--5S%+?m#2|WfM8u*o|}X zTumg1Sc~4ORAy?w8&aN0DsLN``CTc_sHAMwqQWI!GQUs{8oOiB+YUk^%ShHv6@254 zQg~`kEfJ*Vr(DSe*(ge*KD9ftoo#Jc?2NeB-^HRgT}j7l(f z6_p{JT^7QZS7Y;LN5Vm3d@PjYr0LU6jX9{yI;gKqCzA-s%W~_W%B#t5$7$E&hUj|B zcqP?QnHfj!CqJ>W>HM_+Y*RCwE1r%r;&#&|Rs8n(Zp=adhb6ejDe>A;nmy=~Rg%f% z(mEkApfB*mh literal 0 HcmV?d00001 diff --git a/languages/woocommerce-heidelpay-de_DE-formal.po b/languages/woocommerce-heidelpay-de_DE-formal.po new file mode 100644 index 0000000..1cc9b59 --- /dev/null +++ b/languages/woocommerce-heidelpay-de_DE-formal.po @@ -0,0 +1,378 @@ +msgid "" +msgstr "" +"Project-Id-Version: heidelpay WooCommerce 1.7.0\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-" +"heidelpay\n" +"POT-Creation-Date: 2020-06-05T07:45:49+00:00\n" +"PO-Revision-Date: 2020-06-05 08:31+0000\n" +"Last-Translator: Florian Evertz \n" +"Language-Team: German (Germany)\n" +"Language: de-DE\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Loco-Source-Locale: de_DE\n" +"X-Generator: Loco https://localise.biz/\n" +"X-Domain: woocommerce-heidelpay\n" +"\n" +"X-Loco-Parser: loco_parse_po" + +#. Plugin Name of the plugin +msgid "heidelpay WooCommerce" +msgstr "heidelpay WooCommerce" + +#. Plugin URI of the plugin +msgid "https://dev.heidelpay.com" +msgstr "https://dev.heidelpay.com" + +#. Description of the plugin +msgid "heidelpay payment integration for WooCommerce" +msgstr "heidelpay Zahlarten für WooCommerce" + +#. Author of the plugin +msgid "heidelpay" +msgstr "heidelpay GmbH" + +#. Author URI of the plugin +msgid "htts://www.heidelpay.com" +msgstr "htts://www.heidelpay.com" + +#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:62 +msgid "Awaiting payment" +msgstr "Auf Zahlung warten" + +#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:163 +msgid "Pay Now" +msgstr "Jetzt bezahlen" + +#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:180 +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:417 +msgid " Error: Paymentmethod was not found: " +msgstr "Fehler: Zahlart nicht gefunden: " + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:60 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:77 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:82 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:47 +msgid "%s" +msgstr "%s" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:61 +msgid "heidelpay %s" +msgstr "heidelpay %s" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:97 +msgid "Enable/Disable" +msgstr "Aktivieren" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:99 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:79 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:91 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:56 +msgid "Enable %s" +msgstr "%s aktivieren" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:103 +msgid "Title" +msgstr "Bezeichnung" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:106 +msgid "This controls the title which the user sees during checkout." +msgstr "Bezeichnung der Zahlart im Checkout" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:111 +msgid "Description" +msgstr "Beschreibung" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:113 +msgid "Payment method description that the customer will see on your checkout." +msgstr "Beschreibung der Zahlart im Checkout" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:117 +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:78 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:35 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:84 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:49 +msgid "Insert payment data for %s" +msgstr "Zahlungsdaten für %s einfügen" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:121 +msgid "Instructions" +msgstr "Anweisungen" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:123 +msgid "Instructions that will be added to the thank you page and emails." +msgstr "Anweisungen auf der Bestellbestätigungsseite und in E-Mails" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:131 +msgid "Security Sender" +msgstr "Security Sender" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:138 +msgid "User Login" +msgstr "User Login" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:145 +msgid "User Password" +msgstr "User Password" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:152 +msgid "Transaction Channel" +msgstr "Transaction Channel" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:159 +msgid "Secret" +msgstr "Secret" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:167 +msgid "Sandbox" +msgstr "Sandbox" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:170 +msgid "Enable sandbox mode" +msgstr "Sandbox-Modus aktivieren" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:452 +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:104 +msgid "Payment error: " +msgstr "Zahlungsfehler: " + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:692 +msgid "Bookingmode" +msgstr "Buchungsmodus" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:695 +msgid "Debit" +msgstr "Direktbuchung" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:696 +msgid "Authorization" +msgstr "Authorisierung" + +#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:699 +msgid "Choose a bookingmode" +msgstr "Buchungsmodus wählen" + +#: includes/class-wc-heidelpay-push.php:123 +msgid "Payment of %s %s received. Heidelpay ShortID %s" +msgstr "Zahlung über %s %s erhalten. heidelpay Short-ID %s" + +#: includes/class-wc-heidelpay-response.php:111 +msgid "" +"Payment reservation successful. Please use the hiP to check the payment." +msgstr "" +"Reservierung der Zahlung erfolgreich. Bitte Zahlungseingang im hIP prüfen." + +#: includes/class-wc-heidelpay-response.php:119 +msgid "Awaiting payment." +msgstr "Auf Zahlung warten" + +#: includes/gateways/class-wc-heidelpay-gateway-cc.php:55 +msgid "Credit Card" +msgstr "Kreditkarte" + +#: includes/gateways/class-wc-heidelpay-gateway-dc.php:55 +msgid "Debit Card" +msgstr "Debitkarte" + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:57 +msgid "You have to enter the account holder" +msgstr "Bitte den Kontoinhaber eingeben" + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:64 +msgid "You have to enter the IBAN" +msgstr "Bitte die IBAN eingeben" + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:85 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:45 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:98 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:63 +msgid "Payment information mail" +msgstr "Zahlungsdaten per mail" + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:87 +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:47 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:100 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:65 +msgid "Add payment information to e-mail" +msgstr "Fügt Zahlungsdaten der Bestätigungsmail hinzu" + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:103 +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:60 +msgid "Account Holder" +msgstr "Kontoinhaber" + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:104 +msgid "IBAN" +msgstr "IBAN" + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:129 +msgid "Direct Debit" +msgstr "Lastschrift" + +#: includes/gateways/class-wc-heidelpay-gateway-gp.php:36 +msgid "GiroPay" +msgstr "GiroPay" + +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:36 +msgid "iDeal" +msgstr "iDeal" + +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:61 +msgid "Bank" +msgstr "Bank" + +#: includes/gateways/class-wc-heidelpay-gateway-idl.php:104 +msgid "Chose a bank please." +msgstr "Bitte eine Bank wählen" + +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:38 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:87 +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:52 +msgid "please send the money to IBAN BIC " +msgstr "Bitte überweisen Sie an IBAN BIC " + +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:68 +msgid "Invoice" +msgstr "Rechnungskauf" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:41 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:286 +msgid "You have to be at least 18 years old in order to use secured invoice" +msgstr "Der versicherte Rechnungskauf ist erst ab 18 Jahren möglich" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:47 +msgid "You have to enter your salutation" +msgstr "Bitte Anrede wählen" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:54 +msgid "You are not allowed to use secured invoice with a company name" +msgstr "Der versicherte Rechnungskauf ist nicht für Firmenkunden möglich" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:109 +msgid "Advanced options" +msgstr "Erweiterte Optionen" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:115 +msgid "Minimum Amount" +msgstr "Mindestbetrag" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:122 +msgid "Maxmimum Amount" +msgstr "Maximalbetrag" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:129 +msgid "Available Countries for secured invoice" +msgstr "Erlaubte Länder für den versicherten Rechnungskauf" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:131 +msgid "" +"Here you can enable secured Invoice for specific countries. Be aware that " +"this will not enable the country in your WooCommerce settings and you have " +"to enable them seperately." +msgstr "" +"Hier können Sie den versicherten Rechnungskauf auf bestimmte Länder " +"beschränken.Bitte beachten Sie, dass sie entsprechende Länder weiterhin in " +"den WooCommerce Einstellungen aktivieren müssen" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:139 +msgid "Enable Germany" +msgstr "Deutschland aktivieren" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:145 +msgid "Enable Austria" +msgstr "Österreich aktivieren" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:226 +msgid "Salutation" +msgstr "Anrede" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:227 +msgid "Mr" +msgstr "Herr" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:228 +msgid "Mrs" +msgstr "Frau" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:229 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:320 +msgid "Birthdate" +msgstr "Geburtsdatum" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:230 +msgid "datePlaceholder" +msgstr "tt.mm.jjjj" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:231 +msgid "dateFormat" +msgstr "dd.mm.yy" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:302 +msgid "Secured Invoice" +msgstr "Versicherter Rechnungskauf" + +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:321 +msgid "invalid date format" +msgstr "Ungültiges Datumsformat." + +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:82 +msgid "Prepayment" +msgstr "Vorkasse" + +#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:84 +msgid "Enable/Disable Sub" +msgstr "Abonnement aktiv" + +#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:86 +msgid "Enable for Subscriptions" +msgstr "Für Abonnements aktivieren" + +#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:90 +msgid "Transaction Channel for Subscriptions" +msgstr "Transaction Channel für Abonnements" + +#: woocommerce-heidelpay.php:236 +msgid "minimal PHP version error" +msgstr "PHP-Version zu niedrig" + +#: woocommerce-heidelpay.php:242 +msgid "WooCommerce plugin not activated" +msgstr "Das WooCommerce Plug-In ist nicht aktiviert" + +#: woocommerce-heidelpay.php:246 +msgid "minimal WC version error" +msgstr "WooCommerce-Version zu niedrig" + +#: woocommerce-heidelpay.php:252 +msgid "cURL is not installed." +msgstr "cURL ist nicht installiert" + +#: includes/gateways/class-wc-heidelpay-gateway-dd.php:147 +msgid "direct_debit_info" +msgstr "Der Betrag von {AMOUNT} {CURRENCY} wird in den nächsten Tagen von folgendem Konto abgebucht:

" +"IBAN: {Iban}

" +"Die Abbuchung enthält die Mandatsreferenz-ID: {Ident}
" +"und die Gläubiger ID: {CreditorId}

" +"
" +"Bitte sorgen Sie für ausreichende Deckung auf dem entsprechenden Konto." + +#: includes/gateways/class-wc-heidelpay-gateway-iv.php:58 +#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:62 +msgid "invoice_info" +msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} nach Erhalt der Ware auf folgendes Konto:

" +"Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER}
" +"IBAN: {CONNECTOR_ACCOUNT_IBAN}
" +"BIC: {CONNECTOR_ACCOUNT_BIC}

" +"Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an:
" +"{IDENTIFICATION_SHORTID}" + +#: includes/gateways/class-wc-heidelpay-gateway-pp.php:89 +msgid "prepayment_info" +msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} auf folgendes Konto:

" +"Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER}
" +"IBAN: {CONNECTOR_ACCOUNT_IBAN}

" +"Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an:
" +"{IDENTIFICATION_SHORTID}" + From 5f6e31edc332f14c2c52e29de213503f0e35db4f Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Fri, 12 Jun 2020 12:51:29 +0200 Subject: [PATCH 42/59] WOO-96 [refactor] update langauge files --- .../woocommerce-heidelpay-de_DE-formal.mo | Bin 5466 -> 0 bytes languages/woocommerce-heidelpay-de_DE.mo | Bin 5466 -> 7092 bytes .../woocommerce-heidelpay-de_DE_formal.mo | Bin 0 -> 7092 bytes ... => woocommerce-heidelpay-de_DE_formal.po} | 0 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 languages/woocommerce-heidelpay-de_DE-formal.mo create mode 100644 languages/woocommerce-heidelpay-de_DE_formal.mo rename languages/{woocommerce-heidelpay-de_DE-formal.po => woocommerce-heidelpay-de_DE_formal.po} (100%) diff --git a/languages/woocommerce-heidelpay-de_DE-formal.mo b/languages/woocommerce-heidelpay-de_DE-formal.mo deleted file mode 100644 index 597ccd86c776d0129d8faf337f10267f07d3985e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5466 zcmbW4TZ|-C8Gw&+5yuM(?gB#Oth$Q9>Y0UwT^p9zGd;UA?99@cnFU16rn>5McQMsf zZPlsioe>S;#h92FW84S4Bqk_NDn7`AnfTzm;3Jy&fI>n9HAW5U3ok~$|5Wv5b|=9& z>FKY|sdM?ye>;D_a>Lc%Qv9v(e;fZ#yj@yK{r>6+kMj63ZFzOoHA=k~UJH-FL-2j@ z1bh!%f**$uSN&gx@2CBBC`*1Hz7zfsz6(AFKLB?tzF77D5%N+0HUZH^R?X{a=7L(0&rW1AY_!1b!QeTxaS0AZ$Tde-k#~MaW0} zoUiNQFQM%BYbg476p63!H^MT!P<#a;}#uz7A#n8xWDy zn^4yIPsQsw?ESQFhoYCyK{;O=9)(*_*82_=J3I?D{26=z{uVajAqL4gAA=u-1r$3z z4G+Uz$VdH#FWLVU$W--rD0+Dl9)j0kJP+OqZ-L8D&Kp3H?+GaKJypHGRK0%=ewhAW z!Q&|KuTaxIf>K4F^HBC#grcuC=+=RJ)Fr--!yiDg=Svm;2E~pdw9LN-iXLu&BCm!w z!FwTFs&m!*#~?>iJt*_?>iv_|`>#RK%hMHq3U8(T0+jQ<24()gp~S&;e2E=zfqU=> z6uDl9x5K|c*?)$h5PKemBIkNVzhVky-j^yq1v#Sn3SK@GQIu z<={FhfZ|Uv6uI)M{Y5B#@DxOJ^Onb2M@c8m`o4|QMB7vwukS}OBewh`FriKd@`e=(*3P0GH&8XU805EO zqZee|EHXLUWjZ%OkufVuw$dmtsxkB<8ztS*ZdY{F)V!Z;s`)6hz0kKt&8O)m6Z&ar z)Iu*!bEAFT-rrgFF;5R-^gY%|Jb@oMgkX}@o>z+fvYrpYzZJ286x7VF^xr6|nrGiYEk>=JL+)bf1eoLWwD zli86yH8%5|kSLK?HY>qcLEO|3@BzGkLYvs|H2eJ&jeB^0zNBV*j2c5~Ta{Gtk)(2VU`itE&eKcr}@ z)NO8zCP!clhG?xz!W}+<<*7TBzLK72cdY#y@%S~R7$7cpbZk2JD z7eQe1yi>$A-EuCi3!Gd;=tV8jmD|sCu$&x_jWbg{t93svY#EvBr7x;=6J*8;TtJSL z>DrM+B9lla*bvVNQbIV5bGN>YEMYzDMM2NC5k%se01t~yLV0rZ4H>F7GC#?EXLh}S zITI5f)aSfpfB2l2rB~8!lqmPu^7DL{62jANI*1DfILDSv(3lC;XK)zteo1qF9H+z5 zqeN+=2&z&Lrn5a#NRaji#IjEOzH!q>-Yy<#wJ6={V<+{t@v~f$CM9N&1qo6A0SoV2 z1cS&x?B#+)#2c+YdF5A0xK}3OD+f8x$|trA&abU#>?5a)2rf>FTPewtr(Mo=kFD4b zOtofjnvt|Z_rMH@QqtKf#y1BQJGNU@E zc;bL4&1-4aoz07Z44y6Badw!d9Ni^SZ@k4!>!A>H>$PYjWPYzH9ETIdAS>Z|dv{j`rI6Yy*0BH$=R@#r#;xF)o(rt+>ei*b`^U z>pJ0VH1kt;-N(f$kEarSf%JF$I#sZIRn@BHns#9 z#-2LAaoRgM87EnyV=`|s3DS@}Qr9QBr)M7ZR?wuk&g~Q!dG=%03(W<@d(=B)61jfl z)G};rn^?w0-2ClmXO?lzl$@T_^}%MT_GpP*ti!ay1q2B|u2da?9A=J#Tsn=K*n zS=}`qiYLR8iugIpVbdt-`E63>>Al^qb;Ap8Px0ymc{8r$-0nSNqpozz6+`Y$b_%ta z4NXLP!22I^MTkj8)l?ptjL{5<{i4l)mAz*qE$hzSZpNZX83SZoW+!^h1ieI7-}H+P zYjj3ZQ1Z!ugSuRKb;h)d%!;fqh*0{|5;aO zZOU%0l-jiIa<#JFDqo<8pqH7bEk_gYm1fkjXj1!|q;O8n9($K^w8A(pnyK!lDP%${ zrNC4-TF-Q&opQa%^|x=O>dy049c@PT6hCDJ)H4-+--5S%+?m#2|WfM8u*o|}X zTumg1Sc~4ORAy?w8&aN0DsLN``CTc_sHAMwqQWI!GQUs{8oOiB+YUk^%ShHv6@254 zQg~`kEfJ*Vr(DSe*(ge*KD9ftoo#Jc?2NeB-^HRgT}j7l(f z6_p{JT^7QZS7Y;LN5Vm3d@PjYr0LU6jX9{yI;gKqCzA-s%W~_W%B#t5$7$E&hUj|B zcqP?QnHfj!CqJ>W>HM_+Y*RCwE1r%r;&#&|Rs8n(Zp=adhb6ejDe>A;nmy=~Rg%f% z(mEkApfB*mh diff --git a/languages/woocommerce-heidelpay-de_DE.mo b/languages/woocommerce-heidelpay-de_DE.mo index 597ccd86c776d0129d8faf337f10267f07d3985e..d9162dd4e3ca35675771557c193466eacb49a554 100644 GIT binary patch delta 2951 zcmcJPZHQD=7{`z9s=2P(`cheG*Yc%&*)26+)^&4sX5F21XK-CtvShn6b9d*qGk4_9 zjMgs8Q1+of2s1;7BK#6zC1gkmMlVJX7DRqBQSd`ANQ6WbNzm^<_pSx*7o!gI+}}C( zob#OL`9J5*xh3zdsa%**d&tm|*qzu*%3Org;3YU8UV%5m znUjo}3Kzh|a0S%+ov;B8!df^2C&Opp6k{r8Kb={;I2`irV8VO?6~kAs4xSC)Uxf9H zFGD%{9V(#lHwA2fw=uThOt>z5-vwtdehjk36yPz=H+$(Qvc-729WH}9paVu=57dU2 z;dJ;K)Pe6nDRK(dz>lETorYR>1}c#Aumk=Io8Shr>4bS$$NA=jI`Cs2a&QKssyPeg z=-ZH&VGHA{P|B=DKV{eoRibXllz9@W6#JkB55QLVE{wq|P>HT4%gO>eTj{8ld*Chb zFqETXPyw8Ts^J%qB+Plp&wR&YHv9!Hhm$#V4qOA3`BtbvpMVNKHFvFa)KJKyr!Z2XqsS(Z#$B)uDu5+WwO$PsX))x}Azy&n_iD%^Pzt;ObtPD zg-O^3hoKVs5K8H*kc2B{CSl^ktb{tS6DqPal*1f+bR3^4REFQMTcx-J@nL?33Sa_y z>ryR&l0L>mmv2}2J`JD8&j`eonZ#l9^!?AHqszAeZezjY5LD%o17)iWy0Fov?{^-? z(rVkpQ$eZeQ)|TT$D~{oQ?sg1?f_H?lGu9AH*riQ&<)>+-G`}$qfNm*j4cXZ%!R7G zniSZAJ)}X{RHg^R{(LC8_1BKvRb@f7sZ5n-9&537Y#p``TY{~|YA`OcNnpAg8!$E1 zRZTZNQtbtwqsoZ7W(5|*R6f;wtfmqylQ^nr2gZkRt*xTB7<&LyO?A;m+ZsBm_i{{s zM#daJS37HBL&o);bg3`nq})=U>-857{#5s7z3c5MxM?SNacIhp>AQVrxBXP!@xn!y zr~J4ySMXiiv)cDKerd>R=?}(@PIbI7>$n*w$EL<~A%FaG{hV>fYo_%~ti&AOYI91y zJz(uAcvefXXXG_g3Dc@>p4W98zTO`qJ4aZZqH*#%) zS+_OjI#wj5EoE=OBGYVeQm$lWnCh~=mmT-l+bboz7bAe%6*21|X^Th4bi?~#LDdm;taLc3Fkd@Yw0fn0mqEJX&|WmOxajDOw#9Td=Q@juLpgU~ zeGZ*fzM^AQi|Y2fgLcU+ctx+A&y%z5HHVeswv1ldc&t6q6W6@4xj_XKCwJZob(X^k4)7Sc*+pf~~j-yIuc9Tub{ZYRcQV8t-C} zS<1$!l+!WcocedeJ|LHUr|{y6>(BL=71Q>iCaOUNw9&Z(D{05D43D_})99x?hy|F& zN33txsVK5`daH0BYJn3N#dFAI&nbNP61CtPR7U187Z;GrmMHYxGAa-&G}{XyY`|V@ z#bNZazGYRxMbre#NKCeZn&`LF$99`(*P=3W7`4NrSdV8>^V~ok#VCgHDel6z7{dS$ zX`?-us-tp-iq3KbD{un2Y??v=%pqg#D=IT97{GiEa2r-*2-{FQ?n4DQfC_NP-OsrD zW4NCF*G1&NksN-eBTPqxyeg$FsDzdgx$Nb{sXZ-#svhx_tfoDQ+VKKv{4dnkP)MPp4B;z` zpaNUOTKt3xz?HTY`_*ggxb(8RI1;h zcKieNnU_&$z0F8qeYS^+CQP7qb^vt*$53b1k6QRL>Lq)KO8F$}C7XBsA5odeVbD6P zM7?B9f$?Xaa!-1u_+EOrq&xkyWGT2mkqCE2JL2Kyct^A?u{#=zb;Xm(aj!3wGhSDk O^rWYQ_tOPc2mb)OSAKy2 diff --git a/languages/woocommerce-heidelpay-de_DE_formal.mo b/languages/woocommerce-heidelpay-de_DE_formal.mo new file mode 100644 index 0000000000000000000000000000000000000000..d9162dd4e3ca35675771557c193466eacb49a554 GIT binary patch literal 7092 zcmd6rTZklA8OM*g7_%m767L#4(d_2hJ+qt5UV3-O^mNaqlbuUudUI1*tE*0TSEjnE zsmt`vgniKXpb(G{4FORk1bpxk@L|!g5p^PhL_y4(A%Q%okOv7Oib3%AovQBX*&T?A zh{c@#*SUS?yPvP-m1{5in&MfaeU$dqOO#pzuezKco*%wlslDKjK&I5I;Jd)rz#G6f z!1sXHU7^&~;Emu--~mv^9|Erd*TBobv*4BB7r=LdkAd$6pDOTs#rV%aVd2-{9`L1N z{8jKO`mcjR=Wn3!bICh$yaxOreGOg*9xcWfz-#G$24sthz-Pe$D16-nu@8f{gF=4} ztb$EY);|fp8~i3H=Y1a(eLN3d3jPF?buWOj?nO}ecp01n{{l{cClF>H?13WJxdML* z%KjHYRH|MAh0gB^d>uSa|4mTzas=gxd{dyKkozo43@wvIrKx|VNm407Zg4p z28GW)DEqz$%DTrvS@#|A6W|M=oc9N?fnxs(YWh{2Nc7wSWxoMMk1;58p9aMq=fH#D z&q1;C-wV7N=Ec4ml>K`_NUH;&@P8Nh0q{N$)u^zT-vmVuUjk*{6UF?uiuvz?qOa!) z{0;aK`hNsPuFGIT_FoUeinF1i-I z4j-{mg?5BCLpw^_OS_eJh;}Ir7gmcj@rx5QdBmpjh>ut8TONmELsY8{(CRd?o!EP~ zNA!O?P3$>GBLqgzLEdhn?Wc)7#m9!vVP3@6C7R?Q`{rkFihp1LGv7tZE$Ur@H3Eo~oOcpXR^A zfy9k{D~GE4v2jzKubBz02F%!SN5wpKaQ}Nnm4i08&RfRC)6hAWvIYLuE1QWedGFV-__QJqU*ArMlAz} z{b|=p`SBAy@PokGy&#o#O|fGGd&ohtzCVg;QLkrW*I=tuOp|E1w`_Esb?D&&IV=JC0Rb#rks2X8n;&fqt`*a;KInqAj0XJ~@m#;lj@44+d%`efAcLuFr=og^7Vgz&hV_JfQC*0JRf zG-f>YAPytmFKNyRf@qL?lqhW&K}8C}bZM6q;zqqbv8+RW=~@KV>y z$h~)B5Jl+4=H1fhh&{_o%@Q}4)o!VdGAjDOP$AS@%U37p>KkM=E#hXCdoO;>aZ%lYx^;aWETjZ*#-UpviPoA8+UVva$WUM(l{? zrq~{KGE#A=X`Eg~=U1SL;XG-;%JA5jkH5_l$slTBu~v5QJ3R~$4D^*p-E4iYR;C9Y_F3<(>8Hw zCUhf@R8-MN@bf(nlun}E(kd66YvkPtpy!#>u=hY|&V+JJisMSkb$iYIw-9Fa{}hN2mMJIo*%ctmy_a`jFEN9B#*uisaRW;ngfJX)ttaW$GpXN^VY#Nr|KVn)X5xYINioFBk}YIRIIPGL z-^8qDN#JBH7M$FAMpCpQ)@FC8SB%>Yh5DM4wV}}-azWWB3w9f_CEA>6 zWpOIJW<52Xxn0X*HD_!+nV=QcaaoNG*G(oH0x2iPhS7SgtF4GDO0Liy zl!|+^v>+0VZ>nyew!Jl9uwBW)jb7V22jNh!`sOXvu2H>iVQRnE8#5Rq2#NL9Ojypf z*D?;CloP$3e3>K~dsCsM3AqNFV(F2=a~Hv3$l8{Jv1F}hi4Ku@-l9?S8tssJT)?l*m2hhP=0yrRBUIq!^ZQ_I}DkIKCi+FRbXM&8CEd z#Q2CQ$w}kVj;-0PRNHMVPbb?EkmM!XZq-|z@6U19x#2}Ox&*7q>A63>jVh;FOcAJr%Y@~d3U!%RtdK^=hpFvDO)Fqc}xrED#lql zp0_0u#^-ZmjWSzNuMMRvN;VuMRi0Pw^~xI?Doy3(VIIr)v~_vCPJwfrucs*NOg&Ov zSUR=XJgXn6omyF$S*$&H_V`3GM>QMUIFh^`?sKwUaLnxz*r9H6X_M=1ofh!w@%3hT zM{;;3#io_xtyoV?<-a0tML*JLIpNvSIFtTV9c@%wMN*br)6EYGQZ0&Fz%`vTi49k= z2{#D_Ap=8cK}SMe7S09vzO3bUFtc5kf2c=s!$T;)U?o33S9wD9gdCDY+xs$+FDAQi z8m6|{u1>^?Z%Ymp8F%Eu!d&ICN_MW-njh=#ee2q{$PaK~y>85v|MQafRM^=%A8@go zMAzjCP4c>z|9{y0kc&$0k^EZ7pM`vL@&51nNXVVRe}*J^*$i;M!#reP*%Qm~GUm&BoH=>DBqAm1d*99b1a8jbVYRH#1U|@nXND#_Ye_ dbZ$R;Z;aWFdfO%x`{D85H}U`0n*Wc+`X@t1{dE8U literal 0 HcmV?d00001 diff --git a/languages/woocommerce-heidelpay-de_DE-formal.po b/languages/woocommerce-heidelpay-de_DE_formal.po similarity index 100% rename from languages/woocommerce-heidelpay-de_DE-formal.po rename to languages/woocommerce-heidelpay-de_DE_formal.po From 15641df5836ca20fa9023d85b16ae152656cac26 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Tue, 30 Jun 2020 19:46:39 +0200 Subject: [PATCH 43/59] WOO-99 [change] push: pending transaction do not get processed. --- includes/class-wc-heidelpay-push.php | 45 ++++++++++++++++------------ 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/includes/class-wc-heidelpay-push.php b/includes/class-wc-heidelpay-push.php index 7ed83c0..3abb80b 100644 --- a/includes/class-wc-heidelpay-push.php +++ b/includes/class-wc-heidelpay-push.php @@ -66,29 +66,36 @@ public function handlePush($response) wc_get_logger()->debug($order->get_status(), array('source' => 'heidelpay')); - if ($payCode[0] === 'IV') { - if ($response->isSuccess()) { - switch ($payCode[1]) { - case 'FI': - $order->update_status( - 'on-hold', - 'Order has been finalized' - ); - break; - case 'PA': - $order->update_status( - 'processing', - 'Reservation done' - ); - break; - } + // Do not process pending transactions. + if ($response->isPending()) { + return; + } + + list($transactionMethod, $transactionType) = $payCode; + if ($transactionMethod === 'IV' && $response->isSuccess()) { + switch ($transactionType) { + case 'FI': + $order->update_status( + 'on-hold', + 'Order has been finalized' + ); + break; + case 'PA': + $order->update_status( + 'processing', + 'Reservation done' + ); + break; } } - if ($payCode[1] === 'CP' || $payCode[1] === 'RC' || $payCode[1] === 'DB') { - if ($response->isSuccess()) { + $paidTransactionTypes = ['CP', 'RC', 'DB']; + + if (in_array($transactionType, $paidTransactionTypes, true)) { + if ($response->isSuccess() && !$order->is_paid()) { if ($order->get_total() === $response->getPresentation()->getAmount()) { - if ($payCode[0] === 'IV') { + $order->payment_complete($response->getIdentification()->getShortId()); + if ($transactionMethod === 'IV') { $order->update_status( 'completed', $this->getNote($response) From 82ba503331a32dd4bf2152193476291f1c68edc0 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Wed, 1 Jul 2020 12:21:26 +0200 Subject: [PATCH 44/59] WOO-96 [refactor] Response: Add pending check for success case. --- includes/class-wc-heidelpay-response.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index f6872a7..73f020e 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -75,7 +75,7 @@ public function handleResult($post_data, WC_Order $order) $uid = self::$response->getIdentification()->getUniqueId(); $sid = self::$response->getIdentification()->getShortId(); - if (self::$response->isSuccess()) { + if (self::$response->isSuccess() && !self::$response->isPending()) { $payCode = explode('.', strtoupper($post_data['PAYMENT_CODE'])); $note = ''; From 9cdf46ea006ca6a25cfbf71c89c61d0796633124 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Wed, 1 Jul 2020 13:26:58 +0200 Subject: [PATCH 45/59] WOO-96 [refactor] Code style. --- includes/class-wc-heidelpay-response.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index 73f020e..29297a2 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -85,24 +85,24 @@ public function handleResult($post_data, WC_Order $order) if (empty($availableGateways[$paymentMethodId])) { return; } - /** @var WC_Payment_Gateways $paymethod */ - $paymethod = $availableGateways[$paymentMethodId]; + /** @var WC_Heidelpay_Payment_Gateway | WC_Heidelpay_IFrame_Gateway $paymentMethod */ + $paymentMethod = $availableGateways[$paymentMethodId]; // If registration, do a debit on registration afterwards if ($payCode[1] === 'RG' || $payCode[1] === 'CF') { $order->add_meta_data('heidelpay-Registration', $uid); /** @var WC_Heidelpay_Payment_Gateway $paymethod */ - $paymethod->prepareRequest($order); - $paymethod->payMethod->getRequest()->getFrontend()->setEnabled('FALSE'); - $paymethod->payMethod->getRequest()->getIdentification()->setReferenceid($uid); - // Use the Response of the debitOnRegiststration in order to set the correct paymentInfo - $noGuiResponse = $paymethod->performNoGuiRequest($order, $uid); + $paymentMethod->prepareRequest($order); + $paymentMethod->payMethod->getRequest()->getFrontend()->setEnabled('FALSE'); + $paymentMethod->payMethod->getRequest()->getIdentification()->setReferenceid($uid); + // Use the Response of the debitOnRegistration in order to set the correct paymentInfo + $noGuiResponse = $paymentMethod->performNoGuiRequest($order, $uid); if ($noGuiResponse !== null) { self::$response = $noGuiResponse; } } - $paymethod->setPaymentInfo($order, self::$response); + $paymentMethod->setPaymentInfo($order, self::$response); // If no money has been payed yet. if ($payCode[0] !== 'IV' && $payCode[1] === 'PA') { From ac8abcbbc850ca042602c5ebc1e5df9fe4a53eca Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Mon, 20 Jul 2020 12:59:55 +0200 Subject: [PATCH 46/59] [refactor] (WOO-98) Response: fix check for available payment methods. --- includes/class-wc-heidelpay-response.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index 29297a2..fbaa7de 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -79,14 +79,18 @@ public function handleResult($post_data, WC_Order $order) $payCode = explode('.', strtoupper($post_data['PAYMENT_CODE'])); $note = ''; - $availableGateways = WC_Payment_Gateways::instance()->get_available_payment_gateways(); - + $paymentGatewayList = WC_Payment_Gateways::instance()->payment_gateways(); $paymentMethodId = $order->get_payment_method(); - if (empty($availableGateways[$paymentMethodId])) { + /** @var WC_Heidelpay_Payment_Gateway $paymentMethod */ + $paymentMethod = !empty($paymentGatewayList[$paymentMethodId])?$paymentGatewayList[$paymentMethodId]:null; + if (!$paymentMethod || !($paymentMethod instanceof WC_Heidelpay_Payment_Gateway)) { + wc_get_logger()->notice( + sprintf("Payment method is not valid or was not found: %s", htmlspecialchars($paymentMethodId)), + ['source' => 'heidelpay'] + ); return; } /** @var WC_Heidelpay_Payment_Gateway | WC_Heidelpay_IFrame_Gateway $paymentMethod */ - $paymentMethod = $availableGateways[$paymentMethodId]; // If registration, do a debit on registration afterwards if ($payCode[1] === 'RG' || $payCode[1] === 'CF') { From 4b0bc8f28de3ef43396cebc88135dd4d7ba07c2c Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Mon, 20 Jul 2020 13:31:13 +0200 Subject: [PATCH 47/59] [refactor] (WOO-98) code style --- .../abstract-wc-heidelpay-payment-gateway.php | 24 +++++++++---------- .../class-wc-heidelpay-gateway-idl.php | 2 +- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 44c2157..787439f 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -242,11 +242,10 @@ public function process_payment($order_id) /** * @param $order WC_Order - * @throws Exception */ public function prepareRequest(WC_Order $order) { - $this->setAuthentification($order); + $this->setAuthentication($order); $this->setAsync(); $this->setCustomer($order); $this->setBasket($order->get_id()); @@ -255,10 +254,10 @@ public function prepareRequest(WC_Order $order) } /** - * Set up your authentification data for Heidepay api + * Set up your authentication data for heidelpay api * @param WC_order $order */ - protected function setAuthentification(WC_order $order = null) + protected function setAuthentication(WC_order $order = null) { $isSandbox = false; $channel = $this->get_option('transaction_channel'); @@ -286,7 +285,7 @@ protected function setAsync() { $this->payMethod->getRequest()->async( $this->getLanguage(), // Language code for the Frame - $this->getResponeUrl() + $this->getResponseUrl() ); } @@ -324,7 +323,6 @@ protected function setCustomer(WC_Order $order) /** * @param $order_id - * @throws Exception */ protected function setBasket($order_id) { @@ -338,7 +336,7 @@ protected function setBasket($order_id) } /** - * @global string $wp_version + * @param null|string $orderID */ protected function setCriterions($orderID = null) { @@ -415,7 +413,7 @@ public function performRequest($order, $uid = null) htmlspecialchars( print_r( $this->plugin_id . ' - ' . $this->id . __( - ' Error: Paymentmethod was not found: ', + ' Error: Payment method was not found: ', 'woocommerce-heidelpay' ) . $this->bookingAction, 1 @@ -455,7 +453,7 @@ public function addPaymentError($message) } /** - * Get the mapped Errormessage from Respone wich is html escaped. + * Get the mapped Errormessage from response which is html escaped. * If a response is given as a parameter that will determine the message. Otherwise the Response from the payMethod * is used. If none of them is given return the default message * @param Response|null $response @@ -558,7 +556,7 @@ public function callback_handler() wc_get_logger()->log( WC_Log_Levels::DEBUG, 'heidelpay - Response: There has been an error fetching the RedirectURL by the payment. ' - . 'Please make sure the ResponseURL (' . $this->getResponeUrl() .')is accessible from the internet.', + . 'Please make sure the ResponseURL (' . $this->getResponseUrl() .')is accessible from the internet.', array('source' => 'heidelpay') ); wp_redirect(wc_get_cart_url()); @@ -568,7 +566,7 @@ public function callback_handler() /** * Filter function for the hook: woocommerce_available_payment_gateways - * Can be used to set conditions vor availability of a paymethod. + * Can be used to set conditions vor availability of a payment method. * @param $available_gateways * @return mixed */ @@ -578,7 +576,7 @@ public function setAvailability($available_gateways) } /** - * "woocommerce_thankyou_order_received_text" hook to display heidelpay-paymentInfo text on the successpage after + * "woocommerce_thankyou_order_received_text" hook to display heidelpay-paymentInfo text on the success page after * payment. * @param $orderReceivedText * @return string @@ -704,7 +702,7 @@ protected function getBookingSelection() /** * @return string */ - protected function getResponeUrl() + protected function getResponseUrl() { return get_home_url(null, '/wc-api/' . strtolower(get_class($this))); } diff --git a/includes/gateways/class-wc-heidelpay-gateway-idl.php b/includes/gateways/class-wc-heidelpay-gateway-idl.php index 8ca3600..50a2562 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-idl.php +++ b/includes/gateways/class-wc-heidelpay-gateway-idl.php @@ -61,7 +61,7 @@ public function payment_fields() $bankNameLabel = __('Bank', 'woocommerce-heidelpay'); // Performe Authorize request to get paymethod config - $this->setAuthentification(); + $this->setAuthentication(); $this->setAsync(); $this->setCriterions(); From b0b516713b35f9a08ca3914c0ab4fb594c13de99 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Mon, 20 Jul 2020 13:32:31 +0200 Subject: [PATCH 48/59] [change] (WOO-98) update tested WC version to 4.3 --- woocommerce-heidelpay.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/woocommerce-heidelpay.php b/woocommerce-heidelpay.php index 4eb70c3..0842a4f 100644 --- a/woocommerce-heidelpay.php +++ b/woocommerce-heidelpay.php @@ -12,14 +12,14 @@ * Description: heidelpay payment integration for WooCommerce * Version: 1.7.0 * Author: heidelpay - * Author URI: htts://www.heidelpay.com + * Author URI: https://www.heidelpay.com * Developer: heidelpay * Developer URI: https://dev.heidelpay.com * Text Domain: woocommerce-heidelpay * Domain Path: /languages * * WC requires at least: 3.0 - * WC tested up to: 3.8 + * WC tested up to: 4.3 * * Copyright: © 2018-present heidelpay GmbH * License: see LICENSE.txt @@ -300,5 +300,4 @@ public static function log($message) WC_Heidelpay::get_instance(); endif; - } From 2bbb76e055ba458d3b9d827a1a22b15341232c6a Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Mon, 20 Jul 2020 16:06:11 +0200 Subject: [PATCH 49/59] [refactor] (WOO-98) code style. --- includes/class-wc-heidelpay-response.php | 1 - 1 file changed, 1 deletion(-) diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index fbaa7de..02b3583 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -90,7 +90,6 @@ public function handleResult($post_data, WC_Order $order) ); return; } - /** @var WC_Heidelpay_Payment_Gateway | WC_Heidelpay_IFrame_Gateway $paymentMethod */ // If registration, do a debit on registration afterwards if ($payCode[1] === 'RG' || $payCode[1] === 'CF') { From 15d6f64ad3dba387ac2f596c92a63fbb7fac551a Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Fri, 24 Jul 2020 15:47:00 +0200 Subject: [PATCH 50/59] (WOO-98)[fix] Creditcard: meta data is now added in any success case --- includes/class-wc-heidelpay-response.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index 02b3583..8ba44d3 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -106,6 +106,8 @@ public function handleResult($post_data, WC_Order $order) } $paymentMethod->setPaymentInfo($order, self::$response); + $order->add_meta_data('heidelpay-UniqueID', $uid); + $order->add_meta_data('heidelpay-ShortID', $sid); // If no money has been payed yet. if ($payCode[0] !== 'IV' && $payCode[1] === 'PA') { @@ -122,8 +124,6 @@ public function handleResult($post_data, WC_Order $order) __('Awaiting payment.', 'woocommerce-heidelpay') . ' ' . $note ); } else { - $order->add_meta_data('heidelpay-UniqueID', $uid); - $order->add_meta_data('heidelpay-ShortID', $sid); $order->payment_complete($sid); } echo $order->get_checkout_order_received_url(); From f646c728423a3424f3af04072eb48b36251bfce7 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Tue, 28 Jul 2020 15:12:38 +0200 Subject: [PATCH 51/59] (WOO-98)[refactor] replace redundant code --- includes/traits/trait-wc-heidelpay-subscription-gateway.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/traits/trait-wc-heidelpay-subscription-gateway.php b/includes/traits/trait-wc-heidelpay-subscription-gateway.php index 2623256..7f70930 100644 --- a/includes/traits/trait-wc-heidelpay-subscription-gateway.php +++ b/includes/traits/trait-wc-heidelpay-subscription-gateway.php @@ -120,11 +120,11 @@ public function scheduledSubscriptionPayment($amount, $renewalOrder) /** @var Response $response */ $response = $this->payMethod->getResponse(); - if ($this->payMethod->getResponse()->isSuccess()) { + if ($response->isSuccess()) { parent::setPaymentInfo($renewalOrder, $response); $renewalOrder->payment_complete($response->getIdentification()->getShortId()); } - if ($this->payMethod->getResponse()->isError()) { + if ($response->isError()) { wc_get_logger()->error( print_r($this->payMethod->getResponse()->getError(), 1), array('source' => 'heidelpay') From 8912940820d2534592e157120a05bb09fbf83aeb Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Tue, 28 Jul 2020 15:15:59 +0200 Subject: [PATCH 52/59] (WOO-98)[fix] Subscrptions: add new method for using the correct channel --- .../abstract-wc-heidelpay-payment-gateway.php | 5 ---- ...rait-wc-heidelpay-subscription-gateway.php | 23 ++++++++++++++++++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 787439f..945d0b0 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -264,11 +264,6 @@ protected function setAuthentication(WC_order $order = null) if ($this->get_option('sandbox') === 'yes') { $isSandbox = true; } - if (class_exists('WC_Subscriptions')) { - if ($order !== null && (wcs_order_contains_renewal($order) || wcs_order_contains_subscription($order))) { - $channel = $this->get_option('transaction_channel_subscription'); - } - } $this->payMethod->getRequest()->authentification( $this->get_option('security_sender'), $this->get_option('user_login'), diff --git a/includes/traits/trait-wc-heidelpay-subscription-gateway.php b/includes/traits/trait-wc-heidelpay-subscription-gateway.php index 7f70930..8882f44 100644 --- a/includes/traits/trait-wc-heidelpay-subscription-gateway.php +++ b/includes/traits/trait-wc-heidelpay-subscription-gateway.php @@ -107,7 +107,7 @@ public function scheduledSubscriptionPayment($amount, $renewalOrder) /** @var WC_Order $order */ //$order = wcs_get_order $order = WC_Subscriptions_Renewal_Order::get_parent_order($renewalOrder->get_id()); - parent::prepareRequest($renewalOrder); + $this->prepareSubscriptionPayment($renewalOrder); $this->payMethod->getRequest()->getFrontend()->setEnabled('FALSE'); try { @@ -132,4 +132,25 @@ public function scheduledSubscriptionPayment($amount, $renewalOrder) } return null; } + + public function prepareSubscriptionPayment($order) + { + $isSandbox = false; + $channel = $this->get_option('transaction_channel_subscription'); + if ($this->get_option('sandbox') === 'yes') { + $isSandbox = true; + } + $this->payMethod->getRequest()->authentification( + $this->get_option('security_sender'), + $this->get_option('user_login'), + $this->get_option('user_password'), + $channel, + $isSandbox + ); + $this->setAsync(); + $this->setCustomer($order); + $this->setBasket($order->get_id()); + $this->setCriterions(); + $this->payMethod->getRequest()->getContact()->setIp(WC_Geolocation::get_ip_address()); + } } From 1d50c518d71c2070051bfe482a3b9f14ff31d807 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Thu, 13 Aug 2020 15:34:41 +0200 Subject: [PATCH 53/59] [refactor] (WOO-98) Invoice, prepayment: remove default value for instructions. --- includes/gateways/class-wc-heidelpay-gateway-iv.php | 4 ---- includes/gateways/class-wc-heidelpay-gateway-ivpg.php | 4 ---- includes/gateways/class-wc-heidelpay-gateway-pp.php | 4 ---- 3 files changed, 12 deletions(-) diff --git a/includes/gateways/class-wc-heidelpay-gateway-iv.php b/includes/gateways/class-wc-heidelpay-gateway-iv.php index f473308..690cdcc 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-iv.php +++ b/includes/gateways/class-wc-heidelpay-gateway-iv.php @@ -35,10 +35,6 @@ public function init_form_fields() __('Insert payment data for %s', 'woocommerce-heidelpay'), $this->name ); - $this->form_fields['instructions']['default'] = __( - 'please send the money to IBAN BIC ', - 'woocommerce-heidelpay' - ); $this->form_fields['transaction_channel']['default'] = '31HA07BC8142C5A171749A60D979B6E4'; $this->form_fields['send_payment_info'] = array( diff --git a/includes/gateways/class-wc-heidelpay-gateway-ivpg.php b/includes/gateways/class-wc-heidelpay-gateway-ivpg.php index acff381..d164c68 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-ivpg.php +++ b/includes/gateways/class-wc-heidelpay-gateway-ivpg.php @@ -84,10 +84,6 @@ public function init_form_fields() __('Insert payment data for %s', 'woocommerce-heidelpay'), $this->name ); - $this->form_fields['instructions']['default'] = __( - 'please send the money to IBAN BIC ', - 'woocommerce-heidelpay' - ); $this->form_fields['enabled']['label'] = sprintf(__('Enable %s', 'woocommerce-heidelpay'), $this->name); $this->form_fields['security_sender']['default'] = '31HA07BC8142C5A171745D00AD63D182'; $this->form_fields['user_login']['default'] = '31ha07bc8142c5a171744e5aef11ffd3'; diff --git a/includes/gateways/class-wc-heidelpay-gateway-pp.php b/includes/gateways/class-wc-heidelpay-gateway-pp.php index 92a48cf..bc04ffe 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-pp.php +++ b/includes/gateways/class-wc-heidelpay-gateway-pp.php @@ -49,10 +49,6 @@ public function init_form_fields() __('Insert payment data for %s', 'woocommerce-heidelpay'), $this->name ); - $this->form_fields['instructions']['default'] = __( - 'please send the money to IBAN BIC ', - 'woocommerce-heidelpay' - ); $this->form_fields['enabled']['label'] = sprintf(__('Enable %s', 'woocommerce-heidelpay'), $this->name); $this->form_fields['security_sender']['default'] = '31HA07BC8142C5A171745D00AD63D182'; $this->form_fields['user_login']['default'] = '31ha07bc8142c5a171744e5aef11ffd3'; From 2b76eb9cc9709094dc397c37ad4a870451d4acf4 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Thu, 13 Aug 2020 15:46:09 +0200 Subject: [PATCH 54/59] [fix] (WOO-98) Adjust response handling for Subscription orders. --- includes/class-wc-heidelpay-response.php | 76 ++++++++++++++---------- 1 file changed, 43 insertions(+), 33 deletions(-) diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index 8ba44d3..a797ea1 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -72,40 +72,50 @@ public function init(array $post_data, $secret) */ public function handleResult($post_data, WC_Order $order) { - $uid = self::$response->getIdentification()->getUniqueId(); - $sid = self::$response->getIdentification()->getShortId(); - - if (self::$response->isSuccess() && !self::$response->isPending()) { - $payCode = explode('.', strtoupper($post_data['PAYMENT_CODE'])); - $note = ''; - - $paymentGatewayList = WC_Payment_Gateways::instance()->payment_gateways(); - $paymentMethodId = $order->get_payment_method(); - /** @var WC_Heidelpay_Payment_Gateway $paymentMethod */ - $paymentMethod = !empty($paymentGatewayList[$paymentMethodId])?$paymentGatewayList[$paymentMethodId]:null; - if (!$paymentMethod || !($paymentMethod instanceof WC_Heidelpay_Payment_Gateway)) { - wc_get_logger()->notice( - sprintf("Payment method is not valid or was not found: %s", htmlspecialchars($paymentMethodId)), - ['source' => 'heidelpay'] - ); - return; - } + $response = self::$response; + $uid = $response->getIdentification()->getUniqueId(); + $sid = $response->getIdentification()->getShortId(); + + $payCode = explode('.', strtoupper($response->getPayment()->getCode())); + + // Get Payment Method. + $paymentGatewayList = WC_Payment_Gateways::instance()->payment_gateways(); + $paymentMethodId = $order->get_payment_method(); + wc_get_logger()->debug('subscription order id? ' . (wcs_is_subscription($order)?'YES':'NOH')); + /** @var WC_Heidelpay_Payment_Gateway $paymentMethod */ + $paymentMethod = !empty($paymentGatewayList[$paymentMethodId])?$paymentGatewayList[$paymentMethodId]:null; + if (!$paymentMethod || !($paymentMethod instanceof WC_Heidelpay_Payment_Gateway)) { + wc_get_logger()->notice( + sprintf("Payment method is not valid or was not found: %s", htmlspecialchars($paymentMethodId)), + ['source' => 'heidelpay'] + ); + return; + } - // If registration, do a debit on registration afterwards - if ($payCode[1] === 'RG' || $payCode[1] === 'CF') { - $order->add_meta_data('heidelpay-Registration', $uid); - /** @var WC_Heidelpay_Payment_Gateway $paymethod */ - $paymentMethod->prepareRequest($order); - $paymentMethod->payMethod->getRequest()->getFrontend()->setEnabled('FALSE'); - $paymentMethod->payMethod->getRequest()->getIdentification()->setReferenceid($uid); - // Use the Response of the debitOnRegistration in order to set the correct paymentInfo - $noGuiResponse = $paymentMethod->performNoGuiRequest($order, $uid); - if ($noGuiResponse !== null) { - self::$response = $noGuiResponse; + // If registration, do a debit on registration afterwards + if (($payCode[1] === 'RG' || $payCode[1] === 'CF') && $response->isSuccess()) { + $order->add_meta_data('heidelpay-Registration', $uid); + $order->save(); + /** @var WC_Heidelpay_Payment_Gateway $paymethod */ + $paymentMethod->prepareRequest($order); + //$paymentMethod->payMethod->getRequest()->getFrontend()->setEnabled('FALSE'); + $paymentMethod->payMethod->getRequest()->getIdentification()->setReferenceid($uid); + // Use the Response of the debitOnRegistration in order to set the correct paymentInfo + $debitOnRegistrationResponse = $paymentMethod->performNoGuiRequest($order, $uid); + if ($debitOnRegistrationResponse !== null) { + $redirectUrl = $debitOnRegistrationResponse->getFrontend()->getRedirectUrl(); + if(!empty($redirectUrl)) { + echo $redirectUrl; + return; } + $response = $debitOnRegistrationResponse; } + } + + if ($response->isSuccess() && !$response->isPending()) { + $note = ''; - $paymentMethod->setPaymentInfo($order, self::$response); + $paymentMethod->setPaymentInfo($order, $response); $order->add_meta_data('heidelpay-UniqueID', $uid); $order->add_meta_data('heidelpay-ShortID', $sid); @@ -129,8 +139,8 @@ public function handleResult($post_data, WC_Order $order) echo $order->get_checkout_order_received_url(); /* redirect customer to success page */ - } elseif (self::$response->isError()) { - $error = self::$response->getError(); + } elseif ($response->isError()) { + $error = $response->getError(); $order->update_status('failed'); echo apply_filters('woocommerce_get_cancel_order_url_raw', add_query_arg(array( @@ -140,7 +150,7 @@ public function handleResult($post_data, WC_Order $order) '_wpnonce' => wp_create_nonce('woocommerce-cancel_order'), 'errorCode' => $error['code'], ), $order->get_cancel_endpoint())); - } elseif (self::$response->isPending()) { + } elseif ($response->isPending()) { //empty cart wc()->cart->empty_cart(); From af6ac650d0663bf4e56f9667408e85a0eb31fe1e Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Thu, 13 Aug 2020 18:03:17 +0200 Subject: [PATCH 55/59] [refactor] (WOO-98) code style. --- includes/class-wc-heidelpay-response.php | 25 +++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index a797ea1..6d01833 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -50,9 +50,9 @@ public function init(array $post_data, $secret) $callers = debug_backtrace(); wc_get_logger()->notice( print_r("Heidelpay - " . - $callers [0] ['function'] . ": Invalid response hash from " . - $_SERVER ['REMOTE_ADDR'] . ", suspecting manipulation", 1), - array('source' => 'heidelpay') + $callers [0] ['function'] . ": Invalid response hash from " . + $_SERVER ['REMOTE_ADDR'] . ", suspecting manipulation", 1), + ['source' => 'heidelpay'] ); exit(); //error } @@ -61,29 +61,26 @@ public function init(array $post_data, $secret) $order = wc_get_order($orderId); - $this->handleResult($post_data, $order); + $this->handleResult(self::$response, $order); } /** * handle result post * - * @param $post_data + * @param Response $response * @param WC_Order $order */ - public function handleResult($post_data, WC_Order $order) + public function handleResult($response, WC_Order $order) { - $response = self::$response; $uid = $response->getIdentification()->getUniqueId(); $sid = $response->getIdentification()->getShortId(); - $payCode = explode('.', strtoupper($response->getPayment()->getCode())); // Get Payment Method. $paymentGatewayList = WC_Payment_Gateways::instance()->payment_gateways(); $paymentMethodId = $order->get_payment_method(); - wc_get_logger()->debug('subscription order id? ' . (wcs_is_subscription($order)?'YES':'NOH')); /** @var WC_Heidelpay_Payment_Gateway $paymentMethod */ - $paymentMethod = !empty($paymentGatewayList[$paymentMethodId])?$paymentGatewayList[$paymentMethodId]:null; + $paymentMethod = !empty($paymentGatewayList[$paymentMethodId]) ? $paymentGatewayList[$paymentMethodId] : null; if (!$paymentMethod || !($paymentMethod instanceof WC_Heidelpay_Payment_Gateway)) { wc_get_logger()->notice( sprintf("Payment method is not valid or was not found: %s", htmlspecialchars($paymentMethodId)), @@ -95,7 +92,7 @@ public function handleResult($post_data, WC_Order $order) // If registration, do a debit on registration afterwards if (($payCode[1] === 'RG' || $payCode[1] === 'CF') && $response->isSuccess()) { $order->add_meta_data('heidelpay-Registration', $uid); - $order->save(); + $order->save_meta_data(); /** @var WC_Heidelpay_Payment_Gateway $paymethod */ $paymentMethod->prepareRequest($order); //$paymentMethod->payMethod->getRequest()->getFrontend()->setEnabled('FALSE'); @@ -104,7 +101,7 @@ public function handleResult($post_data, WC_Order $order) $debitOnRegistrationResponse = $paymentMethod->performNoGuiRequest($order, $uid); if ($debitOnRegistrationResponse !== null) { $redirectUrl = $debitOnRegistrationResponse->getFrontend()->getRedirectUrl(); - if(!empty($redirectUrl)) { + if (!empty($redirectUrl)) { echo $redirectUrl; return; } @@ -143,13 +140,13 @@ public function handleResult($post_data, WC_Order $order) $error = $response->getError(); $order->update_status('failed'); - echo apply_filters('woocommerce_get_cancel_order_url_raw', add_query_arg(array( + echo apply_filters('woocommerce_get_cancel_order_url_raw', add_query_arg([ 'cancel_order' => 'true', 'order' => $order->get_order_key(), 'order_id' => $order->get_id(), '_wpnonce' => wp_create_nonce('woocommerce-cancel_order'), 'errorCode' => $error['code'], - ), $order->get_cancel_endpoint())); + ], $order->get_cancel_endpoint())); } elseif ($response->isPending()) { //empty cart wc()->cart->empty_cart(); From aa080a8926f71c158f43dab49fe3e558d99817c1 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Tue, 18 Aug 2020 13:20:23 +0200 Subject: [PATCH 56/59] [fix] (WOO-98) Response handling of scheduledSubscriptionPayment. --- includes/traits/trait-wc-heidelpay-subscription-gateway.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/traits/trait-wc-heidelpay-subscription-gateway.php b/includes/traits/trait-wc-heidelpay-subscription-gateway.php index 8882f44..2b9cc09 100644 --- a/includes/traits/trait-wc-heidelpay-subscription-gateway.php +++ b/includes/traits/trait-wc-heidelpay-subscription-gateway.php @@ -120,7 +120,7 @@ public function scheduledSubscriptionPayment($amount, $renewalOrder) /** @var Response $response */ $response = $this->payMethod->getResponse(); - if ($response->isSuccess()) { + if ($response->isSuccess() && !$response->isPending()) { parent::setPaymentInfo($renewalOrder, $response); $renewalOrder->payment_complete($response->getIdentification()->getShortId()); } From 22fae128b61cde6d300b1343af3dc8f7b213c38d Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Thu, 10 Sep 2020 15:16:42 +0200 Subject: [PATCH 57/59] (WOO-98)[fix] set invoice to on-hold if successful to avoid the order to be marked as paid --- includes/class-wc-heidelpay-push.php | 12 ++++-------- includes/class-wc-heidelpay-response.php | 11 +++++------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/includes/class-wc-heidelpay-push.php b/includes/class-wc-heidelpay-push.php index 3abb80b..50054c5 100644 --- a/includes/class-wc-heidelpay-push.php +++ b/includes/class-wc-heidelpay-push.php @@ -64,7 +64,8 @@ public function handlePush($response) $order = wc_get_order($orderID); $payCode = explode('.', strtoupper($response->getPayment()->getCode())); - wc_get_logger()->debug($order->get_status(), array('source' => 'heidelpay')); + wc_get_logger()->debug('Processsing Order' . $orderID, ['source' => 'heidelpay']); + wc_get_logger()->debug('Order has status: '. $order->get_status(), ['source' => 'heidelpay']); // Do not process pending transactions. if ($response->isPending()) { @@ -76,13 +77,13 @@ public function handlePush($response) switch ($transactionType) { case 'FI': $order->update_status( - 'on-hold', + 'processing', 'Order has been finalized' ); break; case 'PA': $order->update_status( - 'processing', + 'on-hold', 'Reservation done' ); break; @@ -100,11 +101,6 @@ public function handlePush($response) 'completed', $this->getNote($response) ); - } else { - $order->update_status( - 'processing', - $this->getNote($response) - ); } } else { $order->add_order_note( diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index 6d01833..91000b5 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -75,6 +75,7 @@ public function handleResult($response, WC_Order $order) $uid = $response->getIdentification()->getUniqueId(); $sid = $response->getIdentification()->getShortId(); $payCode = explode('.', strtoupper($response->getPayment()->getCode())); + list($transactionMethod, $transactionType) = $payCode; // Get Payment Method. $paymentGatewayList = WC_Payment_Gateways::instance()->payment_gateways(); @@ -90,7 +91,7 @@ public function handleResult($response, WC_Order $order) } // If registration, do a debit on registration afterwards - if (($payCode[1] === 'RG' || $payCode[1] === 'CF') && $response->isSuccess()) { + if (($transactionType === 'RG' || $transactionType === 'CF') && $response->isSuccess()) { $order->add_meta_data('heidelpay-Registration', $uid); $order->save_meta_data(); /** @var WC_Heidelpay_Payment_Gateway $paymethod */ @@ -117,9 +118,8 @@ public function handleResult($response, WC_Order $order) $order->add_meta_data('heidelpay-ShortID', $sid); // If no money has been payed yet. - if ($payCode[0] !== 'IV' && $payCode[1] === 'PA') { - // If not Prepayment and Invoice payment can be captured manually - if ($payCode [0] !== 'PP') { + if ($transactionType === 'PA') { + if ($transactionMethod !== 'PP') { $note = __( 'Payment reservation successful. Please use the hiP to check the payment.', 'woocommerce-heidelpay' @@ -133,9 +133,8 @@ public function handleResult($response, WC_Order $order) } else { $order->payment_complete($sid); } - echo $order->get_checkout_order_received_url(); - /* redirect customer to success page */ + echo $order->get_checkout_order_received_url(); } elseif ($response->isError()) { $error = $response->getError(); $order->update_status('failed'); From 9b11e550c672aeeb822545847405299eadf65bab Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Fri, 11 Sep 2020 09:06:48 +0200 Subject: [PATCH 58/59] (WOO-98)[fix] remove setting status to complete --- includes/class-wc-heidelpay-push.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/includes/class-wc-heidelpay-push.php b/includes/class-wc-heidelpay-push.php index 50054c5..bc69ebc 100644 --- a/includes/class-wc-heidelpay-push.php +++ b/includes/class-wc-heidelpay-push.php @@ -96,12 +96,6 @@ public function handlePush($response) if ($response->isSuccess() && !$order->is_paid()) { if ($order->get_total() === $response->getPresentation()->getAmount()) { $order->payment_complete($response->getIdentification()->getShortId()); - if ($transactionMethod === 'IV') { - $order->update_status( - 'completed', - $this->getNote($response) - ); - } } else { $order->add_order_note( $this->getNote($response), From 8643a27d41b36df942e123c4ecfc49385cdb914d Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Thu, 17 Sep 2020 11:02:06 +0200 Subject: [PATCH 59/59] [fix] Response handling of scheduledSubscriptionPayment. --- .../abstracts/abstract-wc-heidelpay-payment-gateway.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 945d0b0..f9b3a0e 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -659,9 +659,15 @@ public function setPaymentInfo(WC_Order $order, Response $response) $connector = $response->getConnector(); $presentation = $response->getPresentation(); + $presentationAmount = number_format( + $presentation->getAmount(), + wc_get_price_decimals(), + wc_get_price_decimal_separator(), + wc_get_price_thousand_separator() + ); $paymentData = [ - '{AMOUNT}' => $presentation->getAmount(), + '{AMOUNT}' => $presentationAmount, '{CURRENCY}' => $presentation->getCurrency(), '{CONNECTOR_ACCOUNT_HOLDER}' => $connector->getAccountHolder(), '{CONNECTOR_ACCOUNT_IBAN}' => $connector->getAccountIBan(),