コード例 #1
0
ファイル: Allinpay.class.php プロジェクト: fkssei/pigcms10
 public function web_pay()
 {
     import('@.ORG.pay.Allinpay.allinpayCore');
     $allinpayClass = new allinpayCore();
     $allinpayClass->setParameter('payUrl', 'http://ceshi.allinpay.com/gateway/index.do');
     $allinpayClass->setParameter('pickupUrl', C('config.site_url') . '/index.php?c=Pay&a=return_url&pay_type=allinpay');
     $allinpayClass->setParameter('receiveUrl', C('config.site_url') . '/index.php?c=Pay&a=notify_url&pay_type=allinpay');
     $allinpayClass->setParameter('merchantId', $this->pay_config['pay_allinpay_merchantid']);
     $allinpayClass->setParameter('orderNo', $this->order_info['order_type'] . '_' . $this->order_info['order_id']);
     $allinpayClass->setParameter('orderAmount', floatval($this->pay_money * 100));
     $allinpayClass->setParameter('orderDatetime', date('YmdHis', $_SERVER['REQUEST_TIME']));
     $allinpayClass->setParameter('productName', $this->order_info['order_name']);
     $allinpayClass->setParameter('payType', 0);
     $allinpayClass->setParameter('key', $this->pay_config['pay_allinpay_merchantkey']);
     $form = $allinpayClass->sendRequestForm();
     return array('error' => 0, 'form' => $form);
 }
コード例 #2
0
ファイル: Allinpay.class.php プロジェクト: belerweb/pigcms
 public function web_pay()
 {
     import("@.ORG.pay.Allinpay.allinpayCore");
     $allinpayClass = new allinpayCore();
     $allinpayClass->setParameter("payUrl", "http://ceshi.allinpay.com/gateway/index.do");
     $allinpayClass->setParameter("pickupUrl", C("config.site_url") . "/index.php?c=Pay&a=return_url&pay_type=allinpay");
     $allinpayClass->setParameter("receiveUrl", C("config.site_url") . "/index.php?c=Pay&a=notify_url&pay_type=allinpay");
     $allinpayClass->setParameter("merchantId", $this->pay_config["pay_allinpay_merchantid"]);
     $allinpayClass->setParameter("orderNo", $this->order_info["order_type"] . "_" . $this->order_info["order_id"]);
     $allinpayClass->setParameter("orderAmount", floatval($this->pay_money * 100));
     $allinpayClass->setParameter("orderDatetime", date("YmdHis", $_SERVER["REQUEST_TIME"]));
     $allinpayClass->setParameter("productName", $this->order_info["order_name"]);
     $allinpayClass->setParameter("payType", 0);
     $allinpayClass->setParameter("key", $this->pay_config["pay_allinpay_merchantkey"]);
     $form = $allinpayClass->sendRequestForm();
     return array("error" => 0, "form" => $form);
 }
コード例 #3
0
 public function pay()
 {
     $orderName = $_GET['orderName'];
     if (!$orderName) {
         $orderName = microtime();
     }
     $orderid = $_GET['orderid'];
     if (!$orderid) {
         $orderid = $_GET['single_orderid'];
     }
     $payHandel = new payHandle($this->token, $_GET['from'], 'allinpay');
     $orderInfo = $payHandel->beforePay($orderid);
     if ($orderInfo['paid']) {
         exit('您已经支付过此次订单!');
     }
     if (!$orderInfo['price']) {
         exit('必须有价格才能支付');
     }
     $database_userinfo = D('Userinfo');
     $condition_userinfo['wecha_id'] = $this->wecha_id;
     $now_user_info = $database_userinfo->field('`id` `wid`')->where($condition_userinfo)->find();
     if (empty($now_user_info)) {
         $this->error('查询数据异常!请重试。');
     }
     if (empty($_GET['platform'])) {
         $return_url = $this->siteUrl . '/index.php?g=Wap&m=Allinpay&a=r_u&wid=' . $now_user_info['wid'] . '&from=' . $_GET['from'];
     } else {
         $return_url = $this->siteUrl . '/index.php?g=Wap&m=Allinpay&a=r_u&wid=' . $now_user_info['wid'] . '&from=' . $_GET['from'] . '&platform=1';
     }
     import('@.ORG.Allinpay.allinpayCore');
     $allinpayClass = new allinpayCore();
     $allinpayClass->setParameter('payUrl', 'https://service.allinpay.com/mobilepayment/mobile/SaveMchtOrderServlet.action');
     $allinpayClass->setParameter('pickupUrl', $return_url);
     $allinpayClass->setParameter('receiveUrl', $this->siteUrl . '/index.php?g=Wap&m=Allinpay&a=notify_url');
     $allinpayClass->setParameter('merchantId', $this->payConfig['merchantId']);
     $allinpayClass->setParameter('orderNo', $orderInfo['orderid']);
     $allinpayClass->setParameter('orderAmount', floatval($orderInfo['price']) * 100);
     $allinpayClass->setParameter('orderDatetime', date('YmdHis', $_SERVER['REQUEST_TIME']));
     $allinpayClass->setParameter('productName', $orderName);
     $allinpayClass->setParameter('payType', 0);
     $allinpayClass->setParameter('key', $this->payConfig['merchantKey']);
     $allinpayClass->sendRequestForm();
 }
コード例 #4
0
 public function pay()
 {
     //得到GET传参的订单名称,若为空则使用系统时间
     $orderName = $_GET['orderName'];
     if (!$orderName) {
         $orderName = microtime();
     }
     //得到GET传参的系统唯一订单号
     $orderid = $_GET['orderid'];
     if (!$orderid) {
         $orderid = $_GET['single_orderid'];
         //单个订单
     }
     //惯例,获取此订单号的信息
     $payHandel = new payHandle($this->token, $_GET['from'], 'allinpay');
     $orderInfo = $payHandel->beforePay($orderid);
     //判断是否已经支付过
     if ($orderInfo['paid']) {
         exit('您已经支付过此次订单!');
     }
     //判断价格是否为空。此做法可顺带查出是否是错误的订单号
     if (!$orderInfo['price']) {
         exit('必须有价格才能支付');
     }
     //为了应用 通联支付坑爹的要求(跳转地址长度为100个以内,通联数据库字段就是100的长度),,,将数据转换成ID。。。。
     //公众号
     $database_wxuser = D('Wxuser');
     $condition_wxuser['token'] = $this->token;
     $now_wxuser = $database_wxuser->field('`id` `wx_id`')->where($condition_wxuser)->find();
     if (empty($now_wxuser)) {
         $this->error('查询数据异常!请重试。');
     }
     //微信用户
     $database_wecha_user = D('Wecha_user');
     $condition_wecha_user['wecha_id'] = $this->wecha_id;
     $now_wecha_user = $database_wecha_user->field('`id` `we_id`')->where($condition_wecha_user)->find();
     if (empty($now_wecha_user)) {
         $this->error('查询数据异常!请重试。');
     }
     if (empty($_GET['platform'])) {
         $return_url = C('site_url') . '/index.php?g=Wap&m=Allinpay&a=r_u&wx_id=' . $now_wxuser['wx_id'] . '&we_id=' . $now_wecha_user['we_id'] . '&from=' . $_GET['from'];
     } else {
         $return_url = C('site_url') . '/index.php?g=Wap&m=Allinpay&a=r_u&wx_id=' . $now_wxuser['wx_id'] . '&we_id=' . $now_wecha_user['we_id'] . '&from=' . $_GET['from'] . '&pl=1';
     }
     //在此引入通联处理类,防止引入又被价格错误返回导致终止
     import('@.ORG.Allinpay.allinpayCore');
     $allinpayClass = new allinpayCore();
     $allinpayClass->setParameter('payUrl', 'http://ceshi.allinpay.com/mobilepayment/mobile/SaveMchtOrderServlet.action');
     //提交地址
     $allinpayClass->setParameter('pickupUrl', $return_url);
     //跳转通知地址
     $allinpayClass->setParameter('receiveUrl', C('site_url') . '/index.php?g=Wap&m=Allinpay&a=notify_url');
     //异步通知地址
     $allinpayClass->setParameter('merchantId', $this->payConfig['merchantId']);
     //商户号
     $allinpayClass->setParameter('orderNo', $orderInfo['orderid']);
     //订单号
     $allinpayClass->setParameter('orderAmount', floatval($orderInfo['price']) * 100);
     //订单金额(单位分)
     $allinpayClass->setParameter('orderDatetime', date('YmdHis', $_SERVER['REQUEST_TIME']));
     //订单提交时间
     $allinpayClass->setParameter('productName', $orderName);
     //商品名称
     $allinpayClass->setParameter('payType', 0);
     //支付方式
     $allinpayClass->setParameter('key', $this->payConfig['merchantKey']);
     //支付方式
     //开始跳转支付
     $allinpayClass->sendRequestForm();
 }