Przeglądaj źródła

#1309 增加发送和查询企业微信红包的接口

增加 企业支付密钥的配置参数
dev1
酱油99号 5 lat temu
committed by Binary Wang
rodzic
commit
c70706c9aa
2 zmienionych plików z 6 dodań i 1 usunięć
  1. +4
    -0
      weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
  2. +2
    -1
      weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EntPayServiceImpl.java

+ 4
- 0
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java Wyświetl plik

@@ -51,6 +51,10 @@ public class WxPayConfig {
* 商户密钥.
*/
private String mchKey;
/**
* 企业支付密钥.
*/
private String entPayKey;
/**
* 服务商模式下的子商户号.
*/


+ 2
- 1
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EntPayServiceImpl.java Wyświetl plik

@@ -3,6 +3,7 @@ package com.github.binarywang.wxpay.service.impl;
import com.github.binarywang.wxpay.bean.entpay.*;
import com.github.binarywang.wxpay.bean.request.WxPayDefaultRequest;
import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
import com.github.binarywang.wxpay.constant.WxPayConstants;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.EntPayService;
import com.github.binarywang.wxpay.service.WxPayService;
@@ -135,7 +136,7 @@ public class EntPayServiceImpl implements EntPayService {
public EntPayRedpackResult sendEnterpriseRedpack(EntPayRedpackRequest request) throws WxPayException {
//企业微信签名,需要在请求签名之前
request.setNonceStr(String.valueOf(System.currentTimeMillis()));
request.setWorkWxSign(SignUtils.createEntSign(request.getActName(),request.getMchBillNo(),request.getMchId(),request.getNonceStr(),request.getReOpenid(),request.getTotalAmount(),request.getWxAppId(),"Hcf-X_dzLeaTIyK33okGmODK8sLzc7kLrgkWXOAoMbE","MD5"));
request.setWorkWxSign(SignUtils.createEntSign(request.getActName(), request.getMchBillNo(), request.getMchId(), request.getNonceStr(), request.getReOpenid(), request.getTotalAmount(), request.getWxAppId(), payService.getConfig().getEntPayKey(), WxPayConstants.SignType.MD5));

request.checkAndSign(this.payService.getConfig());



Ładowanie…
Anuluj
Zapisz