🐛 #2338 【微信支付】营销代金券接口修复pause和restart实现的问题

This commit is contained in:
Lucas
2021-10-06 10:17:07 +08:00
committed by GitHub
parent 56d2b5f57a
commit 3c4e749ea9
5 changed files with 86 additions and 12 deletions

View File

@@ -187,10 +187,10 @@ public interface MarketingFavorService {
* </pre>
*
* @param request 请求对象
* @return FavorCallbacksSaveResult 微信返回的结果信息。
* @return FavorStocksPauseResult 微信返回的结果信息。
* @throws WxPayException the wx pay exception
*/
FavorStocksStartResult pauseFavorStocksV3(String stockId, FavorStocksSetRequest request) throws WxPayException;
FavorStocksPauseResult pauseFavorStocksV3(String stockId, FavorStocksSetRequest request) throws WxPayException;
/**
* <pre>
@@ -200,10 +200,10 @@ public interface MarketingFavorService {
* </pre>
*
* @param request 请求对象
* @return FavorCallbacksSaveResult 微信返回的结果信息。
* @return FavorStocksRestartResult 微信返回的结果信息。
* @throws WxPayException the wx pay exception
*/
FavorStocksStartResult restartFavorStocksV3(String stockId, FavorStocksSetRequest request) throws WxPayException;
FavorStocksRestartResult restartFavorStocksV3(String stockId, FavorStocksSetRequest request) throws WxPayException;
UseNotifyData parseNotifyData(String data, SignatureHeader header) throws WxPayException;

View File

@@ -154,19 +154,19 @@ public class MarketingFavorServiceImpl implements MarketingFavorService {
}
@Override
public FavorStocksStartResult pauseFavorStocksV3(String stockId, FavorStocksSetRequest request) throws WxPayException {
String url = String.format("%s/v3/marketing/favor/stocks/%s/start", this.payService.getPayBaseUrl(), stockId);
public FavorStocksPauseResult pauseFavorStocksV3(String stockId, FavorStocksSetRequest request) throws WxPayException {
String url = String.format("%s/v3/marketing/favor/stocks/%s/pause", this.payService.getPayBaseUrl(), stockId);
RsaCryptoUtil.encryptFields(request, this.payService.getConfig().getVerifier().getValidCertificate());
String result = this.payService.postV3WithWechatpaySerial(url, GSON.toJson(request));
return GSON.fromJson(result, FavorStocksStartResult.class);
return GSON.fromJson(result, FavorStocksPauseResult.class);
}
@Override
public FavorStocksStartResult restartFavorStocksV3(String stockId, FavorStocksSetRequest request) throws WxPayException {
String url = String.format("%s/v3/marketing/favor/stocks/%s/start", this.payService.getPayBaseUrl(), stockId);
public FavorStocksRestartResult restartFavorStocksV3(String stockId, FavorStocksSetRequest request) throws WxPayException {
String url = String.format("%s/v3/marketing/favor/stocks/%s/restart", this.payService.getPayBaseUrl(), stockId);
RsaCryptoUtil.encryptFields(request, this.payService.getConfig().getVerifier().getValidCertificate());
String result = this.payService.postV3WithWechatpaySerial(url, GSON.toJson(request));
return GSON.fromJson(result, FavorStocksStartResult.class);
return GSON.fromJson(result, FavorStocksRestartResult.class);
}
/**