Skip to content

Commit

Permalink
Merge pull request #76 from paynl/feature/PLUG-176
Browse files Browse the repository at this point in the history
Add code for giftwrapping.
  • Loading branch information
woutse authored Feb 16, 2021
2 parents 3762a3b + 8486beb commit ed43647
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Model/Paymentmethod/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,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;
Expand Down

0 comments on commit ed43647

Please sign in to comment.