Helius
2021-06-16 5728be2af515b2200e782aa201ca5d4d67d9ea47
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.ibeetl.admin.console.service.pay;
 
import com.ibeetl.admin.console.service.pay.utils.entity.TransfersDto;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
 
/**
 * 微信企业支付测试接口
 */
public class TestApp
{
    private static final Log LOG = LogFactory.getLog(TestApp.class);
 
    public static void main(String[] args)
    {
 
        String appkey = "QUJvGnZT17N4TAQHISnST6mqLJbaAM5F";// 微信商户秘钥, 根据实际情况填写
        String certPath = "D:\\demo\\apiclient_cert.p12";// 微信商户证书路径, 根据实际情况填写
 
        TransfersDto model = new TransfersDto();// 微信接口请求参数, 根据实际情况填写
        //model.setMch_appid("ww969f4340f1dc491d");
        //model.setMch_appid("wx6d7dfd9073dfa875");
        model.setMch_appid("wx9c43b2bf3aad415b");// 申请商户号的appid或商户号绑定的appid
        model.setMchid("1546567611"); // 商户号
        model.setMch_name("湖南小棕熊环保科技有限责任公司"); // 商户名称
        model.setOpenid("orMX-40YnQsdSZd77cF3UYxg8eX4"); // 商户appid下,某用户的openid
        model.setAmount(1); // 企业付款金额,这里单位为元
        model.setDesc("测试企业付款到零钱");
        // 微信官方API文档 https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_2
        //ResultEntity iResult = WechatpayUtil.doTransfers(appkey, certPath, model);
        //LOG.info(iResult);
    }
}