mirror of
https://github.com/dromara/payment-spring-boot.git
synced 2026-04-04 20:47:33 +00:00
Compare commits
65 Commits
1.0.13.REL
...
1.0.16.REL
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
402fda7cf9 | ||
|
|
9cc3e96dff | ||
|
|
9ccbe1e977 | ||
|
|
6b78b30b75 | ||
|
|
bd782503ea | ||
|
|
110b8b5cfc | ||
|
|
55440b1275 | ||
|
|
59be1e96ad | ||
|
|
6534d4c0f6 | ||
|
|
0faa855f90 | ||
|
|
4fc6aad767 | ||
|
|
c55df6f576 | ||
|
|
3398f7e2b7 | ||
|
|
c5d19c68c0 | ||
|
|
4dea6b0afe | ||
|
|
379d007bb4 | ||
|
|
de3cf3d2ae | ||
|
|
9d2f8a7d72 | ||
|
|
e1ec5f1b7c | ||
|
|
d8288cdd3a | ||
|
|
113e531eae | ||
|
|
d91b52ba2b | ||
|
|
1742437c2c | ||
|
|
2f391cc14c | ||
|
|
31bef5bfac | ||
|
|
5d1fd73f2b | ||
|
|
18b6615c44 | ||
|
|
0ebe58ae09 | ||
|
|
2f69023ffd | ||
|
|
a11aae69c3 | ||
|
|
2c28113ee7 | ||
|
|
05a3e83e3e | ||
|
|
2f7e6c6b22 | ||
|
|
9b4193a4f9 | ||
|
|
6e4bfd2192 | ||
|
|
e412760a8e | ||
|
|
02867baa2c | ||
|
|
4c21329ceb | ||
|
|
e1616c5606 | ||
|
|
34d0bed373 | ||
|
|
575bf6e8a2 | ||
|
|
f73be6452e | ||
|
|
a9ab004a96 | ||
|
|
24f270acd6 | ||
|
|
0145a343f9 | ||
|
|
0dd7ca97f7 | ||
|
|
5ef0ff0c85 | ||
|
|
af3ee97c33 | ||
|
|
796cb4c921 | ||
|
|
28b4c9c7a6 | ||
|
|
91597b90ac | ||
|
|
1acdf629d8 | ||
|
|
d8ec62c293 | ||
|
|
37fc29a02c | ||
|
|
8e9f704b89 | ||
|
|
d8ada58822 | ||
|
|
89f12df44a | ||
|
|
0027e6f934 | ||
|
|
565f27988d | ||
|
|
5e050ddbcb | ||
|
|
5a46bbc0a4 | ||
|
|
14553f9ba7 | ||
|
|
ebfc54d1db | ||
|
|
e59c8f4b16 | ||
|
|
a1071d2f86 |
81
.github/workflows/codesee-arch-diagram.yml
vendored
Normal file
81
.github/workflows/codesee-arch-diagram.yml
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release
|
||||
pull_request_target:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
name: CodeSee Map
|
||||
|
||||
jobs:
|
||||
test_map_action:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
name: Run CodeSee Map Analysis
|
||||
steps:
|
||||
- name: checkout
|
||||
id: checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
fetch-depth: 0
|
||||
|
||||
# codesee-detect-languages has an output with id languages.
|
||||
- name: Detect Languages
|
||||
id: detect-languages
|
||||
uses: Codesee-io/codesee-detect-languages-action@latest
|
||||
|
||||
- name: Configure JDK 16
|
||||
uses: actions/setup-java@v2
|
||||
if: ${{ fromJSON(steps.detect-languages.outputs.languages).java }}
|
||||
with:
|
||||
java-version: '16'
|
||||
distribution: 'zulu'
|
||||
|
||||
# CodeSee Maps Go support uses a static binary so there's no setup step required.
|
||||
|
||||
- name: Configure Node.js 14
|
||||
uses: actions/setup-node@v2
|
||||
if: ${{ fromJSON(steps.detect-languages.outputs.languages).javascript }}
|
||||
with:
|
||||
node-version: '14'
|
||||
|
||||
- name: Configure Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
if: ${{ fromJSON(steps.detect-languages.outputs.languages).python }}
|
||||
with:
|
||||
python-version: '3.10'
|
||||
architecture: 'x64'
|
||||
|
||||
- name: Configure Ruby '3.x'
|
||||
uses: ruby/setup-ruby@v1
|
||||
if: ${{ fromJSON(steps.detect-languages.outputs.languages).ruby }}
|
||||
with:
|
||||
ruby-version: '3.0'
|
||||
|
||||
# CodeSee Maps Rust support uses a static binary so there's no setup step required.
|
||||
|
||||
- name: Generate Map
|
||||
id: generate-map
|
||||
uses: Codesee-io/codesee-map-action@latest
|
||||
with:
|
||||
step: map
|
||||
github_ref: ${{ github.ref }}
|
||||
languages: ${{ steps.detect-languages.outputs.languages }}
|
||||
|
||||
- name: Upload Map
|
||||
id: upload-map
|
||||
uses: Codesee-io/codesee-map-action@latest
|
||||
with:
|
||||
step: mapUpload
|
||||
api_token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
|
||||
github_ref: ${{ github.ref }}
|
||||
|
||||
- name: Insights
|
||||
id: insights
|
||||
uses: Codesee-io/codesee-map-action@latest
|
||||
with:
|
||||
step: insights
|
||||
api_token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
|
||||
github_ref: ${{ github.ref }}
|
||||
39
README.md
39
README.md
@@ -1,9 +1,15 @@
|
||||
# 最好用的微信支付V3 Spring Boot 组件
|
||||
[](https://github.com/NotFound403/payment-spring-boot/blob/release/LICENSE)
|
||||
[]()
|
||||
[]()
|
||||
[](https://mvnrepository.com/artifact/cn.felord/payment-spring-boot)
|
||||
[](https://github.com/NotFound403/payment-spring-boot)
|
||||
[](https://github.com/NotFound403/payment-spring-boot)
|
||||
|
||||
为了满足业务中出现app支付、公众号支付、小程序支付等多appid并存的场景,对原有的进行了增强开发出了多租户版本。
|
||||
如果你感觉这个项目不错,请给**Star**以鼓励,谢谢。
|
||||
|
||||
请给[Payment Spring Boot](https://github.com/NotFound403/payment-spring-boot) **Star**以鼓励,谢谢。
|
||||
# 最全最好用的微信支付V3 Spring Boot 组件
|
||||
|
||||
微信支付V3支付,支持微信优惠券,代金券、商家券、智慧商圈、商家转账到零钱、公众号支付、微信小程序支付、分账、支付分、商家券、合单支付、先享卡、电商收付通等全部微信支付功能API,同时满足多个服务商、多个商户开发需求。一键集成,API友好,上手快,欢迎star。
|
||||
|
||||
## Maven 最新中央仓库坐标
|
||||
|
||||
@@ -11,11 +17,20 @@
|
||||
<dependency>
|
||||
<groupId>cn.felord</groupId>
|
||||
<artifactId>payment-spring-boot-starter</artifactId>
|
||||
<version>1.0.13.RELEASE</version>
|
||||
<version>1.0.16.RELEASE</version>
|
||||
</dependency>
|
||||
```
|
||||
## JDK问题
|
||||
|
||||
**推荐使用Open JDK**,原因参见[FBI Warning](https://github.com/NotFound403/payment-spring-boot/issues/5)
|
||||
|
||||
## 文档地址
|
||||
- [payment-spring-boot GitHub文档](https://notfound403.github.io/payment-spring-boot)
|
||||
- [payment-spring-boot Gitee文档](https://felord.gitee.io/payment-spring-boot)
|
||||
|
||||
|
||||
## 目前已经实现所有服务商和直连商户接口
|
||||
|
||||
## 功能
|
||||
- 实现微信支付多商户
|
||||
- 集成支付宝SDK、快速接入Spring Boot
|
||||
- 实现微信支付V3 基础支付
|
||||
@@ -26,12 +41,13 @@
|
||||
- 实现微信支付V3 商家券
|
||||
- 实现微信支付V3 批量转账到零钱
|
||||
|
||||
更多参考[changelog](https://notfound403.github.io/payment-spring-boot/#/changelog)
|
||||
更新日志参考[changelog](https://notfound403.github.io/payment-spring-boot/#/changelog)
|
||||
|
||||
## 核心API结构
|
||||

|
||||
|
||||
- `WechatPartnerProfitsharingApi` 微信支付服务商V3分账
|
||||
- `WechatBrandProfitsharingApi` 微信支付服务商V3连锁品牌分账
|
||||
- `WechatPayCallback` 微信支付V3回调通知工具封装
|
||||
- `WechatAllocationApi` 微信支付V2分账(未来会移除)
|
||||
- `WechatMarketingFavorApi` 微信支付代金券V3
|
||||
@@ -46,8 +62,13 @@
|
||||
- `WechatDirectPayApi` 微信支付直连模式V3普通支付
|
||||
- `WechatPayScoreParkingApi` 微信支付分V3停车服务
|
||||
- `WechatBatchTransferApi` 微信支付V3批量转账到零钱
|
||||
- `WechatPartnerSpecialMchApi` 微信支付V3服务商商户进件
|
||||
- `WechatMediaApi` 微信支付V3媒体上传
|
||||
- `WechatEcommerceApi` 电商收付通
|
||||
- `WechatSmartGuideApi` 服务商或者直连商户-经营能力-支付即服务
|
||||
- `WechatGoldPlanApi` 服务商-经营能力-点金计划
|
||||
|
||||
> 随着版本迭代功能会增加。
|
||||
> 随着版本迭代功能会增加,可通过API注册表类`WechatPayV3Type`进行API接口检索。
|
||||
|
||||
## 开源协议
|
||||
**Apache 2.0**
|
||||
@@ -56,10 +77,6 @@
|
||||
- [GitHub](https://github.com/NotFound403/payment-spring-boot)
|
||||
- [Gitee](https://gitee.com/felord/payment-spring-boot)
|
||||
|
||||
## 文档地址
|
||||
- [payment-spring-boot GitHub文档](https://notfound403.github.io/payment-spring-boot)
|
||||
- [payment-spring-boot Gitee文档](https://felord.gitee.io/payment-spring-boot)
|
||||
|
||||
## QQ交流群
|
||||
为了交流解惑,新建QQ群,可通过扫码进入。
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<dependency>
|
||||
<groupId>cn.felord</groupId>
|
||||
<artifactId>payment-spring-boot-starter</artifactId>
|
||||
<version>1.0.13.RELEASE</version>
|
||||
<version>1.0.16.RELEASE</version>
|
||||
</dependency>
|
||||
```
|
||||
## 采用技术
|
||||
|
||||
@@ -1,3 +1,32 @@
|
||||
## 1.0.15.RELEASE
|
||||
### 微信支付
|
||||
- feat: 增加服务商退款API
|
||||
- feat: 微信服务商分账-连锁品牌分账 [#82](https://github.com/NotFound403/payment-spring-boot/issues/82)
|
||||
- fix: 多租户证书无法复用的问题,刷新时正确移除证书 [#77](https://github.com/NotFound403/payment-spring-boot/issues/77)
|
||||
- fix: 批量转账到零钱API入参NPE问题修复 [#85](https://github.com/NotFound403/payment-spring-boot/issues/85)
|
||||
- fix: 商家券-修改批次预算API请求方法应该为Patch [#79](https://github.com/NotFound403/payment-spring-boot/issues/79)
|
||||
- enhance: 部分时间格式优化,更好地兼容Java Time API
|
||||
- enhance: 微信代金券样式的背景颜色枚举更新 [#84](https://github.com/NotFound403/payment-spring-boot/issues/84)
|
||||
- upgrade: Spring Boot 版本升级到2.7.7
|
||||
|
||||
## 1.0.14.RELEASE
|
||||
### 微信支付
|
||||
- fix: 批量转账到零钱查询BUG [#I5E2X7](https://gitee.com/felord/payment-spring-boot/issues/I5E2X7)
|
||||
- feat: 移除了被标记过期的API,包括基于微信支付V2版本的分账实现,使用相关接口的同学需要针对性的进行迁移
|
||||
- feat: 增加证书绝对路径实现
|
||||
- 配置项增加`certAbsolutePath`字段用来定义证书的绝对路径,优先级高于`certPath`,当这两个路径都不配置时采用classpath路径`wechat/apiclient_cert.p12` [#73](https://github.com/NotFound403/payment-spring-boot/issues/73)
|
||||
#### 服务商
|
||||
- feat: 实现服务商商户进件-特约商户进件相关API
|
||||
- feat: 实现点金计划,适用于服务商
|
||||
- feat: 实现行业方案-电商收付通
|
||||
- feat: 实现行业方案-智慧商圈
|
||||
- feat: 实现其它能力-银行组件(服务商)
|
||||
- enhance: 服务商分账新增下载账单接口
|
||||
- enhance: 新增服务商退款回调接口
|
||||
#### 通用能力
|
||||
- feat: 实现其它能力-图片、视频上传
|
||||
- feat: 支付即服务,适用于服务商和直连商户
|
||||
|
||||
## 1.0.13.RELEASE
|
||||
### 微信支付
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<dependency>
|
||||
<groupId>cn.felord</groupId>
|
||||
<artifactId>payment-spring-boot-starter</artifactId>
|
||||
<version>1.0.13.RELEASE</version>
|
||||
<version>1.0.16.RELEASE</version>
|
||||
</dependency>
|
||||
```
|
||||
> 基于 **Spring Boot 2.x**
|
||||
|
||||
@@ -1,15 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>cn.felord</groupId>
|
||||
<artifactId>payment-spring-boot</artifactId>
|
||||
<version>1.0.13.RELEASE</version>
|
||||
<version>1.0.16.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>payment-spring-boot-autoconfigure</artifactId>
|
||||
<version>1.0.13.RELEASE</version>
|
||||
<version>1.0.16.RELEASE</version>
|
||||
<packaging>jar</packaging>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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.alipay;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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.alipay;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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.autoconfigure;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,12 +13,12 @@
|
||||
* 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.autoconfigure;
|
||||
|
||||
import cn.felord.payment.alipay.AliPayConfiguration;
|
||||
import cn.felord.payment.wechat.WechatPayConfiguration;
|
||||
import cn.felord.payment.wechat.WechatTenantServiceConfiguration;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@@ -28,6 +27,6 @@ import org.springframework.context.annotation.Import;
|
||||
* @since 1.0.0.RELEASE
|
||||
*/
|
||||
@Configuration
|
||||
@Import({WechatPayConfiguration.class, AliPayConfiguration.class})
|
||||
@Import({WechatPayConfiguration.class, WechatTenantServiceConfiguration.class, AliPayConfiguration.class})
|
||||
public class PayConfiguration {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import cn.felord.payment.wechat.v3.KeyPairFactory;
|
||||
import cn.felord.payment.wechat.v3.WechatMetaBean;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 从配置文件中加载租户信息,默认实现,可被覆盖
|
||||
*
|
||||
* @author xiafang
|
||||
* @since 2023/2/3 11:40
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public class InMemoryWechatTenantService implements WechatTenantService {
|
||||
private final WechatPayProperties wechatPayProperties;
|
||||
|
||||
@Override
|
||||
public Set<WechatMetaBean> loadTenants() {
|
||||
Map<String, WechatPayProperties.V3> v3Map = wechatPayProperties.getV3();
|
||||
KeyPairFactory keyPairFactory = new KeyPairFactory();
|
||||
return v3Map.entrySet()
|
||||
.stream()
|
||||
.map(entry -> {
|
||||
WechatPayProperties.V3 v3 = entry.getValue();
|
||||
String tenantId = entry.getKey();
|
||||
String certPath = v3.getCertPath();
|
||||
String certAbsolutePath = v3.getCertAbsolutePath();
|
||||
String mchId = v3.getMchId();
|
||||
Resource resource = certAbsolutePath != null ? new FileSystemResource(certAbsolutePath) :
|
||||
new ClassPathResource(certPath == null ? "wechat/apiclient_cert.p12" : certPath);
|
||||
WechatMetaBean wechatMetaBean = keyPairFactory.initWechatMetaBean(resource, mchId);
|
||||
wechatMetaBean.setV3(v3);
|
||||
wechatMetaBean.setTenantId(tenantId);
|
||||
return wechatMetaBean;
|
||||
})
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,20 +13,18 @@
|
||||
* 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;
|
||||
|
||||
|
||||
import cn.felord.payment.wechat.v3.*;
|
||||
import cn.felord.payment.wechat.v3.SignatureProvider;
|
||||
import cn.felord.payment.wechat.v3.WechatApiProvider;
|
||||
import cn.felord.payment.wechat.v3.WechatMetaContainer;
|
||||
import cn.felord.payment.wechat.v3.WechatPayClient;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Conditional;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* The type Wechat pay configuration.
|
||||
*
|
||||
@@ -35,36 +32,19 @@ import java.util.Map;
|
||||
* @since 1.0.0.RELEASE
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@Conditional(WechatPayConfiguredCondition.class)
|
||||
@EnableConfigurationProperties(WechatPayProperties.class)
|
||||
public class WechatPayConfiguration {
|
||||
/**
|
||||
* The constant CERT_ALIAS.
|
||||
*/
|
||||
private static final String CERT_ALIAS = "Tenpay Certificate";
|
||||
|
||||
/**
|
||||
* 微信支付公私钥 以及序列号等元数据.
|
||||
*
|
||||
* @param wechatPayProperties the wechat pay properties
|
||||
* @param wechatTenantService the wechat tenant service
|
||||
* @return the wechat cert bean
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
WechatMetaContainer wechatMetaContainer(WechatPayProperties wechatPayProperties) {
|
||||
|
||||
Map<String, WechatPayProperties.V3> v3Map = wechatPayProperties.getV3();
|
||||
WechatMetaContainer wechatMetaContainer(WechatTenantService wechatTenantService) {
|
||||
WechatMetaContainer container = new WechatMetaContainer();
|
||||
KeyPairFactory keyPairFactory = new KeyPairFactory();
|
||||
v3Map.keySet().forEach(tenantId -> {
|
||||
WechatPayProperties.V3 v3 = v3Map.get(tenantId);
|
||||
String certPath = v3.getCertPath();
|
||||
String mchId = v3.getMchId();
|
||||
WechatMetaBean wechatMetaBean = keyPairFactory.initWechatMetaBean(certPath, CERT_ALIAS, mchId);
|
||||
wechatMetaBean.setV3(v3);
|
||||
wechatMetaBean.setTenantId(tenantId);
|
||||
container.addWechatMeta(tenantId, wechatMetaBean);
|
||||
});
|
||||
container.addWechatMetas(wechatTenantService.loadTenants());
|
||||
return container;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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;
|
||||
|
||||
@@ -70,6 +68,10 @@ public class WechatPayProperties {
|
||||
* wechat pay certificate Path
|
||||
*/
|
||||
private String certPath;
|
||||
/**
|
||||
* wechat pay absolute certificate Path
|
||||
*/
|
||||
private String certAbsolutePath;
|
||||
/**
|
||||
* your pay server domain
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
import cn.felord.payment.wechat.v3.WechatMetaBean;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 加载租户信息服务
|
||||
*
|
||||
* @author felord.cn
|
||||
* @since 1.0.16.RELEASE
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface WechatTenantService {
|
||||
Set<WechatMetaBean> loadTenants();
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Conditional;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* The type Wechat tenant service configuration.
|
||||
*
|
||||
* @author felord.cn
|
||||
* @since 1.0.16.RELEASE
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@Conditional(WechatPayConfiguredCondition.class)
|
||||
@EnableConfigurationProperties(WechatPayProperties.class)
|
||||
public class WechatTenantServiceConfiguration {
|
||||
|
||||
/**
|
||||
* Wechat tenant service wechat tenant service.
|
||||
*
|
||||
* @param wechatPayProperties the wechat pay properties
|
||||
* @return the wechat tenant service
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public WechatTenantService wechatTenantService(WechatPayProperties wechatPayProperties) {
|
||||
return new InMemoryWechatTenantService(wechatPayProperties);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -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 Business type.
|
||||
*
|
||||
* @author felord.cn
|
||||
* @since 1.0.16.RELEASE
|
||||
*/
|
||||
public enum BusinessType {
|
||||
/**
|
||||
* 代金券批次(暂不支持合作方为商户的场景)
|
||||
*/
|
||||
FAVOR_STOCK,
|
||||
/**
|
||||
* 商家券批次
|
||||
*/
|
||||
BUSIFAVOR_STOCK
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 超级管理员类型
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
public enum ContactType {
|
||||
/**
|
||||
* 经营者或者法人
|
||||
* <p>
|
||||
* 主体为个体工商户/企业/政府机关/事业单位/社会组织
|
||||
*/
|
||||
LEGAL,
|
||||
/**
|
||||
* 经办人
|
||||
* <p>
|
||||
* 经商户授权办理微信支付业务的人员
|
||||
*/
|
||||
SUPER
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -29,42 +28,41 @@ public enum CouponBgColor {
|
||||
/**
|
||||
* Color 010 coupon bg color.
|
||||
*/
|
||||
Color010,
|
||||
COLOR010,
|
||||
/**
|
||||
* Color 020 coupon bg color.
|
||||
* COLOR 020 coupon bg color.
|
||||
*/
|
||||
Color020,
|
||||
COLOR020,
|
||||
/**
|
||||
* Color 030 coupon bg color.
|
||||
* COLOR 030 coupon bg color.
|
||||
*/
|
||||
Color030,
|
||||
COLOR030,
|
||||
/**
|
||||
* Color 040 coupon bg color.
|
||||
* COLOR 040 coupon bg color.
|
||||
*/
|
||||
Color040,
|
||||
COLOR040,
|
||||
/**
|
||||
* Color 050 coupon bg color.
|
||||
* COLOR 050 coupon bg color.
|
||||
*/
|
||||
Color050,
|
||||
COLOR050,
|
||||
/**
|
||||
* Color 060 coupon bg color.
|
||||
* COLOR 060 coupon bg color.
|
||||
*/
|
||||
Color060,
|
||||
COLOR060,
|
||||
/**
|
||||
* Color 070 coupon bg color.
|
||||
* COLOR 070 coupon bg color.
|
||||
*/
|
||||
Color070,
|
||||
COLOR070,
|
||||
/**
|
||||
* Color 080 coupon bg color.
|
||||
* COLOR 080 coupon bg color.
|
||||
*/
|
||||
Color080,
|
||||
COLOR080,
|
||||
/**
|
||||
* Color 090 coupon bg color.
|
||||
* COLOR 090 coupon bg color.
|
||||
*/
|
||||
Color090,
|
||||
COLOR090,
|
||||
/**
|
||||
* Color 100 coupon bg color.
|
||||
* COLOR 100 coupon bg color.
|
||||
*/
|
||||
Color100
|
||||
|
||||
COLOR100
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 金融机构类型需与营业执照/登记证书上一致,可参考选择 <a href="https://kf.qq.com/faq/220215IrMRZ3220215n6buiU.html">金融机构指引</a>。
|
||||
*
|
||||
* @author felord.cn
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
public enum FinanceType {
|
||||
|
||||
/**
|
||||
* 银行业, 适用于商业银行、政策性银行、农村合作银行、村镇银行、开发性金融机构等
|
||||
*/
|
||||
BANK_AGENT,
|
||||
/**
|
||||
* 支付机构, 适用于非银行类支付机构
|
||||
*/
|
||||
PAYMENT_AGENT,
|
||||
/**
|
||||
* 保险业, 适用于保险、保险中介、保险代理、保险经纪等保险类业务
|
||||
*/
|
||||
INSURANCE,
|
||||
/**
|
||||
* 交易及结算类金融机构, 适用于交易所、登记结算类机构、银行卡清算机构、资金清算中心等
|
||||
*/
|
||||
TRADE_AND_SETTLE,
|
||||
/**
|
||||
* 其他金融机构, 适用于财务公司、信托公司、金融资产管理公司、金融租赁公司、汽车金融公司、贷款公司、货币经纪公司、消费金融公司、证券业、金融控股公司、股票、期货、货币兑换、小额贷款公司、金融资产管理、担保公司、商业保理公司、典当行、融资租赁公司、财经咨询等其他金融业务
|
||||
*/
|
||||
OTHER
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 超级管理员证件类型
|
||||
* <p>
|
||||
* 当超级管理员类型是经办人时,请上传超级管理员证件类型。
|
||||
*
|
||||
* @author felord.cn
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
public enum IdDocType {
|
||||
/**
|
||||
* 中国大陆居民-身份证
|
||||
*/
|
||||
IDENTIFICATION_TYPE_IDCARD,
|
||||
/**
|
||||
* 其他国家或地区居民-护照
|
||||
*/
|
||||
IDENTIFICATION_TYPE_OVERSEA_PASSPORT,
|
||||
/**
|
||||
* 中国香港居民-来往内地通行证
|
||||
*/
|
||||
IDENTIFICATION_TYPE_HONGKONG_PASSPORT,
|
||||
/**
|
||||
* 中国澳门居民-来往内地通行证
|
||||
*/
|
||||
IDENTIFICATION_TYPE_MACAO_PASSPORT,
|
||||
/**
|
||||
* 中国台湾居民-来往大陆通行证
|
||||
*/
|
||||
IDENTIFICATION_TYPE_TAIWAN_PASSPORT,
|
||||
/**
|
||||
* 外国人居留证
|
||||
*/
|
||||
IDENTIFICATION_TYPE_FOREIGN_RESIDENT,
|
||||
/**
|
||||
* 港澳居民证
|
||||
*/
|
||||
IDENTIFICATION_TYPE_HONGKONG_MACAO_RESIDENT,
|
||||
/**
|
||||
* 台湾居民证
|
||||
*/
|
||||
IDENTIFICATION_TYPE_TAIWAN_RESIDENT
|
||||
}
|
||||
@@ -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 Partner type.
|
||||
*
|
||||
* @author felord.cn
|
||||
* @since 1.0.16.RELEASE
|
||||
*/
|
||||
public enum PartnerType {
|
||||
/**
|
||||
* 合作方为APPID
|
||||
*/
|
||||
APPID,
|
||||
/**
|
||||
* 合作方为商户
|
||||
*/
|
||||
MERCHANT
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* 合作状态
|
||||
*
|
||||
* @author felord.cn
|
||||
* @since 1.0.16.RELEASE
|
||||
*/
|
||||
public enum PartnershipState {
|
||||
/**
|
||||
* 已建立合作状态
|
||||
*/
|
||||
ESTABLISHED,
|
||||
/**
|
||||
* 已终止合作状态
|
||||
*/
|
||||
TERMINATED
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2021 felord.cn
|
||||
* 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.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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 felord.cn
|
||||
* @see <a href="https://kf.qq.com/faq/180910IBZVnQ180910naQ77b.html">主体类型指引</a>
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
public enum SubjectType {
|
||||
/**
|
||||
* 个体户
|
||||
* <p>
|
||||
* 营业执照上的主体类型一般为个体户、个体工商户、个体经营;
|
||||
*/
|
||||
SUBJECT_TYPE_INDIVIDUAL,
|
||||
/**
|
||||
* 小微商户
|
||||
*/
|
||||
SUBJECT_TYPE_MICRO,
|
||||
/**
|
||||
* 企业
|
||||
* <p>
|
||||
* 营业执照上的主体类型一般为有限公司、有限责任公司;
|
||||
*/
|
||||
SUBJECT_TYPE_ENTERPRISE,
|
||||
/**
|
||||
* 政府机关
|
||||
* <p>
|
||||
* 包括各级、各类政府机关,如机关党委、税务、民政、人社、工商、商务、市监等;
|
||||
*/
|
||||
SUBJECT_TYPE_GOVERNMENT,
|
||||
/**
|
||||
* 事业单位
|
||||
* <p>
|
||||
* 包括国内各类事业单位,如:医疗、教育、学校等单位;
|
||||
*/
|
||||
SUBJECT_TYPE_INSTITUTIONS,
|
||||
/**
|
||||
* 社会组织
|
||||
* <p>
|
||||
* 包括社会团体、民办非企业、基金会、基层群众性自治组织、农村集体经济组织等组织
|
||||
*/
|
||||
SUBJECT_TYPE_OTHERS
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -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.enumeration;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author xiafang
|
||||
* @since 2023/2/1 8:59
|
||||
*/
|
||||
@Getter
|
||||
public enum WechatPayAlgorithms {
|
||||
RSA("WECHATPAY2-SHA256-RSA2048"),
|
||||
SM3("WECHATPAY2-SM2-WITH-SM3");
|
||||
|
||||
private final String algorithm;
|
||||
|
||||
WechatPayAlgorithms(String algorithm) {
|
||||
this.algorithm = algorithm;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
*
|
||||
* Copyright 2019-2022 felord.cn
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,7 +13,6 @@
|
||||
* 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;
|
||||
|
||||
@@ -54,7 +52,18 @@ public enum WechatPayV3Type {
|
||||
* @since 1.0.3.RELEASE
|
||||
*/
|
||||
FUND_FLOW_BILL(HttpMethod.GET, "%s/v3/bill/fundflowbill"),
|
||||
|
||||
/**
|
||||
* 图片上传API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
MERCHANT_MEDIA_IMG(HttpMethod.POST, "%s/v3/merchant/media/upload"),
|
||||
/**
|
||||
* 视频上传API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
MERCHANT_MEDIA_VIDEO(HttpMethod.POST, "%s/v3/merchant/media/video_upload"),
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
/**
|
||||
@@ -449,11 +458,11 @@ public enum WechatPayV3Type {
|
||||
*/
|
||||
MARKETING_BUSI_FAVOR_DISASSOCIATE(HttpMethod.POST, "%s/v3/marketing/busifavor/coupons/disassociate"),
|
||||
/**
|
||||
* 取消关联订单信息API.
|
||||
* 修改批次预算API.
|
||||
*
|
||||
* @since 1.0.4.RELEASES
|
||||
*/
|
||||
MARKETING_BUSI_FAVOR_BUDGET(HttpMethod.POST, "%s/v3/marketing/busifavor/stocks/{stock_id}/budget"),
|
||||
MARKETING_BUSI_FAVOR_BUDGET(HttpMethod.PATCH, "%s/v3/marketing/busifavor/stocks/{stock_id}/budget"),
|
||||
/**
|
||||
* 修改商家券基本信息API.
|
||||
*
|
||||
@@ -484,6 +493,20 @@ public enum WechatPayV3Type {
|
||||
* @since 1.0.13.RELEASES
|
||||
*/
|
||||
MARKETING_BUSI_FAVOR_SUBSIDY_QUERY(HttpMethod.GET, "%s/v3/marketing/busifavor/subsidy/pay-receipts/{subsidy_receipt_id}"),
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/**
|
||||
* 建立合作关系API.
|
||||
*
|
||||
* @since 1.0.16.RELEASES
|
||||
*/
|
||||
MARKETING_PARTNERSHIPS_BUILD(HttpMethod.POST, "%s/v3/marketing/partnerships/build"),
|
||||
/**
|
||||
* 查询合作关系列表API.
|
||||
*
|
||||
* @since 1.0.16.RELEASES
|
||||
*/
|
||||
MARKETING_PARTNERSHIPS_GET(HttpMethod.GET, "%s/v3/marketing/partnerships"),
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/**
|
||||
* 发起批量转账API.
|
||||
@@ -668,7 +691,413 @@ public enum WechatPayV3Type {
|
||||
*
|
||||
* @since 1.0.13.RELEASE
|
||||
*/
|
||||
PROFITSHARING_BILLS(HttpMethod.GET, "%s/v3/profitsharing/bills");
|
||||
PROFITSHARING_BILLS(HttpMethod.GET, "%s/v3/profitsharing/bills"),
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/**
|
||||
* 请求品牌分账API.
|
||||
*
|
||||
* @since 1.0.15.RELEASE
|
||||
*/
|
||||
BRAND_PROFITSHARING_ORDERS(HttpMethod.POST, "%s/v3/brand/profitsharing/orders"),
|
||||
/**
|
||||
* 查询品牌分账结果API.
|
||||
*
|
||||
* @since 1.0.15.RELEASE
|
||||
*/
|
||||
BRAND_PROFITSHARING_RESULT(HttpMethod.GET, "%s/v3/brand/profitsharing/orders"),
|
||||
/**
|
||||
* 请求品牌分账回退API.
|
||||
*
|
||||
* @since 1.0.15.RELEASE
|
||||
*/
|
||||
BRAND_PROFITSHARING_RETURN_ORDERS(HttpMethod.POST, "%s/v3/brand/profitsharing/returnorders"),
|
||||
/**
|
||||
* 查询品牌分账回退结果API.
|
||||
*
|
||||
* @since 1.0.15.RELEASE
|
||||
*/
|
||||
BRAND_PROFITSHARING_RETURN_ORDERS_RESULT(HttpMethod.GET, "%s/v3/brand/profitsharing/returnorders"),
|
||||
/**
|
||||
* 完结品牌分账API.
|
||||
*
|
||||
* @since 1.0.15.RELEASE
|
||||
*/
|
||||
BRAND_PROFITSHARING_FINISH_ORDER(HttpMethod.POST, "%s/v3/brand/profitsharing/finish-order"),
|
||||
/**
|
||||
* 查询订单剩余待分金额API.
|
||||
*
|
||||
* @since 1.0.15.RELEASE
|
||||
*/
|
||||
BRAND_PROFITSHARING_ORDER_AMOUNTS(HttpMethod.GET, "%s/v3/brand/profitsharing/orders/{transaction_id}/amounts"),
|
||||
/**
|
||||
* 查询最大分账比例API.
|
||||
*
|
||||
* @since 1.0.15.RELEASE
|
||||
*/
|
||||
BRAND_CONFIGS(HttpMethod.GET, "%s/v3/brand/profitsharing/brand-configs/{brand_mchid}"),
|
||||
/**
|
||||
* 添加品牌分账接收方API.
|
||||
*
|
||||
* @since 1.0.15.RELEASE
|
||||
*/
|
||||
BRAND_PROFITSHARING_RECEIVERS_ADD(HttpMethod.POST, "%s/v3/brand/profitsharing/receivers/add"),
|
||||
/**
|
||||
* 删除分账接收方API.
|
||||
*
|
||||
* @since 1.0.15.RELEASE
|
||||
*/
|
||||
BRAND_PROFITSHARING_RECEIVERS_DELETE(HttpMethod.POST, "%s/v3/brand/profitsharing/receivers/delete"),
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/**
|
||||
* 服务商-商户进件-特约商户进件-提交申请单API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
SPEC_MCH_APPLY_PARTNER(HttpMethod.POST, "%s/v3/applyment4sub/applyment/"),
|
||||
/**
|
||||
* 服务商-商户进件-特约商户进件-通过业务申请编号查询申请状态API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
SPEC_MCH_APPLY_QUERY_BUSINESS_CODE(HttpMethod.GET, "%s/v3/applyment4sub/applyment/business_code/{business_code}"),
|
||||
/**
|
||||
* 服务商-商户进件-特约商户进件-通过申请单号查询申请状态API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
SPEC_MCH_APPLY_QUERY_APPLYMENT_ID(HttpMethod.GET, "%s/v3/applyment4sub/applyment/applyment_id/{applyment_id}"),
|
||||
/**
|
||||
* 服务商-商户进件-特约商户进件-修改结算账号API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
SPEC_MCH_SUB_MODIFY(HttpMethod.POST, "%s/v3/apply4sub/sub_merchants/{sub_mchid}/modify-settlement"),
|
||||
/**
|
||||
* 服务商-商户进件-特约商户进件-查询结算账户API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
SPEC_MCH_SUB_SETTLEMENT(HttpMethod.GET, "%s/v3/apply4sub/sub_merchants/{sub_mchid}/settlement"),
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/**
|
||||
* 经营能力-支付即服务-服务人员注册API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
SMART_GUIDES(HttpMethod.POST, "%s/v3/smartguide/guides"),
|
||||
/**
|
||||
* 经营能力-支付即服务-服务人员分配API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
SMART_GUIDES_ASSIGN(HttpMethod.POST, "%s/v3/smartguide/guides/{guide_id}/assign"),
|
||||
/**
|
||||
* 经营能力-支付即服务-服务人员查询API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
SMART_GUIDES_GET(HttpMethod.GET, "%s/v3/smartguide/guides"),
|
||||
/**
|
||||
* 经营能力-支付即服务-服务人员查询API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
SMART_GUIDES_MODIFY(HttpMethod.PATCH, "%s/v3/smartguide/guides/{guide_id}"),
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/**
|
||||
* 经营能力-点金计划-点金计划管理API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
GOLD_PLAN_CHANGE(HttpMethod.POST, "%s/v3/goldplan/merchants/changegoldplanstatus"),
|
||||
/**
|
||||
* 经营能力-点金计划-商家小票管理API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
GOLD_PLAN_CHANGE_CUSTOM(HttpMethod.POST, "%s/v3/goldplan/merchants/changecustompagestatus"),
|
||||
/**
|
||||
* 经营能力-点金计划-同业过滤标签管理API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
GOLD_PLAN_FILTER(HttpMethod.POST, "%s/v3/goldplan/merchants/set-advertising-industry-filter"),
|
||||
/**
|
||||
* 经营能力-点金计划-开通广告展示API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
GOLD_PLAN_ADV_OPEN(HttpMethod.POST, "%s/v3/goldplan/merchants/open-advertising-show"),
|
||||
/**
|
||||
* 经营能力-点金计划-关闭广告展示API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
GOLD_PLAN_ADV_CLOSE(HttpMethod.POST, "%s/v3/goldplan/merchants/close-advertising-show"),
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/**
|
||||
* 行业方案-电商收付通-商户进件-二级商户进件申请API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_APPLYMENT(HttpMethod.POST, "%s/v3/ecommerce/applyments/"),
|
||||
/**
|
||||
* 行业方案-电商收付通-商户进件-查询申请状态-通过申请单ID查询申请状态API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_APPLYMENT_ID(HttpMethod.GET, "%s/v3/ecommerce/applyments/{applyment_id}"),
|
||||
/**
|
||||
* 行业方案-电商收付通-商户进件-查询申请状态-通过业务申请编号查询申请状态API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_APPLYMENT_OUT_REQUEST_NO(HttpMethod.GET, "%s/v3/ecommerce/applyments/out-request-no/{out_request_no}"),
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/**
|
||||
* 行业方案-电商收付通-分账-请求分账API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_PROFITSHARING_ORDERS(HttpMethod.POST, "%s/v3/ecommerce/profitsharing/orders"),
|
||||
/**
|
||||
* 行业方案-电商收付通-分账-查询分账结果API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_PROFITSHARING_RESULT(HttpMethod.GET, "%s/v3/ecommerce/profitsharing/orders"),
|
||||
/**
|
||||
* 行业方案-电商收付通-分账-请求分账回退API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_PROFITSHARING_RETURN_ORDERS(HttpMethod.POST, "%s/v3/ecommerce/profitsharing/returnorders"),
|
||||
/**
|
||||
* 行业方案-电商收付通-分账-查询分账回退结果API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_PROFITSHARING_RETURN_ORDERS_RESULT(HttpMethod.GET, "%s/v3/ecommerce/profitsharing/returnorders"),
|
||||
/**
|
||||
* 行业方案-电商收付通-分账-完结分账API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_PROFITSHARING_FINISH_ORDER(HttpMethod.POST, "%s/v3/ecommerce/profitsharing/finish-order"),
|
||||
/**
|
||||
* 行业方案-电商收付通-分账-查询订单剩余待分金额API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_PROFITSHARING_ORDER_AMOUNTS(HttpMethod.GET, "%s/v3/ecommerce/profitsharing/orders/{transaction_id}/amounts"),
|
||||
/**
|
||||
* 行业方案-电商收付通-分账-添加分账接收方API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_PROFITSHARING_RECEIVERS_ADD(HttpMethod.POST, "%s/v3/ecommerce/profitsharing/receivers/add"),
|
||||
/**
|
||||
* 行业方案-电商收付通-分账-删除分账接收方API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_PROFITSHARING_RECEIVERS_DELETE(HttpMethod.POST, "%s/v3/ecommerce/profitsharing/receivers/delete"),
|
||||
/**
|
||||
* 行业方案-电商收付通-补差-请求补差API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_SUBSIDIES_CREATE(HttpMethod.POST, "%s/v3/ecommerce/subsidies/create"),
|
||||
/**
|
||||
* 行业方案-电商收付通-补差-请求补差回退API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_SUBSIDIES_RETURN(HttpMethod.POST, "%s/v3/ecommerce/subsidies/return"),
|
||||
/**
|
||||
* 行业方案-电商收付通-补差-取消补差API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_SUBSIDIES_CANCEL(HttpMethod.POST, "%s/v3/ecommerce/subsidies/cancel"),
|
||||
/**
|
||||
* 行业方案-电商收付通-退款-申请退款API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_REFUNDS_APPLY(HttpMethod.POST, "%s/v3/ecommerce/refunds/apply"),
|
||||
/**
|
||||
* 行业方案-电商收付通-退款-查询退款API-通过微信支付退款单号查询退款.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_REFUNDS_ID(HttpMethod.GET, "%s/v3/ecommerce/refunds/id/{refund_id}"),
|
||||
/**
|
||||
* 行业方案-电商收付通-退款-查询退款API-通过商户退款单号查询退款.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_REFUNDS_OUT_REFUND_NO(HttpMethod.GET, "%s/v3/ecommerce/refunds/out-refund-no/{out_refund_no}"),
|
||||
/**
|
||||
* 行业方案-电商收付通-退款-垫付退款回补API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_REFUNDS_RETURN_ADVANCE(HttpMethod.POST, "%s/v3/ecommerce/refunds/{refund_id}/return-advance"),
|
||||
/**
|
||||
* 行业方案-电商收付通-退款-查询垫付回补结果API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_REFUNDS_RETURN_ADVANCE_RESULT(HttpMethod.GET, "%s/v3/ecommerce/refunds/{refund_id}/return-advance"),
|
||||
/**
|
||||
* 行业方案-电商收付通-余额查询-查询二级商户账户实时余额API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_BALANCE_REAL_TIME(HttpMethod.GET, "%s/v3/ecommerce/fund/balance/{sub_mchid}"),
|
||||
/**
|
||||
* 行业方案-电商收付通-余额查询-查询二级商户账户日终余额API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_BALANCE_END_DAY(HttpMethod.GET, "%s/v3/ecommerce/fund/enddaybalance/{sub_mchid}"),
|
||||
/**
|
||||
* 行业方案-电商收付通-余额查询-查询电商平台账户实时余额API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_BALANCE_TYPE_REAL_TIME(HttpMethod.GET, "%s/v3/merchant/fund/balance/{account_type}"),
|
||||
/**
|
||||
* 行业方案-电商收付通-余额查询-查询电商平台账户日终余额API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_BALANCE_TYPE_END_DAY(HttpMethod.GET, "%s/v3/merchant/fund/dayendbalance/{account_type}"),
|
||||
/**
|
||||
* 行业方案-电商收付通-商户提现-二级商户预约提现.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_WITHDRAW(HttpMethod.POST, "%s/v3/ecommerce/fund/withdraw"),
|
||||
/**
|
||||
* 行业方案-电商收付通-商户提现-二级商户查询预约提现状态API-微信支付预约提现单号查询.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_WITHDRAW_ID(HttpMethod.GET, "%s/v3/ecommerce/fund/withdraw/{withdraw_id}"),
|
||||
/**
|
||||
* 行业方案-电商收付通-商户提现-二级商户查询预约提现状态API-商户预约提现单号查询.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_WITHDRAW_OUT_REQUEST_NO(HttpMethod.GET, "%s/v3/ecommerce/fund/withdraw/out-request-no/{out_request_no}"),
|
||||
/**
|
||||
* 行业方案-电商收付通-商户提现-电商平台预约提现API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_MERCHANT_WITHDRAW(HttpMethod.POST, "%s/v3/merchant/fund/withdraw"),
|
||||
/**
|
||||
* 行业方案-电商收付通-商户提现-电商平台查询预约提现状态API-微信支付预约提现单号查询.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_MERCHANT_WITHDRAW_ID(HttpMethod.GET, "%s/v3/merchant/fund/withdraw/withdraw-id/{withdraw_id}"),
|
||||
/**
|
||||
* 行业方案-电商收付通-商户提现-电商平台查询预约提现状态API-商户预约提现单号查询.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_WITHDRAW_MERCHANT_OUT_REQUEST_NO(HttpMethod.GET, "%s/v3/merchant/fund/withdraw/out-request-no/{out_request_no}"),
|
||||
/**
|
||||
* 行业方案-电商收付通-商户提现-按日下载提现异常文件API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_WITHDRAW_ERROR_BILL(HttpMethod.GET, "%s/v3/merchant/fund/withdraw/bill-type/{bill_type}"),
|
||||
/**
|
||||
* 行业方案-电商收付通-下载账单-申请二级商户资金账单API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_FLOW_BILL(HttpMethod.GET, "%s/v3/ecommerce/bill/fundflowbill"),
|
||||
/**
|
||||
* 行业方案-电商收付通-跨境付款-查询订单剩余可出境余额API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_OVERSEA_BALANCE(HttpMethod.GET, "%s/v3/funds-to-oversea/transactions/{transaction_id}/available_abroad_amounts"),
|
||||
/**
|
||||
* 行业方案-电商收付通-跨境付款-申请资金出境API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_OVERSEA_ORDERS(HttpMethod.POST, "%s/v3/funds-to-oversea/orders"),
|
||||
/**
|
||||
* 行业方案-电商收付通-跨境付款-查询出境结果API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_OVERSEA_ORDERS_RESULT(HttpMethod.GET, "%s/v3/funds-to-oversea/orders/{out_order_id}"),
|
||||
/**
|
||||
* 行业方案-电商收付通-跨境付款-获取购付汇账单文件下载链接API.
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
ECOMMERCE_FUND_OVERSEA_BILLS(HttpMethod.GET, "%s/v3/funds-to-oversea/bill-download-url"),
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/**
|
||||
* 智慧商圈-商圈积分同步API
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
MALL_SCORE_SYNC(HttpMethod.POST, "%s/v3/businesscircle/points/notify"),
|
||||
/**
|
||||
* 智慧商圈-商圈积分同步API
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
MALL_SCORE_RESULT(HttpMethod.GET, "%s/v3/businesscircle/user-authorizations/{openid}"),
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/**
|
||||
* 获取对私银行卡号开户银行API
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
CAPITAL_SEARCH(HttpMethod.GET, "%s/v3/capital/capitallhh/banks/search-banks-by-bank-account"),
|
||||
/**
|
||||
* 查询支持个人业务的银行列表API
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
CAPITAL_PERSONAL(HttpMethod.GET, "%s/v3/capital/capitallhh/banks/personal-banking"),
|
||||
/**
|
||||
* 查询支持对公业务的银行列表API
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
CAPITAL_CORPORATE(HttpMethod.GET, "%s/v3/capital/capitallhh/banks/corporate-banking"),
|
||||
/**
|
||||
* 查询省份列表API
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
CAPITAL_PROVINCES(HttpMethod.GET, "%s/v3/capital/capitallhh/areas/provinces"),
|
||||
/**
|
||||
* 查询城市列表API
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
CAPITAL_CITIES(HttpMethod.GET, "%s/v3/capital/capitallhh/areas/provinces/{province_code}/cities"),
|
||||
/**
|
||||
* 查询支行列表API
|
||||
*
|
||||
* @since 1.0.14.RELEASE
|
||||
*/
|
||||
CAPITAL_BRANCHES(HttpMethod.GET, "%s/v3/capital/capitallhh/banks/{bank_alias_code}/branches");
|
||||
|
||||
/**
|
||||
* The Pattern.
|
||||
*
|
||||
|
||||
@@ -1,249 +0,0 @@
|
||||
/*
|
||||
* 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.v2;
|
||||
|
||||
import cn.felord.payment.wechat.WechatPayProperties;
|
||||
import cn.felord.payment.wechat.v2.model.BaseModel;
|
||||
import cn.felord.payment.wechat.v2.model.allocation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpMethod;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 微信支付分账
|
||||
* <p>
|
||||
*
|
||||
* @author felord.cn
|
||||
* @since 1.0.10.RELEASE
|
||||
*/
|
||||
@Slf4j
|
||||
public class WechatAllocationApi {
|
||||
/**
|
||||
* The constant MAPPER.
|
||||
*/
|
||||
private static final ObjectMapper MAPPER = new ObjectMapper();
|
||||
|
||||
static {
|
||||
MAPPER.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE)
|
||||
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
|
||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
||||
.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true)
|
||||
.registerModule(new JavaTimeModule());
|
||||
}
|
||||
|
||||
private final WechatV2Client wechatV2Client;
|
||||
|
||||
/**
|
||||
* Instantiates a new Wechat allocation api.
|
||||
*
|
||||
* @param wechatV2Client the wechat v 2 client
|
||||
*/
|
||||
public WechatAllocationApi(WechatV2Client wechatV2Client) {
|
||||
this.wechatV2Client = wechatV2Client;
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求单次分账
|
||||
*
|
||||
* @param profitSharingModel the profit sharing model
|
||||
* @return json node
|
||||
*/
|
||||
@SneakyThrows
|
||||
public JsonNode profitSharing(ProfitSharingModel profitSharingModel) {
|
||||
ProfitSharingSModel model = new ProfitSharingSModel();
|
||||
List<Receiver> receivers = profitSharingModel.getReceivers();
|
||||
model.setReceivers(MAPPER.writeValueAsString(receivers));
|
||||
|
||||
WechatPayProperties.V3 v3 = wechatV2Client.getWechatMetaBean().getV3();
|
||||
model.setAppid(v3.getAppId());
|
||||
model.setMchId(v3.getMchId());
|
||||
|
||||
model.setTransactionId(profitSharingModel.getTransactionId());
|
||||
model.setOutOrderNo(profitSharingModel.getOutOrderNo());
|
||||
|
||||
model.certPath(v3.getCertPath());
|
||||
model.signType(BaseModel.HMAC_SHA256);
|
||||
return wechatV2Client.wechatPayRequest(model,
|
||||
HttpMethod.POST,
|
||||
"https://api.mch.weixin.qq.com/secapi/pay/profitsharing");
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求单次分账
|
||||
*
|
||||
* @param multiProfitSharingModel the multi profit sharing model
|
||||
* @return json node
|
||||
*/
|
||||
@SneakyThrows
|
||||
public JsonNode multiProfitSharing(MultiProfitSharingModel multiProfitSharingModel) {
|
||||
MultiProfitSharingSModel multiProfitSharingSModel = new MultiProfitSharingSModel();
|
||||
List<Receiver> receivers = multiProfitSharingModel.getReceivers();
|
||||
multiProfitSharingSModel.setReceivers(MAPPER.writeValueAsString(receivers));
|
||||
|
||||
WechatPayProperties.V3 v3 = wechatV2Client.getWechatMetaBean().getV3();
|
||||
multiProfitSharingSModel.setAppid(v3.getAppId());
|
||||
multiProfitSharingSModel.setMchId(v3.getMchId());
|
||||
|
||||
multiProfitSharingSModel.setTransactionId(multiProfitSharingModel.getTransactionId());
|
||||
multiProfitSharingSModel.setOutOrderNo(multiProfitSharingModel.getOutOrderNo());
|
||||
|
||||
multiProfitSharingSModel.certPath(v3.getCertPath());
|
||||
multiProfitSharingSModel.signType(BaseModel.HMAC_SHA256);
|
||||
return wechatV2Client.wechatPayRequest(multiProfitSharingSModel,
|
||||
HttpMethod.POST,
|
||||
"https://api.mch.weixin.qq.com/secapi/pay/multiprofitsharing");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分账结果
|
||||
*
|
||||
* @param profitSharingQueryModel the profit sharing query model
|
||||
* @return json node
|
||||
*/
|
||||
public JsonNode profitSharingQuery(ProfitSharingQueryModel profitSharingQueryModel) {
|
||||
WechatPayProperties.V3 v3 = wechatV2Client.getWechatMetaBean().getV3();
|
||||
profitSharingQueryModel.setMchId(v3.getMchId());
|
||||
profitSharingQueryModel.certPath(v3.getCertPath());
|
||||
profitSharingQueryModel.signType(BaseModel.HMAC_SHA256);
|
||||
return wechatV2Client.wechatPayRequest(profitSharingQueryModel,
|
||||
HttpMethod.POST,
|
||||
"https://api.mch.weixin.qq.com/pay/profitsharingquery");
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分账接收方
|
||||
*
|
||||
* @param profitSharingAddReceiverModel the profit sharing add receiver model
|
||||
* @return json node
|
||||
*/
|
||||
@SneakyThrows
|
||||
public JsonNode profitSharingAddReceiver(ProfitSharingAddReceiverModel profitSharingAddReceiverModel) {
|
||||
ProfitSharingAddReceiverSModel profitSharingAddReceiverSModel = new ProfitSharingAddReceiverSModel();
|
||||
ProfitSharingAddReceiverModel.Receiver receiver = profitSharingAddReceiverModel.getReceiver();
|
||||
profitSharingAddReceiverSModel.setReceiver(MAPPER.writeValueAsString(receiver));
|
||||
|
||||
WechatPayProperties.V3 v3 = wechatV2Client.getWechatMetaBean().getV3();
|
||||
profitSharingAddReceiverSModel.setAppid(v3.getAppId());
|
||||
profitSharingAddReceiverSModel.setMchId(v3.getMchId());
|
||||
|
||||
profitSharingAddReceiverSModel.certPath(v3.getCertPath());
|
||||
profitSharingAddReceiverSModel.signType(BaseModel.HMAC_SHA256);
|
||||
return wechatV2Client.wechatPayRequest(profitSharingAddReceiverSModel,
|
||||
HttpMethod.POST,
|
||||
"https://api.mch.weixin.qq.com/pay/profitsharingaddreceiver");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分账接收方
|
||||
*
|
||||
* @param profitSharingRemoveReceiverModel the profit sharing remove receiver model
|
||||
* @return json node
|
||||
*/
|
||||
@SneakyThrows
|
||||
public JsonNode profitSharingRemoveReceiver(ProfitSharingRemoveReceiverModel profitSharingRemoveReceiverModel) {
|
||||
ProfitSharingRemoveReceiverSModel profitSharingRemoveReceiverSModel = new ProfitSharingRemoveReceiverSModel();
|
||||
ProfitSharingRemoveReceiverModel.Receiver receiver = profitSharingRemoveReceiverModel.getReceiver();
|
||||
profitSharingRemoveReceiverSModel.setReceiver(MAPPER.writeValueAsString(receiver));
|
||||
|
||||
WechatPayProperties.V3 v3 = wechatV2Client.getWechatMetaBean().getV3();
|
||||
profitSharingRemoveReceiverSModel.setAppid(v3.getAppId());
|
||||
profitSharingRemoveReceiverSModel.setMchId(v3.getMchId());
|
||||
|
||||
profitSharingRemoveReceiverSModel.certPath(v3.getCertPath());
|
||||
profitSharingRemoveReceiverSModel.signType(BaseModel.HMAC_SHA256);
|
||||
return wechatV2Client.wechatPayRequest(profitSharingRemoveReceiverSModel,
|
||||
HttpMethod.POST,
|
||||
"https://api.mch.weixin.qq.com/pay/profitsharingremovereceiver");
|
||||
}
|
||||
|
||||
/**
|
||||
* 完结分账
|
||||
*
|
||||
* @param profitSharingFinishModel the profit sharing finish model
|
||||
* @return json node
|
||||
*/
|
||||
public JsonNode profitSharingFinish(ProfitSharingFinishModel profitSharingFinishModel) {
|
||||
WechatPayProperties.V3 v3 = wechatV2Client.getWechatMetaBean().getV3();
|
||||
profitSharingFinishModel.setAppid(v3.getAppId());
|
||||
profitSharingFinishModel.setMchId(v3.getMchId());
|
||||
profitSharingFinishModel.certPath(v3.getCertPath());
|
||||
profitSharingFinishModel.signType(BaseModel.HMAC_SHA256);
|
||||
return wechatV2Client.wechatPayRequest(profitSharingFinishModel,
|
||||
HttpMethod.POST,
|
||||
"https://api.mch.weixin.qq.com/secapi/pay/profitsharingfinish");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单待分账金额
|
||||
*
|
||||
* @param profitSharingOrderAmountQueryModel the profit sharing order amount query model
|
||||
* @return json node
|
||||
*/
|
||||
public JsonNode profitSharingOrderAmountQuery(ProfitSharingOrderAmountQueryModel profitSharingOrderAmountQueryModel) {
|
||||
WechatPayProperties.V3 v3 = wechatV2Client.getWechatMetaBean().getV3();
|
||||
profitSharingOrderAmountQueryModel.setMchId(v3.getMchId());
|
||||
profitSharingOrderAmountQueryModel.certPath(v3.getCertPath());
|
||||
profitSharingOrderAmountQueryModel.signType(BaseModel.HMAC_SHA256);
|
||||
return wechatV2Client.wechatPayRequest(profitSharingOrderAmountQueryModel,
|
||||
HttpMethod.POST,
|
||||
"https://api.mch.weixin.qq.com/pay/profitsharingorderamountquery");
|
||||
}
|
||||
|
||||
/**
|
||||
* 分账回退
|
||||
*
|
||||
* @param profitSharingReturnModel the profit sharing return model
|
||||
* @return json node
|
||||
*/
|
||||
public JsonNode profitSharingReturn(ProfitSharingReturnModel profitSharingReturnModel) {
|
||||
WechatPayProperties.V3 v3 = wechatV2Client.getWechatMetaBean().getV3();
|
||||
profitSharingReturnModel.setAppid(v3.getAppId());
|
||||
profitSharingReturnModel.setMchId(v3.getMchId());
|
||||
profitSharingReturnModel.certPath(v3.getCertPath());
|
||||
profitSharingReturnModel.signType(BaseModel.HMAC_SHA256);
|
||||
return wechatV2Client.wechatPayRequest(profitSharingReturnModel,
|
||||
HttpMethod.POST,
|
||||
"https://api.mch.weixin.qq.com/secapi/pay/profitsharingreturn");
|
||||
}
|
||||
|
||||
/**
|
||||
* 回退结果查询
|
||||
*
|
||||
* @param profitSharingReturnQueryModel the profit sharing return query model
|
||||
* @return json node
|
||||
*/
|
||||
public JsonNode profitSharingReturnQuery(ProfitSharingReturnQueryModel profitSharingReturnQueryModel) {
|
||||
WechatPayProperties.V3 v3 = wechatV2Client.getWechatMetaBean().getV3();
|
||||
profitSharingReturnQueryModel.setAppid(v3.getAppId());
|
||||
profitSharingReturnQueryModel.setMchId(v3.getMchId());
|
||||
profitSharingReturnQueryModel.certPath(v3.getCertPath());
|
||||
profitSharingReturnQueryModel.signType(BaseModel.HMAC_SHA256);
|
||||
return wechatV2Client.wechatPayRequest(profitSharingReturnQueryModel,
|
||||
HttpMethod.POST,
|
||||
"https://api.mch.weixin.qq.com/pay/profitsharingreturnquery");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,6 +42,8 @@ public class WechatV2Client {
|
||||
WechatPayProperties.V3 v3 = wechatMetaBean.getV3();
|
||||
return model
|
||||
.appSecret(v3.getAppSecret())
|
||||
.certPath(v3.getCertPath())
|
||||
.certAbsolutePath(v3.getCertAbsolutePath())
|
||||
.request(v3.getMchId(), method, url);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
||||
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
|
||||
import lombok.Getter;
|
||||
import lombok.SneakyThrows;
|
||||
@@ -37,6 +37,8 @@ import org.bouncycastle.crypto.Digest;
|
||||
import org.bouncycastle.crypto.digests.MD5Digest;
|
||||
import org.bouncycastle.util.encoders.Hex;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.RequestEntity;
|
||||
@@ -79,11 +81,11 @@ public abstract class BaseModel {
|
||||
// 忽略null
|
||||
XML_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL)
|
||||
// 属性使用 驼峰首字母小写
|
||||
.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
|
||||
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
|
||||
OBJECT_MAPPER
|
||||
// .configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true)
|
||||
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
|
||||
.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
|
||||
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,6 +99,8 @@ public abstract class BaseModel {
|
||||
@JsonIgnore
|
||||
private String certPath;
|
||||
@JsonIgnore
|
||||
private String certAbsolutePath;
|
||||
@JsonIgnore
|
||||
private String signType;
|
||||
|
||||
public BaseModel appSecret(String appSecret) {
|
||||
@@ -109,6 +113,10 @@ public abstract class BaseModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public BaseModel certAbsolutePath(String certAbsolutePath) {
|
||||
this.certAbsolutePath = certAbsolutePath;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BaseModel signType(String signType) {
|
||||
this.signType = signType;
|
||||
@@ -211,8 +219,9 @@ public abstract class BaseModel {
|
||||
private RestTemplate getRestTemplateClientAuthentication(String mchId)
|
||||
throws IOException, UnrecoverableKeyException, CertificateException, NoSuchAlgorithmException,
|
||||
KeyStoreException, KeyManagementException {
|
||||
ClassPathResource resource = new ClassPathResource(certPath == null ? "wechat/apiclient_cert.p12" : certPath);
|
||||
|
||||
Resource resource = certAbsolutePath != null ? new FileSystemResource(certAbsolutePath) :
|
||||
new ClassPathResource(certPath == null ? "wechat/apiclient_cert.p12" : certPath);
|
||||
char[] pem = mchId.toCharArray();
|
||||
|
||||
KeyStore store = KeyStore.getInstance("PKCS12");
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* 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.v2.model.allocation;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* The type Profit sharing add receiver model.
|
||||
*
|
||||
* @author wangzecheng
|
||||
* @since 1.0.10.RELEASE
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ProfitSharingAddReceiverModel extends BaseProfitSharingReceiverModel {
|
||||
|
||||
private Receiver receiver;
|
||||
|
||||
/**
|
||||
* The type Receiver.
|
||||
*/
|
||||
@Data
|
||||
public static class Receiver {
|
||||
|
||||
/**
|
||||
* 分账接收方类型.
|
||||
* <p>
|
||||
* MERCHANT_ID:商户号(mch_id或者sub_mch_id)
|
||||
* PERSONAL_OPENID:个人openid
|
||||
*/
|
||||
private Type type;
|
||||
|
||||
/**
|
||||
* 分账接收方帐号.
|
||||
* <p>
|
||||
* 类型是MERCHANT_ID时,是商户号(mch_id或者sub_mch_id)
|
||||
* 类型是PERSONAL_OPENID时,是个人openid
|
||||
*/
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 分账接收方全称.
|
||||
* <p>
|
||||
* 分账接收方类型是MERCHANT_ID时,是商户全称(必传),当商户是小微商户或个体户时,是开户人姓名
|
||||
* 分账接收方类型是PERSONAL_OPENID时,是个人姓名(选传,传则校验)
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 与分账方的关系类型.
|
||||
* <p>
|
||||
* 子商户与接收方的关系。
|
||||
* 本字段值为枚举:
|
||||
* SERVICE_PROVIDER:服务商
|
||||
* STORE:门店
|
||||
* STAFF:员工
|
||||
* STORE_OWNER:店主
|
||||
* PARTNER:合作伙伴
|
||||
* HEADQUARTER:总部
|
||||
* BRAND:品牌方
|
||||
* DISTRIBUTOR:分销商
|
||||
* USER:用户
|
||||
* SUPPLIER:供应商
|
||||
* CUSTOM:自定义
|
||||
*/
|
||||
private RelationType relationType;
|
||||
|
||||
/**
|
||||
* 自定义的分账关系.
|
||||
* <p>
|
||||
* 子商户与接收方具体的关系,本字段最多10个字。
|
||||
* 当字段relation_type的值为CUSTOM时,本字段必填
|
||||
* 当字段relation_type的值不为CUSTOM时,本字段无需填写
|
||||
*/
|
||||
private String customRelation;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* 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.v2.model.allocation;
|
||||
|
||||
import cn.felord.payment.wechat.v2.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* The type Profit sharing finish model.
|
||||
*
|
||||
* @author wangzecheng
|
||||
* @since 1.0.10.RELEASE
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ProfitSharingFinishModel extends BaseModel {
|
||||
|
||||
/**
|
||||
* 商户号.
|
||||
* <p>
|
||||
* 微信支付分配的商户号
|
||||
*/
|
||||
private String mchId;
|
||||
|
||||
/**
|
||||
* 公众账号ID.
|
||||
* <p>
|
||||
* 微信分配的公众账号ID
|
||||
*/
|
||||
private String appid;
|
||||
|
||||
/**
|
||||
* 微信订单号.
|
||||
* <p>
|
||||
* 微信支付订单号
|
||||
*/
|
||||
private String transactionId;
|
||||
|
||||
/**
|
||||
* 商户分账单号.
|
||||
* <p>
|
||||
* 查询分账结果,输入申请分账时的商户分账单号; 查询分账完结执行的结果,输入发起分账完结时的商户分账单号
|
||||
*/
|
||||
private String outOrderNo;
|
||||
|
||||
/**
|
||||
* 分账完结描述.
|
||||
* <p>
|
||||
* 分账完结的原因描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* 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.v2.model.allocation;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单次分账请求按照传入的分账接收方账号和资金进行分账,同时会将订单剩余的待分账金额解冻给本商户。
|
||||
* 故操作成功后,订单不能再进行分账,也不能进行分账完结。
|
||||
*
|
||||
* @author wangzecheng
|
||||
* @since 1.0.10.RELEASE
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ProfitSharingModel extends BaseProfitSharingModel {
|
||||
|
||||
/**
|
||||
* 分账接收方列表,不超过50个json对象,不能设置分账方作为分账接受方
|
||||
*/
|
||||
private List<Receiver> receivers;
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* 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.v2.model.allocation;
|
||||
|
||||
import cn.felord.payment.wechat.v2.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* The type Profit sharing query model.
|
||||
*
|
||||
* @author wangzecheng
|
||||
* @since 1.0.10.RELEASE
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ProfitSharingQueryModel extends BaseModel {
|
||||
|
||||
/**
|
||||
* 商户号.
|
||||
* <p>
|
||||
* 微信支付分配的商户号
|
||||
*/
|
||||
private String mchId;
|
||||
|
||||
/**
|
||||
* 微信订单号.
|
||||
* <p>
|
||||
* 微信支付订单号
|
||||
*/
|
||||
private String transactionId;
|
||||
|
||||
/**
|
||||
* 商户分账单号.
|
||||
* <p>
|
||||
* 查询分账结果,输入申请分账时的商户分账单号; 查询分账完结执行的结果,输入发起分账完结时的商户分账单号
|
||||
*/
|
||||
private String outOrderNo;
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* 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.v2.model.allocation;
|
||||
|
||||
import cn.felord.payment.wechat.v2.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* The type Profit sharing return model.
|
||||
*
|
||||
* @author wangzecheng
|
||||
* @since 1.0.10.RELEASE
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ProfitSharingReturnModel extends BaseModel {
|
||||
|
||||
/**
|
||||
* 商户号.
|
||||
* <p>
|
||||
* 微信支付分配的商户号
|
||||
*/
|
||||
private String mchId;
|
||||
|
||||
/**
|
||||
* 公众账号ID.
|
||||
* <p>
|
||||
* 微信分配的公众账号ID
|
||||
*/
|
||||
private String appid;
|
||||
private String orderId;
|
||||
private String outOrderNo;
|
||||
private String outReturnNo;
|
||||
private String returnAccountType;
|
||||
private String returnAccount;
|
||||
private String returnAmount;
|
||||
private String description;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user