Skip to content

Commit

Permalink
Import Magento Release 1.5.0.0-rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeSaferite committed Feb 9, 2011
1 parent 69d36df commit d7bb289
Show file tree
Hide file tree
Showing 35 changed files with 488 additions and 147 deletions.
Empty file modified .htaccess
100644 → 100755
Empty file.
Empty file modified .htaccess.sample
100644 → 100755
Empty file.
34 changes: 34 additions & 0 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
==== 1.5.0.0-rc2 =====

== Changes ==
Paypal HSS payment method label, comment and default title

== Fixes ==
Fixed User cannot place order using Paypal payment methods with 3d secure
Fixed iPhone product list preview
Fixed App locations (countries) do not match iTunes App Stores countries available
Fixed Added parent quote items to discount calculation to prevent skipping of configurable products.
Fixed Rounding issue on front end if discount with fixed amount is applied and no tax rules applies to the order.
- added rounding item discount before take away from total discount
Fixed Fatal error after deleting one of the shipping addresses during checkout with multiple addresses
Fixed Merged CSS files with selected native Database as media storage are not applied with Chrome and FF
- first trying to detect MIME type manually, and only after by native php function
Fixed The buttons "Accept Payment" and "Deny Payment" do not appear in orders with status 'Payment Review'
Fixed issue when Simple products not visible individually (part of grouped) are moved to Wishlist
Fixed Impossible to delete product from Items Ordered (backend Order creation) using "remove" in Action dropdown
Fixed Fatal error after deleting one of the shipping addresses during checkout with multiple addresses
Fixed Qty for simple products (part of grouped) is incorrect when moved from order to Wishlist
- additional fixture for other testcase
Fixed Grouped product is added to Items Ordered as grouped, when any of buttons in sideblocks is pressed after product configuration in a product grid (backend Order creation)
- prevent to add unconfigured grouped product on server side
- in sales.js, do productConfigure.clean('quote_items') only if "Items Ordered" block is going to update
- in sales.js, hide "Search" block only when product added to qoute from "Search" block
- in configure.js, added ability to cleaning by list type scope
Fixed Incorrect behavior of Partial Authorization process, when admin user cancels authorizations (Authorize.net)
- added reloading block 'totals' after canceling partial authorization
Fixed Google Checkout Issue - Transactions not appearing
- adding transaction (transaction id = google order id) for googlecheckout payment
- fixed usage of Mage_GoogleCheckout_Model_Api_Xml_Callback::_getTaxClassForShipping() method according to it's interface
- fixed usage of Mage_GoogleCheckout_Model_Api_Xml_Abstract::_getTaxClassForShipping() method according to it's interface
- creating transactions for refund and chargeback

==== 1.5.0.0-rc1 =====

=== Fixes ===
Expand Down
2 changes: 1 addition & 1 deletion app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public static function getVersionInfo()
'revision' => '0',
'patch' => '0',
'stability' => 'rc',
'number' => '1',
'number' => '2',
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,4 +331,15 @@ public function getItemExtraInfo($item)
->getBlock('order_item_extra_info')
->setItem($item);
}

/**
* Returns whether moving to wishlist is allowed for this item
*
* @param Mage_Sales_Model_Quote_Item $item
* @return bool
*/
public function isMoveToWishlistAllowed($item)
{
return $item->getProduct()->isVisibleInSiteVisibility();
}
}
34 changes: 19 additions & 15 deletions app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ public function moveQuoteItem($item, $moveTo, $qty)
{
$item = $this->_getQuoteItem($item);
if ($item) {
$removeItem = false;
switch ($moveTo) {
case 'order':
$info = $item->getBuyRequest();
Expand Down Expand Up @@ -554,26 +555,27 @@ public function moveQuoteItem($item, $moveTo, $qty)
}
$cartItem->setPrice($item->getProduct()->getPrice());
$this->_needCollectCart = true;
$removeItem = true;
}
break;
case 'wishlist':
$wishlist = $this->getCustomerWishlist();
if ($wishlist) {
$info = $item->getOptionByCode('info_buyRequest');
if ($info) {
$info = new Varien_Object(
unserialize($info->getValue())
);
$info->setOptions($this->_prepareOptionsForRequest($item));
$info->setStoreId($this->getSession()->getStoreId());
}
if ($wishlist && $item->getProduct()->isVisibleInSiteVisibility()) {
$info = $item->getBuyRequest();
$info->setOptions($this->_prepareOptionsForRequest($item))
->setQty($qty)
->setStoreId($this->getSession()->getStoreId());
$wishlist->addNewItem($item->getProduct(), $info);
$removeItem = true;
}
break;
case 'remove':
$removeItem = true;
break;
default:
break;
}
if ($moveTo != 'order') {
if ($removeItem) {
$this->getQuote()->removeItem($item->getId());
}
$this->setRecollect(true);
Expand Down Expand Up @@ -719,11 +721,13 @@ public function addProduct($product, $config = 1)
Mage_Catalog_Model_Product_Type_Abstract::PROCESS_MODE_FULL
);
if (is_string($item)) {
$item = $this->getQuote()->addProductAdvanced(
$product,
$config,
Mage_Catalog_Model_Product_Type_Abstract::PROCESS_MODE_LITE
);
if ($product->getTypeId() != Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE) {
$item = $this->getQuote()->addProductAdvanced(
$product,
$config,
Mage_Catalog_Model_Product_Type_Abstract::PROCESS_MODE_LITE
);
}
if (is_string($item)) {
Mage::throwException($item);
}
Expand Down
17 changes: 2 additions & 15 deletions app/code/core/Mage/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -1789,8 +1789,8 @@ public function prepareCustomOptions()
*/
protected function _clearReferences()
{
$this->_clearStockItem();
$this->_clearOptionReferences();
return $this;
}

/**
Expand Down Expand Up @@ -1830,23 +1830,10 @@ protected function _clearOptionReferences()
if (!empty($this->_options)) {
foreach ($this->_options as $key => $option) {
$option->setProduct();
$option->clear();
$option->clearInstance();
}
}

return $this;
}

/**
* Clearing references to product from product's stock item
*
* @return Mage_Catalog_Model_Product
*/
protected function _clearStockItem()
{
if ($this->hasStockItem()){
$this->getStockItem()->reset();
}
return $this;
}
}
3 changes: 2 additions & 1 deletion app/code/core/Mage/CatalogInventory/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ public function checkQuoteItemQty($observer)
{
$quoteItem = $observer->getEvent()->getItem();
/* @var $quoteItem Mage_Sales_Model_Quote_Item */
if (!$quoteItem || !$quoteItem->getProductId() || $quoteItem->getQuote()->getIsSuperMode()) {
if (!$quoteItem || !$quoteItem->getProductId() || !$quoteItem->getQuote()
|| $quoteItem->getQuote()->getIsSuperMode()) {
return $this;
}

Expand Down
83 changes: 65 additions & 18 deletions app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ protected function _responseMerchantCalculationCallback()
$merchantCalculations = new GoogleMerchantCalculations($this->getCurrency());

$quote = $this->_loadQuote();
$storeId = $quote->getStoreId();

$billingAddress = $quote->getBillingAddress();
$address = $quote->getShippingAddress();
Expand Down Expand Up @@ -207,6 +206,7 @@ protected function _responseMerchantCalculationCallback()
->setLimitCarrier($limitCarrier);

$billingAddress->collectTotals();
$shippingTaxClass = $this->_getTaxClassForShipping($quote);

$gRequestMethods = $this->getData('root/calculate/shipping/method');
if ($gRequestMethods) {
Expand Down Expand Up @@ -239,15 +239,14 @@ protected function _responseMerchantCalculationCallback()
->setCollectShippingRates(true)
->collectTotals();
$shippingRate = $address->getBaseShippingAmount() - $address->getBaseShippingDiscountAmount();
$result->SetShippingDetails($methodName, $shippingRate, "true");
$result->SetShippingDetails($methodName, $shippingRate, 'true');

if ($this->getData('root/calculate/tax/VALUE') == 'true') {
$taxAmount = $address->getBaseTaxAmount();
$taxAmount += $billingAddress->getBaseTaxAmount();
$result->setTaxDetails($taxAmount);
}
} else {
$shippingTaxClass = $this->_getTaxClassForShipping($quote->getStoreId());
if ($shippingTaxClass &&
$this->getData('root/calculate/tax/VALUE') == 'true') {
$i = 1;
Expand All @@ -261,24 +260,24 @@ protected function _responseMerchantCalculationCallback()
$address->setShippingAmount(
$this->_reCalculateToStoreCurrency($price, $quote)
);
$this->_applyShippingTaxClass($address);
$this->_applyShippingTaxClass($address, $shippingTaxClass);
$taxAmount = $address->getBaseTaxAmount();
$taxAmount += $billingAddress->getBaseTaxAmount();
$result->SetShippingDetails($methodName, $price - $address->getBaseShippingDiscountAmount(), "true");
$result->SetShippingDetails($methodName, $price - $address->getBaseShippingDiscountAmount(), 'true');
$result->setTaxDetails($taxAmount);
$i++;
} else {
$result->SetShippingDetails($methodName, 0, "false");
$result->SetShippingDetails($methodName, 0, 'false');
}
}
$merchantCalculations->AddResult($result);
}

} else if ($this->getData('root/calculate/tax/VALUE')=='true') {
} else if ($this->getData('root/calculate/tax/VALUE') == 'true') {
$address->setShippingMethod(null);
$address->setCollectShippingRates(true)->collectTotals();
$billingAddress->setCollectShippingRates(true)->collectTotals();
$this->_applyShippingTaxClass($address);
$this->_applyShippingTaxClass($address, $shippingTaxClass);

$taxAmount = $address->getBaseTaxAmount();
$taxAmount += $billingAddress->getBaseTaxAmount();
Expand Down Expand Up @@ -399,8 +398,16 @@ protected function _responseNewOrderNotification()
$order->addItem($orderItem);
}

$payment = Mage::getModel('sales/order_payment')->setMethod('googlecheckout');
/*
* Adding transaction for correct transaction information displaying on order view at back end.
* It has no influence on api interaction logic.
*/
$payment = Mage::getModel('sales/order_payment')
->setMethod('googlecheckout')
->setTransactionId($this->getGoogleOrderNumber())
->setIsTransactionClosed(false);
$order->setPayment($payment);
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
$order->setCanShipPartiallyItem(false);

$emailAllowed = ($this->getData('root/buyer-marketing-preferences/email-allowed/VALUE')==='true');
Expand Down Expand Up @@ -485,7 +492,7 @@ protected function _applyCustomTax($qAddress)
}

/**
* Import address data from goole request to address object
* Import address data from google request to address object
*
* @param array | Varien_Object $gAddress
* @param Varien_Object $qAddress
Expand Down Expand Up @@ -782,11 +789,12 @@ protected function _responseChargeAmountNotification()
$msg .= '<br />'.$this->__('Invoice Auto-Created: %s', '<strong>'.$invoice->getIncrementId().'</strong>');
}

$this->_addChildTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);

$open = Mage_Sales_Model_Order_Invoice::STATE_OPEN;
foreach ($order->getInvoiceCollection() as $orderInvoice) {
$open = Mage_Sales_Model_Order_Invoice::STATE_OPEN;
$paid = Mage_Sales_Model_Order_Invoice::STATE_PAID;
if ($orderInvoice->getState() == $open && $orderInvoice->getBaseGrandTotal() == $latestCharged) {
$orderInvoice->setState($paid)
$orderInvoice->setState(Mage_Sales_Model_Order_Invoice::STATE_PAID)
->setTransactionId($this->getGoogleOrderNumber())
->save();
break;
Expand All @@ -795,17 +803,17 @@ protected function _responseChargeAmountNotification()

$order->addStatusToHistory($order->getStatus(), $msg);
$order->save();

}

protected function _createInvoice()
{
$order = $this->getOrder();

$invoice = $order->prepareInvoice();
$invoice->addComment(Mage::helper('googlecheckout')->__('Auto-generated from GoogleCheckout Charge'));
$invoice->register();
$invoice->pay();
$invoice = $order->prepareInvoice()
->setTransactionId($this->getGoogleOrderNumber())
->addComment(Mage::helper('googlecheckout')->__('Auto-generated from GoogleCheckout Charge'))
->register()
->pay();

$transactionSave = Mage::getModel('core/resource_transaction')
->addObject($invoice)
Expand Down Expand Up @@ -859,6 +867,9 @@ protected function _responseChargebackAmountNotification()
$msg .= '<br />'.$this->__('Latest Chargeback: %s', '<strong>' . $this->_formatAmount($latestChargeback) . '</strong>');
$msg .= '<br />'.$this->__('Total Chargeback: %s', '<strong>' . $this->_formatAmount($totalChargeback) . '</strong>');

$this->_addChildTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND,
Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);

$order->addStatusToHistory($order->getStatus(), $msg);
$order->save();
}
Expand Down Expand Up @@ -898,6 +909,9 @@ protected function _responseRefundAmountNotification()
$msg .= '<br />'.$this->__('Latest Refund: %s', '<strong>' . $this->_formatAmount($latestRefunded) . '</strong>');
$msg .= '<br />'.$this->__('Total Refunded: %s', '<strong>' . $this->_formatAmount($totalRefunded) . '</strong>');

$this->_addChildTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND,
Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);

$order->addStatusToHistory($order->getStatus(), $msg);
$order->save();
}
Expand Down Expand Up @@ -933,6 +947,39 @@ protected function _responseOrderStateChangeNotification()
}
}

/**
* Add transaction to payment with defined type
*
* @param string $typeTarget
* @param string $typeParent
* @return Mage_GoogleCheckout_Model_Api_Xml_Callback
*/
protected function _addChildTransaction($typeTarget, $typeParent = Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH)
{
$payment = $this->getOrder()->getPayment();
$googleOrderId = $this->getGoogleOrderNumber();
$parentTransactionId = $googleOrderId;

if ($typeParent != Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH) {
$parentTransactionId .= '-' . $typeParent;
} else {
$payment->setIsTransactionClosed(false);
}

$parentTransaction = $payment->getTransaction($parentTransactionId);

if ($parentTransaction) {
$payment->setParentTransactionId($parentTransactionId)
->setTransactionId($googleOrderId . '-' . $typeTarget)
->addTransaction($typeTarget);

$parentTransaction->setIsClosed(true)
->save();
}

return $this;
}

protected function _orderStateChangeFinancialReviewing()
{

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Paypal/Model/Pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public function cancel(Varien_Object $payment)
*/
public function canReviewPayment(Mage_Payment_Model_Info $payment)
{
return Mage_Paypal_Model_Info::isFraudReviewAllowed($payment);
return Mage_Paypal_Model_Info::isPaymentReviewRequired($payment);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Paypal/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@
<show_in_website>1</show_in_website>
</payflow_link>
<hosted_pro translate="label comment">
<label>Website Payments Pro Hosted Solution for EU &amp; APAC</label>
<comment>Hosted Solution, which is available to merchants in the United Kingdom as part of Website Payments Pro, is a fast and easy way to add transaction processing to your website.</comment>
<label>Website Payments Pro Hosted Solution (Website Payments Plus (JP) - Integral Evolution (FR) - PayPal Pro (IT) - Pasarela integral (ES))</label>
<comment><![CDATA[Payments by cards + seller protection - <strong style="color:red">Contact PayPal before activating</strong>]]></comment>
<more_url><![CDATA[https://cms.paypal.com/cms_content/GB/en_GB/files/developer/HostedSolution.pdf]]></more_url>
<config_path>payment/hosted_pro/active</config_path>
<frontend_type>checkbox</frontend_type>
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Sales/Model/Order/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public function capture($invoice)
}
$this->_isCaptureFinal($paidWorkaround);

if (!$this->getParentTransactionId) {
if (!$this->getParentTransactionId()) {
$orderingTransaction = $this->_lookupTransaction(false, Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER);
if ($orderingTransaction) {
$this->setParentTransactionId($orderingTransaction->getTxnId());
Expand Down
Loading

0 comments on commit d7bb289

Please sign in to comment.