Example #1
0
 public function index()
 {
     require_once APPPATH . 'third_party/aliyun_oss/vendor/autoload.php';
     $accessKeyId = "GtzMAvDTnxg72R04";
     $accessKeySecret = "VhD2czcwLVAaE7DReDG4uEVSgtaSYK";
     $endpoint = "oss-cn-hangzhou.aliyuncs.com";
     $bmobOrder = new BmobObject('Order');
     $res = $bmobOrder->get('', array('where={"state":"' . orderState::UNPAID . '","userId":"2447db529e"}', 'limit=1'));
     var_dump($res);
     $order = new MY_Order();
     $order->alipay();
 }
Example #2
0
 function alipay()
 {
     $orderId = $this->input->get('orderId');
     $bmobOrder = new BmobObject('Order');
     $res = $bmobOrder->get('', array('where={"userId":"' . $this->userId . '","objectId":"' . $orderId . '","state":"' . orderState::UNPAID . '"}'));
     if (empty($orderId) or empty($res->results)) {
         echo '无效订单号!';
         header('Location: ' . base_url('user/orders'));
         exit;
     } else {
         $order = new MY_Order();
         $order->createAlipay();
         //$charge = $order->getChargeInfo($chargeId);
         //$this->load->view('user/pay_page',array('charge'=>$pay,'orderInfo'=>$res->results[0]));
     }
 }
Example #3
0
 public function createPay()
 {
     //订单状态
     //购物车->确认订单(完善,确认订单信息)->提交订单->支付订单->商家打印->等待配送->完成订单
     // 		$username = $this->input->post('username');
     // 		$files = $this->input->post('files');
     try {
         $order = new MY_Order();
         $charge = $order->createPingPay();
         echo $charge;
     } catch (MY_Exception $e) {
         $this->echo_msg(false, $e->error_msg);
     }
 }