Skip to content

Commit 854ee69

Browse files
committed
Merge pull request #5 from magently/master
0.6.3 RC
2 parents 0083f1b + fc7bf5e commit 854ee69

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

app/code/community/Sign2pay/Payment/Helper/Data.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,23 @@ public function attachPaymentScripts(array $additional = array())
7979
);
8080
}
8181

82+
/**
83+
* Set status on order
84+
*
85+
* @param Mage_Sales_Model_Order $order
86+
* @param string $status_code
87+
*/
88+
public function setStatusOnOrder($order, $status_code)
89+
{
90+
$collection = Mage::getResourceModel('sales/order_status_collection');
91+
$collection->joinStates();
92+
$collection->getSelect()
93+
->where('main_table.status=?', $status_code)
94+
->limit(1);
95+
96+
$status = $collection->fetchItem()->getData();
97+
98+
$order->setState($status['state'], $status['status']);
99+
}
100+
82101
}

app/code/community/Sign2pay/Payment/Model/Processor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ protected function _registerPaymentCapture()
143143
->registerCaptureNotification(
144144
$this->getRequestData('amount') / 100
145145
);
146-
$this->_order->setState(Mage::getStoreConfig('payment/sign2pay/complete_order_status', Mage::app()->getStore()), true);
146+
147+
Mage::helper('sign2pay')->setStatusOnOrder($this->_order, Mage::getStoreConfig('payment/sign2pay/complete_order_status', Mage::app()->getStore()));
147148
$this->_order->save();
148149

149150
// notify customer

app/code/community/Sign2pay/Payment/controllers/PaymentController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function redirectAction()
2727
return $this->_redirect('checkout/cart');
2828
}
2929

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

3333
$this->loadLayout();

package.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<package>
33
<name>Sign2Pay_Mobile_Payments</name>
4-
<version>0.6.2</version>
4+
<version>0.6.3</version>
55
<stability>beta</stability>
66
<license>Sign2Pay Commercial License</license>
77
<channel>community</channel>
@@ -13,7 +13,7 @@ Analysing hundreds of data points in a single signature, Sign2Pay provides the s
1313
&#xD;
1414
Compatible with: 1.7, 1.8, 1.9</description>
1515
<notes>Changes:&#xD;
16-
- Fixed compatibility for Magento 1.7.0.2 and below</notes>
16+
- Fixed order states placement for custom statuses</notes>
1717
<authors><author><name>Sign2Pay</name><user>Sign2Pay</user><email>[email protected]</email></author></authors>
1818
<date>2015-07-27</date>
1919
<time>06:00:44</time>

0 commit comments

Comments
 (0)