mirror of
https://github.com/dromara/payment-spring-boot.git
synced 2026-03-15 22:43:42 +08:00
查询批次详情API
This commit is contained in:
@@ -15,22 +15,22 @@ public enum WechatPayV3Type {
|
|||||||
CERT(HttpMethod.GET, "%s/v3/certificates"),
|
CERT(HttpMethod.GET, "%s/v3/certificates"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信公众号支付或者小程序支付
|
* 微信公众号支付或者小程序支付.
|
||||||
*/
|
*/
|
||||||
JSAPI(HttpMethod.POST, "%s/v3/pay/transactions/jsapi"),
|
JSAPI(HttpMethod.POST, "%s/v3/pay/transactions/jsapi"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信扫码支付
|
* 微信扫码支付.
|
||||||
*/
|
*/
|
||||||
NATIVE(HttpMethod.POST, "%s/v3/pay/transactions/native"),
|
NATIVE(HttpMethod.POST, "%s/v3/pay/transactions/native"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信APP支付
|
* 微信APP支付.
|
||||||
*/
|
*/
|
||||||
APP(HttpMethod.POST, "%s/v3/pay/transactions/app"),
|
APP(HttpMethod.POST, "%s/v3/pay/transactions/app"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* H5支付
|
* H5支付.
|
||||||
*/
|
*/
|
||||||
MWEB(HttpMethod.POST, "%s/v3/pay/transactions/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"),
|
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"),
|
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_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"),
|
MARKETING_FAVOR_STOCKS_MERCHANTS(HttpMethod.GET, "%s/v3/marketing/favor/stocks/{stock_id}/merchants"),
|
||||||
/**
|
/**
|
||||||
* 条件查询批次列表API.
|
* 条件查询批次列表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}");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class WechatPayV3Api {
|
|||||||
* @param stockId the stock id
|
* @param stockId the stock id
|
||||||
* @return the wechat response entity
|
* @return the wechat response entity
|
||||||
*/
|
*/
|
||||||
public WechatResponseEntity<ObjectNode> startStocks(String stockId) {
|
public WechatResponseEntity<ObjectNode> startStock(String stockId) {
|
||||||
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
wechatPayV3Client.withType(WechatPayV3Type.MARKETING_FAVOR_STOCKS_START, stockId)
|
wechatPayV3Client.withType(WechatPayV3Type.MARKETING_FAVOR_STOCKS_START, stockId)
|
||||||
.function(this::startStocksFunction)
|
.function(this::startStocksFunction)
|
||||||
@@ -103,6 +103,21 @@ public class WechatPayV3Api {
|
|||||||
return wechatResponseEntity;
|
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) {
|
private RequestEntity<?> startStocksFunction(WechatPayV3Type type, String stockId) {
|
||||||
WechatPayProperties.V3 v3 = wechatMetaBean.getWechatPayProperties().getV3();
|
WechatPayProperties.V3 v3 = wechatMetaBean.getWechatPayProperties().getV3();
|
||||||
|
|||||||
@@ -3,11 +3,23 @@ package com.enongm.dianji.payment.wechat.v3.model;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 固定面额满减券使用规则, stock_type为NORMAL时必填
|
||||||
|
*
|
||||||
|
* 满transactionMinimum 减少 couponAmount
|
||||||
|
*
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class FixedNormalCoupon {
|
public class FixedNormalCoupon {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面额,单位分
|
||||||
|
*/
|
||||||
private Long couponAmount;
|
private Long couponAmount;
|
||||||
|
/**
|
||||||
|
* 门槛 满M元可用
|
||||||
|
*/
|
||||||
private Long transactionMinimum;
|
private Long transactionMinimum;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.enongm.dianji.payment.wechat.v3.model;
|
|||||||
|
|
||||||
|
|
||||||
import com.enongm.dianji.payment.wechat.enumeration.CouponBgColor;
|
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
|
* @author Dax
|
||||||
* @since 15:09
|
* @since 15:09
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public class PatternInfo {
|
public class PatternInfo {
|
||||||
/**
|
/**
|
||||||
* 背景色
|
* 背景色
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package com.enongm.dianji.payment.wechat.v3.model;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建优惠券批次参数.
|
* 创建优惠券批次参数.
|
||||||
*
|
*
|
||||||
@@ -25,13 +23,13 @@ public class StocksCreateParams {
|
|||||||
*/
|
*/
|
||||||
private String belongMerchant;
|
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 CouponUseRule couponUseRule;
|
||||||
|
/**
|
||||||
|
* 代金券样式
|
||||||
|
*/
|
||||||
|
private PatternInfo patternInfo;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user