Class WeChatPayService

java.lang.Object
com.bytedesk.wechat.pay.WeChatPayService

@Service public class WeChatPayService extends Object
Author:
kefux.com on 2019/3/15
  • Field Details

    • appId

      @Value("${wechat.pay.appid:}") private String appId
    • key

      @Value("${wechat.pay.key:}") private String key
    • mchId

      @Value("${wechat.pay.mch_id:}") private String mchId
    • notifyUrl

      @Value("${wechat.pay.notify_url:}") private String notifyUrl
    • userService

      @Autowired UserService userService
    • rechargeService

      @Autowired RechargeService rechargeService
    • wechatPayConfig

      @Autowired WeChatPayConfig wechatPayConfig
    • authService

      @Autowired AuthService authService
    • uidUtils

      @Autowired UidUtils uidUtils
  • Constructor Details

    • WeChatPayService

      public WeChatPayService()
  • Method Details

    • unifiedOrder

      public JsonResult<?> unifiedOrder(RechargeRequest request)
      调用微信支付:统一下单api NATIVE方式:模式二 https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=6_5
      Returns:
      json
    • getSign

      public String getSign(String deviceInfo, String body, String nonceStr, String myAppId)
      app支付文档: https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=8_1
    • reSign

      public String reSign(String prepayid, String nonceStr, String timestamp, String packageString, String myAppId)
    • orderQuery

      public JsonResult<?> orderQuery(String outTradeNo)
      订单查询 https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=9_2
      Parameters:
      outTradeNo - no
      Returns:
      json
    • closeOrder

      public JsonResult<?> closeOrder(String outTradeNo)
      关闭订单
      Parameters:
      outTradeNo - no
      Returns:
      json
    • refund

      public JsonResult<?> refund(String outTradeNo)
      申请退款
      Parameters:
      principal - principal
      outTradeNo - no
      Returns:
      json
    • refundQuery

      @GetMapping("/refundquery") public JsonResult<?> refundQuery(String outTradeNo)
      退款查询
      Parameters:
      principal - principal
      outTradeNo - no
      Returns:
      json
    • parseRequest

      public String parseRequest(jakarta.servlet.http.HttpServletRequest request)
      将数据流转换为字符串
      Parameters:
      request - 数据流
      Returns:
      string