public class WechatMarketingFavorApi extends AbstractApi
| Constructor and Description |
|---|
WechatMarketingFavorApi(WechatPayClient wechatPayClient,
String tenantId)
Instantiates a new Wechat marketing favor api.
|
| Modifier and Type | Method and Description |
|---|---|
private org.springframework.http.RequestEntity<?> |
couponDetailFunction(WechatPayV3Type type,
CouponDetailsQueryParams params)
Coupon detail function request entity.
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
createStock(StocksCreateParams params)
创建代金券批次API
|
private org.springframework.http.RequestEntity<?> |
createStocksFunction(WechatPayV3Type type,
StocksCreateParams params)
Create stocks function request entity.
|
private org.springframework.http.RequestEntity<?> |
downloadFlowFunction(WechatPayV3Type type,
String stockId)
Download flow function request entity.
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
downloadStockRefundFlow(String stockId)
下载批次退款明细API
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
downloadStockUseFlow(String stockId)
下载批次核销明细API
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
marketingImageUpload(org.springframework.web.multipart.MultipartFile file)
营销图片上传API
|
private org.springframework.http.RequestEntity<?> |
marketingImageUploadFunction(WechatPayV3Type type,
org.springframework.web.multipart.MultipartFile file)
Marketing image upload function request entity.
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
pauseStock(String stockId)
暂停代金券批次API
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
queryCouponDetails(CouponDetailsQueryParams params)
查询代金券详情API
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
queryMerchantsByStockId(MchQueryParams params)
查询代金券可用商户API
|
private org.springframework.http.RequestEntity<?> |
queryMerchantsByStockIdFunction(WechatPayV3Type type,
MchQueryParams params)
Query stocks function request entity.
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
queryStockDetail(String stockId)
查询批次详情API
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
queryStockItems(MchQueryParams params)
查询代金券可用单品API
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
queryStocksByMch(StocksQueryParams params)
条件查询批次列表API
|
private org.springframework.http.RequestEntity<?> |
queryStocksByMchFunction(WechatPayV3Type type,
StocksQueryParams params)
Query stocks function request entity.
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
queryUserCouponsByMchId(UserCouponsQueryParams params)
根据商户号查用户的券API
|
private org.springframework.http.RequestEntity<?> |
queryUserCouponsFunction(WechatPayV3Type type,
UserCouponsQueryParams params)
Query user coupons function request entity.
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
restartStock(String stockId)
重启代金券批次API
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
sendCouponsCard(CouponsCardSendParams params)
发放消费卡API
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
sendStock(StocksSendParams params)
发放代金券API
|
private org.springframework.http.RequestEntity<?> |
sendStocksFunction(WechatPayV3Type type,
StocksSendParams params)
Send stocks function request entity.
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
setMarketingFavorCallback(String notifyUrl)
代金券核销回调通知API。
|
private org.springframework.http.RequestEntity<?> |
setMarketingFavorCallbackFunction(WechatPayV3Type type,
String notifyUrl)
Sets marketing favor callback function.
|
private org.springframework.http.RequestEntity<?> |
startAndRestartAndPauseStockFunction(WechatPayV3Type type,
String stockId)
Start and restart and pause stock function request entity.
|
WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> |
startStock(String stockId)
激活代金券批次API
|
private org.springframework.http.RequestEntity<?> |
stockDetailFunction(WechatPayV3Type type,
String stockId)
Stock detail function request entity.
|
billDownload, billResource, client, container, downloadFundFlowBill, downloadTradeBill, Get, Get, getMapper, Post, Post, tenantId, wechatMetaBeanpublic WechatMarketingFavorApi(WechatPayClient wechatPayClient, String tenantId)
wechatPayClient - the wechat pay clienttenantId - the tenant idpublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> createStock(StocksCreateParams params)
通过调用此接口可创建代金券批次,包括 预充值 和 免充值 类型。
params - the paramsprivate org.springframework.http.RequestEntity<?> createStocksFunction(WechatPayV3Type type, StocksCreateParams params)
type - the typeparams - the paramspublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> startStock(String stockId)
制券成功后,通过调用此接口激活批次,如果是预充值代金券,激活时会从商户账户余额中锁定本批次的营销资金。
stockId - the stock idpublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> sendStock(StocksSendParams params)
商户侧开发时建议增加发放流水记录。
微信支付文档所要求的微信公众号服务号不是必须的,只要你有一个绑定了微信支付商户平台和开放平台的appid即可。
流程为: 1. appid 请求授权微信登录。 2. 登录成功后,开发者在商户侧保存用户 对应此appid的openid。 3. 通过 appid - openid 进行发券。
商户平台/API完成制券后,可使用发放代金券接口发券。通过调用此接口可发放指定批次给指定用户,发券场景可以是小程序、H5、APP等。
注意: • 商户可在H5活动页面、商户小程序、商户APP等自有场景内调用该接口完成发券,商户默认只允许发放本商户号(调用发券接口的商户号)创建的代金券,如需发放其他商户商户创建的代金券,请参考常见问题Q1。
params - the paramsprivate org.springframework.http.RequestEntity<?> sendStocksFunction(WechatPayV3Type type, StocksSendParams params)
type - the typeparams - the paramspublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> pauseStock(String stockId)
通过此接口可暂停指定代金券批次。暂停后,该代金券批次暂停发放,用户无法通过任何渠道再领取该批次的券。
stockId - the stock idpublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> restartStock(String stockId)
通过此接口可重启指定代金券批次。重启后,该代金券批次可以再次发放。
stockId - the stock idprivate org.springframework.http.RequestEntity<?> startAndRestartAndPauseStockFunction(WechatPayV3Type type, String stockId)
type - the typestockId - the stock idpublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> queryStocksByMch(StocksQueryParams params)
通过此接口可查询多个批次的信息,包括批次的配置信息以及批次概况数据。
params - the paramsprivate org.springframework.http.RequestEntity<?> queryStocksByMchFunction(WechatPayV3Type type, StocksQueryParams params)
type - the typeparams - the paramspublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> queryStockDetail(String stockId)
通过此接口可查询批次信息,包括批次的配置信息以及批次概况数据。
stockId - the stock idprivate org.springframework.http.RequestEntity<?> stockDetailFunction(WechatPayV3Type type, String stockId)
type - the typestockId - the stock idpublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> queryCouponDetails(CouponDetailsQueryParams params)
通过此接口可查询代金券信息,包括代金券的基础信息、状态。如代金券已核销,会包括代金券核销的订单信息(订单号、单品信息等)。
2021-1 微信侧不再返回consume_information字段
params - the paramsprivate org.springframework.http.RequestEntity<?> couponDetailFunction(WechatPayV3Type type, CouponDetailsQueryParams params)
type - the typeparams - the paramspublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> queryMerchantsByStockId(MchQueryParams params)
通过调用此接口可查询批次的可用商户号,判断券是否在某商户号可用,来决定是否展示。
params - the paramsprivate org.springframework.http.RequestEntity<?> queryMerchantsByStockIdFunction(WechatPayV3Type type, MchQueryParams params)
type - the typeparams - the paramspublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> queryStockItems(MchQueryParams params)
通过此接口可查询批次的可用商品编码,判断券是否可用于某些商品,来决定是否展示。
params - the paramspublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> queryUserCouponsByMchId(UserCouponsQueryParams params)
可通过该接口查询用户在某商户号可用的全部券,可用于商户的小程序/H5中,用户"我的代金券"或"提交订单页"展示优惠信息。无法查询到微信支付立减金。本接口查不到用户的微信支付立减金(又称“全平台通用券”),即在所有商户都可以使用的券,例如:摇摇乐红包;当按可用商户号查询时,无法查询用户已经核销的券
params - the paramsprivate org.springframework.http.RequestEntity<?> queryUserCouponsFunction(WechatPayV3Type type, UserCouponsQueryParams params)
type - the typeparams - the paramspublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> downloadStockUseFlow(String stockId)
数据结果包含在响应体的 csv 字段中
可获取到某批次的核销明细数据,包括订单号、单品信息、银行流水号等,用于对账/数据分析。
stockId - the stock idAbstractApi#billDownload(String)对账单下载apipublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> downloadStockRefundFlow(String stockId)
数据结果包含在响应体的 csv 字段中
可获取到某批次的退款明细数据,包括订单号、单品信息、银行流水号等,用于对账/数据分析。
stockId - the stock idAbstractApi#billDownload(String)对账单下载apiprivate org.springframework.http.RequestEntity<?> downloadFlowFunction(WechatPayV3Type type, String stockId)
type - the typestockId - the stock idpublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> marketingImageUpload(org.springframework.web.multipart.MultipartFile file)
媒体图片只支持JPG、BMP、PNG格式,文件大小不能超过2M。
通过本接口上传图片后可获得图片url地址。图片url可在微信支付营销相关的API使用,包括商家券、代金券、支付有礼等。
file - the fileprivate org.springframework.http.RequestEntity<?> marketingImageUploadFunction(WechatPayV3Type type, org.springframework.web.multipart.MultipartFile file)
type - the typefile - the filepublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> setMarketingFavorCallback(String notifyUrl)
设置核销回调通知的notifyUrl,notifyUrl需要设置应用白名单。开发者应该对代金券的核销结果进行流水记录。
notifyUrl - the notify urlWechatPayCallback#couponCallback(ResponseSignVerifyParams, Consumer)核销回调private org.springframework.http.RequestEntity<?> setMarketingFavorCallbackFunction(WechatPayV3Type type, String notifyUrl)
type - the typenotifyUrl - the notify urlpublic WechatResponseEntity<com.fasterxml.jackson.databind.node.ObjectNode> sendCouponsCard(CouponsCardSendParams params)
商户通过调用本接口向用户发放消费卡,用户领到卡的同时会领取到一批代金券,消费卡会自动放入卡包中。
注意:
params - the paramsCopyright © 2021. All rights reserved.