コード例 #1
0
 public function testPayCouponAct()
 {
     \Wechat\Logic\CouponLogic::givePayInvertCoupon(getOpenid());
 }
コード例 #2
0
 public function notifyurlAct()
 {
     recordLog('异步通知开始', 'wechatPay');
     $wechatPay = new \Common\Lib\Pay\pay_wap_wechat\wap_wechat();
     $check = $wechatPay->serverCallback(C('WECHAT_PAY_KEY'));
     if ($check) {
         recordLog('验证成功', 'wechatPay');
         recordLog($check, 'wechatPay');
         $order_sn = $check['out_trade_no'];
         $checkOrder = D('TicketOrder')->where(array('sn' => $order_sn))->find();
         if ($checkOrder['status'] == 0) {
             $save['status'] = 1;
             $save['third_pay_id'] = $this->payType;
             $result = D('TicketOrder')->where(array('sn' => $order_sn))->save($save);
             if ($result) {
                 //调用取票sn接口
                 $this->addTicketSn($order_sn);
                 recordLog('订单修改状态成功', 'wechatPay');
                 //赠送支付人的推荐人优惠券
                 \Wechat\Logic\CouponLogic::givePayInvertCoupon($checkOrder['open_id']);
                 $wechatPay->notifyStop();
             }
         } else {
             recordLog('订单已经支付或取消', 'wechatPay');
         }
     } else {
         recordLog('验证失败', 'wechatPay');
     }
     recordLog('异步通知结束', 'wechatPay');
 }