public function getBalance()
 {
     $xmlinput = Xmlicash::channelpartnerlimit();
     $jsonresult = Icash::registerkyc($xmlinput);
     $output = Xmltoarray::arr($jsonresult);
     $city = $output['SOAP:ENVELOPE']['SOAP:BODY']['CHANNELPARTNERLIMITRESPONSE']['CHANNELPARTNERLIMITRESULT'];
     $output1 = Xmltoarray::arr($city);
     //print_r($output1); exit;
     if ($output1 && $output1['CHANNELPARTNERLIMITRESPONSE']['STATUSCODE'] == 0) {
         $admin = Icash::updatebalance($output1['CHANNELPARTNERLIMITRESPONSE']['LIMIT']);
         //print_r($admin);
     } else {
         return Redirect::to('admin/noservice');
     }
 }
 public function getTrans()
 {
     $checkbalancein = Xmlicash::servicecharge(Input::all());
     $checkbalancexml = Icash::registerkyc($checkbalancein);
     $checkbalanceout = Xmltoarray::arr($checkbalancexml);
     $jsonresult = Icash::topupcard();
     $city = $checkbalanceout['SOAP:ENVELOPE']['SOAP:BODY']['SERVICECHARGERESPONSE']['SERVICECHARGERESULT'];
     $output1 = Xmltoarray::arr($city);
     //print_r($output1);
     //print_r($jsonresult);
     if ($output1 && $output1['SERVICECHARGERESPONSE']['STATUSCODE'] == 0) {
         print_r($output1);
         Session::put('servicecharge', $output1['SERVICECHARGERESPONSE']['SERVICECHARGE']);
         if ($output1['SERVICECHARGERESPONSE']['TOPUPFLAG'] == 1) {
             if ($jsonresult->impsbalance > Input::get('transamount')) {
                 $input = Xmlicash::topup(Input::all());
                 $data = Icash::registerkyc($input);
                 $output = Xmltoarray::arr($data);
                 $jsonresult = Icash::transferamount(Input::get('transamount'));
                 $city = $output['SOAP:ENVELOPE']['SOAP:BODY']['TOPUP_V2RESPONSE']['TOPUP_V2RESULT'];
                 $output1 = Xmltoarray::arr($city);
                 if ($output1['TOPUP_V2RESPONSE']['STATUSCODE'] == 0) {
                     $xmlinput = Xmlicash::channelpartnerlimit();
                     $jsonresult = Icash::registerkyc($xmlinput);
                     $output = Xmltoarray::arr($jsonresult);
                     $city = $output['SOAP:ENVELOPE']['SOAP:BODY']['CHANNELPARTNERLIMITRESPONSE']['CHANNELPARTNERLIMITRESULT'];
                     $output1 = Xmltoarray::arr($city);
                     //print_r($output1); exit;
                     if ($output1 && $output1['CHANNELPARTNERLIMITRESPONSE']['STATUSCODE'] == 0) {
                         $admin = Icash::updatebalance($output1['CHANNELPARTNERLIMITRESPONSE']['LIMIT']);
                         //print_r($admin);
                     }
                     $input = Xmlicash::transfer(Input::all());
                     $data = Icash::registerkyc($input);
                     $output = Xmltoarray::arr($data);
                     $city = $output['SOAP:ENVELOPE']['SOAP:BODY']['TRANSACTION_V3RESPONSE']['TRANSACTION_V3RESULT'];
                     $output1 = Xmltoarray::arr($city);
                     //print_r($input);exit;
                     $jsoninput = Jsonicash::transfer(Input::all());
                     $jsonresult = Icash::transfer($jsoninput);
                     //print_r($jsoninput); exit;
                     if ($output1['TRANSACTION_V3RESPONSE']['STATUSCODE'] == 0) {
                         $jsoninput = Jsonicash::transtatus($output1['TRANSACTION_V3RESPONSE']['STATUSCODE']);
                         $jsonresult = Icash::transtatus($jsoninput);
                         return Redirect::to('retailer/icash/manage')->with('success', $output1['TRANSACTION_V3RESPONSE']['STATUS']);
                     } elseif ($output1['TRANSACTION_V3RESPONSE']['STATUSCODE'] == 1 || $output1['TRANSACTION_V3RESPONSE']['STATUSCODE'] == 3) {
                         $jsoninput = Jsonicash::transtatus($output1['TRANSACTION_V3RESPONSE']['STATUSCODE']);
                         $jsonresult = Icash::transtatus($jsoninput);
                         return Redirect::to('retailer/icash/transfer/' . Input::get('ifsc') . '/' . Input::get('benname') . '/' . Input::get('benemobile') . '/' . Input::get('accno') . '/' . Input::get('benid') . '_' . Input::get('type'))->with('failure', $output1['TRANSACTION_V3RESPONSE']['STATUS']);
                     } elseif ($output1['TRANSACTION_V3RESPONSE']['STATUSCODE'] == 2) {
                         //print_r($output);
                         //print_r(Session::all());
                         return View::make('retailer.icashcard.transwaitrespose');
                     }
                 } else {
                     return Redirect::to('retailer/icash/manage')->with('failure', "something went wrong");
                 }
             } else {
                 return Redirect::to('retailer/icash/manage')->with('failure', "Balance is low");
             }
         } else {
             //print_r($output1);
             //echo "hi"; exit;
             $input = Xmlicash::transfer(Input::all());
             $data = Icash::registerkyc($input);
             $output = Xmltoarray::arr($data);
             $city = $output['SOAP:ENVELOPE']['SOAP:BODY']['TRANSACTION_V3RESPONSE']['TRANSACTION_V3RESULT'];
             $output1 = Xmltoarray::arr($city);
             //print_r($input);exit;
             $jsoninput = Jsonicash::transfer(Input::all());
             $jsonresult = Icash::transfer($jsoninput);
             //print_r($jsoninput); exit;
             if ($output1['TRANSACTION_V3RESPONSE']['STATUSCODE'] == 0) {
                 $jsoninput = Jsonicash::transtatus($output1['TRANSACTION_V3RESPONSE']['STATUSCODE']);
                 $jsonresult = Icash::transtatus($jsoninput);
                 return Redirect::to('retailer/icash/manage')->with('success', $output1['TRANSACTION_V3RESPONSE']['STATUS']);
             } elseif ($output1['TRANSACTION_V3RESPONSE']['STATUSCODE'] == 1 || $output1['TRANSACTION_V3RESPONSE']['STATUSCODE'] == 3) {
                 $jsoninput = Jsonicash::transtatus($output1['TRANSACTION_V3RESPONSE']['STATUSCODE']);
                 $jsonresult = Icash::transtatus($jsoninput);
                 return Redirect::to('retailer/icash/transfer/' . Input::get('ifsc') . '/' . Input::get('benname') . '/' . Input::get('benemobile') . '/' . Input::get('accno') . '/' . Input::get('benid') . '_' . Input::get('type'))->with('failure', $output1['TRANSACTION_V3RESPONSE']['STATUS']);
             } elseif ($output1['TRANSACTION_V3RESPONSE']['STATUSCODE'] == 2) {
                 //print_r($output);
                 //print_r(Session::all());
                 return View::make('retailer.icashcard.transwaitrespose');
             }
         }
     }
     //exit;
 }