Example #1
0
 public static function getTemplate($params)
 {
     if (isset($params) && count($params) > 0) {
         $transaction = new Mradiwallettemplate();
         $transaction->amount = $params['amount'];
         $transaction->order_id = $params['order_id'];
         $transaction->user_id = $params['user_id'];
         $transaction->item_name = $params['item_name'];
         $transaction->campaign_id = $params['campaign_id'];
         $transaction->save();
         //get transaction details to process
         $transactions = Mradiwallettemplate::find($transaction->id);
         return $transactions;
     }
 }
         $transaction->save();
         $cout = '<div style="width: 98%"><div class="alert alert-success alert-dismissable">
                             <i class="fa fa-check"></i>
                             <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                             <b> Successfully purchase Financial Template. Please check your email ' . session::get('email_address') . ' for download link.</b>
                             </div></div>';
         $Details = Helpers::getProfileDetails();
         Helpers::sendMail(array("names" => $Details[0]->firstname . ' ' . $Details[0]->lastname, "message" => 'Click on this link to download your template   www.mradi.com/ref=fin-900.doc', "to" => session::get('email_address')), true);
         $cid = Mradiwallettemplate::find($trans_id);
     }
 } elseif (Input::get('sid') != '1') {
     $trans_id = e(Input::get('oid'));
     $transaction = Mradiwallettemplate::find($trans_id);
     $transaction->mradistatustransaction_id = e(Input::get('sid'));
     $transaction->save();
     $cid = Mradiwallettemplate::find($trans_id);
     if (Input::get('sid') == '2') {
         error_log("cancelling flush");
         $cout = '<div style="width: 98%"><div class="alert alert-danger alert-dismissable">
                             <i class="fa fa-check"></i>
                             <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                             <b> Transaction Failed!! Please check your balance and try again later. </b>
                             </div></div>';
     } elseif (Input::get('sid') == '3') {
         $cout = '<div style="width: 98%"><div class="alert alert-danger alert-dismissable">
                             <i class="fa fa-check"></i>
                             <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                             <b> Transaction Cancelled!! Please try again later. </b>
                             </div></div>';
     }
 }