Skip to content

Commit

Permalink
feat: 支付有礼-直连商户
Browse files Browse the repository at this point in the history
  • Loading branch information
NotFound403 committed Jun 21, 2023
1 parent 348fe9b commit 5941907
Show file tree
Hide file tree
Showing 24 changed files with 957 additions and 5 deletions.
15 changes: 13 additions & 2 deletions docs/wechat_v3_api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 入口类

`WechatApiProvider`是本项目微信支付的入口类,已被注入**Spring IoC**,由它来初始化微信支付相关的**API**,具体分为**直连商户****服务商**两个体系。
`WechatApiProvider`是本项目微信支付的入口类,已被注入**Spring IoC**,由它来初始化微信支付相关的**API**,具体分为**直连商户
****服务商**两个体系。

> 以下清单请搭配微信支付文档使用。
Expand Down Expand Up @@ -152,7 +153,15 @@

##### 支付有礼

- [ ] 功能实现中……
- [x] `WechatMarketingPayGiftActivityApi` 支付有礼,通过`WechatApiProvider#marketingPayGiftActivityApi`初始化
- [x] `create` 创建全场满额送活动
- [x] `details` 查询活动详情接口
- [x] `merchants` 查询活动发券商户号
- [x] `goods` 查询活动指定商品列表
- [x] `terminate` 终止活动
- [x] `addMches` 新增活动发券商户号
- [x] `page` 获取支付有礼活动列表
- [x] `deleteMch` 删除活动发券商户号

##### 图片上传(营销专用)

Expand Down Expand Up @@ -221,5 +230,7 @@
- [x] `marketingImageUpload` 营销图片上传

> 通过营销**图片上传API**上传图片后可获得图片url地址。图片url可在微信支付营销相关的API使用,包括商家券、代金券、支付有礼等。
### 服务商

施工中……
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/**
* 从配置文件中加载租户信息,默认实现,可被覆盖
*
* @author xiafang
* @author dax
* @since 2023/2/3 11:40
*/
@AllArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import lombok.Getter;

/**
* @author xiafang
* @author dax
* @since 2023/2/1 8:59
*/
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ public WechatMarketingPartnershipApi marketingshipApi(String tenantId) {
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>
Expand Down
Loading

0 comments on commit 5941907

Please sign in to comment.