All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.mingsoft.mweixin.service.PayService Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2012-present 铭软科技(mingsoft.net)
 * 本软件及相关文档文件(以下简称“软件”)的版权归 铭软科技 所有
 * 遵循 铭软科技《服务协议》中的《保密条款》
 */

package net.mingsoft.mweixin.service;

import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;

import java.util.Map;

/**
 * @author Binary Wang
 */
public class PayService extends WxPayServiceImpl{

  public WxPayService wxPayService(Map weixinPayConfig) {
	  WxPayConfig payConfig = new WxPayConfig();
//	  payConfig.setAppId("wxa733ea82a763bdb0"); //微信APPID
//	  payConfig.setMchId("1349417401");//微信支付商户号
//	  payConfig.setMchKey("46c93b9bca3a42fcf9e311b65e03efcc");//支付key
//	  payConfig.setKeyPath(BasicUtil.getRealPath("apiclient_cert.p12")); //.p12文件的绝对路径
	  
	  payConfig.setAppId(weixinPayConfig.get("payNo")); //微信APPID
	  payConfig.setMchId(weixinPayConfig.get("payPartner")); //微信支付商户号
	  payConfig.setMchKey(weixinPayConfig.get("payKey")); //支付key
	  
//	  payConfig.setSubAppId(StringUtils.trimToNull(this.properties.getSubAppId()));
//	  payConfig.setSubMchId(StringUtils.trimToNull(this.properties.getSubMchId()));
//	  payConfig.setKeyPath(weixin);
	  
	  WxPayService wxPayService = new WxPayServiceImpl();
	  wxPayService.setConfig(payConfig);
	  return wxPayService;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy