Skip to content

Commit

Permalink
Merge pull request #5 from magently/master
Browse files Browse the repository at this point in the history
0.6.3 RC
  • Loading branch information
tilsammans committed Jul 29, 2015
2 parents 0083f1b + fc7bf5e commit 854ee69
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
19 changes: 19 additions & 0 deletions app/code/community/Sign2pay/Payment/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,23 @@ public function attachPaymentScripts(array $additional = array())
);
}

/**
* Set status on order
*
* @param Mage_Sales_Model_Order $order
* @param string $status_code
*/
public function setStatusOnOrder($order, $status_code)
{
$collection = Mage::getResourceModel('sales/order_status_collection');
$collection->joinStates();
$collection->getSelect()
->where('main_table.status=?', $status_code)
->limit(1);

$status = $collection->fetchItem()->getData();

$order->setState($status['state'], $status['status']);
}

}
3 changes: 2 additions & 1 deletion app/code/community/Sign2pay/Payment/Model/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ protected function _registerPaymentCapture()
->registerCaptureNotification(
$this->getRequestData('amount') / 100
);
$this->_order->setState(Mage::getStoreConfig('payment/sign2pay/complete_order_status', Mage::app()->getStore()), true);

Mage::helper('sign2pay')->setStatusOnOrder($this->_order, Mage::getStoreConfig('payment/sign2pay/complete_order_status', Mage::app()->getStore()));
$this->_order->save();

// notify customer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function redirectAction()
return $this->_redirect('checkout/cart');
}

$order->setState(Mage::getStoreConfig('payment/sign2pay/order_status', Mage::app()->getStore()), true);
Mage::helper('sign2pay')->setStatusOnOrder($order, Mage::getStoreConfig('payment/sign2pay/order_status', Mage::app()->getStore()));
$order->save();

$this->loadLayout();
Expand Down
4 changes: 2 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package>
<name>Sign2Pay_Mobile_Payments</name>
<version>0.6.2</version>
<version>0.6.3</version>
<stability>beta</stability>
<license>Sign2Pay Commercial License</license>
<channel>community</channel>
Expand All @@ -13,7 +13,7 @@ Analysing hundreds of data points in a single signature, Sign2Pay provides the s
&#xD;
Compatible with: 1.7, 1.8, 1.9</description>
<notes>Changes:&#xD;
- Fixed compatibility for Magento 1.7.0.2 and below</notes>
- Fixed order states placement for custom statuses</notes>
<authors><author><name>Sign2Pay</name><user>Sign2Pay</user><email>[email protected]</email></author></authors>
<date>2015-07-27</date>
<time>06:00:44</time>
Expand Down

0 comments on commit 854ee69

Please sign in to comment.