微信企业付款

时间:2016-05-18 22:08:41   收藏:0   阅读:419

导入weixin4j-server,weixin4j-base,用的是sdk

runtime ‘com.foxinmy:weixin4j-base:1.6.9‘
runtime ‘com.foxinmy:weixin4j-server:1.1.8‘

付款代码:

WeixinPayAccount payAccount = new WeixinPayAccount(‘AppId‘, ‘商户支付密钥(32位,后台配置)‘, ‘商户号‘)
        Weixin4jSettings settings = new Weixin4jSettings(payAccount, ‘p12证书路径‘)
        WeixinPayProxy weixinPayProxy = new WeixinPayProxy(settings); // 或者自定义传入Weixin4jSettings对象

        CorpPayment corpPayment = new CorpPayment(‘订单号‘, ‘openId‘, CorpPaymentCheckNameType.NO_CHECK, ‘备注‘, 金额, ‘ip地址‘)

        def res = weixinPayProxy.sendCorpPayment(corpPayment)

输出的res是交易号

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!