Skip to content

Commit

Permalink
Merge pull request #48 from paynl/feature/PLUG-318
Browse files Browse the repository at this point in the history
Added setting for not including paymentcosts in refunds
  • Loading branch information
woutse authored Feb 24, 2021
2 parents b7ce956 + 88954a5 commit c23b08d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ class Pay_Payment_Model_Sales_Order_Creditmemo_Total_Paymentcharge extends Mage_
public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
{
$order = $creditmemo->getOrder();
$store = $order->getStore();

$exclude_fee_refund = $store->getConfig('pay_payment/general/exclude_fee_refund');
if($exclude_fee_refund) {
return $this;
}

$paymentCharge = $order->getPaynlPaymentCharge();
$basePaymentCharge = $order->getPaynlBasePaymentCharge();
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Pay/Payment/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Pay_Payment>
<version>3.13.9</version>
<version>3.13.10</version>
</Pay_Payment>
</modules>
<global>
Expand Down
30 changes: 20 additions & 10 deletions app/code/community/Pay/Payment/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</show_icons>
<icon_size translate="label comment">
<label>Icon size</label>
<comment><![CDATA[Selecteer hoe groot de icoontjes van de betaalmethoden moeten zijn]]></comment>
<frontend_type>select</frontend_type>
<source_model>pay_payment/source_iconsize</source_model>
<sort_order>141</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</icon_size>
<show_fee translate="label comment">
<label>Betaalkosten weergeven</label>
<comment><![CDATA[Kosten voor de betaalmethode weergeven in de checkout]]></comment>
Expand Down Expand Up @@ -211,16 +221,6 @@
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</deduct_tax_fee_invoicing>
<icon_size translate="label comment">
<label>Icon size</label>
<comment><![CDATA[Selecteer hoe groot de icoontjes van de betaalmethoden moeten zijn]]></comment>
<frontend_type>select</frontend_type>
<source_model>pay_payment/source_iconsize</source_model>
<sort_order>300</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</icon_size>
<text_payment_charge translate="label comment">
<label>Text betalingskosten</label>
<comment><![CDATA[De text die wordt weergegeven bij de betalingskosten]]></comment>
Expand All @@ -230,6 +230,15 @@
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</text_payment_charge>
<exclude_fee_refund translate="label comment">
<label>Betaalkosten niet terugbetalen</label>
<comment>Bij terugbetaling(refund) niet de betaalkosten terugbetalen</comment>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>410</sort_order>
<show_in_default>1</show_in_default>
</exclude_fee_refund>

<use_backup_api translate="label comment">
<label>Gateway</label>
<comment><![CDATA[Gebruik de standard gateway, op <a href='https://status-pay.nl'>status-pay.nl</a> kunt u de status van onze techniek volgen]]></comment>
Expand Down Expand Up @@ -311,6 +320,7 @@
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</testipaddress>

</fields>
</general>
<loaded_payment_methods translate="label" module="pay_payment">
Expand Down
2 changes: 2 additions & 0 deletions app/locale/en_US/Pay_Payment.csv
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"Kosten voor de betaalmethode weergeven in de checkout","Show the charge of the payment method in the checkout"
"Selecteer hoe groot de icoontjes van de betaalmethoden moeten zijn","Select the size of the payment method icons"
"Text betalingskosten","Payment charge label"
"Betaalkosten niet terugbetalen","Exclude paymentfee from refund"
"Bij terugbetaling(refund) niet de betaalkosten terugbetalen","Dont include the payment fee in refunds"
"De text die wordt weergegeven bij de betalingskosten","The text that is shown for the payment charge"
"Gateway","Gateway"
"Gebruik de standard gateway, op <a href='https://status-pay.nl'>status-pay.nl</a> kunt u de status van onze techniek volgen","Use the standard gateway, on <a href='https://status-pay.nl'>status-pay.nl</a> you can view the status of our services"
Expand Down

0 comments on commit c23b08d

Please sign in to comment.