查询批次详情API

This commit is contained in:
xiafang
2020-11-24 16:52:54 +08:00
parent 623e80ada1
commit 88abacb7cc
5 changed files with 50 additions and 15 deletions

View File

@@ -15,22 +15,22 @@ public enum WechatPayV3Type {
CERT(HttpMethod.GET, "%s/v3/certificates"),
/**
* 微信公众号支付或者小程序支付
* 微信公众号支付或者小程序支付.
*/
JSAPI(HttpMethod.POST, "%s/v3/pay/transactions/jsapi"),
/**
* 微信扫码支付
* 微信扫码支付.
*/
NATIVE(HttpMethod.POST, "%s/v3/pay/transactions/native"),
/**
* 微信APP支付
* 微信APP支付.
*/
APP(HttpMethod.POST, "%s/v3/pay/transactions/app"),
/**
* H5支付
* H5支付.
*/
MWEB(HttpMethod.POST, "%s/v3/pay/transactions/h5"),
@@ -40,7 +40,7 @@ public enum WechatPayV3Type {
*/
MARKETING_FAVOR_STOCKS_COUPON_STOCKS(HttpMethod.POST,"%s/v3/marketing/favor/coupon-stocks"),
/**
* 激活代金券批次API
* 激活代金券批次API.
*/
MARKETING_FAVOR_STOCKS_START(HttpMethod.POST,"%s/v3/marketing/favor/stocks/{stock_id}/start"),
/**
@@ -48,13 +48,17 @@ public enum WechatPayV3Type {
*/
MARKETING_FAVOR_USERS_COUPONS(HttpMethod.POST,"%s/v3/marketing/favor/users/{openid}/coupons"),
/**
* 查询代金券可用商户
* 查询代金券可用商户.
*/
MARKETING_FAVOR_STOCKS_MERCHANTS(HttpMethod.GET, "%s/v3/marketing/favor/stocks/{stock_id}/merchants"),
/**
* 条件查询批次列表API.
*/
MARKETING_FAVOR_STOCKS(HttpMethod.GET, "%s/v3/marketing/favor/stocks");
MARKETING_FAVOR_STOCKS(HttpMethod.GET, "%s/v3/marketing/favor/stocks"),
/**
* 查询批次详情API.
*/
MARKETING_FAVOR_STOCKS_DETAIL(HttpMethod.GET, "%s/v3/marketing/favor/stocks/{stock_id}");

View File

@@ -94,7 +94,7 @@ public class WechatPayV3Api {
* @param stockId the stock id
* @return the wechat response entity
*/
public WechatResponseEntity<ObjectNode> startStocks(String stockId) {
public WechatResponseEntity<ObjectNode> startStock(String stockId) {
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
wechatPayV3Client.withType(WechatPayV3Type.MARKETING_FAVOR_STOCKS_START, stockId)
.function(this::startStocksFunction)
@@ -103,6 +103,21 @@ public class WechatPayV3Api {
return wechatResponseEntity;
}
/**
* 查询批次详情API.
*
* @param stockId the stock id
* @return the wechat response entity
*/
public WechatResponseEntity<ObjectNode> stockDetail(String stockId) {
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
wechatPayV3Client.withType(WechatPayV3Type.MARKETING_FAVOR_STOCKS_DETAIL, stockId)
.function(this::startStocksFunction)
.consumer(wechatResponseEntity::convert)
.request();
return wechatResponseEntity;
}
private RequestEntity<?> startStocksFunction(WechatPayV3Type type, String stockId) {
WechatPayProperties.V3 v3 = wechatMetaBean.getWechatPayProperties().getV3();

View File

@@ -3,11 +3,23 @@ package com.enongm.dianji.payment.wechat.v3.model;
import lombok.Data;
/**
* 固定面额满减券使用规则, stock_type为NORMAL时必填
*
* 满transactionMinimum 减少 couponAmount
*
*/
@Data
public class FixedNormalCoupon {
/**
* 面额,单位分
*/
private Long couponAmount;
/**
* 门槛 满M元可用
*/
private Long transactionMinimum;
}

View File

@@ -2,6 +2,7 @@ package com.enongm.dianji.payment.wechat.v3.model;
import com.enongm.dianji.payment.wechat.enumeration.CouponBgColor;
import lombok.Data;
/**
* 优惠券样式
@@ -9,6 +10,7 @@ import com.enongm.dianji.payment.wechat.enumeration.CouponBgColor;
* @author Dax
* @since 15:09
*/
@Data
public class PatternInfo {
/**
* 背景色

View File

@@ -2,8 +2,6 @@ package com.enongm.dianji.payment.wechat.v3.model;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 创建优惠券批次参数.
*
@@ -25,13 +23,13 @@ public class StocksCreateParams {
*/
private String belongMerchant;
/**
* 批次开始时间
* 批次开始时间 rfc 3339 YYYY-MM-DDTHH:mm:ss.sss+TIMEZONE
*/
private LocalDateTime availableBeginTime;
private String availableBeginTime;
/**
* 批次结束时间
* 批次结束时间 rfc 3339 YYYY-MM-DDTHH:mm:ss.sss+TIMEZONE
*/
private LocalDateTime availableEndTime;
private String availableEndTime;
/**
* 是否无资金流
*/
@@ -56,5 +54,9 @@ public class StocksCreateParams {
* 核销规则
*/
private CouponUseRule couponUseRule;
/**
* 代金券样式
*/
private PatternInfo patternInfo;
}