コード例 #1
0
 public function execute($request)
 {
     error_reporting(E_ALL);
     ini_set("displays", 1);
     $payment = Sp_Payment::factory('weixinpay');
     $returnXml = $payment->notify($GLOBALS['HTTP_RAW_POST_DATA']);
     echo $returnXml;
 }
コード例 #2
0
 public function execute($request)
 {
     $param = array();
     $param['sn'] = 'fdsafdsafsdafds' . time();
     $param['amount'] = 0.001;
     $param['title'] = '测试支付';
     $payment = Sp_Payment::factory('weixinpay');
     $returnUrl = $payment->prepare($param);
     include LIB_ROOT . "third/phpqrcode/phpqrcode.php";
     // 纠错级别:L、M、Q、H
     $level = 'L';
     // 点的大小:1到10,用于手机端4就可以了
     $size = 4;
     // 下面注释了把二维码图片保存到本地的代码,如果要保存图片,用$fileName替换第二个参数fal
     QRcode::png($returnUrl, false, $level, $size);
 }
コード例 #3
0
 public function execute($request)
 {
     $view = new Sp_View();
     $request = Request::current();
     $order_sn = $request->c_order;
     $order_id = $request->c_orderid;
     $order_amount = $request->c_orderamount;
     $the_order = Sp_Shopping_Order::load($order_sn, 'odrcode');
     if (!$the_order->ID or $the_order->ID != $order_id) {
         $view->assign('error_message', "错误的订单编号");
         $view->out_404();
         return;
     }
     $TruePr = $the_order["TruePr"];
     $ComePr = $the_order["ComePr"];
     $BackPr = $the_order["BackPr"];
     $the_order['order_amount'] = round($TruePr - $ComePr + $BackPr, 2);
     $Payment = Sp_Payment::factory("alipay");
     $params = array('order_id' => $order_id, 'order_sn' => $order_sn, 'order_amount' => $the_order['order_amount']);
     $link = $Payment->prepare($params);
     echo $link;
 }
コード例 #4
0
 public function execute($request)
 {
     $payment = Sp_Payment::factory('alipay');
     $payment->complete($_GET);
 }