public function returnNotify() { $llpayNotify = new LLpayNotify($this->llpay_config); $verify_result = $llpayNotify->verifyNotify(); if ($verify_result) { //验证成功 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //请在这里加上商户的业务逻辑程序代 //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— //获取连连支付的通知返回参数,可参考技术文档中服务器异步通知参数列表 $is_notify = true; $json = new JSON(); $str = file_get_contents("php://input"); $val = $json->decode($str); $oid_partner = trim($val->{'oid_partner'}); $dt_order = trim($val->{'dt_order'}); $no_order = trim($val->{'no_order'}); $oid_paybill = trim($val->{'oid_paybill'}); $money_order = trim($val->{'money_order'}); $result_pay = trim($val->{'result_pay'}); $settle_date = trim($val->{'settle_date'}); $info_order = trim($val->{'info_order'}); $pay_type = trim($val->{'pay_type'}); $bank_code = trim($val->{'bank_code'}); $sign_type = trim($val->{'sign_type'}); $sign = trim($val->{'sign'}); ///如果同步接受操作没有处理成功 $pay = payLL::findOne(['no_order' => $no_order, 'status' => self::CONFIRM]); if ($pay) { if ($result_pay == 'SUCCESS') { //验证支付金额 if ($pay->money_order == $money_order) { //支付成功了--更新数据 $pay->status = self::SUCCESS; $pay->remark = "success"; $pay->sign_type = $sign_type; $pay->sign = $sign; $pay->oid_paybill = $oid_paybill; $pay->settle_date = $settle_date; $pay->money_lianlian = $money_order; $pay->pay_type = $pay_type; $pay->bank_code = $bank_code; $res = $pay->save(); if ($res) { $card_no = $pay->card_no; $uid = $pay->uid; $info = Info::find()->where(['member_id' => $uid])->one(); $newmoney = $info->balance; $info->balance = $newmoney + $money_order; $info->bank_card = $card_no; $info->bank_card_phone = $bank_code; $info->save(); } } else { $pay->status = self::ERROR; $pay->remark = "订单金额错误"; $pay->sign_type = $sign_type; $pay->sign = $sign; $pay->oid_paybill = $oid_paybill; $pay->settle_date = $settle_date; $pay->money_lianlian = $money_order; $pay->pay_type = $pay_type; $pay->bank_code = $bank_code; $pay->save(); } } } file_put_contents("log.txt", "异步通知 验证成功\n", FILE_APPEND); die("{'ret_code':'0000','ret_msg':'交易成功'}"); //请不要修改或删除 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// } else { file_put_contents("log.txt", "异步通知 验证失败\n", FILE_APPEND); //验证失败 die("{'ret_code':'9999','ret_msg':'验签失败'}"); //调试用,写文本函数记录程序运行情况是否正常 //logResult("这里写入想要调试的代码变量值,或其他运行的结果记录"); } }
/** * Finds the payLL model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return payLL the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = payLL::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }