title: How to stop order processing of same order once if order status is canceled in Magento?
body: <p>How to stop processing of the same order once the order is cancelled ?
  I'm using paypal payment method,While placing the order from paypal if I cancel the order from the paypal gateway (Cancel and return),it set the order status as cancelled and redirected to the cart page, but again if I press browser back button, then it redirects me back to the paypal payment gateway page,and the payment is done succesfully.My order status history shows as <strong>Pending Payment</strong>,<strong>Canceled</strong>,<strong>Order Processing</strong>,<strong>Preparing for delivery</strong>.</p>
  
  <p>How can I stop this?</p>
  
  <p>I tried to update the order status using event and observer, but still I unable to stop this processing. </p>
  
  <pre><code>$order = $observer-&gt;getEvent()-&gt;getPayment()-&gt;getOrder();
  $order=Mage::getModel('sales/order')-&gt;load($order-&gt;getEntityId());
  $order-&gt;setState(Mage_Sales_Model_Order::STATE_CANCELED, true);
  $order-&gt;setStatus("canceled");
  $order-&gt;save();
  </code></pre>