| Conditions | 7 |
| Paths | 6 |
| Total Lines | 29 |
| Code Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 18 | public function frameAction() |
||
| 19 | { |
||
| 20 | if ($this->getRequest()->isPost()) { |
||
| 21 | $postData = Mage::app()->getRequest()->getPost(); |
||
| 22 | if (!Mage::getModel('payture/payture')->checkSign($postData['orderid'], $postData['hash'])) { |
||
| 23 | $this->response->statusCode(401); |
||
| 24 | return $this->response; |
||
| 25 | } |
||
| 26 | $order_id = $postData['orderid']; |
||
| 27 | $order = Mage::getModel('sales/order')->load($order_id); |
||
| 28 | if (!$order || !$order->getId()) { |
||
| 29 | return false; |
||
| 30 | } |
||
| 31 | if (!$order->canInvoice()) { |
||
| 32 | return false; |
||
| 33 | } |
||
| 34 | $code = $order->getPayment()->getMethodInstance()->getCode(); |
||
| 35 | if (!$code == 'payture') { |
||
| 36 | return false; |
||
| 37 | } |
||
| 38 | $url2go = Mage::helper('payture')->getLink($order->getId()); |
||
| 39 | Mage::register('payture_frame_link', $url2go); |
||
| 40 | $this->loadLayout(); |
||
| 41 | $this->renderLayout(); |
||
| 42 | } else { |
||
| 43 | $this->response->statusCode(500); |
||
| 44 | return $this->response; |
||
| 45 | } |
||
| 46 | } |
||
| 47 | } |
||
| 48 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.