From 899677d5e879e81f372d5de97b4019c2b71c658e Mon Sep 17 00:00:00 2001 From: woutse Date: Thu, 10 Jun 2021 10:32:15 +0200 Subject: [PATCH 1/2] Added dob for afterpay --- Model/Paymentmethod/Afterpay.php | 19 ++++++++++++++++++- Model/Paymentmethod/Billink.php | 7 +------ Model/Paymentmethod/PaymentMethod.php | 2 +- etc/adminhtml/paymentmethods/afterpay.xml | 10 +++++++++- etc/adminhtml/paymentmethods/paylink.xml | 2 +- i18n/en_US.csv | 2 +- i18n/nl_NL.csv | 4 ++-- 7 files changed, 33 insertions(+), 13 deletions(-) diff --git a/Model/Paymentmethod/Afterpay.php b/Model/Paymentmethod/Afterpay.php index 5cb6ce7d..f6f91a0c 100644 --- a/Model/Paymentmethod/Afterpay.php +++ b/Model/Paymentmethod/Afterpay.php @@ -17,4 +17,21 @@ protected function getDefaultPaymentOptionId() { return 739; } -} \ No newline at end of file + + public function assignData(\Magento\Framework\DataObject $data) + { + parent::assignData($data); + + if (is_array($data)) { + $this->getInfoInstance()->setAdditionalInformation('dob', $data['dob']); + } elseif ($data instanceof \Magento\Framework\DataObject) { + $additional_data = $data->getAdditionalData(); + + if (isset($additional_data['dob'])) { + $this->getInfoInstance()->setAdditionalInformation('dob', $additional_data['dob']); + } + + } + return $this; + } +} diff --git a/Model/Paymentmethod/Billink.php b/Model/Paymentmethod/Billink.php index 785cf59d..e64a6fcb 100644 --- a/Model/Paymentmethod/Billink.php +++ b/Model/Paymentmethod/Billink.php @@ -25,11 +25,6 @@ public function getKVK() return $this->_scopeConfig->getValue('payment/paynl_payment_billink/showkvk', 'store'); } - public function getDOB() - { - return $this->_scopeConfig->getValue('payment/paynl_payment_billink/showdob', 'store'); - } - public function assignData(\Magento\Framework\DataObject $data) { parent::assignData($data); @@ -72,4 +67,4 @@ private function getCache() return $cache; } -} \ No newline at end of file +} diff --git a/Model/Paymentmethod/PaymentMethod.php b/Model/Paymentmethod/PaymentMethod.php index 45de5281..ce986138 100644 --- a/Model/Paymentmethod/PaymentMethod.php +++ b/Model/Paymentmethod/PaymentMethod.php @@ -134,7 +134,7 @@ public function getKVK() public function getDOB() { - return []; + return $this->_scopeConfig->getValue('payment/' . $this->_code . '/showdob', 'store'); } public function getDisallowedShippingMethods() diff --git a/etc/adminhtml/paymentmethods/afterpay.xml b/etc/adminhtml/paymentmethods/afterpay.xml index eb5fecc0..bd7467bf 100644 --- a/etc/adminhtml/paymentmethods/afterpay.xml +++ b/etc/adminhtml/paymentmethods/afterpay.xml @@ -106,6 +106,15 @@ 1 + + + Paynl\Payment\Model\Config\Source\showDobOptions + + 1 + + payment/paynl_payment_afterpay/showdob + + @@ -148,4 +157,3 @@ - \ No newline at end of file diff --git a/etc/adminhtml/paymentmethods/paylink.xml b/etc/adminhtml/paymentmethods/paylink.xml index edf94044..cda7d30e 100644 --- a/etc/adminhtml/paymentmethods/paylink.xml +++ b/etc/adminhtml/paymentmethods/paylink.xml @@ -6,7 +6,7 @@ - + Magento\Config\Model\Config\Source\Yesno payment/paynl_payment_paylink/active diff --git a/i18n/en_US.csv b/i18n/en_US.csv index f1d3ebd1..cace5475 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -61,7 +61,7 @@ "URL of the payment option icons. Default URL: https://static.pay.nl/payment_profiles/50x32/#paymentOptionId#.png","URL of the payment option icons. Default URL: https://static.pay.nl/payment_profiles/50x32/#paymentOptionId#.png" "Send discount tax","Send discount tax" "Set this to NO if you have a mix of low and high vatrate products. Some pay later methods have issues when the discount has a tax amount other than the default vat categories","Set this to NO if you have a mix of low and high vatrate products. Some pay later methods have issues when the discount has a tax amount other than the default vat categories" -"Paylink is only available with custom orders and won't appear in the checkout","Paylink is only available with custom orders and won't appear in the checkout" +"Paylink is only available for backorders and won't appear in the checkout","Paylink is only available for backorders and won't appear in the checkout" "Thank you for your order from ","Thank you for your order from " "If you have questions about your order, you can email us at","If you have questions about your order, you can email us at" "In order to pay for your order click the link below","In order to pay for your order click the link below" diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv index f4a065ea..40bf8d31 100644 --- a/i18n/nl_NL.csv +++ b/i18n/nl_NL.csv @@ -62,7 +62,7 @@ "URL of the payment option icons. Default URL: https://static.pay.nl/payment_profiles/50x32/#paymentOptionId#.png","De URL van de payment option icoontjes. Standaard URL: https://static.pay.nl/payment_profiles/50x32/#paymentOptionId#.png" "Send discount tax","Korting btw versturen" "Set this to NO if you have a mix of low and high vatrate products. Some pay later methods have issues when the discount has a tax amount other than the default vat categories","Zet dit op NEE als je hoog en laag btw producten verkoopt. Achteraf betaaloplossingen kunnen niet omgaan met een kortingsregel van samengestelde btw" -"Paylink is only available with custom orders and won't appear in the checkout","Paylink is alleen beschikbaar bij custom orders en komt niet tevoorschijn in de checkout" +"Paylink is only available for backorders and won't appear in the checkout","Paylink is alleen beschikbaar bij custom orders en komt niet tevoorschijn in de checkout" "Thank you for your order from ","Bedankt voor je bestelling van " "If you have questions about your order, you can email us at","Als u vragen heeft over uw bestelling, kunt u ons mailen op" "In order to pay for your order click the link below","Klik op de onderstaande link om uw bestelling te betalen" @@ -97,4 +97,4 @@ "Add a comma between IP addresses for multiple inputs.","Indien u meerder IP-addressen wilt opgeven, scheid deze dan met een komma." "Only available with useragent","Alleen tonen indien useragent" "Custom useragent","Aangepaste useragent" -"Add a comma between useragents for multiple inputs.","Indien u meerder useragents wilt opgeven, scheid deze dan met een komma." \ No newline at end of file +"Add a comma between useragents for multiple inputs.","Indien u meerder useragents wilt opgeven, scheid deze dan met een komma." From 38792a292606b16a99306803c81d03567604497b Mon Sep 17 00:00:00 2001 From: woutse Date: Thu, 10 Jun 2021 11:04:47 +0200 Subject: [PATCH 2/2] Added dob for afterpay --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 61340a2a..c1d06afe 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "paynl/magento2-plugin", "description": "PAY. Payment methods for Magento2", "type": "magento2-module", - "version": "2.0.2", + "version": "2.0.3", "require": { "magento/module-sales": "^102.0.0 || ^103.0.0", "magento/module-payment": "^100.3.0",