示例#1
0
文件: buy.php 项目: vuong93st/w-game
     $iteminfo['name'] = $info['name'];
     $iteminfo['price'] = intval($info['price']);
     $iteminfo['product_id'] = $pid;
     $charginginfo = $payment->request($iteminfo);
     if (isset($charginginfo)) {
         $token = $charginginfo[0];
         $redirectUrl = $charginginfo[1];
         //Get Charging status
         //Save token to order
         $vals['transection_token'] = $token;
         $vals['transection_time'] = time();
         $vals['transection_method'] = 'wap-tinhvan';
         $vals['msisdn'] = $_SESSION['msisdn'];
         $vals['product_id'] = $pid;
         $vals['device_id'] = $device_id;
         $resul_s = $transection->save($vals);
         if ($resul_s == 1 && $token != "" && $token != "-1" && $token != "-2") {
             pheader("Location: " . $redirectUrl);
         } else {
             flash("Đăng ký giao dịch không thành công!");
         }
     }
 } else {
     //Neu giao dich mien phi
     $token = pb_radom(24, 1);
     $vals['transection_token'] = $token;
     $vals['transection_time'] = time();
     $vals['transection_method'] = 'free';
     $vals['msisdn'] = $_SESSION['msisdn'];
     $vals['product_id'] = $pid;
     $vals['device_id'] = $device_id;