@Test public void testShorturl() throws Exception { String longUrl = "weixin: String result = this.payService.shorturl(new WxPayShorturlRequest(longUrl)); assertNotNull(result); this.logger.info(result); result = this.payService.shorturl(longUrl); assertNotNull(result); this.logger.info(result); }
@Override public String shorturl(WxPayShorturlRequest request) throws WxPayException { request.checkAndSign(this.getConfig()); String url = this.getPayBaseUrl() + "/tools/shorturl"; String responseContent = this.post(url, request.toXML(), false); WxPayShorturlResult result = BaseWxPayResult.fromXML(responseContent, WxPayShorturlResult.class); result.checkResult(this, request.getSignType(), true); return result.getShortUrl(); }
BaseWxPayServiceImpl implements WxPayService { @Override public String shorturl(WxPayShorturlRequest request) throws WxPayException { request.checkAndSign(this.getConfig()); String url = this.getPayBaseUrl() + "/tools/shorturl"; String responseContent = this.post(url, request.toXML(), false); WxPayShorturlResult result = BaseWxPayResult.fromXML(responseContent, WxPayShorturlResult.class); result.checkResult(this, request.getSignType(), true); return result.getShortUrl(); } }
BaseWxPayServiceImpl implements WxPayService { @Override public String shorturl(WxPayShorturlRequest request) throws WxPayException { request.checkAndSign(this.getConfig()); String url = this.getPayBaseUrl() + "/tools/shorturl"; String responseContent = this.post(url, request.toXML(), false); WxPayShorturlResult result = BaseWxPayResult.fromXML(responseContent, WxPayShorturlResult.class); result.checkResult(this, request.getSignType(), true); return result.getShortUrl(); }  }
BaseWxPayServiceImpl implements WxPayService { @Override public String shorturl(WxPayShorturlRequest request) throws WxPayException { request.checkAndSign(this.getConfig()); String url = this.getPayBaseUrl() + "/tools/shorturl"; String responseContent = this.post(url, request.toXML(), false); WxPayShorturlResult result = BaseWxPayResult.fromXML(responseContent, WxPayShorturlResult.class); result.checkResult(this, request.getSignType(), true); return result.getShortUrl(); }  @Override EntPayService getEntPayService(); @Override void setEntPayService(EntPayService entPayService); @Override WxPayConfig getConfig(); @Override void setConfig(WxPayConfig config); @Override String getPayBaseUrl(); @Override WxPayRefundResult refund(WxPayRefundRequest request); @Override WxPayRefundQueryResult refundQuery(String transactionId, String outTradeNo, String outRefundNo, String refundId); @Override WxPayRefundQueryResult refundQuery(WxPayRefundQueryRequest request); @Override WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData); @Override WxPayRefundNotifyResult parseRefundNotifyResult(String xmlData); @Override WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData); @Override WxPaySendRedpackResult sendRedpack(WxPaySendRedpackRequest request); @Override WxPayRedpackQueryResult queryRedpack(String mchBillNo); @Override WxPayRedpackQueryResult queryRedpack(WxPayRedpackQueryRequest request); @Override WxPayOrderQueryResult queryOrder(String transactionId, String outTradeNo); @Override WxPayOrderQueryResult queryOrder(WxPayOrderQueryRequest request); @Override WxPayOrderCloseResult closeOrder(String outTradeNo); @Override WxPayOrderCloseResult closeOrder(WxPayOrderCloseRequest request); @Override T createOrder(WxPayUnifiedOrderRequest request); @Override WxPayUnifiedOrderResult unifiedOrder(WxPayUnifiedOrderRequest request); @Override @Deprecated Map<String, String> getPayInfo(WxPayUnifiedOrderRequest request); @Override byte[] createScanPayQrcodeMode1(String productId, File logoFile, Integer sideLength); @Override String createScanPayQrcodeMode1(String productId); @Override byte[] createScanPayQrcodeMode2(String codeUrl, File logoFile, Integer sideLength); @Override void report(WxPayReportRequest request); @Override String downloadRawBill(String billDate, String billType, String tarType, String deviceInfo); @Override WxPayBillResult downloadBill(String billDate, String billType, String tarType, String deviceInfo); @Override WxPayBillResult downloadBill(WxPayDownloadBillRequest request); @Override String downloadRawBill(WxPayDownloadBillRequest request); @Override WxPayFundFlowResult downloadFundFlow(String billDate, String accountType, String tarType); @Override WxPayFundFlowResult downloadFundFlow(WxPayDownloadFundFlowRequest request); @Override WxPayMicropayResult micropay(WxPayMicropayRequest request); @Override WxPayOrderReverseResult reverseOrder(WxPayOrderReverseRequest request); @Override String shorturl(WxPayShorturlRequest request); @Override String shorturl(String longUrl); @Override String authcode2Openid(WxPayAuthcode2OpenidRequest request); @Override String authcode2Openid(String authCode); @Override String getSandboxSignKey(); @Override WxPayCouponSendResult sendCoupon(WxPayCouponSendRequest request); @Override WxPayCouponStockQueryResult queryCouponStock(WxPayCouponStockQueryRequest request); @Override WxPayCouponInfoQueryResult queryCouponInfo(WxPayCouponInfoQueryRequest request); @Override WxPayApiData getWxApiData(); @Override String queryComment(Date beginDate, Date endDate, Integer offset, Integer limit); @Override String queryComment(WxPayQueryCommentRequest request); }
BaseWxPayServiceImpl implements WxPayService { @Override public String shorturl(WxPayShorturlRequest request) throws WxPayException { request.checkAndSign(this.getConfig()); String url = this.getPayBaseUrl() + "/tools/shorturl"; String responseContent = this.post(url, request.toXML(), false); WxPayShorturlResult result = BaseWxPayResult.fromXML(responseContent, WxPayShorturlResult.class); result.checkResult(this, request.getSignType(), true); return result.getShortUrl(); }  @Override EntPayService getEntPayService(); @Override void setEntPayService(EntPayService entPayService); @Override WxPayConfig getConfig(); @Override void setConfig(WxPayConfig config); @Override String getPayBaseUrl(); @Override WxPayRefundResult refund(WxPayRefundRequest request); @Override WxPayRefundQueryResult refundQuery(String transactionId, String outTradeNo, String outRefundNo, String refundId); @Override WxPayRefundQueryResult refundQuery(WxPayRefundQueryRequest request); @Override WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData); @Override WxPayRefundNotifyResult parseRefundNotifyResult(String xmlData); @Override WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData); @Override WxPaySendRedpackResult sendRedpack(WxPaySendRedpackRequest request); @Override WxPayRedpackQueryResult queryRedpack(String mchBillNo); @Override WxPayRedpackQueryResult queryRedpack(WxPayRedpackQueryRequest request); @Override WxPayOrderQueryResult queryOrder(String transactionId, String outTradeNo); @Override WxPayOrderQueryResult queryOrder(WxPayOrderQueryRequest request); @Override WxPayOrderCloseResult closeOrder(String outTradeNo); @Override WxPayOrderCloseResult closeOrder(WxPayOrderCloseRequest request); @Override T createOrder(WxPayUnifiedOrderRequest request); @Override WxPayUnifiedOrderResult unifiedOrder(WxPayUnifiedOrderRequest request); @Override @Deprecated Map<String, String> getPayInfo(WxPayUnifiedOrderRequest request); @Override byte[] createScanPayQrcodeMode1(String productId, File logoFile, Integer sideLength); @Override String createScanPayQrcodeMode1(String productId); @Override byte[] createScanPayQrcodeMode2(String codeUrl, File logoFile, Integer sideLength); @Override void report(WxPayReportRequest request); @Override String downloadRawBill(String billDate, String billType, String tarType, String deviceInfo); @Override WxPayBillResult downloadBill(String billDate, String billType, String tarType, String deviceInfo); @Override WxPayBillResult downloadBill(WxPayDownloadBillRequest request); @Override String downloadRawBill(WxPayDownloadBillRequest request); @Override WxPayFundFlowResult downloadFundFlow(String billDate, String accountType, String tarType); @Override WxPayFundFlowResult downloadFundFlow(WxPayDownloadFundFlowRequest request); @Override WxPayMicropayResult micropay(WxPayMicropayRequest request); @Override WxPayOrderReverseResult reverseOrder(WxPayOrderReverseRequest request); @Override String shorturl(WxPayShorturlRequest request); @Override String shorturl(String longUrl); @Override String authcode2Openid(WxPayAuthcode2OpenidRequest request); @Override String authcode2Openid(String authCode); @Override String getSandboxSignKey(); @Override WxPayCouponSendResult sendCoupon(WxPayCouponSendRequest request); @Override WxPayCouponStockQueryResult queryCouponStock(WxPayCouponStockQueryRequest request); @Override WxPayCouponInfoQueryResult queryCouponInfo(WxPayCouponInfoQueryRequest request); @Override WxPayApiData getWxApiData(); @Override String queryComment(Date beginDate, Date endDate, Integer offset, Integer limit); @Override String queryComment(WxPayQueryCommentRequest request);  }