예제 #1
0
 public function r_u()
 {
     import('@.ORG.Allinpay.allinpayCore');
     $allinpayClass = new allinpayCore();
     $verify_result = $allinpayClass->verify_pay($this->payConfig['merchantKey']);
     if (!$verify_result['error']) {
         $payHandel = new payHandle($this->token, $_GET['from'], 'allinpay');
         $orderInfo = $payHandel->afterPay($verify_result['order_id'], $verify_result['paymentOrderId']);
         $from = $payHandel->getFrom();
         $this->redirect('/index.php?g=Wap&m=' . $from . '&a=payReturn&token=' . $orderInfo['token'] . '&wecha_id=' . $orderInfo['wecha_id'] . '&orderid=' . $verify_result['order_id']);
     } else {
         $this->error($verify_result['msg']);
     }
 }
예제 #2
0
 public function return_url()
 {
     if (empty($this->pay_config['pay_allinpay_merchantid']) || empty($this->pay_config['pay_allinpay_merchantkey'])) {
         return array('error' => 1, 'msg' => '通联支付缺少配置信息!请联系管理员处理或选择其他支付方式。');
     }
     import('@.ORG.pay.Allinpay.allinpayCore');
     $allinpayClass = new allinpayCore();
     $verify_result = $allinpayClass->verify_pay($this->pay_config['pay_allinpay_merchantkey']);
     if (empty($verify_result['error'])) {
         $order_id_arr = explode('_', $verify_result['order_id']);
         $order_param['pay_type'] = 'allinpay';
         $order_param['is_mobile'] = $this->is_mobile;
         $order_param['order_type'] = $order_id_arr[0];
         $order_param['order_id'] = $order_id_arr[1];
         $order_param['third_id'] = $verify_result['paymentOrderId'];
         $order_param['pay_money'] = $verify_result['pay_money'];
         return array('error' => 0, 'order_param' => $order_param);
     } else {
         return array('error' => 1, 'msg' => $verify_result['msg']);
     }
 }
예제 #3
0
 public function refund()
 {
     if ($this->pay_config["pay_allinpay_merchantid"] || $this->pay_config["pay_allinpay_merchantkey"]) {
         return array("error" => 1, "msg" => "通联支付缺少配置信息!请联系管理员处理或选择其他支付方式。");
     }
     import("@.ORG.pay.Allinpay.allinpayCore");
     $allinpayClass = new allinpayCore();
     $allinpayClass->setParameter("refundHost", "ceshi.allinpay.com");
     $allinpayClass->setParameter("key", $this->pay_config["pay_allinpay_merchantkey"]);
     $allinpayClass->setParameter("merchantId", $this->pay_config["pay_allinpay_merchantid"]);
     $allinpayClass->setParameter("orderNo", $this->order_info["order_type"] . "_" . $this->order_info["order_id"]);
     $allinpayClass->setParameter("orderDatetime", date("YmdHis", $this->order_info["submit_order_time"]));
     $allinpayClass->setParameter("refundAmount", $this->pay_money * 100);
     $verify_result = $allinpayClass->refund($this->order_info, $this->pay_money, $this->pay_config);
     return $verify_result;
 }