Skip to content

Commit

Permalink
Merge pull request #10 in DEV-MO/magento1.7-module from release/4.1.1…
Browse files Browse the repository at this point in the history
… to master

* commit '0b546852eca47f5772d957e90dd284f426eed70f':
  [ETS-83] Add Version
  [ETS-83] Fix wrong debit action which leads to partial return
  fix/MGNT-359_support-item-bundles-when-bundle-price-is-zero
  [MGTN-261] French Translations
  • Loading branch information
eiriarte-mendez committed Dec 11, 2018
2 parents e4229b8 + 0b54685 commit db13397
Show file tree
Hide file tree
Showing 5 changed files with 286 additions and 17 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
|------|----------
|Author | Annegret Seufert
|Shop Version | `CE` `1.7.x` `1.8.x` `1.9.x` `EE` `1.12.x` `1.13.x` `1.14.x`
|Version | `4.0.3`
|Version | `4.1.1`
|Link | https://www.ratepay.com
|Mail | [email protected]
|Installation | see separate installation manual
Expand All @@ -25,15 +25,22 @@ git submodule update --remote

## Changelog

### Version 4.1.1 - Released 2018-12-11

* french translations
* cleaned languages files
* item bundles with price of 0
* fixed incorrect partial-return when setting a debit

### Version 4.1.0 - Released 2018-07-30

* implement switch between special items and basket items
* implement switch between special items and basket items
* fix backend-orders with installment
* fix fatal errors with strict php configuration
* text revisions on rejection messages
* text complaining with GDPR
* complete translation into english
* adapt display of installment form
* adapt display of installment form
* remove VatID Field

### Version 4.0.3 - Released 2018-05-07
Expand Down Expand Up @@ -88,7 +95,7 @@ git submodule update --remote
* Date of birth issue in backend order fixed
* Ability to create new customer within backend order
* Prevent missing taxPercent index

### Version 3.2.0 - Released 2016-11-02
* Compatibility with SUPEE-8788`
* Support backend orders
Expand Down
2 changes: 2 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
.idea
4 changes: 3 additions & 1 deletion app/code/community/RatePAY/Ratepaypayment/Helper/Mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ public function getArticles($object)

$shopProduct = Mage::getModel('catalog/product')->load($orderItem->getProductId());

if ((($orderItem->getProductType() !== 'bundle') || ($orderItem->getProductType() === 'bundle' && $shopProduct->getPrice() > 0)) && $orderItem->getRowTotal() > 0) {
if ((($orderItem->getProductType() !== 'bundle') || ($orderItem->getProductType() === 'bundle' && $item->getPriceInclTax() > 0))
&& $orderItem->getRowTotal() > 0) {
$article = [];
$article['ArticleNumber'] = $item->getSku();
$article['Description'] = $item->getName();
$article['Quantity'] = ($object instanceof Mage_Sales_Model_Order) ? $item->getQtyOrdered() : $item->getQty();
$article['UnitPriceGross'] = (float) $item->getPriceInclTax();
$article['TaxRate'] = (float) $orderItem->getTaxPercent();

//What's with this?
if ($article['Quantity'] != (int) $article['Quantity']) {
$article['UnitPriceGross'] = (float) $item->getPriceInclTax() * $article['Quantity'];
$article['Quantity'] = 1;
Expand Down
26 changes: 14 additions & 12 deletions app/code/community/RatePAY/Ratepaypayment/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function handlePaymentFee(Varien_Event_Observer $observer)
if (($item->getSku() == $skuInvoice || $item->getSku() == $skuElv || $item->getSku() == $skuRate) && $item->getSku() != $sku) {
$quote->removeItem($item->getId());
}

if ($item->getSku() == $sku) {
$item->calcRowTotal();
$flag = false;
Expand Down Expand Up @@ -325,8 +325,6 @@ public function sendRatepayCreditmemoCall(Varien_Event_Observer $observer)
$amount = (float) $creditmemo->getGrandTotal();
}

$content = $this->_helperMapping->getRequestContent($creditmemo, "PAYMENT_CHANGE", null, $amount);

// Check whether backend operation is admitted
if ($this->_helperData->getRpConfigData($order, $paymentMethod, 'status') == 1) {
Mage::throwException($this->_helper->__('Processing failed'));
Expand All @@ -350,17 +348,21 @@ public function sendRatepayCreditmemoCall(Varien_Event_Observer $observer)
}
}

// Call PAYMENT CHANGE return
$responseReturn = $request->callPaymentChange($head, $content, 'return');
$content = $this->_helperMapping->getRequestContent($creditmemo, "PAYMENT_CHANGE", null, $amount);

if ($logging) {
Mage::getSingleton('ratepaypayment/logging')->log($responseReturn, $order);
}
if (array_key_exists('Items', $content['ShoppingBasket'])) {
// Call PAYMENT CHANGE return
$responseReturn = $request->callPaymentChange($head, $content, 'return');

if ($responseReturn->isSuccessful()) {
$this->_helperPayment->addNewTransaction($payment, Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND, $creditmemo, true, 'PAYMENT_CHANGE SEND (return)');
} else {
Mage::throwException($this->_helper->__('Return was not successful') . " - " . $responseReturn->getReasonMessage());
if ($logging) {
Mage::getSingleton('ratepaypayment/logging')->log($responseReturn, $order);
}

if ($responseReturn->isSuccessful()) {
$this->_helperPayment->addNewTransaction($payment, Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND, $creditmemo, true, 'PAYMENT_CHANGE SEND (return)');
} else {
Mage::throwException($this->_helper->__('Return was not successful') . " - " . $responseReturn->getReasonMessage());
}
}
}

Expand Down
Loading

0 comments on commit db13397

Please sign in to comment.