Skip to content

Commit

Permalink
Merge pull request #6 from wirecard/ticket-20170515888014366
Browse files Browse the repository at this point in the history
Ticket 20170515888014366
  • Loading branch information
rinnhofer authored May 24, 2017
2 parents 923d6c8 + 1687540 commit 7759249
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
20 changes: 4 additions & 16 deletions Model/AbstractPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,8 @@ public function initPaymentByCart(CheckoutCart $cart, $urls, \Magento\Framework\
$bitem->setDescription($item->getProduct()->getName());
$bitem->setImageUrl($baseUrl . "pub/media/catalog/product" . $item->getProduct()->getImage());
$bitem->setName($item->getProduct()->getName());
$bitem->setUnitGrossAmount(number_format($item->getPrice(), $precision, '.', ''));
$bitem->setUnitNetAmount(
number_format(
number_format($item->getPrice(), $precision, '.', '') - number_format(
$item->getTaxAmount(), $precision, '.', ''
), $precision, '.', ''
)
);
$bitem->setUnitGrossAmount(number_format($item->getPriceInclTax(), $precision, '.', ''));
$bitem->setUnitNetAmount(number_format($item->getPrice(), $precision, '.', ''));
$bitem->setUnitTaxAmount(number_format($item->getTaxAmount(), $precision, '.', ''));
$bitem->setUnitTaxRate(number_format($item->getTaxPercent(), $precision, '.', ''));
$basket->addItem($bitem, (int)$item->getQty());
Expand All @@ -216,16 +210,10 @@ public function initPaymentByCart(CheckoutCart $cart, $urls, \Magento\Framework\
$bitem->setName('shipping');
$bitem->setDescription($quote->getShippingAddress()->getShippingDescription());
$bitem->setUnitGrossAmount(
number_format($quote->getShippingAddress()->getShippingAmount(), $precision, '.', '')
number_format($quote->getShippingAddress()->getShippingInclTax(), $precision, '.', '')
);
$bitem->setUnitNetAmount(
number_format(
number_format(
$quote->getShippingAddress()->getShippingAmount(), $precision, '.', ''
) - number_format(
$quote->getShippingAddress()->getShippingTaxAmount(), $precision, '.', ''
), $precision, '.', ''
)
number_format($quote->getShippingAddress()->getShippingAmount(), $precision, '.', '')
);
$bitem->setUnitTaxAmount(
number_format($quote->getShippingAddress()->getShippingTaxAmount(), $precision, '.', '')
Expand Down
2 changes: 1 addition & 1 deletion Model/Payment/Eps.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function assignData(\Magento\Framework\DataObject $data)

/** @var \Magento\Quote\Model\Quote\Payment $infoInstance */
$infoInstance = $this->getInfoInstance();
$infoInstance->setAdditionalInformation('financialInstitution', $data->getData('financialInstitution'));
$infoInstance->setAdditionalInformation('financialInstitution', $data->getDataByPath('additional_data/financialInstitution'));

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion Model/Payment/Ideal.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function assignData(\Magento\Framework\DataObject $data)

/** @var \Magento\Quote\Model\Quote\Payment $infoInstance */
$infoInstance = $this->getInfoInstance();
$infoInstance->setAdditionalInformation('financialInstitution', $data->getData('financialInstitution'));
$infoInstance->setAdditionalInformation('financialInstitution', $data->getDataByPath('additional_data/financialInstitution'));

return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "wirecard/magento2-wcs",
"description": "Wirecard Checkout Seamless",
"type": "magento2-module",
"version": "1.0.2",
"version": "1.0.3",
"license": [
"MIT"
],
Expand All @@ -12,7 +12,7 @@
"magento/module-sales": "*",
"magento/module-payment": "*",
"magento/module-quote": "*",
"wirecard/checkout-client-library": "3.3.2"
"wirecard/checkout-client-library": "3.3.4"
},
"autoload": {
"files": [
Expand Down

0 comments on commit 7759249

Please sign in to comment.