mirror of
https://github.com/dromara/payment-spring-boot.git
synced 2026-03-13 21:33:41 +08:00
feat: 支付有礼-直连商户
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
## 入口类
|
||||
|
||||
`WechatApiProvider`是本项目微信支付的入口类,已被注入**Spring IoC**,由它来初始化微信支付相关的**API**,具体分为**直连商户**和**服务商**两个体系。
|
||||
`WechatApiProvider`是本项目微信支付的入口类,已被注入**Spring IoC**,由它来初始化微信支付相关的**API**,具体分为**直连商户
|
||||
**和**服务商**两个体系。
|
||||
|
||||
> 以下清单请搭配微信支付文档使用。
|
||||
|
||||
@@ -152,7 +153,15 @@
|
||||
|
||||
##### 支付有礼
|
||||
|
||||
- [ ] 功能实现中……
|
||||
- [x] `WechatMarketingPayGiftActivityApi` 支付有礼,通过`WechatApiProvider#marketingPayGiftActivityApi`初始化
|
||||
- [x] `create` 创建全场满额送活动
|
||||
- [x] `details` 查询活动详情接口
|
||||
- [x] `merchants` 查询活动发券商户号
|
||||
- [x] `goods` 查询活动指定商品列表
|
||||
- [x] `terminate` 终止活动
|
||||
- [x] `addMches` 新增活动发券商户号
|
||||
- [x] `page` 获取支付有礼活动列表
|
||||
- [x] `deleteMch` 删除活动发券商户号
|
||||
|
||||
##### 图片上传(营销专用)
|
||||
|
||||
@@ -221,5 +230,7 @@
|
||||
- [x] `marketingImageUpload` 营销图片上传
|
||||
|
||||
> 通过营销**图片上传API**上传图片后可获得图片url地址。图片url可在微信支付营销相关的API使用,包括商家券、代金券、支付有礼等。
|
||||
|
||||
### 服务商
|
||||
|
||||
施工中……
|
||||
@@ -34,7 +34,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* 从配置文件中加载租户信息,默认实现,可被覆盖
|
||||
*
|
||||
* @author xiafang
|
||||
* @author dax
|
||||
* @since 2023/2/3 11:40
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.enumeration;
|
||||
|
||||
/**
|
||||
* The enum Activity status.
|
||||
*
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
public enum ActivityStatus {
|
||||
/**
|
||||
* 状态未知
|
||||
*/
|
||||
ACT_STATUS_UNKNOWN,
|
||||
/**
|
||||
* 已创建
|
||||
*/
|
||||
CREATE_ACT_STATUS,
|
||||
/**
|
||||
* 运行中
|
||||
*/
|
||||
ONGOING_ACT_STATUS,
|
||||
/**
|
||||
* 已终止
|
||||
*/
|
||||
TERMINATE_ACT_STATUS,
|
||||
|
||||
/**
|
||||
* 已暂停
|
||||
*/
|
||||
STOP_ACT_STATUS,
|
||||
|
||||
/**
|
||||
* 已过期
|
||||
*/
|
||||
OVER_TIME_ACT_STATUS,
|
||||
|
||||
/**
|
||||
* 创建活动失败
|
||||
*/
|
||||
CREATE_ACT_FAILED
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.enumeration;
|
||||
|
||||
/**
|
||||
* The enum Award type.
|
||||
*
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
public enum AwardType {
|
||||
/**
|
||||
* 商家券
|
||||
*/
|
||||
BUSIFAVOR
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.enumeration;
|
||||
|
||||
/**
|
||||
* The enum Delivery purpose.
|
||||
*
|
||||
* @author felord.cn
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
public enum DeliveryPurpose {
|
||||
/**
|
||||
* 拉用户回店消费
|
||||
*/
|
||||
OFF_LINE_PAY,
|
||||
/**
|
||||
* 引导用户前往小程序消费
|
||||
*/
|
||||
JUMP_MINI_APP
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.enumeration;
|
||||
|
||||
/**
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
public enum DeliveryUserCategory {
|
||||
/**
|
||||
* 所有用户
|
||||
*/
|
||||
DELIVERY_ALL_PERSON,
|
||||
/**
|
||||
* 会员用户
|
||||
*/
|
||||
DELIVERY_MEMBER_PERSON
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.enumeration;
|
||||
|
||||
/**
|
||||
* The enum Send content.
|
||||
*
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
public enum SendContent {
|
||||
/**
|
||||
* 单张券
|
||||
*/
|
||||
SINGLE_COUPON,
|
||||
/**
|
||||
* 礼包
|
||||
*/
|
||||
GIFT_PACKAGE
|
||||
}
|
||||
@@ -20,7 +20,7 @@ package cn.felord.payment.wechat.enumeration;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author xiafang
|
||||
* @author dax
|
||||
* @since 2023/2/1 8:59
|
||||
*/
|
||||
@Getter
|
||||
|
||||
@@ -507,6 +507,55 @@ public enum WechatPayV3Type {
|
||||
*/
|
||||
MARKETING_PARTNERSHIPS_GET(HttpMethod.GET, "%s/v3/marketing/partnerships"),
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/**
|
||||
* 创建全场满额送活动API
|
||||
*
|
||||
* @since 1.0.19.RELEASES
|
||||
*/
|
||||
MARKETING_PAYGIFTACTIVITY(HttpMethod.POST, "%s/v3/marketing/paygiftactivity/unique-threshold-activity"),
|
||||
/**
|
||||
* 查询活动详情接口API
|
||||
*
|
||||
* @since 1.0.19.RELEASES
|
||||
*/
|
||||
MARKETING_PAYGIFTACTIVITY_DETAIL(HttpMethod.GET, "%s/v3/marketing/paygiftactivity/activities/{activity_id}"),
|
||||
/**
|
||||
* 查询活动发券商户号API
|
||||
*
|
||||
* @since 1.0.19.RELEASES
|
||||
*/
|
||||
MARKETING_PAYGIFTACTIVITY_MCH(HttpMethod.GET, "%s/v3/marketing/paygiftactivity/activities/{activity_id}/merchants"),
|
||||
/**
|
||||
* 查询活动指定商品列表API
|
||||
*
|
||||
* @since 1.0.19.RELEASES
|
||||
*/
|
||||
MARKETING_PAYGIFTACTIVITY_GOODS(HttpMethod.GET, "%s/v3/marketing/paygiftactivity/activities/{activity_id}/goods"),
|
||||
/**
|
||||
* 终止活动API
|
||||
*
|
||||
* @since 1.0.19.RELEASES
|
||||
*/
|
||||
MARKETING_PAYGIFTACTIVITY_TERMINATE(HttpMethod.POST, "%s/v3/marketing/paygiftactivity/activities/{activity_id}/terminate"),
|
||||
/**
|
||||
* 新增活动发券商户号API
|
||||
*
|
||||
* @since 1.0.19.RELEASES
|
||||
*/
|
||||
MARKETING_PAYGIFTACTIVITY_MCH_ADD(HttpMethod.POST, "%s/v3/marketing/paygiftactivity/activities/{activity_id}/merchants/add"),
|
||||
/**
|
||||
* 获取支付有礼活动列表API
|
||||
*
|
||||
* @since 1.0.19.RELEASES
|
||||
*/
|
||||
MARKETING_PAYGIFTACTIVITY_ACTIVITIES(HttpMethod.GET, "%s/v3/marketing/paygiftactivity/activities"),
|
||||
/**
|
||||
* 删除活动发券商户号API
|
||||
*
|
||||
* @since 1.0.19.RELEASES
|
||||
*/
|
||||
MARKETING_PAYGIFTACTIVITY_MCH_DEL(HttpMethod.POST, "%s/v3/marketing/paygiftactivity/activities/{activity_id}/merchants/delete"),
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/**
|
||||
* 发起批量转账API.
|
||||
|
||||
@@ -140,6 +140,17 @@ public class WechatApiProvider {
|
||||
return new WechatMarketingPartnershipApi(this.wechatPayClient, tenantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付有礼-直连商户
|
||||
*
|
||||
* @param tenantId the tenant id
|
||||
* @return the wechat marketing pay gift activity api
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
public WechatMarketingPayGiftActivityApi marketingPayGiftActivityApi(String tenantId) {
|
||||
return new WechatMarketingPayGiftActivityApi(this.wechatPayClient, tenantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量转账到零钱.
|
||||
* <p>
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3;
|
||||
|
||||
import cn.felord.payment.wechat.enumeration.WeChatServer;
|
||||
import cn.felord.payment.wechat.enumeration.WechatPayV3Type;
|
||||
import cn.felord.payment.wechat.v3.model.paygiftactivity.ActivitiesListPageRequest;
|
||||
import cn.felord.payment.wechat.v3.model.paygiftactivity.ActivitiesPageRequest;
|
||||
import cn.felord.payment.wechat.v3.model.paygiftactivity.DeleteActivityMchRequest;
|
||||
import cn.felord.payment.wechat.v3.model.paygiftactivity.GiftActivityParams;
|
||||
import cn.felord.payment.wechat.v3.model.paygiftactivity.NewActivityMchRequest;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 支付有礼
|
||||
*
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
public class WechatMarketingPayGiftActivityApi extends AbstractApi {
|
||||
/**
|
||||
* Instantiates a new Abstract api.
|
||||
*
|
||||
* @param wechatPayClient the wechat pay client
|
||||
* @param tenantId the tenant id
|
||||
*/
|
||||
public WechatMarketingPayGiftActivityApi(WechatPayClient wechatPayClient, String tenantId) {
|
||||
super(wechatPayClient, tenantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建全场满额送活动API
|
||||
*
|
||||
* @param params the params
|
||||
* @return the wechat response entity
|
||||
*/
|
||||
public WechatResponseEntity<ObjectNode> create(GiftActivityParams params) {
|
||||
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||
this.client().withType(WechatPayV3Type.MARKETING_PAYGIFTACTIVITY, params)
|
||||
.function((type, activityParams) -> {
|
||||
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
||||
.build()
|
||||
.toUri();
|
||||
return Post(uri, activityParams);
|
||||
})
|
||||
.consumer(wechatResponseEntity::convert)
|
||||
.request();
|
||||
return wechatResponseEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询活动详情接口API
|
||||
*
|
||||
* @param activityId the activity id
|
||||
* @return the wechat response entity
|
||||
*/
|
||||
public WechatResponseEntity<ObjectNode> details(String activityId) {
|
||||
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||
this.client().withType(WechatPayV3Type.MARKETING_PAYGIFTACTIVITY_DETAIL, activityId)
|
||||
.function((type, param) -> {
|
||||
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
||||
.build()
|
||||
.expand(param)
|
||||
.toUri();
|
||||
return Get(uri);
|
||||
})
|
||||
.consumer(wechatResponseEntity::convert)
|
||||
.request();
|
||||
return wechatResponseEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询活动发券商户号API
|
||||
*
|
||||
* @param request the request
|
||||
* @return the wechat response entity
|
||||
*/
|
||||
public WechatResponseEntity<ObjectNode> merchants(ActivitiesPageRequest request) {
|
||||
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||
this.client().withType(WechatPayV3Type.MARKETING_PAYGIFTACTIVITY_MCH, request)
|
||||
.function((type, params) -> {
|
||||
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
||||
.queryParam("offset", params.getOffset())
|
||||
.queryParam("limit", params.getLimit())
|
||||
.build()
|
||||
.expand(params.getActivityId())
|
||||
.toUri();
|
||||
return Get(uri);
|
||||
})
|
||||
.consumer(wechatResponseEntity::convert)
|
||||
.request();
|
||||
return wechatResponseEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询活动指定商品列表API
|
||||
*
|
||||
* @param request the request
|
||||
* @return the wechat response entity
|
||||
*/
|
||||
public WechatResponseEntity<ObjectNode> goods(ActivitiesPageRequest request) {
|
||||
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||
this.client().withType(WechatPayV3Type.MARKETING_PAYGIFTACTIVITY_GOODS, request)
|
||||
.function((type, params) -> {
|
||||
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
||||
.queryParam("offset", params.getOffset())
|
||||
.queryParam("limit", params.getLimit())
|
||||
.build()
|
||||
.expand(params.getActivityId())
|
||||
.toUri();
|
||||
return Get(uri);
|
||||
})
|
||||
.consumer(wechatResponseEntity::convert)
|
||||
.request();
|
||||
return wechatResponseEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 终止活动API
|
||||
*
|
||||
* @param activityId the activity id
|
||||
* @return the wechat response entity
|
||||
*/
|
||||
public WechatResponseEntity<ObjectNode> terminate(String activityId) {
|
||||
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||
this.client().withType(WechatPayV3Type.MARKETING_PAYGIFTACTIVITY_TERMINATE, activityId)
|
||||
.function((type, param) -> {
|
||||
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
||||
.build()
|
||||
.expand(param)
|
||||
.toUri();
|
||||
return Post(uri, Collections.emptyMap());
|
||||
})
|
||||
.consumer(wechatResponseEntity::convert)
|
||||
.request();
|
||||
return wechatResponseEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增活动发券商户号API
|
||||
*
|
||||
* @param request the request
|
||||
* @return the wechat response entity
|
||||
*/
|
||||
public WechatResponseEntity<ObjectNode> addMches(NewActivityMchRequest request) {
|
||||
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||
this.client().withType(WechatPayV3Type.MARKETING_PAYGIFTACTIVITY_MCH_ADD, request)
|
||||
.function((type, params) -> {
|
||||
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
||||
.build()
|
||||
.expand(params.getActivityId())
|
||||
.toUri();
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
body.put("merchant_id_list", params.getMerchantIdList());
|
||||
body.put("add_request_no", params.getAddRequestNo());
|
||||
return Post(uri, body);
|
||||
})
|
||||
.consumer(wechatResponseEntity::convert)
|
||||
.request();
|
||||
return wechatResponseEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付有礼活动列表API
|
||||
*
|
||||
* @param request the request
|
||||
* @return the wechat response entity
|
||||
*/
|
||||
public WechatResponseEntity<ObjectNode> page(ActivitiesListPageRequest request) {
|
||||
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||
this.client().withType(WechatPayV3Type.MARKETING_PAYGIFTACTIVITY_ACTIVITIES, request)
|
||||
.function((type, params) -> {
|
||||
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
||||
.queryParam("offset", params.getOffset())
|
||||
.queryParam("limit", params.getLimit())
|
||||
.queryParam("activity_name", params.getActivityName())
|
||||
.queryParam("activity_status", params.getActivityStatus())
|
||||
.queryParam("award_type", params.getAwardType())
|
||||
.build()
|
||||
.toUri();
|
||||
return Get(uri);
|
||||
})
|
||||
.consumer(wechatResponseEntity::convert)
|
||||
.request();
|
||||
return wechatResponseEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除活动发券商户号API
|
||||
*
|
||||
* @param request the request
|
||||
* @return the wechat response entity
|
||||
*/
|
||||
public WechatResponseEntity<ObjectNode> deleteMch(DeleteActivityMchRequest request) {
|
||||
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||
this.client().withType(WechatPayV3Type.MARKETING_PAYGIFTACTIVITY_MCH_DEL, request)
|
||||
.function((type, params) -> {
|
||||
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
||||
.build()
|
||||
.expand(params.getActivityId())
|
||||
.toUri();
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
body.put("merchant_id_list", params.getMerchantIdList());
|
||||
body.put("delete_request_no", params.getDeleteRequestNo());
|
||||
return Post(uri, body);
|
||||
})
|
||||
.consumer(wechatResponseEntity::convert)
|
||||
.request();
|
||||
return wechatResponseEntity;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.paygiftactivity;
|
||||
|
||||
import cn.felord.payment.wechat.enumeration.ActivityStatus;
|
||||
import cn.felord.payment.wechat.enumeration.AwardType;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
@Data
|
||||
public class ActivitiesListPageRequest {
|
||||
private final long offset;
|
||||
private final long limit;
|
||||
private String activityName;
|
||||
private ActivityStatus activityStatus;
|
||||
private AwardType awardType;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.paygiftactivity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
@Data
|
||||
public class ActivitiesPageRequest {
|
||||
private final String activityId;
|
||||
private Long offset;
|
||||
private Long limit;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.paygiftactivity;
|
||||
|
||||
import cn.felord.payment.wechat.enumeration.CouponBgColor;
|
||||
import cn.felord.payment.wechat.enumeration.DeliveryPurpose;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
/**
|
||||
* The type Activity base info.
|
||||
*
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
@Data
|
||||
public class ActivityBaseInfo {
|
||||
private String activityName;
|
||||
private String activitySecondTitle;
|
||||
private String merchantLogoUrl;
|
||||
private String backgroundColor;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssXXX")
|
||||
private OffsetDateTime beginTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssXXX")
|
||||
private OffsetDateTime endTime;
|
||||
private AvailablePeriods availablePeriods;
|
||||
private String outRequestNo;
|
||||
private DeliveryPurpose deliveryPurpose;
|
||||
private String miniProgramsPath;
|
||||
|
||||
/**
|
||||
* Sets background color.
|
||||
*
|
||||
* @param backgroundColor the background color
|
||||
*/
|
||||
void setBackgroundColor(String backgroundColor) {
|
||||
this.backgroundColor = backgroundColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets background color.
|
||||
*
|
||||
* @param backgroundColor the background color
|
||||
*/
|
||||
public void setBackgroundColor(CouponBgColor backgroundColor) {
|
||||
this.backgroundColor = backgroundColor.getValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.paygiftactivity;
|
||||
|
||||
import cn.felord.payment.wechat.enumeration.DeliveryUserCategory;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
@Data
|
||||
public class AdvancedSetting {
|
||||
private DeliveryUserCategory deliveryUserCategory;
|
||||
private String merchantMemberAppid;
|
||||
private Set<String> goodsTags;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.paygiftactivity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The type Available periods.
|
||||
*
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
@Data
|
||||
public class AvailablePeriods {
|
||||
private List<OffsetDateTimePeriods> availableTime;
|
||||
private List<LocalTimePeriods> availableDayTime;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.paygiftactivity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
@Data
|
||||
public class AwardItem {
|
||||
private final String stock_id;
|
||||
private final String original_image_url;
|
||||
private String thumbnail_url;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.paygiftactivity;
|
||||
|
||||
import cn.felord.payment.wechat.enumeration.AwardType;
|
||||
import cn.felord.payment.wechat.enumeration.SendContent;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 满送活动规则
|
||||
*
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
@Data
|
||||
public class AwardSendRule {
|
||||
private final int transactionAmountMinimum;
|
||||
private final SendContent sendContent;
|
||||
private final AwardType awardType;
|
||||
private final List<AwardItem> awardList;
|
||||
private final String merchantOption;
|
||||
private final List<String> merchantIdList;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.paygiftactivity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
@Data
|
||||
public class DeleteActivityMchRequest {
|
||||
private final String activityId;
|
||||
private String deleteRequestNo;
|
||||
private List<String> merchantIdList;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.paygiftactivity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
@Data
|
||||
public class GiftActivityParams {
|
||||
private final ActivityBaseInfo activityBaseInfo;
|
||||
private final AwardSendRule awardSendRule;
|
||||
private AdvancedSetting advancedSetting;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.paygiftactivity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
/**
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
@Data
|
||||
public class LocalTimePeriods {
|
||||
@JsonFormat(pattern = "HHmmss")
|
||||
private final OffsetDateTime beginDayTime;
|
||||
@JsonFormat(pattern = "HHmmss")
|
||||
private final OffsetDateTime endDayTime;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.paygiftactivity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
@Data
|
||||
public class NewActivityMchRequest {
|
||||
private final String activityId;
|
||||
private final String addRequestNo;
|
||||
private List<String> merchantIdList;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.paygiftactivity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
/**
|
||||
* The type Time periods.
|
||||
*
|
||||
* @author dax
|
||||
* @since 1.0.19.RELEASE
|
||||
*/
|
||||
@Data
|
||||
public class OffsetDateTimePeriods {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssXXX")
|
||||
private final OffsetDateTime beginTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssXXX")
|
||||
private final OffsetDateTime endTime;
|
||||
}
|
||||
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* Website:
|
||||
* https://felord.cn
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.felord.payment.wechat.v3.model.profitsharing;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -5,7 +22,7 @@ import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xiafang
|
||||
* @author dax
|
||||
* @since 2023/1/3 10:27
|
||||
*/
|
||||
@Data
|
||||
|
||||
Reference in New Issue
Block a user