Exemplo n.º 1
0
 public function batchTrans()
 {
     $fields = \Input::All();
     if (!$this->validation->passes(TransValidator::$transRule)) {
         //throw new PayException(ErrCode::ERR_PARAM) ;
     }
     //$batchNo = TransBiz::getInstance()->createTransOrderForBatch($fields) ;
     $batchNo = $fields['batch_no'];
     $url = TransBiz::getInstance()->transThirdParty($batchNo);
     return ['batch_no' => $batchNo, 'pay_gateway_url' => $url];
 }
Exemplo n.º 2
0
 private function _transNotify($notice)
 {
     $errCode = 0;
     $errMsg = '';
     foreach ($notice['details'] as $detail) {
         try {
             $transOrder = TransModel::where('mer_trans_no', $detail['mer_trans_no'])->first();
             if (!$transOrder) {
                 $errCode++;
                 $errMsg = '提现订单不存在' . $detail['mer_trans_no'];
                 continue;
             }
             if ($transOrder->status != TransModel::STATUS_DEFAULT) {
                 $errCode++;
                 $errMsg = '订单状态不正确';
                 continue;
             }
             $upInfo = ['ser_pay_time' => $detail['pay_time'], 'ser_trans_no' => $detail['ser_trans_no'], 'ser_notify_status' => $detail['notify_status'], 'ser_notify_time' => $detail['notify_time'], 'ser_notify_log' => $detail['notify_log']];
             if (true !== TransBiz::getInstance()->confirmTransOrderById($transOrder->id, $upInfo)) {
                 $errCode++;
                 $errMsg = '确认转账订单失败';
                 continue;
             }
         } catch (\Exception $e) {
             $errCode++;
             $errMsg = $e->getMessage();
             continue;
         }
     }
     $ret = new \stdClass();
     $ret->is_success = $errCode === 0 ? 'T' : 'F';
     $ret->code = $errCode;
     $ret->output = $notice['output'];
     $ret->error = $errMsg;
     return $ret;
 }