@Test public void testEntPay() throws WxPayException { EntPayRequest request = EntPayRequest.newBuilder() .partnerTradeNo("Eb6Aep7uVTdbkJqrP4") .openid("ojOQA0y9o-Eb6Aep7uVTdbkJqrP5") .amount(100) .spbillCreateIp("10.10.10.10") .checkName(CheckNameOption.NO_CHECK) .description("描述信息") .build(); this.logger.info(this.payService.getEntPayService().entPay(request).toString()); }
@Override public EntPayResult entPay(EntPayRequest request) throws WxPayException { request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/mmpaymkttransfers/promotion/transfers"; String responseContent = this.payService.post(url, request.toXML(), true); EntPayResult result = BaseWxPayResult.fromXML(responseContent, EntPayResult.class); result.checkResult(this.payService, request.getSignType(), true); return result; }
EntPayServiceImpl implements EntPayService { @Override public EntPayResult entPay(EntPayRequest request) throws WxPayException { request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/mmpaymkttransfers/promotion/transfers"; String responseContent = this.payService.post(url, request.toXML(), true); EntPayResult result = BaseWxPayResult.fromXML(responseContent, EntPayResult.class); result.checkResult(this.payService, request.getSignType(), true); return result; } }
EntPayServiceImpl implements EntPayService { @Override public EntPayResult entPay(EntPayRequest request) throws WxPayException { request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/mmpaymkttransfers/promotion/transfers"; String responseContent = this.payService.post(url, request.toXML(), true); EntPayResult result = BaseWxPayResult.fromXML(responseContent, EntPayResult.class); result.checkResult(this.payService, request.getSignType(), true); return result; } EntPayServiceImpl(WxPayService payService); }
EntPayServiceImpl implements EntPayService { @Override public EntPayResult entPay(EntPayRequest request) throws WxPayException { request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/mmpaymkttransfers/promotion/transfers"; String responseContent = this.payService.post(url, request.toXML(), true); EntPayResult result = BaseWxPayResult.fromXML(responseContent, EntPayResult.class); result.checkResult(this.payService, request.getSignType(), true); return result; } EntPayServiceImpl(WxPayService payService); @Override EntPayResult entPay(EntPayRequest request); @Override EntPayQueryResult queryEntPay(String partnerTradeNo); @Override String getPublicKey(); @Override EntPayBankResult payBank(EntPayBankRequest request); @Override EntPayBankQueryResult queryPayBank(String partnerTradeNo); static void main(String[] args); }
EntPayServiceImpl implements EntPayService { @Override public EntPayResult entPay(EntPayRequest request) throws WxPayException { request.checkAndSign(this.payService.getConfig()); String url = this.payService.getPayBaseUrl() + "/mmpaymkttransfers/promotion/transfers"; String responseContent = this.payService.post(url, request.toXML(), true); EntPayResult result = BaseWxPayResult.fromXML(responseContent, EntPayResult.class); result.checkResult(this.payService, request.getSignType(), true); return result; } EntPayServiceImpl(WxPayService payService); @Override EntPayResult entPay(EntPayRequest request); @Override EntPayQueryResult queryEntPay(String partnerTradeNo); @Override String getPublicKey(); @Override EntPayBankResult payBank(EntPayBankRequest request); @Override EntPayBankQueryResult queryPayBank(String partnerTradeNo); static void main(String[] args);  }