diff --git a/Helper/Payment.php b/Helper/Payment.php index 91f3d0ec..e19dcb71 100644 --- a/Helper/Payment.php +++ b/Helper/Payment.php @@ -49,13 +49,11 @@ class Payment extends \Payone\Core\Helper\Base PayoneConfig::METHOD_ADVANCE_PAYMENT, PayoneConfig::METHOD_INVOICE, PayoneConfig::METHOD_OBT_SOFORTUEBERWEISUNG, - #PayoneConfig::METHOD_OBT_GIROPAY,#Giropay has been disabled, Paydirekt is now Giropay PayoneConfig::METHOD_OBT_EPS, PayoneConfig::METHOD_OBT_POSTFINANCE_EFINANCE, PayoneConfig::METHOD_OBT_POSTFINANCE_CARD, PayoneConfig::METHOD_OBT_IDEAL, PayoneConfig::METHOD_OBT_PRZELEWY, - PayoneConfig::METHOD_BARZAHLEN, PayoneConfig::METHOD_PAYDIREKT, PayoneConfig::METHOD_SAFE_INVOICE, PayoneConfig::METHOD_PAYOLUTION_INVOICE, @@ -70,7 +68,6 @@ class Payment extends \Payone\Core\Helper\Base PayoneConfig::METHOD_KLARNA_INSTALLMENT, PayoneConfig::METHOD_WECHATPAY, PayoneConfig::METHOD_RATEPAY_INVOICE, - PayoneConfig::METHOD_TRUSTLY, PayoneConfig::METHOD_APPLEPAY, PayoneConfig::METHOD_BANCONTACT, PayoneConfig::METHOD_BNPL_INVOICE, @@ -90,7 +87,6 @@ class Payment extends \Payone\Core\Helper\Base PayoneConfig::METHOD_ADVANCE_PAYMENT => 'vor', PayoneConfig::METHOD_INVOICE => 'rec', PayoneConfig::METHOD_OBT_SOFORTUEBERWEISUNG => 'sb', - PayoneConfig::METHOD_OBT_GIROPAY => 'sb', PayoneConfig::METHOD_OBT_EPS => 'sb', PayoneConfig::METHOD_OBT_POSTFINANCE_EFINANCE => 'sb', PayoneConfig::METHOD_OBT_POSTFINANCE_CARD => 'sb', @@ -99,7 +95,6 @@ class Payment extends \Payone\Core\Helper\Base PayoneConfig::METHOD_PAYPAL => 'wlt', PayoneConfig::METHOD_PAYPALV2 => 'wlt', PayoneConfig::METHOD_PAYDIREKT => 'wlt', - PayoneConfig::METHOD_BARZAHLEN => 'csh', PayoneConfig::METHOD_SAFE_INVOICE => 'rec', PayoneConfig::METHOD_PAYOLUTION_INVOICE => 'fnc', PayoneConfig::METHOD_PAYOLUTION_DEBIT => 'fnc', @@ -113,7 +108,6 @@ class Payment extends \Payone\Core\Helper\Base PayoneConfig::METHOD_KLARNA_INSTALLMENT => 'wlt', PayoneConfig::METHOD_WECHATPAY => 'wlt', PayoneConfig::METHOD_RATEPAY_INVOICE => 'fnc', - PayoneConfig::METHOD_TRUSTLY => 'sb', PayoneConfig::METHOD_APPLEPAY => 'wlt', PayoneConfig::METHOD_BANCONTACT => 'sb', ]; diff --git a/Model/ConfigProvider.php b/Model/ConfigProvider.php index 4272ac6d..45250fc9 100644 --- a/Model/ConfigProvider.php +++ b/Model/ConfigProvider.php @@ -251,13 +251,11 @@ protected function getPayoneConfig() 'availableApplePayTypes' => $this->paymentHelper->getAvailableApplePayTypes(), 'fieldConfig' => $this->hostedIframeHelper->getHostedFieldConfig(), 'sepaCountries' => $this->countryHelper->getEnabledCountries(PayoneConfig::METHOD_DEBIT), - 'trustlyCountries' => $this->countryHelper->getEnabledCountries(PayoneConfig::METHOD_TRUSTLY), 'hostedRequest' => $this->requestHelper->getHostedIframeRequest(), 'mandateManagementActive' => $this->paymentHelper->isMandateManagementActive(), 'checkCvc' => (bool)$this->paymentHelper->isCheckCvcActive(), 'ccMinValidity' => $this->requestHelper->getConfigParam('min_validity_period', PayoneConfig::METHOD_CREDITCARD, 'payone_payment'), 'requestBic' => (bool)$this->requestHelper->getConfigParam('request_bic', PayoneConfig::METHOD_DEBIT, 'payone_payment'), - 'trustlyRequestBic' => (bool)$this->requestHelper->getConfigParam('request_bic', PayoneConfig::METHOD_TRUSTLY, 'payone_payment'), 'validateBankCode' => (bool)$this->requestHelper->getConfigParam('check_bankaccount', PayoneConfig::METHOD_DEBIT, 'payone_payment'), 'disableSafeInvoice' => (bool)$this->requestHelper->getConfigParam('disable_after_refusal', PayoneConfig::METHOD_SAFE_INVOICE, 'payone_payment'), 'bankaccountcheckRequest' => $this->requestHelper->getBankaccountCheckRequest(), diff --git a/Model/Methods/Barzahlen.php b/Model/Methods/Barzahlen.php deleted file mode 100644 index 66610435..00000000 --- a/Model/Methods/Barzahlen.php +++ /dev/null @@ -1,93 +0,0 @@ -. - * - * PHP version 5 - * - * @category Payone - * @package Payone_Magento2_Plugin - * @author FATCHIP GmbH - * @copyright 2003 - 2016 Payone GmbH - * @license GNU Lesser General Public License - * @link http://www.payone.de - */ - -namespace Payone\Core\Model\Methods; - -use Payone\Core\Model\PayoneConfig; -use Magento\Sales\Model\Order; - -/** - * Model for Barzahlen payment method - */ -class Barzahlen extends PayoneMethod -{ - /** - * Payment method code - * - * @var string - */ - protected $_code = PayoneConfig::METHOD_BARZAHLEN; - - /** - * Clearingtype for PAYONE authorization request - * - * @var string - */ - protected $sClearingtype = 'csh'; - - /** - * Returns authorization-mode - * Barzahlen only supports preauthorization - * - * @return string - */ - public function getAuthorizationMode() - { - return PayoneConfig::REQUEST_TYPE_PREAUTHORIZATION; - } - - /** - * Perform certain actions with the response - * - * @param array $aResponse - * @param Order $oOrder - * @param float $amount - * @return array - */ - protected function handleResponse($aResponse, Order $oOrder, $amount) - { - $aResponse = parent::handleResponse($aResponse, $oOrder, $amount); - if (isset($aResponse['status']) && $aResponse['status'] == 'APPROVED' && isset($aResponse['add_paydata[instruction_notes]'])) { - $sInstructionNotes = urldecode($aResponse['add_paydata[instruction_notes]']); - $this->checkoutSession->setPayoneInstructionNotes($sInstructionNotes); - } - return $aResponse; - } - - /** - * Return parameters specific to this payment type - * - * @param Order $oOrder - * @return array - */ - public function getPaymentSpecificParameters(Order $oOrder) - { - return [ - 'cashtype' => 'BZN', - 'api_version' => '3.10', - ]; - } -} diff --git a/Model/Methods/BaseMethod.php b/Model/Methods/BaseMethod.php index 89d26597..a545c51b 100644 --- a/Model/Methods/BaseMethod.php +++ b/Model/Methods/BaseMethod.php @@ -86,7 +86,7 @@ abstract class BaseMethod extends AbstractMethod /** * Determines if payment type can use partial captures - * Is true for all PAYONE Payment Methods except Barzahlen + * Is true for all PAYONE Payment Methods * * @var bool */ diff --git a/Model/Methods/OnlineBankTransfer/Giropay.php b/Model/Methods/OnlineBankTransfer/Giropay.php deleted file mode 100644 index 1f1179d5..00000000 --- a/Model/Methods/OnlineBankTransfer/Giropay.php +++ /dev/null @@ -1,87 +0,0 @@ -. - * - * PHP version 5 - * - * @category Payone - * @package Payone_Magento2_Plugin - * @author FATCHIP GmbH - * @copyright 2003 - 2016 Payone GmbH - * @license GNU Lesser General Public License - * @link http://www.payone.de - */ - -namespace Payone\Core\Model\Methods\OnlineBankTransfer; - -use Payone\Core\Model\PayoneConfig; -use Magento\Sales\Model\Order; -use Magento\Framework\DataObject; - -/** - * Model for Giropay payment method - */ -class Giropay extends OnlineBankTransferBase -{ - /** - * Payment method code - * - * @var string - */ - protected $_code = PayoneConfig::METHOD_OBT_GIROPAY; - - /** - * Payment method sub type - * - * @var string - */ - protected $sSubType = self::METHOD_OBT_SUBTYPE_GIROPAY; - - /** - * Return parameters specific to this payment sub type - * - * @param Order $oOrder - * @return array - */ - public function getSubTypeSpecificParameters(Order $oOrder) - { - $oInfoInstance = $this->getInfoInstance(); - - $aParams = [ - 'bankcountry' => 'DE', - 'iban' => $oInfoInstance->getAdditionalInformation('iban'), - 'bic' => $oInfoInstance->getAdditionalInformation('bic'), - ]; - - return $aParams; - } - - /** - * Add the checkout-form-data to the checkout session - * - * @param DataObject $data - * @return $this - */ - public function assignData(DataObject $data) - { - parent::assignData($data); - - $oInfoInstance = $this->getInfoInstance(); - $oInfoInstance->setAdditionalInformation('iban', $this->toolkitHelper->getAdditionalDataEntry($data, 'iban')); - $oInfoInstance->setAdditionalInformation('bic', $this->toolkitHelper->getAdditionalDataEntry($data, 'bic')); - - return $this; - } -} diff --git a/Model/Methods/OnlineBankTransfer/OnlineBankTransferBase.php b/Model/Methods/OnlineBankTransfer/OnlineBankTransferBase.php index 73defeb8..d1b7ab02 100644 --- a/Model/Methods/OnlineBankTransfer/OnlineBankTransferBase.php +++ b/Model/Methods/OnlineBankTransfer/OnlineBankTransferBase.php @@ -36,7 +36,6 @@ class OnlineBankTransferBase extends \Payone\Core\Model\Methods\PayoneMethod { /* Payment method sub types */ const METHOD_OBT_SUBTYPE_SOFORTUEBERWEISUNG = 'PNT'; - const METHOD_OBT_SUBTYPE_GIROPAY = 'GPY'; const METHOD_OBT_SUBTYPE_EPS = 'EPS'; const METHOD_OBT_SUBTYPE_POSTFINANCE_EFINANCE = 'PFF'; const METHOD_OBT_SUBTYPE_POSTFINANCE_CARD = 'PFC'; diff --git a/Model/Methods/Payolution/Installment.php b/Model/Methods/Payolution/Installment.php index 137f9445..17966145 100644 --- a/Model/Methods/Payolution/Installment.php +++ b/Model/Methods/Payolution/Installment.php @@ -58,7 +58,6 @@ class Installment extends PayolutionBase /** * Returns authorization-mode - * Barzahlen only supports preauthorization * * @return string */ diff --git a/Model/Methods/Trustly.php b/Model/Methods/Trustly.php deleted file mode 100644 index c3cec609..00000000 --- a/Model/Methods/Trustly.php +++ /dev/null @@ -1,100 +0,0 @@ -. - * - * PHP version 5 - * - * @category Payone - * @package Payone_Magento2_Plugin - * @author FATCHIP GmbH - * @copyright 2003 - 2020 Payone GmbH - * @license GNU Lesser General Public License - * @link http://www.payone.de - */ - -namespace Payone\Core\Model\Methods; - -use Payone\Core\Model\PayoneConfig; -use Magento\Sales\Model\Order; -use Magento\Framework\DataObject; - -/** - * Model for Trustly payment method - */ -class Trustly extends PayoneMethod -{ - /** - * Payment method code - * - * @var string - */ - protected $_code = PayoneConfig::METHOD_TRUSTLY; - - /** - * Clearingtype for PAYONE authorization request - * - * @var string - */ - protected $sClearingtype = 'sb'; - - /** - * Determines if the redirect-parameters have to be added - * to the authorization-request - * - * @var bool - */ - protected $blNeedsRedirectUrls = true; - - /** - * Return parameters specific to this payment type - * - * @param Order $oOrder - * @return array - */ - public function getPaymentSpecificParameters(Order $oOrder) - { - $oInfoInstance = $this->getInfoInstance(); - - $aParams = [ - 'onlinebanktransfertype' => 'TRL', - 'api_version' => '3.10', - 'bankcountry' => $oInfoInstance->getAdditionalInformation('bank_country'), - 'iban' => $oInfoInstance->getAdditionalInformation('iban'), - ]; - if ($oInfoInstance->getAdditionalInformation('bic')) { - $aParams['bic'] = $oInfoInstance->getAdditionalInformation('bic'); - } - - return $aParams; - } - - /** - * Add the checkout-form-data to the checkout session - * - * @param DataObject $data - * @return $this - */ - public function assignData(DataObject $data) - { - parent::assignData($data); - - $oInfoInstance = $this->getInfoInstance(); - $oInfoInstance->setAdditionalInformation('bank_country', $this->toolkitHelper->getAdditionalDataEntry($data, 'bank_country')); - $oInfoInstance->setAdditionalInformation('iban', $this->toolkitHelper->getAdditionalDataEntry($data, 'iban')); - $oInfoInstance->setAdditionalInformation('bic', $this->toolkitHelper->getAdditionalDataEntry($data, 'bic')); - - return $this; - } -} diff --git a/Model/PayoneConfig.php b/Model/PayoneConfig.php index 7b8b4a9a..16dc8874 100644 --- a/Model/PayoneConfig.php +++ b/Model/PayoneConfig.php @@ -70,14 +70,12 @@ abstract class PayoneConfig const METHOD_PAYPAL = 'payone_paypal'; const METHOD_PAYPALV2 = 'payone_paypalv2'; const METHOD_OBT_SOFORTUEBERWEISUNG = 'payone_obt_sofortueberweisung'; - const METHOD_OBT_GIROPAY = 'payone_obt_giropay'; const METHOD_OBT_EPS = 'payone_obt_eps'; const METHOD_OBT_POSTFINANCE_EFINANCE = 'payone_obt_postfinance_efinance'; const METHOD_OBT_POSTFINANCE_CARD = 'payone_obt_postfinance_card'; const METHOD_OBT_IDEAL = 'payone_obt_ideal'; const METHOD_OBT_PRZELEWY = 'payone_obt_przelewy'; const METHOD_KLARNA = 'payone_klarna'; // method was deleted but constant is still useful for unit tests - const METHOD_BARZAHLEN = 'payone_barzahlen'; const METHOD_PAYDIREKT = 'payone_paydirekt'; const METHOD_SAFE_INVOICE = 'payone_safe_invoice'; const METHOD_PAYOLUTION_INVOICE = 'payone_payolution_invoice'; @@ -94,7 +92,6 @@ abstract class PayoneConfig const METHOD_RATEPAY_INVOICE = 'payone_ratepay_invoice'; const METHOD_RATEPAY_INSTALLMENT = 'payone_ratepay_installment'; const METHOD_RATEPAY_DEBIT = 'payone_ratepay_debit'; - const METHOD_TRUSTLY = 'payone_trustly'; const METHOD_APPLEPAY = 'payone_applepay'; const METHOD_BANCONTACT = 'payone_bancontact'; const METHOD_BNPL_INVOICE = 'payone_bnpl_invoice'; diff --git a/Model/Source/CreditcardTypes.php b/Model/Source/CreditcardTypes.php index d5efa80d..871b75c0 100644 --- a/Model/Source/CreditcardTypes.php +++ b/Model/Source/CreditcardTypes.php @@ -44,7 +44,6 @@ class CreditcardTypes implements ArrayInterface 'americanexpress' => array('name' => 'American Express', 'cardtype' => 'A', 'cvc_length' => 4), 'dinersclub' => array('name' => 'Diners Club', 'cardtype' => 'D', 'cvc_length' => 3), 'jcb' => array('name' => 'JCB', 'cardtype' => 'J', 'cvc_length' => 3), - 'maestroint' => array('name' => 'Maestro International', 'cardtype' => 'O', 'cvc_length' => 3), 'cartebleue' => array('name' => 'Carte Bleue', 'cardtype' => 'B', 'cvc_length' => 3), ]; diff --git a/Test/Unit/Helper/HostedIframeTest.php b/Test/Unit/Helper/HostedIframeTest.php index 2ecc581a..0c3e4351 100644 --- a/Test/Unit/Helper/HostedIframeTest.php +++ b/Test/Unit/Helper/HostedIframeTest.php @@ -169,7 +169,6 @@ protected function getExpectedArray($addCardtypeDetection = false) 'A' => 4, 'D' => 3, 'J' => 3, - 'O' => 3, 'B' => 3, ], ], diff --git a/Test/Unit/Model/Methods/BarzahlenTest.php b/Test/Unit/Model/Methods/BarzahlenTest.php deleted file mode 100644 index f5f2cc25..00000000 --- a/Test/Unit/Model/Methods/BarzahlenTest.php +++ /dev/null @@ -1,105 +0,0 @@ -. - * - * PHP version 5 - * - * @category Payone - * @package Payone_Magento2_Plugin - * @author FATCHIP GmbH - * @copyright 2003 - 2017 Payone GmbH - * @license GNU Lesser General Public License - * @link http://www.payone.de - */ - -namespace Payone\Core\Test\Unit\Model\Methods; - -use Magento\Store\Model\Store; -use Payone\Core\Model\Methods\Barzahlen as ClassToTest; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Sales\Model\Order; -use Payone\Core\Model\PayoneConfig; -use Payone\Core\Model\Api\Request\Authorization; -use Magento\Payment\Model\Info; -use Payone\Core\Test\Unit\BaseTestCase; -use Payone\Core\Test\Unit\PayoneObjectManager; -use Magento\Sales\Model\Order\Payment; - -class BarzahlenTest extends BaseTestCase -{ - /** - * @var ClassToTest - */ - private $classToTest; - - /** - * @var ObjectManager|PayoneObjectManager - */ - private $objectManager; - - /** - * @var Authorization|\PHPUnit_Framework_MockObject_MockObject - */ - private $authorizationRequest; - - protected function setUp(): void - { - $this->objectManager = $this->getObjectManager(); - - $this->authorizationRequest = $this->getMockBuilder(Authorization::class)->disableOriginalConstructor()->getMock(); - - $this->classToTest = $this->objectManager->getObject(ClassToTest::class, [ - 'authorizationRequest' => $this->authorizationRequest, - ]); - } - - public function testGetAuthorizationMode() - { - $result = $this->classToTest->getAuthorizationMode(); - $expected = PayoneConfig::REQUEST_TYPE_PREAUTHORIZATION; - $this->assertEquals($expected, $result); - } - - public function testGetPaymentSpecificParameters() - { - $order = $this->getMockBuilder(Order::class)->disableOriginalConstructor()->getMock(); - - $result = $this->classToTest->getPaymentSpecificParameters($order); - $expected = ['cashtype' => 'BZN', 'api_version' => '3.10']; - $this->assertEquals($expected, $result); - } - - public function testAuthorize() - { - $store = $this->getMockBuilder(Store::class)->disableOriginalConstructor()->getMock(); - $store->method('getCode')->willReturn('test'); - - $payment = $this->getMockBuilder(Payment::class)->disableOriginalConstructor()->getMock(); - $payment->method('getAdditionalInformation')->willReturn([]); - - $order = $this->getMockBuilder(Order::class)->disableOriginalConstructor()->getMock(); - $order->method('getStore')->willReturn($store); - $order->method('getPayment')->willReturn($payment); - - $paymentInfo = $this->getMockBuilder(Info::class)->disableOriginalConstructor()->setMethods(['getOrder'])->getMock(); - $paymentInfo->method('getOrder')->willReturn($order); - - $aResponse = ['status' => 'APPROVED', 'txid' => '12345', 'redirecturl' => 'http://testdomain.com', 'add_paydata[instruction_notes]' => 'test']; - $this->authorizationRequest->method('sendRequest')->willReturn($aResponse); - - $result = $this->classToTest->authorize($paymentInfo, 100); - $this->assertInstanceOf(ClassToTest::class, $result); - } -} diff --git a/Test/Unit/Model/Methods/OnlineBankTransfer/GiropayTest.php b/Test/Unit/Model/Methods/OnlineBankTransfer/GiropayTest.php deleted file mode 100644 index 65526e66..00000000 --- a/Test/Unit/Model/Methods/OnlineBankTransfer/GiropayTest.php +++ /dev/null @@ -1,82 +0,0 @@ -. - * - * PHP version 5 - * - * @category Payone - * @package Payone_Magento2_Plugin - * @author FATCHIP GmbH - * @copyright 2003 - 2017 Payone GmbH - * @license GNU Lesser General Public License - * @link http://www.payone.de - */ - -namespace Payone\Core\Test\Unit\Model\Methods\OnlineBankTransfer; - -use Payone\Core\Helper\Toolkit; -use Payone\Core\Model\Methods\OnlineBankTransfer\Giropay as ClassToTest; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Sales\Model\Order; -use Magento\Payment\Model\InfoInterface; -use Magento\Framework\DataObject; -use Payone\Core\Test\Unit\BaseTestCase; -use Payone\Core\Test\Unit\PayoneObjectManager; - -class GiropayTest extends BaseTestCase -{ - /** - * @var ClassToTest - */ - private $classToTest; - - /** - * @var ObjectManager|PayoneObjectManager - */ - private $objectManager; - - protected function setUp(): void - { - $this->objectManager = $this->getObjectManager(); - - $info = $this->getMockBuilder(InfoInterface::class)->disableOriginalConstructor()->getMock(); - $info->method('getAdditionalInformation')->willReturn('info'); - - $toolkitHelper = $this->getMockBuilder(Toolkit::class)->disableOriginalConstructor()->getMock(); - $toolkitHelper->method('getAdditionalDataEntry')->willReturn('info'); - - $this->classToTest = $this->objectManager->getObject(ClassToTest::class, [ - 'toolkitHelper' => $toolkitHelper - ]); - $this->classToTest->setInfoInstance($info); - } - - public function testGetSubTypeSpecificParameters() - { - $order = $this->getMockBuilder(Order::class)->disableOriginalConstructor()->getMock(); - - $result = $this->classToTest->getSubTypeSpecificParameters($order); - $expected = ['bankcountry' => 'DE', 'iban' => 'info', 'bic' => 'info']; - $this->assertEquals($expected, $result); - } - - public function testAssignData() - { - $data = $this->getMockBuilder(DataObject::class)->disableOriginalConstructor()->getMock(); - - $result = $this->classToTest->assignData($data); - $this->assertInstanceOf(ClassToTest::class, $result); - } -} diff --git a/Test/Unit/Model/Methods/TrustlyTest.php b/Test/Unit/Model/Methods/TrustlyTest.php deleted file mode 100644 index b9aef432..00000000 --- a/Test/Unit/Model/Methods/TrustlyTest.php +++ /dev/null @@ -1,82 +0,0 @@ -. - * - * PHP version 5 - * - * @category Payone - * @package Payone_Magento2_Plugin - * @author FATCHIP GmbH - * @copyright 2003 - 2020 Payone GmbH - * @license GNU Lesser General Public License - * @link http://www.payone.de - */ - -namespace Payone\Core\Test\Unit\Model\Methods; - -use Magento\Framework\DataObject; -use Magento\Payment\Model\InfoInterface; -use Payone\Core\Model\Methods\Trustly as ClassToTest; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Sales\Model\Order; -use Payone\Core\Test\Unit\BaseTestCase; -use Payone\Core\Test\Unit\PayoneObjectManager; - -class TrustlyTest extends BaseTestCase -{ - /** - * @var ClassToTest - */ - private $classToTest; - - /** - * @var ObjectManager|PayoneObjectManager - */ - private $objectManager; - - protected function setUp(): void - { - $this->objectManager = $this->getObjectManager(); - - $info = $this->getMockBuilder(InfoInterface::class)->disableOriginalConstructor()->getMock(); - $info->method('getAdditionalInformation')->willReturn('info'); - - $this->classToTest = $this->objectManager->getObject(ClassToTest::class); - $this->classToTest->setInfoInstance($info); - } - - public function testGetPaymentSpecificParameters() - { - $order = $this->getMockBuilder(Order::class)->disableOriginalConstructor()->getMock(); - - $result = $this->classToTest->getPaymentSpecificParameters($order); - $expected = [ - 'onlinebanktransfertype' => 'TRL', - 'api_version' => '3.10', - 'bankcountry' => 'info', - 'iban' => 'info', - 'bic' => 'info', - ]; - $this->assertEquals($expected, $result); - } - - public function testAssignData() - { - $data = $this->getMockBuilder(DataObject::class)->disableOriginalConstructor()->getMock(); - - $result = $this->classToTest->assignData($data); - $this->assertInstanceOf(ClassToTest::class, $result); - } -} diff --git a/Test/Unit/Model/Plugins/MethodListTest.php b/Test/Unit/Model/Plugins/MethodListTest.php index 53297179..acffb8fd 100644 --- a/Test/Unit/Model/Plugins/MethodListTest.php +++ b/Test/Unit/Model/Plugins/MethodListTest.php @@ -84,7 +84,7 @@ protected function setUp(): void $this->consumerscoreHelper->expects($this->any()) ->method('getAllowedMethodsForScore') ->willReturnMap([ - ['Y', [PayoneConfig::METHOD_CREDITCARD, PayoneConfig::METHOD_ADVANCE_PAYMENT, PayoneConfig::METHOD_OBT_GIROPAY]], + ['Y', [PayoneConfig::METHOD_CREDITCARD, PayoneConfig::METHOD_ADVANCE_PAYMENT, PayoneConfig::METHOD_OBT_IDEAL]], ['R', [PayoneConfig::METHOD_DEBIT, PayoneConfig::METHOD_CASH_ON_DELIVERY, PayoneConfig::METHOD_AMAZONPAY]], ]); @@ -111,7 +111,7 @@ protected function setUp(): void ->getMock(); $checkoutSession->method('getQuote')->willReturn($this->quote); $checkoutSession->method('getPayonePaymentBans')->willReturn([PayoneConfig::METHOD_DEBIT => '2100-01-01 12:00:00']); - $checkoutSession->method('getPayonePaymentWhitelist')->willReturn(['payone_creditcard', 'payone_paypal', 'payone_debit', 'payone_barzahlen', 'payone_cash_on_delivery', 'payone_amazonpay', 'payone_klarna_base', 'payone_klarna_invoice']); + $checkoutSession->method('getPayonePaymentWhitelist')->willReturn(['payone_creditcard', 'payone_paypal', 'payone_debit', 'payone_cash_on_delivery', 'payone_amazonpay', 'payone_klarna_base', 'payone_klarna_invoice']); $addresscheck = $this->getMockBuilder(Addresscheck::class)->disableOriginalConstructor()->getMock(); $addresscheck->method('getPersonstatusMapping')->willReturn(['PPV' => 'R']); @@ -174,7 +174,7 @@ public function testAfterGetAvailableMethodsEmpty() $subject = $this->getMockBuilder(MethodList::class)->disableOriginalConstructor()->getMock(); $payment = $this->getMockBuilder(MethodInterface::class)->disableOriginalConstructor()->getMock(); - $payment->method('getCode')->willReturn(PayoneConfig::METHOD_BARZAHLEN); + $payment->method('getCode')->willReturn(PayoneConfig::METHOD_ADVANCE_PAYMENT); $paymentMethods = [$payment]; $this->quote->method('getCustomerId')->willReturn('5'); @@ -246,7 +246,7 @@ public function testAfterGetAvailableMethodsRemoveNotWhitelisted() $subject = $this->getMockBuilder(MethodList::class)->disableOriginalConstructor()->getMock(); $payment = $this->getMockBuilder(MethodInterface::class)->disableOriginalConstructor()->getMock(); - $payment->method('getCode')->willReturn(PayoneConfig::METHOD_OBT_GIROPAY); + $payment->method('getCode')->willReturn(PayoneConfig::METHOD_OBT_IDEAL); $paymentMethods = [$payment]; $this->quote->method('getCustomerId')->willReturn('5'); diff --git a/Test/Unit/Model/Source/CreditcardTypesTest.php b/Test/Unit/Model/Source/CreditcardTypesTest.php index a5418e12..31aa80cf 100644 --- a/Test/Unit/Model/Source/CreditcardTypesTest.php +++ b/Test/Unit/Model/Source/CreditcardTypesTest.php @@ -48,7 +48,7 @@ protected function setUp(): void public function testToOptionArray() { $result = $this->classToTest->toOptionArray(); - $this->assertCount(7, $result); + $this->assertCount(6, $result); } public function testGetCreditcardTypes() diff --git a/Test/Unit/Observer/CheckoutSubmitBeforeTest.php b/Test/Unit/Observer/CheckoutSubmitBeforeTest.php index 4fed9467..bc1f3753 100644 --- a/Test/Unit/Observer/CheckoutSubmitBeforeTest.php +++ b/Test/Unit/Observer/CheckoutSubmitBeforeTest.php @@ -395,7 +395,7 @@ public function testExecuteException() ->method('getAllowedMethodsForScore') ->willReturnMap([ ['Y', [PayoneConfig::METHOD_ADVANCE_PAYMENT, PayoneConfig::METHOD_CASH_ON_DELIVERY]], - ['R', [PayoneConfig::METHOD_DEBIT, PayoneConfig::METHOD_BARZAHLEN]] + ['R', [PayoneConfig::METHOD_DEBIT, PayoneConfig::METHOD_BNPL_DEBIT]] ]); $observer = $this->getExecuteObserver(); diff --git a/composer.json b/composer.json index ce642d47..56dae82a 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "payone-gmbh/magento-2", - "description": "PAYONE payment gateway for all German online and offline payment methods including PayPal, all major Credit Cards and Maestro.", + "description": "PAYONE payment gateway for all German online and offline payment methods including PayPal, all major Credit Cards.", "type": "magento2-module", "version": "3.13.2", "license": [ diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index c2633cca..168bc1b1 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -146,11 +146,6 @@ Payone\Core\Block\Adminhtml\Config\Form\Field\StatusMapping Payone\Core\Model\Config\Backend\SerializedOrJson - Payone\Core\Block\Adminhtml\Config\Form\Field\StatusMapping @@ -176,13 +171,8 @@ Payone\Core\Block\Adminhtml\Config\Form\Field\StatusMapping Payone\Core\Model\Config\Backend\SerializedOrJson - - - Payone\Core\Block\Adminhtml\Config\Form\Field\StatusMapping - Payone\Core\Model\Config\Backend\SerializedOrJson - - + Payone\Core\Block\Adminhtml\Config\Form\Field\StatusMapping Payone\Core\Model\Config\Backend\SerializedOrJson @@ -257,11 +247,6 @@ Payone\Core\Block\Adminhtml\Config\Form\Field\StatusMapping Payone\Core\Model\Config\Backend\SerializedOrJson - - - Payone\Core\Block\Adminhtml\Config\Form\Field\StatusMapping - Payone\Core\Model\Config\Backend\SerializedOrJson - Payone\Core\Block\Adminhtml\Config\Form\Field\StatusMapping @@ -317,13 +302,11 @@ - - @@ -340,7 +323,6 @@ - diff --git a/etc/adminhtml/system/payone_barzahlen.xml b/etc/adminhtml/system/payone_barzahlen.xml deleted file mode 100644 index a14bf1ea..00000000 --- a/etc/adminhtml/system/payone_barzahlen.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - Magento\Config\Model\Config\Source\Yesno - payment/payone_barzahlen/active - - - - payment/payone_barzahlen/title - - - - Magento\Sales\Model\Config\Source\Order\Status\NewStatus - payment/payone_barzahlen/order_status - - - - payment/payone_barzahlen/instructions - - - - payment/payone_barzahlen/min_order_total - - - - payment/payone_barzahlen/max_order_total - - - - payment/payone_barzahlen/sort_order - - - - diff --git a/etc/adminhtml/system/payone_obt_giropay.xml b/etc/adminhtml/system/payone_obt_giropay.xml deleted file mode 100644 index 44aaa6b4..00000000 --- a/etc/adminhtml/system/payone_obt_giropay.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - Magento\Config\Model\Config\Source\Yesno - payment/payone_obt_giropay/active - - - - payment/payone_obt_giropay/title - - - - Magento\Sales\Model\Config\Source\Order\Status\NewStatus - payment/payone_obt_giropay/order_status - - - - payment/payone_obt_giropay/instructions - - - - payment/payone_obt_giropay/min_order_total - - - - payment/payone_obt_giropay/max_order_total - - - - payment/payone_obt_giropay/sort_order - - - - diff --git a/etc/adminhtml/system/payone_paydirekt.xml b/etc/adminhtml/system/payone_paydirekt.xml index da61751f..7980d102 100644 --- a/etc/adminhtml/system/payone_paydirekt.xml +++ b/etc/adminhtml/system/payone_paydirekt.xml @@ -26,7 +26,7 @@ --> - + Magento\Config\Model\Config\Source\Yesno diff --git a/etc/adminhtml/system/payone_trustly.xml b/etc/adminhtml/system/payone_trustly.xml deleted file mode 100644 index 18a56cb4..00000000 --- a/etc/adminhtml/system/payone_trustly.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - Magento\Config\Model\Config\Source\Yesno - payment/payone_trustly/active - - - - payment/payone_trustly/title - - - - Magento\Sales\Model\Config\Source\Order\Status\NewStatus - payment/payone_trustly/order_status - - - - payment/payone_trustly/instructions - - - - payment/payone_trustly/min_order_total - - - - payment/payone_trustly/max_order_total - - - - payment/payone_trustly/sort_order - - - - Magento\Config\Model\Config\Source\Yesno - - - - Payone\Core\Model\Source\SepaCountry - - - - diff --git a/etc/config.xml b/etc/config.xml index 2bb9e48d..51e7b080 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -101,15 +101,6 @@ 0 payone - 1 Authorization @@ -155,21 +146,12 @@ 0 payone - - 1 - Authorization - Payone\Core\Model\Methods\Barzahlen - pending - PAYONE Barzahlen - 0 - payone - 1 Authorization Payone\Core\Model\Methods\Paydirekt pending - PAYONE Giropay + PAYONE Paydirekt 0 payone @@ -310,15 +292,6 @@ 0 payone - - 1 - Authorization - Payone\Core\Model\Methods\Trustly - pending - PAYONE Trustly - 0 - payone - 1 Authorization @@ -396,13 +369,11 @@ {"_1338893611948_948":{"txaction":"appointed","state_status":"processing"}} {"_1338893618715_715":{"txaction":"appointed","state_status":"pending"},"_1458214328719_719":{"txaction":"paid","state_status":"processing"}} {"_1343137411652_152":{"txaction":"appointed","state_status":"processing"}} - {"_1343137411652_352":{"txaction":"appointed","state_status":"processing"}} {"_1343137411652_452":{"txaction":"appointed","state_status":"processing"}} {"_1343137411652_552":{"txaction":"appointed","state_status":"processing"}} {"_1343137411652_752":{"txaction":"appointed","state_status":"processing"}} {"_1343137411652_852":{"txaction":"appointed","state_status":"processing"}} - {"_payone_status_mapping6":{"txaction":"appointed","state_status":"processing"}} {"_1343118466182_183":{"txaction":"appointed","state_status":"processing"}} {"_payone_status_invoice":{"txaction":"appointed","state_status":"processing"}} {"_payone_status_mapping7":{"txaction":"appointed","state_status":"processing"}} @@ -418,7 +389,6 @@ {"_payone_status_rpdebit":{"txaction":"appointed","state_status":"processing"}} {"_payone_status_rpinstallment":{"txaction":"appointed","state_status":"processing"}} {"_payone_status_wechatpay":{"txaction":"appointed","state_status":"processing"}} - {"_payone_status_trustly":{"txaction":"appointed","state_status":"processing"}} {"_payone_status_applepay":{"txaction":"appointed","state_status":"processing"}} {"_payone_status_bancontact":{"txaction":"appointed","state_status":"processing"}} {"_payone_status_bnpl_invoice":{"txaction":"appointed","state_status":"processing"}} @@ -509,9 +479,6 @@ 1 - 1 @@ -527,9 +494,6 @@ 1 - - 1 - 1 0 @@ -579,9 +543,6 @@ 1 - - 1 - 1 diff --git a/etc/payment.xml b/etc/payment.xml index 353b094e..4bc1a8f8 100644 --- a/etc/payment.xml +++ b/etc/payment.xml @@ -55,9 +55,6 @@ 0 - 0 @@ -73,9 +70,6 @@ 0 - - 0 - 0 @@ -124,9 +118,6 @@ 0 - - 0 - 0 diff --git a/i18n/de_DE.csv b/i18n/de_DE.csv index 89d5a579..76e9a21b 100644 --- a/i18n/de_DE.csv +++ b/i18n/de_DE.csv @@ -60,9 +60,6 @@ "New Creditcard Channel Frontend","Kreditkarte Channel Frontend" "Add Creditcard Channel Frontend","Kreditkarte Channel Frontend hinzufügen" "Edit Creditcard Channel Frontend","Kreditkarte Channel Frontend bearbeiten" -"New Barzahlen","Barzahlen" -"Add Barzahlen","Barzahlen hinzufügen" -"Edit Barzahlen","Barzahlen bearbeiten" "New Debit Payment","Lastschrift" "Add Debit Payment","Lastschrift hinzufügen" "Edit Debit Payment","Lastschrift bearbeiten" @@ -135,7 +132,6 @@ "Transactionstatus-message","Transaktionsstatus-Meldung" "Magento-status","Magento-Status" "Add Statusmapping","Füge Statusmapping hinzu" -"Barzahlen","Barzahlen" "Mapping configuration is used by the addresscheck and the credit rating with combined addresscheck.","Mapping Konfiguration wird von der Adressprüfung und der Bonitätsprüfung mit kombinierter Adressprüfung verwendet" "Address checking","Adressprüfung" @@ -420,7 +416,6 @@ "GETFILE","Download Mandat als PDF (getfile)" "INSTANT_MONEY_TRANSFER","SOFORT Überweisung" -"GIROPAY","giropay" "EPS_ONLINE_BANK_TRANSFER","eps Online-Überweisung" "POSTFINANCE_EFINANCE","PostFinance E-Finance" "POSTFINANCE_CARD","PostFinance Card" @@ -447,8 +442,6 @@ "AMEX","American Express" "DINERS","Diners-Club" "JCB","JCB" -"MAESTRO_INTERNATIONAL","Maestro International" -"MAESTRO_UK","Maestro UK" "DISCOVER","Discover" "CARTE_BLEUE","Carte Bleue" @@ -578,7 +571,7 @@ "Define the countries to which this settings should apply. This setting follows the Magento country standard.","Definieren Sie die Länder, in denen diese Einstellungen gelten. Die Einstellung folgt dem Magento Länderauswahlstandard." "Authorization method","Autorisierungsmethode" "Chose here which method to apply for your payments","Hier können Sie einstellen welches Verfahren Sie für Ihre Transaktion verwenden wollen." -"Note: For the online transfer methods giropay, SOFORT Banking, eps, PostFinance and iDEAL the payment is carried out fully and completely even if you have selected ""Pre-authorisation"". Despite this, you would still have to post the receivable via a separate capture, in this case.","Note: For the online transfer methods giropay, SOFORT Banking, eps, PostFinance and iDEAL the payment is carried out fully and completely even if you have selected “Pre-authorisation“. Despite this, you would still have to post the receivable via a separate capture, in this case." +"Note: For the online transfer methods SOFORT Banking, eps, PostFinance and iDEAL the payment is carried out fully and completely even if you have selected ""Pre-authorisation"". Despite this, you would still have to post the receivable via a separate capture, in this case.","Note: For the online transfer methods SOFORT Banking, eps, PostFinance and iDEAL the payment is carried out fully and completely even if you have selected “Pre-authorisation“. Despite this, you would still have to post the receivable via a separate capture, in this case." "Options:","Optionen:" "Pre-authorization","Vorautorisierung" "When selecting "Pre-authorisation" the amount to be paid is reserved during the ordering process. In this case, the actual capture of the amount must be initiated in a second step upon delivery of the goods. The receivable will only be posted after the amount has been captured.","Dieses Verfahren versucht zunächst eine Reservierung des Betrages auf dem ausgewählten Zahlungsmittel. Zu einen späteren Zeitpunkt wird per Capture das Geld vom Zahlungsmittel abgebucht. Dieses Verfahren ist zu empfehlen, wenn Sie Versender von materiellen Gütern sind. Erst zum Zeitpunkt des Warenversandes wird dann der Geldeinzug vorgenommen." @@ -789,7 +782,7 @@ "Security Key","Sicherheitsschlüssel (Key)" "The key that you defined in the PMI to encrypt the queries sent to the PAYONE Platform.","Tragen Sie hier den von Ihnen definierten PMI-Sicherheitsschlüssel ein, um eine gesicherte Kommunikation zu gewährleisten.", "Authorization method","Autorisierungsmethode" -"Chose here which method to apply for your payments. Note: For the online transfer methods giropay, SOFORT Banking, eps, PostFinance and iDEAL the payment is carried out fully and completely even if you have selected ""Pre-authorisation"". Despite this, you would still have to post the receivable via a separate capture, in this case.","Hier können Sie einstellen welches Verfahren Sie für Ihre Transaktion verwenden wollen.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"Chose here which method to apply for your payments. Note: For the online transfer methods SOFORT Banking, eps, PostFinance and iDEAL the payment is carried out fully and completely even if you have selected ""Pre-authorisation"". Despite this, you would still have to post the receivable via a separate capture, in this case.","Hier können Sie einstellen welches Verfahren Sie für Ihre Transaktion verwenden wollen.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Pre-authorization","Vorautorisierung" "When selecting ""Pre-authorisation"" the amount to be paid is reserved during the ordering process. In this case, the actual capture of the amount must be initiated in a second step upon delivery of the goods. The receivable will only be posted after the amount has been captured.","Dieses Verfahren versucht zunächst eine Reservierung des Betrages auf dem ausgewählten Zahlungsmittel. Zu einen späteren Zeitpunkt wird per Capture das Geld vom Zahlungsmittel abgebucht. Dieses Verfahren ist zu empfehlen, wenn Sie Versender von materiellen Gütern sind. Erst zum Zeitpunkt des Warenversandes wird dann der Geldeinzug vorgenommen." "Authorization","Autorisierung" diff --git a/i18n/en_GB.csv b/i18n/en_GB.csv index 9adf92c6..ec84ee46 100644 --- a/i18n/en_GB.csv +++ b/i18n/en_GB.csv @@ -3,15 +3,12 @@ "AMEX", "Amex" "DINERS", "Diners" "JCB", "JCB" -"MAESTRO_INTERNATIONAL", "Maestro International" -"MAESTRO_UK", "Maestro UK" "DISCOVER", "Discover" "CARTE_BLEUE", "Carte Bleue" "PPE", "Paypal Express" "PNT", "SOFORT Überweisung" -"GPY", "Giropay" "EPS", "EPS Österreich" "PFF", "PostFinance E-Finance Schweiz" "PFC", "PostFinance Card Schweiz" diff --git a/i18n/en_US.csv b/i18n/en_US.csv index 9adf92c6..ec84ee46 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -3,15 +3,12 @@ "AMEX", "Amex" "DINERS", "Diners" "JCB", "JCB" -"MAESTRO_INTERNATIONAL", "Maestro International" -"MAESTRO_UK", "Maestro UK" "DISCOVER", "Discover" "CARTE_BLEUE", "Carte Bleue" "PPE", "Paypal Express" "PNT", "SOFORT Überweisung" -"GPY", "Giropay" "EPS", "EPS Österreich" "PFF", "PostFinance E-Finance Schweiz" "PFC", "PostFinance Card Schweiz" diff --git a/view/frontend/layout/checkout_index_index.xml b/view/frontend/layout/checkout_index_index.xml index 4a5f9d17..8b80b1a3 100644 --- a/view/frontend/layout/checkout_index_index.xml +++ b/view/frontend/layout/checkout_index_index.xml @@ -76,9 +76,6 @@ true - true @@ -94,9 +91,6 @@ true - - true - true @@ -145,9 +139,6 @@ true - - true - true diff --git a/view/frontend/web/js/view/payment/method-renderer/barzahlen-method.js b/view/frontend/web/js/view/payment/method-renderer/barzahlen-method.js deleted file mode 100644 index bc50f9d8..00000000 --- a/view/frontend/web/js/view/payment/method-renderer/barzahlen-method.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PAYONE Magento 2 Connector is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with PAYONE Magento 2 Connector. If not, see . - * - * PHP version 5 - * - * @category Payone - * @package Payone_Magento2_Plugin - * @author FATCHIP GmbH - * @copyright 2003 - 2016 Payone GmbH - * @license GNU Lesser General Public License - * @link http://www.payone.de - */ -define( - [ - 'Payone_Core/js/view/payment/method-renderer/base' - ], - function (Component) { - 'use strict'; - return Component.extend({ - defaults: { - template: 'Payone_Core/payment/barzahlen' - }, - - /** Returns payment method instructions */ - getInstructions: function () { - return window.checkoutConfig.payment.instructions[this.item.method]; - } - }); - } -); diff --git a/view/frontend/web/js/view/payment/method-renderer/obt_giropay-method.js b/view/frontend/web/js/view/payment/method-renderer/obt_giropay-method.js deleted file mode 100644 index 540d34d2..00000000 --- a/view/frontend/web/js/view/payment/method-renderer/obt_giropay-method.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PAYONE Magento 2 Connector is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with PAYONE Magento 2 Connector. If not, see . - * - * PHP version 5 - * - * @category Payone - * @package Payone_Magento2_Plugin - * @author FATCHIP GmbH - * @copyright 2003 - 2016 Payone GmbH - * @license GNU Lesser General Public License - * @link http://www.payone.de - */ -define( - [ - 'Payone_Core/js/view/payment/method-renderer/base', - 'Magento_Ui/js/model/messageList', - 'mage/translate' - ], - function (Component, messageList, $t) { - 'use strict'; - return Component.extend({ - defaults: { - template: 'Payone_Core/payment/obt_giropay', - iban: '', - bic: '' - }, - - initObservable: function () { - this._super() - .observe([ - 'iban', - 'bic' - ]); - return this; - }, - - validate: function () { - if (this.iban() == '') { - this.messageContainer.addErrorMessage({'message': $t('Please enter a valid IBAN.')}); - return false; - } - if (this.bic() == '') { - this.messageContainer.addErrorMessage({'message': $t('Please enter a valid BIC.')}); - return false; - } - return true; - }, - - /** Returns payment method instructions */ - getInstructions: function () { - return window.checkoutConfig.payment.instructions[this.item.method]; - }, - - getCleanedNumber: function (sDirtyNumber) { - var sCleanedNumber = ''; - var sTmpChar; - for (var i = 0; i < sDirtyNumber.length; i++) { - sTmpChar = sDirtyNumber.charAt(i); - if (sTmpChar != ' ' && (!isNaN(sTmpChar) || /^[A-Za-z]/.test(sTmpChar))) { - if (/^[a-z]/.test(sTmpChar)) { - sTmpChar = sTmpChar.toUpperCase(); - } - sCleanedNumber = sCleanedNumber + sTmpChar; - } - } - return sCleanedNumber; - }, - getData: function () { - document.getElementById(this.getCode() + '_iban').value = this.getCleanedNumber(this.iban()); - document.getElementById(this.getCode() + '_bic').value = this.getCleanedNumber(this.bic()); - - var parentReturn = this._super(); - if (parentReturn.additional_data === null) { - parentReturn.additional_data = {}; - } - parentReturn.additional_data.iban = this.getCleanedNumber(this.iban()); - parentReturn.additional_data.bic = this.getCleanedNumber(this.bic()); - return parentReturn; - } - }); - } -); diff --git a/view/frontend/web/js/view/payment/method-renderer/trustly-method.js b/view/frontend/web/js/view/payment/method-renderer/trustly-method.js deleted file mode 100644 index 7dc2d297..00000000 --- a/view/frontend/web/js/view/payment/method-renderer/trustly-method.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PAYONE Magento 2 Connector is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with PAYONE Magento 2 Connector. If not, see . - * - * PHP version 5 - * - * @category Payone - * @package Payone_Magento2_Plugin - * @author FATCHIP GmbH - * @copyright 2003 - 2020 Payone GmbH - * @license GNU Lesser General Public License - * @link http://www.payone.de - */ -define( - [ - 'Payone_Core/js/view/payment/method-renderer/base', - 'Magento_Ui/js/model/messageList', - 'mage/translate' - ], - function (Component, messageList, $t) { - 'use strict'; - return Component.extend({ - defaults: { - template: 'Payone_Core/payment/trustly', - bankCountry: '', - iban: '', - bic: '' - }, - - initObservable: function () { - this._super() - .observe([ - 'bankCountry', - 'iban', - 'bic' - ]); - return this; - }, - - validate: function () { - if (document.getElementById(this.getCode() + '_country').value == '') { - this.messageContainer.addErrorMessage({'message': $t('Please choose the bank country.')}); - return false; - } - if (this.iban() == '') { - this.messageContainer.addErrorMessage({'message': $t('Please enter a valid IBAN.')}); - return false; - } - if (this.requestBic() == 1 && this.bic() == '') { - this.messageContainer.addErrorMessage({'message': $t('Please enter a valid BIC.')}); - return false; - } - return true; - }, - - /** Returns payment method instructions */ - getInstructions: function () { - return window.checkoutConfig.payment.instructions[this.item.method]; - }, - - getCountries: function () { - return window.checkoutConfig.payment.payone.trustlyCountries; - }, - requestBic: function () { - return window.checkoutConfig.payment.payone.trustlyRequestBic; - }, - getCleanedNumber: function (sDirtyNumber) { - var sCleanedNumber = ''; - var sTmpChar; - for (var i = 0; i < sDirtyNumber.length; i++) { - sTmpChar = sDirtyNumber.charAt(i); - if (sTmpChar != ' ' && (!isNaN(sTmpChar) || /^[A-Za-z]/.test(sTmpChar))) { - if (/^[a-z]/.test(sTmpChar)) { - sTmpChar = sTmpChar.toUpperCase(); - } - sCleanedNumber = sCleanedNumber + sTmpChar; - } - } - return sCleanedNumber; - }, - - getData: function () { - document.getElementById(this.getCode() + '_iban').value = this.getCleanedNumber(this.iban()); - if (this.requestBic() == 1) { - document.getElementById(this.getCode() + '_bic').value = this.getCleanedNumber(this.bic()); - } - - var parentReturn = this._super(); - if (parentReturn.additional_data === null) { - parentReturn.additional_data = {}; - } - parentReturn.additional_data.bank_country = this.bankCountry(); - parentReturn.additional_data.iban = this.getCleanedNumber(this.iban()); - parentReturn.additional_data.bic = this.getCleanedNumber(this.bic()); - return parentReturn; - }, - }); - } -); diff --git a/view/frontend/web/js/view/payment/payone-payments.js b/view/frontend/web/js/view/payment/payone-payments.js index dd90bfce..3cce9860 100644 --- a/view/frontend/web/js/view/payment/payone-payments.js +++ b/view/frontend/web/js/view/payment/payone-payments.js @@ -64,10 +64,6 @@ define( type: 'payone_obt_sofortueberweisung', component: 'Payone_Core/js/view/payment/method-renderer/obt_sofortueberweisung-method' }, - /*{ - type: 'payone_obt_giropay', - component: 'Payone_Core/js/view/payment/method-renderer/obt_giropay-method' - }, Giropay has been disabled, Paydirekt is now Giropay */ { type: 'payone_obt_eps', component: 'Payone_Core/js/view/payment/method-renderer/obt_eps-method' @@ -88,10 +84,6 @@ define( type: 'payone_obt_przelewy', component: 'Payone_Core/js/view/payment/method-renderer/obt_przelewy-method' }, - { - type: 'payone_barzahlen', - component: 'Payone_Core/js/view/payment/method-renderer/barzahlen-method' - }, { type: 'payone_paydirekt', component: 'Payone_Core/js/view/payment/method-renderer/paydirekt-method' @@ -156,10 +148,6 @@ define( type: 'payone_wechatpay', component: 'Payone_Core/js/view/payment/method-renderer/wechatpay-method' }, - { - type: 'payone_trustly', - component: 'Payone_Core/js/view/payment/method-renderer/trustly-method' - }, { type: 'payone_applepay', component: 'Payone_Core/js/view/payment/method-renderer/applepay-method' diff --git a/view/frontend/web/template/payment/barzahlen.html b/view/frontend/web/template/payment/barzahlen.html deleted file mode 100644 index 5fd2b0fd..00000000 --- a/view/frontend/web/template/payment/barzahlen.html +++ /dev/null @@ -1,89 +0,0 @@ - -
-
- - -
- -
- - - -
- - - -
-

-
- - - -
-
-
- - -
- -
- - -
- - -
- - -
-
-
-
- -
-
-
-
diff --git a/view/frontend/web/template/payment/obt_giropay.html b/view/frontend/web/template/payment/obt_giropay.html deleted file mode 100644 index 14ab9525..00000000 --- a/view/frontend/web/template/payment/obt_giropay.html +++ /dev/null @@ -1,126 +0,0 @@ - -
-
- - -
- -
- - - -
- - - -
- -
-
-
- -
- -
-
- -
- -
- -
-
-
-
- -

-
- - - -
-
-
- - -
- -
- - -
- - -
- - -
-
-
-
- -
-
-
-
diff --git a/view/frontend/web/template/payment/trustly.html b/view/frontend/web/template/payment/trustly.html deleted file mode 100644 index aa6690b4..00000000 --- a/view/frontend/web/template/payment/trustly.html +++ /dev/null @@ -1,145 +0,0 @@ - -
-
- - -
- -
- - - -
- - - -
- -
-
-
- -
- -
-
- -
- -
- -
-
- - -
- -
- -
-
- -
-
- -

-
- - - -
-
-
- - -
- -
- - -
- - -
- - -
-
-
-
- -
-
-
-