1

i am creating a shipment programmatically but i also need to capture payment too how i can do that?

    $order=Mage::getModel('sales/order')->load($orderid);
             $itemQty =  $order->getItemsCollection()->count();
             if($order->canShip())
                {   
                    $shipmentId = Mage::getModel('sales/order_shipment_api')->create($order->getIncrementId(), $itemsarray ,'' ,$email,1);
                    $trackingdata=$this->getRequest()->getParam('order'.$orderid);
                    $tracking=explode('-',$trackingdata);

                    $trackmodel = Mage::getModel('sales/order_shipment_api')
                    ->addTrack($shipmentId,$tracking[0],$title,$tracking[2]);
                }
  • when are you trying to capture payment ? on admin order creation / front-end order creation or during admin order processing ? – Ahmed May 8 '15 at 10:31
  • i am creating mass order action for shipment and capture user select the order and select the action and submit. – Qaisar Satti May 8 '15 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.