Skip to content

Commit

Permalink
Added EPS uberweisung
Browse files Browse the repository at this point in the history
Added a setting to omit vat for discount rules
  • Loading branch information
andy committed Nov 2, 2018
1 parent e0bdf90 commit df35469
Show file tree
Hide file tree
Showing 14 changed files with 178 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ public function isTestMode()
{
return $this->store->getConfig('payment/paynl/testmode') == 1;
}

public function isSendDiscountTax(){
return $this->store->getConfig('payment/paynl/discount_tax') == 1;
}
public function isNeverCancel()
{
return $this->store->getConfig('payment/paynl/never_cancel') == 1;
Expand Down
12 changes: 12 additions & 0 deletions Model/Config/Source/Available/Eps.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* Copyright © 2015 Pay.nl All rights reserved.
*/

namespace Paynl\Payment\Model\Config\Source\Available;


class Eps extends Available
{
protected $_code = 'paynl_payment_eps';
}
1 change: 1 addition & 0 deletions Model/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ConfigProvider implements ConfigProviderInterface
'paynl_payment_cashly',
'paynl_payment_clickandbuy',
'paynl_payment_dankort',
'paynl_payment_eps',
'paynl_payment_fashioncheque',
'paynl_payment_fashiongiftcard',
'paynl_payment_focum',
Expand Down
12 changes: 12 additions & 0 deletions Model/Paymentmethod/Eps.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* Copyright © 2015 Pay.nl All rights reserved.
*/

namespace Paynl\Payment\Model\Paymentmethod;

class Eps extends PaymentMethod
{
protected $_code = 'paynl_payment_eps';

}
4 changes: 4 additions & 0 deletions Model/Paymentmethod/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ protected function doStartTransaction(Order $order)
$discountTax = $order->getBaseDiscountTaxCompensationAmount() * -1;
}

if($this->paynlConfig->isSendDiscountTax() == 0){
$discountTax = 0;
}

$discountDescription = __('Discount');

if ($discount != 0) {
Expand Down
1 change: 1 addition & 0 deletions etc/adminhtml/paymentmethods.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<include path="Paynl_Payment::paymentmethods/cashly.xml" />
<include path="Paynl_Payment::paymentmethods/clickandbuy.xml" />
<include path="Paynl_Payment::paymentmethods/dankort.xml" />
<include path="Paynl_Payment::paymentmethods/eps.xml" />
<include path="Paynl_Payment::paymentmethods/fashioncheque.xml" />
<include path="Paynl_Payment::paymentmethods/fashiongiftcard.xml" />
<include path="Paynl_Payment::paymentmethods/focum.xml" />
Expand Down
4 changes: 2 additions & 2 deletions etc/adminhtml/paymentmethods/capayable_gespreid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="paynl_payment_capayable_gespreid" sortOrder="310" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Capayable Gespreid Betalen</label>
<group id="paynl_payment_capayable_gespreid" sortOrder="1025" showInDefault="1" showInWebsite="1" showInStore="1">
<label>In3 Gespreid Betalen</label>
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1"
showInStore="1">
<label>Enabled</label>
Expand Down
108 changes: 108 additions & 0 deletions etc/adminhtml/paymentmethods/eps.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © 2015 Pay.nl All rights reserved.
*/
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="paynl_payment_eps" sortOrder="475" showInDefault="1" showInWebsite="1" showInStore="1">
<label>EPS Überweisung</label>
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1"
showInStore="1">
<label>Enabled</label>
<source_model>Paynl\Payment\Model\Config\Source\Available\Eps</source_model>
<config_path>payment/paynl_payment_eps/active</config_path>
</field>
<field id="title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1"
showInStore="1">
<label>Title</label>
<config_path>payment/paynl_payment_eps/title</config_path>
<depends>
<field id="active">1</field>
</depends>
</field>
<field id="order_status" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="1"
showInStore="1">
<label>New Order Status</label>
<source_model>Paynl\Payment\Model\Config\Source\Order\Status\PendingPayment</source_model>
<depends>
<field id="active">1</field>
</depends>
<config_path>payment/paynl_payment_eps/order_status</config_path>
</field>
<field id="allowspecific" translate="label" type="allowspecific" sortOrder="40" showInDefault="1"
showInWebsite="1" showInStore="1">
<label>Payment from Applicable Countries</label>
<source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
<config_path>payment/paynl_payment_eps/allowspecific</config_path>
<depends>
<field id="active">1</field>
</depends>
</field>
<field id="specificcountry" translate="label" type="multiselect" sortOrder="50" showInDefault="1"
showInWebsite="1" showInStore="1">
<label>Payment from Specific Countries</label>
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
<can_be_empty>1</can_be_empty>
<config_path>payment/paynl_payment_eps/specificcountry</config_path>
<depends>
<field id="allowspecific">1</field>
<field id="active">1</field>
</depends>
</field>
<field id="instructions" translate="label" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Instructions</label>
<depends>
<field id="active">1</field>
</depends>
<config_path>payment/paynl_payment_eps/instructions</config_path>
</field>
<field id="min_order_total" translate="label" type="text" sortOrder="70" showInDefault="1" showInWebsite="1"
showInStore="1">
<label>Minimum Order Total</label>
<config_path>payment/paynl_payment_eps/min_order_total</config_path>
<depends>
<field id="active">1</field>
</depends>
</field>
<field id="max_order_total" translate="label" type="text" sortOrder="80" showInDefault="1" showInWebsite="1"
showInStore="1">
<label>Maximum Order Total</label>
<config_path>payment/paynl_payment_eps/max_order_total</config_path>
<depends>
<field id="active">1</field>
</depends>
</field>
<field id="sort_order" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1"
showInStore="1">
<label>Sort Order</label>
<frontend_class>validate-number</frontend_class>
<config_path>payment/paynl_payment_eps/sort_order</config_path>
<depends>
<field id="active">1</field>
</depends>
</field>
<field id="send_new_order_email" translate="label" type="select" sortOrder="100" showInDefault="1"
showInWebsite="1"
showInStore="1">
<label>Send new order email</label>
<source_model>Paynl\Payment\Model\Config\Source\SendNewOrderEmail</source_model>
<config_path>payment/paynl_payment_eps/send_new_order_email</config_path>
<depends>
<field id="active">1</field>
</depends>
</field>
<group id="advanced" translate="label" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Advanced</label>
<field id="payment_option_id" translate="label comment" type="text" sortOrder="10" showInDefault="1"
showInWebsite="1"
showInStore="1">
<label>Payment option id</label>
<comment>The id of the payment method, only change this if you are told to do so</comment>
<config_path>payment/paynl_payment_eps/payment_option_id</config_path>
</field>
</group>
</group>
</include>

6 changes: 6 additions & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
<label>Icon URL</label>
<comment><![CDATA[URL of the payment option icons. Default URL: https://www.pay.nl/images/payment_profiles/50x32/#paymentOptionId#.png]]></comment>
</field>
<field id="discount_tax" translate="label,comment" type="select" sortOrder="90" showInDefault="1"
showInWebsite="1" showInStore="1">
<label>Send discount tax</label>
<comment><![CDATA[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]]></comment>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<group id="paynl_paymentmethods" translate="label" sortOrder="101" showInDefault="1" showInWebsite="1"
showInStore="1">
<frontend_model>Paynl\Payment\Block\Adminhtml\System\Config\Fieldset\Expanded</frontend_model>
Expand Down
17 changes: 16 additions & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<payment>
<paynl>
<model>Paynl\Payment\Model\Paymentmethod\Paylink</model>
<discount_tax>1</discount_tax>
</paynl>
<paynl_payment_paylink>
<active>1</active>
<title>Pay.nl betaallink</title>
Expand Down Expand Up @@ -66,7 +70,7 @@
</paynl_payment_capayable>
<paynl_payment_capayable_gespreid>
<active>0</active>
<title>Capayable Gespreid Betalen</title>
<title>In3 gespreid betalen</title>
<payment_option_id>1813</payment_option_id>
<order_status>pending_payment</order_status>
<instructions></instructions>
Expand Down Expand Up @@ -130,6 +134,17 @@
<group>paynl_payment</group>
<send_new_order_email>after_payment</send_new_order_email>
</paynl_payment_dankort>
<paynl_payment_eps>
<active>0</active>
<title>EPS Überweisung</title>
<payment_option_id>2062</payment_option_id>
<order_status>pending_payment</order_status>
<instructions></instructions>
<payment_action>order</payment_action>
<model>Paynl\Payment\Model\Paymentmethod\Eps</model>
<group>paynl_payment</group>
<send_new_order_email>after_payment</send_new_order_email>
</paynl_payment_eps>
<paynl_payment_fashioncheque>
<active>0</active>
<title>Fashioncheque</title>
Expand Down
6 changes: 6 additions & 0 deletions etc/payment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
<method name="paynl_payment_clickandbuy">
<allow_multiple_address>0</allow_multiple_address>
</method>
<method name="paynl_payment_dankort">
<allow_multiple_address>0</allow_multiple_address>
</method>
<method name="paynl_payment_eps">
<allow_multiple_address>0</allow_multiple_address>
</method>
<method name="paynl_payment_fashioncheque">
<allow_multiple_address>0</allow_multiple_address>
</method>
Expand Down
4 changes: 3 additions & 1 deletion i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@
"The AT-code of your token, you can find your tokens <a target='_blank' href='https://admin.pay.nl/company/tokens'>here</a>", "De AT-code die bij het token hoort, je kunt je tokens <a target='_blank' href='https://admin.pay.nl/company/tokens'>hier</a> vinden"
"Your API-token, you can find your tokens <a target='_blank' href='https://admin.pay.nl/company/tokens'>here</a>", "Jouw API-token, je kunt je tokens <a target='_blank' href='https://admin.pay.nl/company/tokens'>hier</a> vinden"
"The SL-code of your service, you can find your services <a target='_blank' href='https://admin.pay.nl/programs/programs'>here</a>", "De SL-code die bij je dienst hoort, je kunt je diensten <a target='_blank' href='https://admin.pay.nl/programs/programs'>hier</a> vinden",
"URL of the payment option icons. Default URL: https://www.pay.nl/images/payment_profiles/50x32/#paymentOptionId#.png","De URL van de payment option icoontjes. Standaard URL: https://www.pay.nl/images/payment_profiles/50x32/#paymentOptionId#.png"
"URL of the payment option icons. Default URL: https://www.pay.nl/images/payment_profiles/50x32/#paymentOptionId#.png","De URL van de payment option icoontjes. Standaard URL: https://www.pay.nl/images/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"
3 changes: 3 additions & 0 deletions view/frontend/layout/checkout_index_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
<item name="paynl_payment_dankort" xsi:type="array">
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
</item>
<item name="paynl_payment_eps" xsi:type="array">
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
</item>
<item name="paynl_payment_fashioncheque" xsi:type="array">
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
</item>
Expand Down
1 change: 1 addition & 0 deletions view/frontend/web/js/view/payment/method-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ define(
{type: 'paynl_payment_cashly', component: defaultComponent},
{type: 'paynl_payment_clickandbuy', component: defaultComponent},
{type: 'paynl_payment_dankort', component: defaultComponent},
{type: 'paynl_payment_eps', component: defaultComponent},
{type: 'paynl_payment_fashioncheque', component: defaultComponent},
{type: 'paynl_payment_fashiongiftcard', component: defaultComponent},
{type: 'paynl_payment_focum', component: defaultComponent},
Expand Down

0 comments on commit df35469

Please sign in to comment.