Skip to content

Commit

Permalink
Merge pull request #148 from paynl/feature/PLUG-452
Browse files Browse the repository at this point in the history
Added dob for afterpay
  • Loading branch information
woutse committed Jun 10, 2021
2 parents 4b9d52c + 38792a2 commit 6dbd4e0
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 14 deletions.
19 changes: 18 additions & 1 deletion Model/Paymentmethod/Afterpay.php
Expand Up @@ -17,4 +17,21 @@ protected function getDefaultPaymentOptionId()
{
return 739;
}
}

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;
}
}
7 changes: 1 addition & 6 deletions Model/Paymentmethod/Billink.php
Expand Up @@ -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);
Expand Down Expand Up @@ -72,4 +67,4 @@ private function getCache()
return $cache;
}

}
}
2 changes: 1 addition & 1 deletion Model/Paymentmethod/PaymentMethod.php
Expand Up @@ -134,7 +134,7 @@ public function getKVK()

public function getDOB()
{
return [];
return $this->_scopeConfig->getValue('payment/' . $this->_code . '/showdob', 'store');
}

public function getDisallowedShippingMethods()
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -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",
Expand Down
10 changes: 9 additions & 1 deletion etc/adminhtml/paymentmethods/afterpay.xml
Expand Up @@ -106,6 +106,15 @@
<field id="active">1</field>
</depends>
</field>
<field id="showdob" translate="label" type="select" sortOrder="66" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Show Date of birth field</label>
<source_model>Paynl\Payment\Model\Config\Source\showDobOptions</source_model>
<depends>
<field id="active">1</field>
</depends>
<config_path>payment/paynl_payment_afterpay/showdob</config_path>
<comment><![CDATA[When selecting AfterPay, a date of birth field will be visible. This might increase the chance for a successful payment.]]></comment>
</field>
<field id="disallowedshipping" translate="label" type="multiselect" sortOrder="110" showInDefault="1"
showInWebsite="1" showInStore="1">
<label>Disallowed Shipping Methods</label>
Expand Down Expand Up @@ -148,4 +157,3 @@

</group>
</include>

2 changes: 1 addition & 1 deletion etc/adminhtml/paymentmethods/paylink.xml
Expand Up @@ -6,7 +6,7 @@
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1"
showInStore="1">
<label>Enabled</label>
<comment><![CDATA[Paylink is only available with custom orders and won't appear in the checkout]]></comment>
<comment><![CDATA[Paylink is only available for backorders and won't appear in the checkout]]></comment>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>payment/paynl_payment_paylink/active</config_path>
</field>
Expand Down
2 changes: 1 addition & 1 deletion i18n/en_US.csv
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions i18n/nl_NL.csv
Expand Up @@ -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"
Expand Down Expand Up @@ -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."
"Add a comma between useragents for multiple inputs.","Indien u meerder useragents wilt opgeven, scheid deze dan met een komma."

0 comments on commit 6dbd4e0

Please sign in to comment.