gpt4 book ai didi

com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult类的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 02:49:05 28 4
gpt4 key购买 nike

本文整理了Java中com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult类的一些代码示例,展示了WxPayOrderNotifyResult类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WxPayOrderNotifyResult类的具体详情如下:
包路径:com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult
类名称:WxPayOrderNotifyResult

WxPayOrderNotifyResult介绍

[英]支付结果通用通知 ,文档见:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_7
[中]支付结果通用通知 ,文档见:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_7

代码示例

代码示例来源:origin: jmdhappy/xxpay-master

if (!PayConstant.RETURN_VALUE_SUCCESS.equalsIgnoreCase(params.getResultCode())
    && !PayConstant.RETURN_VALUE_SUCCESS.equalsIgnoreCase(params.getReturnCode())) {
  _log.error("returnCode={},resultCode={},errCode={},errCodeDes={}", params.getReturnCode(), params.getResultCode(), params.getErrCode(), params.getErrCodeDes());
  payContext.put("retMsg", "notify data failed");
  return false;
Integer total_fee = params.getTotalFee();   			// 总金额
String out_trade_no = params.getOutTradeNo();			// 商户系统订单号

代码示例来源:origin: linlinjava/litemall

logger.info(result);
String orderSn = result.getOutTradeNo();
String payId = result.getTransactionId();
String totalFee = BaseWxPayResult.fenToYuan(result.getTotalFee());
LitemallOrder order = orderService.findBySn(orderSn);
if (order == null) {
};
notifyService.notifyWxTemplate(result.getOpenid(), NotifyType.PAY_SUCCEED, parms, "pages/index/index?orderId=" + order.getId());

代码示例来源:origin: liuweijw/fw-cloud-framework

if (StringHelper.isBlank(xmlResult)) { return WxPayNotifyResponse.fail("FAIL"); }
WxPayServiceImpl wxPayService = new WxPayServiceImpl();
WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlResult);
if (!PayConstant.RETURN_VALUE_SUCCESS.equalsIgnoreCase(result.getResultCode())
    || !PayConstant.RETURN_VALUE_SUCCESS.equalsIgnoreCase(result.getResultCode())) {
  log.error("returnCode={},resultCode={},errCode={},errCodeDes={}", result
      .getReturnCode(), result.getResultCode(), result.getErrCode(), result
      .getErrCodeDes());
  return WxPayNotifyResponse.fail("notify data failed");
Integer total_fee = result.getTotalFee(); // 总金额
String out_trade_no = result.getOutTradeNo(); // 商户系统订单号
wxPayService.setConfig(wxPayConfig);
result.checkResult(wxPayService, null, false);

代码示例来源:origin: ustcwudi/springboot-seed

@PostMapping("/pay_callback/{type}/{id}/{rid}/{uid}")
public ResponseEntity<?> parseOrderNotifyResult(@ApiParam("支付类型") @PathVariable("type") Integer type,
                        @ApiParam("主键") @PathVariable("id") long id,
                        @ApiParam("外键") @PathVariable("rid") long rid,
                        @ApiParam("用户id") @PathVariable("uid") long uid,
                        @RequestBody String xmlData) throws WxPayException {
  WxPayOrderNotifyResult result = wxPayAPI.parseOrderNotifyResult(xmlData);
  if (result.getReturnCode().equals("SUCCESS")) {
    if (type == 1) {
      Payment payment = paymentService.selectByID(id).get();
      payment.setBankType(result.getBankType());
      payment.setOutTradeNo(result.getOutTradeNo());
      payment.setTransactionNo(result.getTransactionId());
      payment.setComment(result.getReturnCode());
      paymentService.modifyById(payment);
      CarFee carFee = carFeeService.selectByID(rid).get();
      carFee.setPaymentAmount(new BigDecimal(payment.getTotalFee()).divide(new BigDecimal(100)));
      carFee.setPaymentTime(new Date());
      carFee.setPaymentMode("微信支付");
      carFee.setPaymentId(id);
      carFee.setUserId(uid);
      carFeeService.modifyById(carFee);
    } else {
      // todo: 会员充值
    }
    return ResponseEntity.status(HttpStatus.OK).body("SUCCESS");
  } else {
    return ResponseEntity.status(HttpStatus.OK).body("FAIL");
  }
}

代码示例来源:origin: jmdhappy/xxpay-master

WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlResult);
Map<String, Object> payContext = new HashMap<>();
payContext.put("parameters", result);
  int updatePayOrderRows = super.baseUpdateStatus4Success(payOrder.getPayOrderId(), result.getTransactionId());
  if (updatePayOrderRows != 1) {
    _log.error("{}更新支付状态失败,将payOrderId={},更新payStatus={}失败", logPrefix, payOrder.getPayOrderId(), PayConstant.PAY_STATUS_SUCCESS);
  payOrder.setChannelOrderNo(result.getTransactionId());

代码示例来源:origin: com.github.binarywang/weixin-java-pay

@Override
public void checkResult(WxPayService wxPayService, String signType, boolean checkSuccess) throws WxPayException {
 //防止伪造成功通知
 if (WxPayConstants.ResultCode.SUCCESS.equals(getReturnCode()) && getSign() == null) {
  throw new WxPayException("伪造的通知!");
 }
 
 super.checkResult(wxPayService, signType, checkSuccess);
}

代码示例来源:origin: binarywang/WxJava

@Override
public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData) throws WxPayException {
 try {
  log.debug("微信支付异步通知请求参数:{}", xmlData);
  WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlData);
  log.debug("微信支付异步通知请求解析后的对象:{}", result);
  result.checkResult(this, this.getConfig().getSignType(), false);
  return result;
 } catch (WxPayException e) {
  log.error(e.getMessage(), e);
  throw e;
 } catch (Exception e) {
  log.error(e.getMessage(), e);
  throw new WxPayException("发生异常," + e.getMessage(), e);
 }
}

代码示例来源:origin: jmdhappy/xxpay-master

String xmlResult = IOUtils.toString(request.getInputStream(), request.getCharacterEncoding());
WxPayService wxPayService = new WxPayServiceImpl();
WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlResult);
Map<String, Object> payContext = new HashMap();
payContext.put("parameters", result);

代码示例来源:origin: jmdhappy/xxpay-master

WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlResult);
Map<String, Object> payContext = new HashMap();
payContext.put("parameters", result);
  int updatePayOrderRows = super.baseUpdateStatus4Success(payOrder.getPayOrderId(), result.getTransactionId());
  if (updatePayOrderRows != 1) {
    _log.error("{}更新支付状态失败,将payOrderId={},更新payStatus={}失败", logPrefix, payOrder.getPayOrderId(), PayConstant.PAY_STATUS_SUCCESS);

代码示例来源:origin: binarywang/WxJava

@Override
public void checkResult(WxPayService wxPayService, String signType, boolean checkSuccess) throws WxPayException {
 //防止伪造成功通知
 if (WxPayConstants.ResultCode.SUCCESS.equals(getReturnCode()) && getSign() == null) {
  throw new WxPayException("伪造的通知!");
 }
 
 super.checkResult(wxPayService, signType, checkSuccess);
}

代码示例来源:origin: com.github.binarywang/weixin-java-pay

@Override
public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData) throws WxPayException {
 try {
  log.debug("微信支付异步通知请求参数:{}", xmlData);
  WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlData);
  log.debug("微信支付异步通知请求解析后的对象:{}", result);
  result.checkResult(this, this.getConfig().getSignType(), false);
  return result;
 } catch (WxPayException e) {
  log.error(e.getMessage(), e);
  throw e;
 } catch (Exception e) {
  log.error(e.getMessage(), e);
  throw new WxPayException("发生异常," + e.getMessage(), e);
 }
}

代码示例来源:origin: jmdhappy/xxpay-master

if (!PayConstant.RETURN_VALUE_SUCCESS.equalsIgnoreCase(params.getResultCode())
    && !PayConstant.RETURN_VALUE_SUCCESS.equalsIgnoreCase(params.getReturnCode())) {
  _log.error("returnCode={},resultCode={},errCode={},errCodeDes={}", params.getReturnCode(), params.getResultCode(), params.getErrCode(), params.getErrCodeDes());
  payContext.put("retMsg", "notify data failed");
  return false;
Integer total_fee = params.getTotalFee();   			// 总金额
String out_trade_no = params.getOutTradeNo();			// 商户系统订单号

代码示例来源:origin: jmdhappy/xxpay-master

if (!PayConstant.RETURN_VALUE_SUCCESS.equalsIgnoreCase(params.getResultCode())
    && !PayConstant.RETURN_VALUE_SUCCESS.equalsIgnoreCase(params.getReturnCode())) {
  _log.error("returnCode={},resultCode={},errCode={},errCodeDes={}", params.getReturnCode(), params.getResultCode(), params.getErrCode(), params.getErrCodeDes());
  payContext.put("retMsg", "notify data failed");
  return false;
Integer total_fee = params.getTotalFee();   			// 总金额
String out_trade_no = params.getOutTradeNo();			// 商户系统订单号

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com