From 8486bebfd0bd04712b4646ac73b7dd16aed4dd36 Mon Sep 17 00:00:00 2001 From: Kevin Verschoor Date: Wed, 22 Jul 2020 14:36:33 +0200 Subject: [PATCH] Add code for giftwrapping. --- Model/Paymentmethod/PaymentMethod.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Model/Paymentmethod/PaymentMethod.php b/Model/Paymentmethod/PaymentMethod.php index 63ba2c84..d227c3fc 100644 --- a/Model/Paymentmethod/PaymentMethod.php +++ b/Model/Paymentmethod/PaymentMethod.php @@ -378,6 +378,26 @@ protected function doStartTransaction(Order $order) ); } + // Gift Wrapping + $gwCost = $order->getGwPriceInclTax(); + $gwTax = $order->getGwTaxAmount(); + + if ($this->paynlConfig->isAlwaysBaseCurrency()) { + $gwCost = $order->getGwBasePriceInclTax(); + $gwTax = $order->getGwBaseTaxAmount(); + } + + if ($gwCost != 0) { + $arrProducts[] = array( + 'id' => $order->getGwId(), + 'name' => 'Gift Wrapping', + 'price' => $gwCost, + 'qty' => 1, + 'tax' => $gwTax, + 'type' => \Paynl\Transaction::PRODUCT_TYPE_HANDLING + ); + } + // kortingen $discount = $order->getDiscountAmount(); $discountTax = $order->getDiscountTaxCompensationAmount() * -1;