mirror of
https://github.com/dromara/payment-spring-boot.git
synced 2026-03-16 06:53:41 +08:00
Merge branch '1.0.2.SNAPSHOT' into release
This commit is contained in:
@@ -12,13 +12,15 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
## 功能亮点
|
## 功能
|
||||||
- 实现微信支付多商户
|
- 实现微信支付多商户
|
||||||
|
- 集成支付宝SDK、快速接入Spring Boot
|
||||||
- 实现微信支付V3 基础支付
|
- 实现微信支付V3 基础支付
|
||||||
- 实现微信支付V3 合单支付
|
- 实现微信支付V3 合单支付
|
||||||
- 实现微信支付V3 代金券
|
- 实现微信支付V3 代金券
|
||||||
- 集成支付宝SDK、快速接入Spring Boot
|
- 实现微信支付V3 微信支付分
|
||||||
> 微信支付分等积极对接中……
|
- 实现微信支付V3 先享卡
|
||||||
|
|
||||||
## 开源协议
|
## 开源协议
|
||||||
**Apache 2.0**
|
**Apache 2.0**
|
||||||
|
|
||||||
|
|||||||
@@ -44,4 +44,4 @@
|
|||||||
|
|
||||||
## **免责声明**
|
## **免责声明**
|
||||||
|
|
||||||
**<span style="color:red;">本项目涉及到资金交易,开发者需要经严格测试后方能用于生产环境,本项目不对使用者的行为负责。</span>**
|
**<span style="color:red;">本项目涉及到资金交易开发,开发者需要经严格测试后方能用于生产环境,本项目不对使用者的行为负责。</span>**
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="java.lang中的类或接口">java.lang.Object</a></li>
|
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="java.lang中的类或接口">java.lang.Object</a></li>
|
||||||
<li>
|
<li>
|
||||||
<ul class="inheritance">
|
<ul class="inheritance">
|
||||||
<li>cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData.CombineAmount</li>
|
<li>cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData.CombineAmount</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="java.lang中的类或接口">java.lang.Object</a></li>
|
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="java.lang中的类或接口">java.lang.Object</a></li>
|
||||||
<li>
|
<li>
|
||||||
<ul class="inheritance">
|
<ul class="inheritance">
|
||||||
<li>cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData.SubOrderCallback</li>
|
<li>cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData.SubOrderCallback</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="java.lang中的类或接口">java.lang.Object</a></li>
|
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="java.lang中的类或接口">java.lang.Object</a></li>
|
||||||
<li>
|
<li>
|
||||||
<ul class="inheritance">
|
<ul class="inheritance">
|
||||||
<li>cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData</li>
|
<li>cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<!-- Generated by javadoc (1.8.0_252) on Sun Dec 13 22:43:48 CST 2020 -->
|
<!-- Generated by javadoc (1.8.0_252) on Sun Dec 13 22:43:48 CST 2020 -->
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<title>类 cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData.CombineAmount的使用 (payment-spring-boot 1.0.0.RELEASE API)</title>
|
<title>类 cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData.CombineAmount的使用 (payment-spring-boot 1.0.0.RELEASE API)</title>
|
||||||
<meta name="date" content="2020-12-13">
|
<meta name="date" content="2020-12-13">
|
||||||
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
|
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
|
||||||
<script type="text/javascript" src="../../../../../../../script.js"></script>
|
<script type="text/javascript" src="../../../../../../../script.js"></script>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<script type="text/javascript"><!--
|
<script type="text/javascript"><!--
|
||||||
try {
|
try {
|
||||||
if (location.href.indexOf('is-external=true') == -1) {
|
if (location.href.indexOf('is-external=true') == -1) {
|
||||||
parent.document.title="\u7C7B cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData.CombineAmount\u7684\u4F7F\u7528 (payment-spring-boot 1.0.0.RELEASE API)";
|
parent.document.title="\u7C7B cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData.CombineAmount\u7684\u4F7F\u7528 (payment-spring-boot 1.0.0.RELEASE API)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
</a></div>
|
</a></div>
|
||||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h2 title="类的使用 cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData.CombineAmount" class="title">类的使用<br>cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData.CombineAmount</h2>
|
<h2 title="类的使用 cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData.CombineAmount" class="title">类的使用<br>cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData.CombineAmount</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="classUseContainer">
|
<div class="classUseContainer">
|
||||||
<ul class="blockList">
|
<ul class="blockList">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<!-- Generated by javadoc (1.8.0_252) on Sun Dec 13 22:43:48 CST 2020 -->
|
<!-- Generated by javadoc (1.8.0_252) on Sun Dec 13 22:43:48 CST 2020 -->
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<title>类 cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData.SubOrderCallback的使用 (payment-spring-boot 1.0.0.RELEASE API)</title>
|
<title>类 cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData.SubOrderCallback的使用 (payment-spring-boot 1.0.0.RELEASE API)</title>
|
||||||
<meta name="date" content="2020-12-13">
|
<meta name="date" content="2020-12-13">
|
||||||
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
|
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
|
||||||
<script type="text/javascript" src="../../../../../../../script.js"></script>
|
<script type="text/javascript" src="../../../../../../../script.js"></script>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<script type="text/javascript"><!--
|
<script type="text/javascript"><!--
|
||||||
try {
|
try {
|
||||||
if (location.href.indexOf('is-external=true') == -1) {
|
if (location.href.indexOf('is-external=true') == -1) {
|
||||||
parent.document.title="\u7C7B cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData.SubOrderCallback\u7684\u4F7F\u7528 (payment-spring-boot 1.0.0.RELEASE API)";
|
parent.document.title="\u7C7B cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData.SubOrderCallback\u7684\u4F7F\u7528 (payment-spring-boot 1.0.0.RELEASE API)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
</a></div>
|
</a></div>
|
||||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h2 title="类的使用 cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData.SubOrderCallback" class="title">类的使用<br>cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData.SubOrderCallback</h2>
|
<h2 title="类的使用 cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData.SubOrderCallback" class="title">类的使用<br>cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData.SubOrderCallback</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="classUseContainer">
|
<div class="classUseContainer">
|
||||||
<ul class="blockList">
|
<ul class="blockList">
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<script type="text/javascript"><!--
|
<script type="text/javascript"><!--
|
||||||
try {
|
try {
|
||||||
if (location.href.indexOf('is-external=true') == -1) {
|
if (location.href.indexOf('is-external=true') == -1) {
|
||||||
parent.document.title="\u7C7B cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData\u7684\u4F7F\u7528 (payment-spring-boot 1.0.0.RELEASE API)";
|
parent.document.title="\u7C7B cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData\u7684\u4F7F\u7528 (payment-spring-boot 1.0.0.RELEASE API)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
</a></div>
|
</a></div>
|
||||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h2 title="类的使用 cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData" class="title">类的使用<br>cn.felord.payment.wechat.v3.model.CombineTransactionConsumeData</h2>
|
<h2 title="类的使用 cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData" class="title">类的使用<br>cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="classUseContainer">
|
<div class="classUseContainer">
|
||||||
<ul class="blockList">
|
<ul class="blockList">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
- [Java中的微信支付(2):API V3 微信平台证书的获取与刷新](https://mp.weixin.qq.com/s/O_YcnIRcl2MltElBupm3Hg)
|
- [Java中的微信支付(2):API V3 微信平台证书的获取与刷新](https://mp.weixin.qq.com/s/O_YcnIRcl2MltElBupm3Hg)
|
||||||
- [Java中的微信支付(3):API V3对微信服务器响应进行签名验证](https://mp.weixin.qq.com/s/cb2eTTRjHifNYUGpQETMCQ)
|
- [Java中的微信支付(3):API V3对微信服务器响应进行签名验证](https://mp.weixin.qq.com/s/cb2eTTRjHifNYUGpQETMCQ)
|
||||||
### 微信支付V3中的坑
|
### 微信支付V3中的坑
|
||||||
|
#### 代金券
|
||||||
- 代金券制券后不能修改,所以一定要注意
|
- 代金券制券后不能修改,所以一定要注意
|
||||||
- 已激活的代金券批次被停用后不影响该批次已发放代金券的核销
|
- 已激活的代金券批次被停用后不影响该批次已发放代金券的核销
|
||||||
- 代金券激活券和制券要有一定的间隔时间,官方说是1分钟
|
- 代金券激活券和制券要有一定的间隔时间,官方说是1分钟
|
||||||
@@ -21,6 +22,7 @@
|
|||||||
7.out_request_no:校验规则:不可以重复
|
7.out_request_no:校验规则:不可以重复
|
||||||
8.活动时间不可以大于90天
|
8.活动时间不可以大于90天
|
||||||
```
|
```
|
||||||
|
#### 微信支付分
|
||||||
- 微信支付分`service_id`相关
|
- 微信支付分`service_id`相关
|
||||||
```
|
```
|
||||||
1. 在微信支付分功能申请成功后,联系运营那边配置 service_id。
|
1. 在微信支付分功能申请成功后,联系运营那边配置 service_id。
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>cn.felord</groupId>
|
<groupId>cn.felord</groupId>
|
||||||
<artifactId>payment-spring-boot</artifactId>
|
<artifactId>payment-spring-boot</artifactId>
|
||||||
<version>1.0.1.RELEASE</version>
|
<version>1.0.2.RELEASE</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>payment-spring-boot-autoconfigure</artifactId>
|
<artifactId>payment-spring-boot-autoconfigure</artifactId>
|
||||||
<version>1.0.1.RELEASE</version>
|
<version>1.0.2.RELEASE</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ package cn.felord.payment.wechat.enumeration;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The enum Bank code.
|
* 银行代码.
|
||||||
*
|
*
|
||||||
* @author felord.cn
|
* @author felord.cn
|
||||||
* @since 1.0.0.RELEASE
|
* @since 1.0.0.RELEASE
|
||||||
@@ -28,186 +28,278 @@ package cn.felord.payment.wechat.enumeration;
|
|||||||
public enum BankCode {
|
public enum BankCode {
|
||||||
/**
|
/**
|
||||||
* 工商银行
|
* 工商银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1002("1002", "工商银行"),
|
BK_1002("1002", "工商银行"),
|
||||||
/**
|
/**
|
||||||
* 农业银行
|
* 农业银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1005("1005", "农业银行"),
|
BK_1005("1005", "农业银行"),
|
||||||
/**
|
/**
|
||||||
* 建设银行
|
* 建设银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1003("1003", "建设银行"),
|
BK_1003("1003", "建设银行"),
|
||||||
/**
|
/**
|
||||||
* 中国银行
|
* 中国银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1026("1026", "中国银行"),
|
BK_1026("1026", "中国银行"),
|
||||||
/**
|
/**
|
||||||
* 交通银行
|
* 交通银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1020("1020", "交通银行"),
|
BK_1020("1020", "交通银行"),
|
||||||
/**
|
/**
|
||||||
* 招商银行
|
* 招商银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1001("1001", "招商银行"),
|
BK_1001("1001", "招商银行"),
|
||||||
/**
|
/**
|
||||||
* 邮储银行
|
* 邮储银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1066("1066", "邮储银行"),
|
BK_1066("1066", "邮储银行"),
|
||||||
/**
|
/**
|
||||||
* 民生银行
|
* 民生银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1006("1006", "民生银行"),
|
BK_1006("1006", "民生银行"),
|
||||||
/**
|
/**
|
||||||
* 平安银行
|
* 平安银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1010("1010", "平安银行"),
|
BK_1010("1010", "平安银行"),
|
||||||
/**
|
/**
|
||||||
* 中信银行
|
* 中信银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1021("1021", "中信银行"),
|
BK_1021("1021", "中信银行"),
|
||||||
/**
|
/**
|
||||||
* 浦发银行
|
* 浦发银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1004("1004", "浦发银行"),
|
BK_1004("1004", "浦发银行"),
|
||||||
/**
|
/**
|
||||||
* 兴业银行
|
* 兴业银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1009("1009", "兴业银行"),
|
BK_1009("1009", "兴业银行"),
|
||||||
/**
|
/**
|
||||||
* 光大银行
|
* 光大银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1022("1022", "光大银行"),
|
BK_1022("1022", "光大银行"),
|
||||||
/**
|
/**
|
||||||
* 广发银行
|
* 广发银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1027("1027", "广发银行"),
|
BK_1027("1027", "广发银行"),
|
||||||
/**
|
/**
|
||||||
* 华夏银行
|
* 华夏银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1025("1025", "华夏银行"),
|
BK_1025("1025", "华夏银行"),
|
||||||
/**
|
/**
|
||||||
* 宁波银行
|
* 宁波银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1056("1056", "宁波银行"),
|
BK_1056("1056", "宁波银行"),
|
||||||
/**
|
/**
|
||||||
* 北京银行
|
* 北京银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4836("4836", "北京银行"),
|
BK_4836("4836", "北京银行"),
|
||||||
/**
|
/**
|
||||||
* 上海银行
|
* 上海银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1024("1024", "上海银行"),
|
BK_1024("1024", "上海银行"),
|
||||||
/**
|
/**
|
||||||
* 南京银行
|
* 南京银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_1054("1054", "南京银行"),
|
BK_1054("1054", "南京银行"),
|
||||||
/**
|
/**
|
||||||
* 长子县融汇村镇银行
|
* 长子县融汇村镇银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4755("4755", "长子县融汇村镇银行"),
|
BK_4755("4755", "长子县融汇村镇银行"),
|
||||||
/**
|
/**
|
||||||
* 长沙银行
|
* 长沙银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4216("4216", "长沙银行"),
|
BK_4216("4216", "长沙银行"),
|
||||||
/**
|
/**
|
||||||
* 浙江泰隆商业银行
|
* 浙江泰隆商业银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4051("4051", "浙江泰隆商业银行"),
|
BK_4051("4051", "浙江泰隆商业银行"),
|
||||||
/**
|
/**
|
||||||
* 中原银行
|
* 中原银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4753("4753", "中原银行"),
|
BK_4753("4753", "中原银行"),
|
||||||
/**
|
/**
|
||||||
* 企业银行(中国)
|
* 企业银行(中国)
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4761("4761", "企业银行(中国)"),
|
BK_4761("4761", "企业银行(中国)"),
|
||||||
/**
|
/**
|
||||||
* 顺德农商银行
|
* 顺德农商银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4036("4036", "顺德农商银行"),
|
BK_4036("4036", "顺德农商银行"),
|
||||||
/**
|
/**
|
||||||
* 衡水银行
|
* 衡水银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4752("4752", "衡水银行"),
|
BK_4752("4752", "衡水银行"),
|
||||||
/**
|
/**
|
||||||
* 长治银行
|
* 长治银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4756("4756", "长治银行"),
|
BK_4756("4756", "长治银行"),
|
||||||
/**
|
/**
|
||||||
* 大同银行
|
* 大同银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4767("4767", "大同银行"),
|
BK_4767("4767", "大同银行"),
|
||||||
/**
|
/**
|
||||||
* 河南省农村信用社
|
* 河南省农村信用社
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4115("4115", "河南省农村信用社"),
|
BK_4115("4115", "河南省农村信用社"),
|
||||||
/**
|
/**
|
||||||
* 宁夏黄河农村商业银行
|
* 宁夏黄河农村商业银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4150("4150", "宁夏黄河农村商业银行"),
|
BK_4150("4150", "宁夏黄河农村商业银行"),
|
||||||
/**
|
/**
|
||||||
* 山西省农村信用社
|
* 山西省农村信用社
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4156("4156", "山西省农村信用社"),
|
BK_4156("4156", "山西省农村信用社"),
|
||||||
/**
|
/**
|
||||||
* 安徽省农村信用社
|
* 安徽省农村信用社
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4166("4166", "安徽省农村信用社"),
|
BK_4166("4166", "安徽省农村信用社"),
|
||||||
/**
|
/**
|
||||||
* 甘肃省农村信用社
|
* 甘肃省农村信用社
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4157("4157", "甘肃省农村信用社"),
|
BK_4157("4157", "甘肃省农村信用社"),
|
||||||
/**
|
/**
|
||||||
* 天津农村商业银行
|
* 天津农村商业银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4153("4153", "天津农村商业银行"),
|
BK_4153("4153", "天津农村商业银行"),
|
||||||
/**
|
/**
|
||||||
* 广西壮族自治区农村信用社
|
* 广西壮族自治区农村信用社
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4113("4113", "广西壮族自治区农村信用社"),
|
BK_4113("4113", "广西壮族自治区农村信用社"),
|
||||||
/**
|
/**
|
||||||
* 陕西省农村信用社
|
* 陕西省农村信用社
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4108("4108", "陕西省农村信用社"),
|
BK_4108("4108", "陕西省农村信用社"),
|
||||||
/**
|
/**
|
||||||
* 深圳农村商业银行
|
* 深圳农村商业银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4076("4076", "深圳农村商业银行"),
|
BK_4076("4076", "深圳农村商业银行"),
|
||||||
/**
|
/**
|
||||||
* 宁波鄞州农村商业银行
|
* 宁波鄞州农村商业银行
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4052("4052", "宁波鄞州农村商业银行"),
|
BK_4052("4052", "宁波鄞州农村商业银行"),
|
||||||
/**
|
/**
|
||||||
* 浙江省农村信用社联合社
|
* 浙江省农村信用社联合社
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4764("4764", "浙江省农村信用社联合社"),
|
BK_4764("4764", "浙江省农村信用社联合社"),
|
||||||
/**
|
/**
|
||||||
* 江苏省农村信用社联合社
|
* 江苏省农村信用社联合社
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4217("4217", "江苏省农村信用社联合社"),
|
BK_4217("4217", "江苏省农村信用社联合社"),
|
||||||
/**
|
/**
|
||||||
* 江苏紫金农村商业银行股份有限公司
|
* 江苏紫金农村商业银行股份有限公司
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4072("4072", "江苏紫金农村商业银行"),
|
BK_4072("4072", "江苏紫金农村商业银行"),
|
||||||
/**
|
/**
|
||||||
* 北京中关村银行股份有限公司
|
* 北京中关村银行股份有限公司
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4769("4769", "北京中关村银行"),
|
BK_4769("4769", "北京中关村银行"),
|
||||||
/**
|
/**
|
||||||
* 星展银行(中国)有限公司
|
* 星展银行(中国)有限公司
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4778("4778", "星展银行(中国)"),
|
BK_4778("4778", "星展银行(中国)"),
|
||||||
/**
|
/**
|
||||||
* 枣庄银行股份有限公司
|
* 枣庄银行股份有限公司
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4766("4766", "枣庄银行"),
|
BK_4766("4766", "枣庄银行"),
|
||||||
/**
|
/**
|
||||||
* 海口联合农村商业银行股份有限公司
|
* 海口联合农村商业银行股份有限公司
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4758("4758", "海口联合农村商业银行"),
|
BK_4758("4758", "海口联合农村商业银行"),
|
||||||
/**
|
/**
|
||||||
* 南洋商业银行(中国)有限公司
|
* 南洋商业银行(中国)有限公司
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
BK_4763("4763", "南洋商业银行(中国)");
|
BK_4763("4763", "南洋商业银行(中国)");
|
||||||
|
|
||||||
@@ -220,10 +312,20 @@ public enum BankCode {
|
|||||||
this.bankName = bankName;
|
this.bankName = bankName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Code string.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String code() {
|
public String code() {
|
||||||
return this.code;
|
return this.code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bank name string.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String bankName() {
|
public String bankName() {
|
||||||
return this.bankName;
|
return this.bankName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package cn.felord.payment.wechat.enumeration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信先享卡的守约状态
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
public enum ContractStatus {
|
||||||
|
/**
|
||||||
|
* 约定进行中,表示用户在约定有效期内,尚未完成所有目标时,守约状态为约定进行中。
|
||||||
|
*/
|
||||||
|
ONGOING,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 约定到期核对中,在约定有效期结束后的一段时间,商户可对卡记录进行校对并做必要调整,守约状态为约定到期核对调整中。
|
||||||
|
*/
|
||||||
|
SETTLING,
|
||||||
|
/**
|
||||||
|
* 已完成约定,表示用户在约定有效期内,已完成所有目标,守约状态为已完成约定。
|
||||||
|
*/
|
||||||
|
FINISHED,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未完成约定,表示用户在约定有效期到期后,最终未完成所有约定目标,或用户提前退出约定,守约状态为未完成约定。
|
||||||
|
*/
|
||||||
|
UNFINISHED
|
||||||
|
}
|
||||||
@@ -14,7 +14,6 @@
|
|||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
package cn.felord.payment.wechat.enumeration;
|
package cn.felord.payment.wechat.enumeration;
|
||||||
|
|
||||||
@@ -27,23 +26,66 @@ package cn.felord.payment.wechat.enumeration;
|
|||||||
* @since 1.0.0.RELEASE
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
public enum CouponBgColor {
|
public enum CouponBgColor {
|
||||||
|
/**
|
||||||
|
* Color 010 coupon bg color.
|
||||||
|
*/
|
||||||
COLOR010("#63B359"),
|
COLOR010("#63B359"),
|
||||||
|
/**
|
||||||
|
* Color 020 coupon bg color.
|
||||||
|
*/
|
||||||
COLOR020("#2C9F67"),
|
COLOR020("#2C9F67"),
|
||||||
|
/**
|
||||||
|
* Color 030 coupon bg color.
|
||||||
|
*/
|
||||||
COLOR030("#509FC9"),
|
COLOR030("#509FC9"),
|
||||||
|
/**
|
||||||
|
* Color 040 coupon bg color.
|
||||||
|
*/
|
||||||
COLOR040("#5885CF"),
|
COLOR040("#5885CF"),
|
||||||
|
/**
|
||||||
|
* Color 050 coupon bg color.
|
||||||
|
*/
|
||||||
COLOR050("#9062C0"),
|
COLOR050("#9062C0"),
|
||||||
|
/**
|
||||||
|
* Color 060 coupon bg color.
|
||||||
|
*/
|
||||||
COLOR060("#D09A45"),
|
COLOR060("#D09A45"),
|
||||||
|
/**
|
||||||
|
* Color 070 coupon bg color.
|
||||||
|
*/
|
||||||
COLOR070("#E4B138"),
|
COLOR070("#E4B138"),
|
||||||
|
/**
|
||||||
|
* Color 080 coupon bg color.
|
||||||
|
*/
|
||||||
COLOR080("#EE903C"),
|
COLOR080("#EE903C"),
|
||||||
|
/**
|
||||||
|
* Color 090 coupon bg color.
|
||||||
|
*/
|
||||||
COLOR090("#DD6549"),
|
COLOR090("#DD6549"),
|
||||||
|
/**
|
||||||
|
* Color 100 coupon bg color.
|
||||||
|
*/
|
||||||
COLOR100("#CC463D");
|
COLOR100("#CC463D");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Color.
|
||||||
|
*/
|
||||||
private final String color;
|
private final String color;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new Coupon bg color.
|
||||||
|
*
|
||||||
|
* @param color the color
|
||||||
|
*/
|
||||||
CouponBgColor(String color) {
|
CouponBgColor(String color) {
|
||||||
this.color = color;
|
this.color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Color string.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String color() {
|
public String color() {
|
||||||
return this.color;
|
return this.color;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
package cn.felord.payment.wechat.enumeration;
|
package cn.felord.payment.wechat.enumeration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The enum Coupon status.
|
* 代金券状态.
|
||||||
*
|
*
|
||||||
* @author felord.cn
|
* @author felord.cn
|
||||||
* @since 1.0.0.RELEASE
|
* @since 1.0.0.RELEASE
|
||||||
@@ -27,14 +27,20 @@ package cn.felord.payment.wechat.enumeration;
|
|||||||
public enum CouponStatus {
|
public enum CouponStatus {
|
||||||
/**
|
/**
|
||||||
* 可用.
|
* 可用.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
SENDED,
|
SENDED,
|
||||||
/**
|
/**
|
||||||
* 已实扣.
|
* 已实扣.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
USED,
|
USED,
|
||||||
/**
|
/**
|
||||||
* 已过期.
|
* 已过期.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
EXPIRED
|
EXPIRED
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
package cn.felord.payment.wechat.enumeration;
|
package cn.felord.payment.wechat.enumeration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The enum Stock status.
|
* 代金券批次状态.
|
||||||
*
|
*
|
||||||
* @author felord.cn
|
* @author felord.cn
|
||||||
* @since 1.0.0.RELEASE
|
* @since 1.0.0.RELEASE
|
||||||
@@ -27,22 +27,32 @@ package cn.felord.payment.wechat.enumeration;
|
|||||||
public enum StockStatus {
|
public enum StockStatus {
|
||||||
/**
|
/**
|
||||||
* Unactivated stock status.
|
* Unactivated stock status.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
UNACTIVATED("unactivated", "未激活"),
|
UNACTIVATED("unactivated", "未激活"),
|
||||||
/**
|
/**
|
||||||
* Audit stock status.
|
* Audit stock status.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
AUDIT("audit", "审核中"),
|
AUDIT("audit", "审核中"),
|
||||||
/**
|
/**
|
||||||
* Running stock status.
|
* Running stock status.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
RUNNING("running", "运行中"),
|
RUNNING("running", "运行中"),
|
||||||
/**
|
/**
|
||||||
* Stoped stock status.
|
* Stoped stock status.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
STOPED("stoped", "已停止"),
|
STOPED("stoped", "已停止"),
|
||||||
/**
|
/**
|
||||||
* Paused stock status.
|
* Paused stock status.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
PAUSED("paused", "暂停发放");
|
PAUSED("paused", "暂停发放");
|
||||||
|
|
||||||
@@ -58,6 +68,7 @@ public enum StockStatus {
|
|||||||
* Value string.
|
* Value string.
|
||||||
*
|
*
|
||||||
* @return the string
|
* @return the string
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
public String value() {
|
public String value() {
|
||||||
return this.value;
|
return this.value;
|
||||||
@@ -67,6 +78,7 @@ public enum StockStatus {
|
|||||||
* Description string.
|
* Description string.
|
||||||
*
|
*
|
||||||
* @return the string
|
* @return the string
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
public String description() {
|
public String description() {
|
||||||
return this.description;
|
return this.description;
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package cn.felord.payment.wechat.enumeration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目标完成类型、优惠使用类型
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
public enum StrategyType {
|
||||||
|
/**
|
||||||
|
* 增加数量,表示用户发生了履约行为
|
||||||
|
*/
|
||||||
|
INCREASE,
|
||||||
|
/**
|
||||||
|
* 减少数量,表示取消用户的履约行为(例如用户取消购买、退货退款等)
|
||||||
|
*/
|
||||||
|
DECREASE
|
||||||
|
}
|
||||||
@@ -27,30 +27,44 @@ package cn.felord.payment.wechat.enumeration;
|
|||||||
public enum TradeState {
|
public enum TradeState {
|
||||||
/**
|
/**
|
||||||
* 支付成功
|
* 支付成功
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
SUCCESS,
|
SUCCESS,
|
||||||
/**
|
/**
|
||||||
* 转入退款
|
* 转入退款
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
REFUND,
|
REFUND,
|
||||||
/**
|
/**
|
||||||
* 未支付
|
* 未支付
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
NOTPAY,
|
NOTPAY,
|
||||||
/**
|
/**
|
||||||
* 已关闭
|
* 已关闭
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
CLOSED,
|
CLOSED,
|
||||||
/**
|
/**
|
||||||
* 已撤销(付款码支付)
|
* 已撤销(付款码支付)
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
REVOKED,
|
REVOKED,
|
||||||
/**
|
/**
|
||||||
* 用户支付中(付款码支付)
|
* 用户支付中(付款码支付)
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
USERPAYING,
|
USERPAYING,
|
||||||
/**
|
/**
|
||||||
* 支付失败(其他原因,如银行返回失败)
|
* 支付失败(其他原因,如银行返回失败)
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
PAYERROR,
|
PAYERROR,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,26 +27,38 @@ package cn.felord.payment.wechat.enumeration;
|
|||||||
public enum TradeType {
|
public enum TradeType {
|
||||||
/**
|
/**
|
||||||
* 公众号支付
|
* 公众号支付
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
JSAPI,
|
JSAPI,
|
||||||
/**
|
/**
|
||||||
* 扫码支付
|
* 扫码支付
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
NATIVE,
|
NATIVE,
|
||||||
/**
|
/**
|
||||||
* APP支付
|
* APP支付
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
APP,
|
APP,
|
||||||
/**
|
/**
|
||||||
* 付款码支付
|
* 付款码支付
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MICROPAY,
|
MICROPAY,
|
||||||
/**
|
/**
|
||||||
* H5支付
|
* H5支付
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MWEB,
|
MWEB,
|
||||||
/**
|
/**
|
||||||
* 刷脸支付
|
* 刷脸支付
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
FACEPAY,
|
FACEPAY,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,32 +28,46 @@ package cn.felord.payment.wechat.enumeration;
|
|||||||
public enum WeChatServer {
|
public enum WeChatServer {
|
||||||
/**
|
/**
|
||||||
* 中国
|
* 中国
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
CHINA("https://api.mch.weixin.qq.com"),
|
CHINA("https://api.mch.weixin.qq.com"),
|
||||||
/**
|
/**
|
||||||
* 中国国内(备用域名)
|
* 中国国内(备用域名)
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
CHINA2("https://api2.mch.weixin.qq.com"),
|
CHINA2("https://api2.mch.weixin.qq.com"),
|
||||||
/**
|
/**
|
||||||
* 香港
|
* 香港
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
HK("https://apihk.mch.weixin.qq.com"),
|
HK("https://apihk.mch.weixin.qq.com"),
|
||||||
/**
|
/**
|
||||||
* 美国
|
* 美国
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
US("https://apius.mch.weixin.qq.com"),
|
US("https://apius.mch.weixin.qq.com"),
|
||||||
/**
|
/**
|
||||||
* 获取公钥
|
* 获取公钥
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
FRAUD("https://fraud.mch.weixin.qq.com"),
|
FRAUD("https://fraud.mch.weixin.qq.com"),
|
||||||
/**
|
/**
|
||||||
* 活动
|
* 活动
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
ACTION("https://action.weixin.qq.com");
|
ACTION("https://action.weixin.qq.com");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 域名
|
* 域名
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
private final String domain;
|
private final String domain;
|
||||||
|
|
||||||
@@ -65,6 +79,7 @@ public enum WeChatServer {
|
|||||||
* Gets type.
|
* Gets type.
|
||||||
*
|
*
|
||||||
* @return the type
|
* @return the type
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
public String domain() {
|
public String domain() {
|
||||||
return domain;
|
return domain;
|
||||||
|
|||||||
@@ -21,148 +21,326 @@ package cn.felord.payment.wechat.enumeration;
|
|||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Wechat Pay V3 type.
|
* 微信支付类型.
|
||||||
*
|
*
|
||||||
* @author felord.cn
|
* @author felord.cn
|
||||||
|
* @see cn.felord.payment.wechat.v3.WechatPayClient
|
||||||
* @since 1.0.0.RELEASE
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
public enum WechatPayV3Type {
|
public enum WechatPayV3Type {
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取证书.
|
* 获取证书.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
CERT(HttpMethod.GET, "%s/v3/certificates"),
|
CERT(HttpMethod.GET, "%s/v3/certificates"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件下载
|
* 文件下载
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
FILE_DOWNLOAD(HttpMethod.GET, "%s/v3/billdownload/file"),
|
FILE_DOWNLOAD(HttpMethod.GET, "%s/v3/billdownload/file"),
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信公众号支付或者小程序支付.
|
* 微信公众号支付或者小程序支付.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
JSAPI(HttpMethod.POST, "%s/v3/pay/transactions/jsapi"),
|
JSAPI(HttpMethod.POST, "%s/v3/pay/transactions/jsapi"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信扫码支付.
|
* 微信扫码支付.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
NATIVE(HttpMethod.POST, "%s/v3/pay/transactions/native"),
|
NATIVE(HttpMethod.POST, "%s/v3/pay/transactions/native"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信APP支付.
|
* 微信APP支付.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
APP(HttpMethod.POST, "%s/v3/pay/transactions/app"),
|
APP(HttpMethod.POST, "%s/v3/pay/transactions/app"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* H5支付.
|
* H5支付.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MWEB(HttpMethod.POST, "%s/v3/pay/transactions/h5"),
|
MWEB(HttpMethod.POST, "%s/v3/pay/transactions/h5"),
|
||||||
/**
|
/**
|
||||||
* 关闭订单.
|
* 关闭订单.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
CLOSE(HttpMethod.POST, "%s/v3/pay/transactions/out-trade-no/{out_trade_no}/close"),
|
CLOSE(HttpMethod.POST, "%s/v3/pay/transactions/out-trade-no/{out_trade_no}/close"),
|
||||||
/**
|
/**
|
||||||
* 微信支付订单号查询.
|
* 微信支付订单号查询.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
TRANSACTION_TRANSACTION_ID(HttpMethod.GET, "%s/v3/pay/transactions/id/{transaction_id}"),
|
TRANSACTION_TRANSACTION_ID(HttpMethod.GET, "%s/v3/pay/transactions/id/{transaction_id}"),
|
||||||
/**
|
/**
|
||||||
* 商户订单号查询.
|
* 商户订单号查询.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
TRANSACTION_OUT_TRADE_NO(HttpMethod.GET, "%s/v3/pay/transactions/out-trade-no/{out_trade_no}"),
|
TRANSACTION_OUT_TRADE_NO(HttpMethod.GET, "%s/v3/pay/transactions/out-trade-no/{out_trade_no}"),
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合单下单-APP支付API.
|
* 合单下单-APP支付API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
COMBINE_APP(HttpMethod.POST, "%s/v3/combine-transactions/app"),
|
COMBINE_APP(HttpMethod.POST, "%s/v3/combine-transactions/app"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合单下单-微信公众号支付或者小程序支付.
|
* 合单下单-微信公众号支付或者小程序支付.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
COMBINE_JSAPI(HttpMethod.POST, "%s/v3/pay/combine-transactions/jsapi"),
|
COMBINE_JSAPI(HttpMethod.POST, "%s/v3/pay/combine-transactions/jsapi"),
|
||||||
/**
|
/**
|
||||||
* 合单下单-H5支付API.
|
* 合单下单-H5支付API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
COMBINE_MWEB(HttpMethod.POST, "%s/v3/pay/combine-transactions/h5"),
|
COMBINE_MWEB(HttpMethod.POST, "%s/v3/pay/combine-transactions/h5"),
|
||||||
/**
|
/**
|
||||||
* 合单下单-Native支付API.
|
* 合单下单-Native支付API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
COMBINE_NATIVE(HttpMethod.POST, "%s/v3/pay/combine-transactions/native"),
|
COMBINE_NATIVE(HttpMethod.POST, "%s/v3/pay/combine-transactions/native"),
|
||||||
/**
|
/**
|
||||||
* 合单查询订单API.
|
* 合单查询订单API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
COMBINE_TRANSACTION_OUT_TRADE_NO(HttpMethod.GET, "%s/v3/combine-transactions/out-trade-no/{combine_out_trade_no}"),
|
COMBINE_TRANSACTION_OUT_TRADE_NO(HttpMethod.GET, "%s/v3/combine-transactions/out-trade-no/{combine_out_trade_no}"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合单关闭订单API.
|
* 合单关闭订单API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
COMBINE_CLOSE(HttpMethod.POST, "%s/v3/combine-transactions/out-trade-no/{combine_out_trade_no}/close"),
|
COMBINE_CLOSE(HttpMethod.POST, "%s/v3/combine-transactions/out-trade-no/{combine_out_trade_no}/close"),
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户预授权API.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_PERMISSIONS(HttpMethod.POST, "%s/v3/payscore/permissions"),
|
||||||
|
/**
|
||||||
|
* 创单结单合并API.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_DIRECT_COMPLETE(HttpMethod.POST, "%s/payscore/serviceorder/direct-complete"),
|
||||||
|
/**
|
||||||
|
* 查询与用户授权记录(授权协议号)API.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_PERMISSIONS_AUTH_CODE(HttpMethod.GET, "%s/v3/payscore/permissions/authorization-code/{authorization_code}"),
|
||||||
|
/**
|
||||||
|
* 解除用户授权关系(授权协议号)API.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_TERMINATE_PERMISSIONS_AUTH_CODE(HttpMethod.POST, "%s/v3/payscore/permissions/authorization-code/{authorization_code}/terminate"),
|
||||||
|
/**
|
||||||
|
* 查询与用户授权记录(openid)API.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_PERMISSIONS_OPENID(HttpMethod.GET, "%s/v3/payscore/permissions/openid/{openid}"),
|
||||||
|
/**
|
||||||
|
* 解除用户授权关系(openid)API.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_TERMINATE_PERMISSIONS_OPENID(HttpMethod.POST, "%s/v3/payscore/permissions/openid/{openid}/terminate"),
|
||||||
|
/**
|
||||||
|
* 查询用户授权状态API.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_USER_SERVICE_STATE(HttpMethod.GET, "%s/v3/payscore/user-service-state?service_id={service_id}&appid={appid}&openid={openid}"),
|
||||||
|
/**
|
||||||
|
* 创建支付分订单API
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_CREATE_USER_SERVICE_ORDER(HttpMethod.POST, "%s/v3/payscore/serviceorder"),
|
||||||
|
/**
|
||||||
|
* 查询支付分订单API
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_QUERY_USER_SERVICE_ORDER(HttpMethod.GET, "%s/v3/payscore/serviceorder"),
|
||||||
|
/**
|
||||||
|
* 取消支付分订单API
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_CANCEL_USER_SERVICE_ORDER(HttpMethod.POST, "%s/v3/payscore/serviceorder/{out_order_no}/cancel"),
|
||||||
|
/**
|
||||||
|
* 修改订单金额API
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_MODIFY_USER_SERVICE_ORDER(HttpMethod.POST, "%s/v3/payscore/serviceorder/{out_order_no}/modify"),
|
||||||
|
/**
|
||||||
|
* 完结支付分订单API
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_COMPLETE_USER_SERVICE_ORDER(HttpMethod.POST, "%s/v3/payscore/serviceorder/{out_order_no}/complete"),
|
||||||
|
/**
|
||||||
|
* 商户发起催收扣款API
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_PAY_USER_SERVICE_ORDER(HttpMethod.POST, "%s/v3/payscore/serviceorder/{out_order_no}/pay"),
|
||||||
|
/**
|
||||||
|
* 同步服务订单信息API
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAY_SCORE_SYNC_USER_SERVICE_ORDER(HttpMethod.POST, "%s/v3/payscore/serviceorder/{out_order_no}/sync"),
|
||||||
|
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
/**
|
||||||
|
* 微信先享卡预受理领卡请求API.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
DISCOUNT_CARD_PRE_REQUEST(HttpMethod.POST, "%s/v3/discount-card/cards"),
|
||||||
|
/**
|
||||||
|
* 微信先享卡增加用户记录API.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
DISCOUNT_CARD_ADD_USER_RECORDS(HttpMethod.POST, "%s/v3/discount-card/cards/{out_card_code}/add-user-records"),
|
||||||
|
/**
|
||||||
|
* 微信先享卡查询先享卡订单API.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
DISCOUNT_CARD_INFO(HttpMethod.POST, "%s/v3/discount-card/cards/{out_card_code}"),
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建代金券批次API.
|
* 创建代金券批次API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_FAVOR_STOCKS_COUPON_STOCKS(HttpMethod.POST, "%s/v3/marketing/favor/coupon-stocks"),
|
MARKETING_FAVOR_STOCKS_COUPON_STOCKS(HttpMethod.POST, "%s/v3/marketing/favor/coupon-stocks"),
|
||||||
/**
|
/**
|
||||||
* 激活代金券批次API.
|
* 激活代金券批次API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_FAVOR_STOCKS_START(HttpMethod.POST, "%s/v3/marketing/favor/stocks/{stock_id}/start"),
|
MARKETING_FAVOR_STOCKS_START(HttpMethod.POST, "%s/v3/marketing/favor/stocks/{stock_id}/start"),
|
||||||
/**
|
/**
|
||||||
* 暂停代金券批次API.
|
* 暂停代金券批次API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_FAVOR_STOCKS_PAUSE(HttpMethod.POST, "%s/v3/marketing/favor/stocks/{stock_id}/pause"),
|
MARKETING_FAVOR_STOCKS_PAUSE(HttpMethod.POST, "%s/v3/marketing/favor/stocks/{stock_id}/pause"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发放代金券API、根据商户号查用户的券.
|
* 发放代金券API、根据商户号查用户的券.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_FAVOR_USERS_COUPONS(HttpMethod.POST, "%s/v3/marketing/favor/users/{openid}/coupons"),
|
MARKETING_FAVOR_USERS_COUPONS(HttpMethod.POST, "%s/v3/marketing/favor/users/{openid}/coupons"),
|
||||||
/**
|
/**
|
||||||
* 重启代金券API.
|
* 重启代金券API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_FAVOR_STOCKS_RESTART(HttpMethod.POST, "%s/v3/marketing/favor/stocks/{stock_id}/restart"),
|
MARKETING_FAVOR_STOCKS_RESTART(HttpMethod.POST, "%s/v3/marketing/favor/stocks/{stock_id}/restart"),
|
||||||
/**
|
/**
|
||||||
* 条件查询批次列表API.
|
* 条件查询批次列表API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_FAVOR_STOCKS(HttpMethod.GET, "%s/v3/marketing/favor/stocks"),
|
MARKETING_FAVOR_STOCKS(HttpMethod.GET, "%s/v3/marketing/favor/stocks"),
|
||||||
/**
|
/**
|
||||||
* 查询批次详情API.
|
* 查询批次详情API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_FAVOR_STOCKS_DETAIL(HttpMethod.GET, "%s/v3/marketing/favor/stocks/{stock_id}"),
|
MARKETING_FAVOR_STOCKS_DETAIL(HttpMethod.GET, "%s/v3/marketing/favor/stocks/{stock_id}"),
|
||||||
/**
|
/**
|
||||||
* 查询代金券详情API
|
* 查询代金券详情API
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_FAVOR_USERS_COUPONS_DETAIL(HttpMethod.GET, "%s/v3/marketing/favor/users/{openid}/coupons/{coupon_id}"),
|
MARKETING_FAVOR_USERS_COUPONS_DETAIL(HttpMethod.GET, "%s/v3/marketing/favor/users/{openid}/coupons/{coupon_id}"),
|
||||||
/**
|
/**
|
||||||
* 查询代金券可用商户API.
|
* 查询代金券可用商户API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_FAVOR_STOCKS_MERCHANTS(HttpMethod.GET, "%s/v3/marketing/favor/stocks/{stock_id}/merchants"),
|
MARKETING_FAVOR_STOCKS_MERCHANTS(HttpMethod.GET, "%s/v3/marketing/favor/stocks/{stock_id}/merchants"),
|
||||||
/**
|
/**
|
||||||
* 查询代金券可用单品API.
|
* 查询代金券可用单品API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_FAVOR_STOCKS_ITEMS(HttpMethod.GET, "%s/v3/marketing/favor/stocks/{stock_id}/items"),
|
MARKETING_FAVOR_STOCKS_ITEMS(HttpMethod.GET, "%s/v3/marketing/favor/stocks/{stock_id}/items"),
|
||||||
/**
|
/**
|
||||||
* 下载批次核销明细API.
|
* 下载批次核销明细API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_FAVOR_STOCKS_USE_FLOW(HttpMethod.GET, "%s/v3/marketing/favor/stocks/{stock_id}/use-flow"),
|
MARKETING_FAVOR_STOCKS_USE_FLOW(HttpMethod.GET, "%s/v3/marketing/favor/stocks/{stock_id}/use-flow"),
|
||||||
/**
|
/**
|
||||||
* 下载批次退款明细API.
|
* 下载批次退款明细API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_FAVOR_STOCKS_REFUND_FLOW(HttpMethod.GET, "%s/v3/marketing/favor/stocks/{stock_id}/refund-flow"),
|
MARKETING_FAVOR_STOCKS_REFUND_FLOW(HttpMethod.GET, "%s/v3/marketing/favor/stocks/{stock_id}/refund-flow"),
|
||||||
/**
|
/**
|
||||||
* 营销图片上传API.
|
* 营销图片上传API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_IMAGE_UPLOAD(HttpMethod.POST, "%s/v3/marketing/favor/media/image-upload"),
|
MARKETING_IMAGE_UPLOAD(HttpMethod.POST, "%s/v3/marketing/favor/media/image-upload"),
|
||||||
/**
|
/**
|
||||||
* 设置核销回调通知API.
|
* 设置核销回调通知API.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
MARKETING_FAVOR_CALLBACKS(HttpMethod.POST, "%s/v3/marketing/favor/callbacks");
|
MARKETING_FAVOR_CALLBACKS(HttpMethod.POST, "%s/v3/marketing/favor/callbacks");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Pattern.
|
* The Pattern.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
private final String pattern;
|
private final String pattern;
|
||||||
/**
|
/**
|
||||||
* The Method.
|
* The Method.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
private final HttpMethod method;
|
private final HttpMethod method;
|
||||||
|
|
||||||
@@ -171,6 +349,7 @@ public enum WechatPayV3Type {
|
|||||||
*
|
*
|
||||||
* @param method the method
|
* @param method the method
|
||||||
* @param pattern the pattern
|
* @param pattern the pattern
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
WechatPayV3Type(HttpMethod method, String pattern) {
|
WechatPayV3Type(HttpMethod method, String pattern) {
|
||||||
this.method = method;
|
this.method = method;
|
||||||
@@ -181,6 +360,7 @@ public enum WechatPayV3Type {
|
|||||||
* Method string.
|
* Method string.
|
||||||
*
|
*
|
||||||
* @return the string
|
* @return the string
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
public HttpMethod method() {
|
public HttpMethod method() {
|
||||||
return this.method;
|
return this.method;
|
||||||
@@ -190,6 +370,7 @@ public enum WechatPayV3Type {
|
|||||||
* Pattern string.
|
* Pattern string.
|
||||||
*
|
*
|
||||||
* @return the string
|
* @return the string
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
public String pattern() {
|
public String pattern() {
|
||||||
return this.pattern;
|
return this.pattern;
|
||||||
@@ -201,6 +382,7 @@ public enum WechatPayV3Type {
|
|||||||
*
|
*
|
||||||
* @param weChatServer the we chat server
|
* @param weChatServer the we chat server
|
||||||
* @return the string
|
* @return the string
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
public String uri(WeChatServer weChatServer) {
|
public String uri(WeChatServer weChatServer) {
|
||||||
return String.format(this.pattern, weChatServer.domain());
|
return String.format(this.pattern, weChatServer.domain());
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class SignatureProvider {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 我方请求时加签,使用API证书.
|
* 我方请求前用 SHA256withRSA 加签,使用API证书.
|
||||||
*
|
*
|
||||||
* @param tenantId the properties key
|
* @param tenantId the properties key
|
||||||
* @param method the method
|
* @param method the method
|
||||||
@@ -195,7 +195,7 @@ public class SignatureProvider {
|
|||||||
ArrayNode certificates = bodyObjectNode.withArray("data");
|
ArrayNode certificates = bodyObjectNode.withArray("data");
|
||||||
if (certificates.isArray() && certificates.size() > 0) {
|
if (certificates.isArray() && certificates.size() > 0) {
|
||||||
CERTIFICATE_MAP.clear();
|
CERTIFICATE_MAP.clear();
|
||||||
final CertificateFactory cf = CertificateFactory.getInstance("X509");
|
final CertificateFactory certificateFactory = CertificateFactory.getInstance("X509");
|
||||||
certificates.forEach(objectNode -> {
|
certificates.forEach(objectNode -> {
|
||||||
JsonNode encryptCertificate = objectNode.get("encrypt_certificate");
|
JsonNode encryptCertificate = objectNode.get("encrypt_certificate");
|
||||||
String associatedData = encryptCertificate.get("associated_data").asText();
|
String associatedData = encryptCertificate.get("associated_data").asText();
|
||||||
@@ -204,21 +204,18 @@ public class SignatureProvider {
|
|||||||
String publicKey = decryptResponseBody(tenantId, associatedData, nonce, ciphertext);
|
String publicKey = decryptResponseBody(tenantId, associatedData, nonce, ciphertext);
|
||||||
|
|
||||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(publicKey.getBytes(StandardCharsets.UTF_8));
|
ByteArrayInputStream inputStream = new ByteArrayInputStream(publicKey.getBytes(StandardCharsets.UTF_8));
|
||||||
Certificate certificate = null;
|
|
||||||
try {
|
try {
|
||||||
certificate = cf.generateCertificate(inputStream);
|
Certificate certificate = certificateFactory.generateCertificate(inputStream);
|
||||||
|
String responseSerialNo = objectNode.get("serial_no").asText();
|
||||||
|
CERTIFICATE_MAP.put(responseSerialNo, certificate);
|
||||||
} catch (CertificateException e) {
|
} catch (CertificateException e) {
|
||||||
e.printStackTrace();
|
throw new PayException("An error occurred while generating the wechat v3 certificate, reason : " + e.getMessage());
|
||||||
}
|
}
|
||||||
String responseSerialNo = objectNode.get("serial_no").asText();
|
|
||||||
CERTIFICATE_MAP.put(responseSerialNo, certificate);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解密响应体.
|
* 解密响应体.
|
||||||
*
|
*
|
||||||
@@ -251,7 +248,6 @@ public class SignatureProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wechat meta container.
|
* Wechat meta container.
|
||||||
*
|
*
|
||||||
@@ -267,10 +263,9 @@ public class SignatureProvider {
|
|||||||
* @param components the components
|
* @param components the components
|
||||||
* @return string string
|
* @return string string
|
||||||
*/
|
*/
|
||||||
private String createSign(String... components) {
|
private static String createSign(String... components) {
|
||||||
return Arrays.stream(components)
|
return Arrays.stream(components)
|
||||||
.collect(Collectors.joining("\n", "", "\n"));
|
.collect(Collectors.joining("\n", "", "\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ public class WechatApiProvider {
|
|||||||
*
|
*
|
||||||
* @param tenantId the tenant id
|
* @param tenantId the tenant id
|
||||||
* @return the wechat marketing favor api
|
* @return the wechat marketing favor api
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
public WechatMarketingFavorApi favorApi(String tenantId) {
|
public WechatMarketingFavorApi favorApi(String tenantId) {
|
||||||
return new WechatMarketingFavorApi(this.wechatPayClient, tenantId);
|
return new WechatMarketingFavorApi(this.wechatPayClient, tenantId);
|
||||||
@@ -54,6 +55,7 @@ public class WechatApiProvider {
|
|||||||
*
|
*
|
||||||
* @param tenantId the tenant id
|
* @param tenantId the tenant id
|
||||||
* @return the wechat pay api
|
* @return the wechat pay api
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
public WechatDirectPayApi directPayApi(String tenantId) {
|
public WechatDirectPayApi directPayApi(String tenantId) {
|
||||||
return new WechatDirectPayApi(wechatPayClient, tenantId);
|
return new WechatDirectPayApi(wechatPayClient, tenantId);
|
||||||
@@ -64,16 +66,42 @@ public class WechatApiProvider {
|
|||||||
*
|
*
|
||||||
* @param tenantId the tenant id
|
* @param tenantId the tenant id
|
||||||
* @return the wechat combine pay api
|
* @return the wechat combine pay api
|
||||||
|
* @since 1.0.1.RELEASE
|
||||||
*/
|
*/
|
||||||
public WechatCombinePayApi combinePayApi(String tenantId) {
|
public WechatCombinePayApi combinePayApi(String tenantId) {
|
||||||
return new WechatCombinePayApi(wechatPayClient, tenantId);
|
return new WechatCombinePayApi(wechatPayClient, tenantId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付分.
|
||||||
|
*
|
||||||
|
* @param tenantId the tenant id
|
||||||
|
* @return the wechat pay score api
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
public WechatPayScoreApi payScoreApi(String tenantId) {
|
||||||
|
return new WechatPayScoreApi(wechatPayClient, tenantId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付先享卡.
|
||||||
|
*
|
||||||
|
* @param tenantId the tenant id
|
||||||
|
* @return the wechat discount card api
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
public WechatDiscountCardApi discountCardApi(String tenantId) {
|
||||||
|
return new WechatDiscountCardApi(wechatPayClient, tenantId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回调.
|
* 回调.
|
||||||
|
* <p>
|
||||||
|
* 需要处理白名单、幂等性问题。
|
||||||
*
|
*
|
||||||
* @param tenantId the tenant id
|
* @param tenantId the tenant id
|
||||||
* @return the wechat pay callback
|
* @return the wechat pay callback
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
public WechatPayCallback callback(String tenantId) {
|
public WechatPayCallback callback(String tenantId) {
|
||||||
return new WechatPayCallback(wechatPayClient.signatureProvider(), tenantId);
|
return new WechatPayCallback(wechatPayClient.signatureProvider(), tenantId);
|
||||||
|
|||||||
@@ -0,0 +1,120 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.WechatPayProperties;
|
||||||
|
import cn.felord.payment.wechat.enumeration.WeChatServer;
|
||||||
|
import cn.felord.payment.wechat.enumeration.WechatPayV3Type;
|
||||||
|
import cn.felord.payment.wechat.v3.model.discountcard.DiscountCardPreRequestParams;
|
||||||
|
import cn.felord.payment.wechat.v3.model.discountcard.UserRecordsParams;
|
||||||
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
|
import org.springframework.web.util.UriComponentsBuilder;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付先享卡.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
public class WechatDiscountCardApi extends AbstractApi {
|
||||||
|
/**
|
||||||
|
* Instantiates a new Abstract api.
|
||||||
|
*
|
||||||
|
* @param wechatPayClient the wechat pay client
|
||||||
|
* @param tenantId the tenant id
|
||||||
|
*/
|
||||||
|
public WechatDiscountCardApi(WechatPayClient wechatPayClient, String tenantId) {
|
||||||
|
super(wechatPayClient, tenantId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预受理领卡请求API
|
||||||
|
* <p>
|
||||||
|
* 商户在引导用户跳转先享卡领卡前,需要请求先享卡预受理领卡请求接口,再根据返回数据引导用户跳转领卡。
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> preRequest(DiscountCardPreRequestParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.DISCOUNT_CARD_PRE_REQUEST, params)
|
||||||
|
.function((wechatPayV3Type, requestParams) -> {
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.toUri();
|
||||||
|
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
requestParams.setAppid(v3.getAppId());
|
||||||
|
requestParams.setNotifyUrl(v3.getDomain().concat(requestParams.getNotifyUrl()));
|
||||||
|
return Post(uri, requestParams);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增加用户记录API
|
||||||
|
* <p>
|
||||||
|
* 当用户在商户侧消费时,用户完成了微信先享卡的目标或者获取使用优惠时,商户需要把这个信息同步给微信先享卡平台,用于在微信先享卡小程序展示及先享卡到期后的用户结算。
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return 返回http状态码 204 处理成功,应答无内容
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> addUserRecords(UserRecordsParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.DISCOUNT_CARD_ADD_USER_RECORDS, params)
|
||||||
|
.function((wechatPayV3Type, recordsParams) -> {
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.expand(recordsParams.getOutCardCode())
|
||||||
|
.toUri();
|
||||||
|
recordsParams.setOutCardCode(null);
|
||||||
|
return Post(uri, recordsParams);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询先享卡订单API
|
||||||
|
* <p>
|
||||||
|
* 商户可以通过商户领卡号查询指定的先享卡,可用于对账或者界面展示。
|
||||||
|
*
|
||||||
|
* @param outCardCode 商户领卡号
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> addUserRecords(String outCardCode) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.DISCOUNT_CARD_INFO, outCardCode)
|
||||||
|
.function((wechatPayV3Type, cardCode) -> {
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.expand(cardCode)
|
||||||
|
.toUri();
|
||||||
|
return Get(uri);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,7 +14,6 @@
|
|||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
package cn.felord.payment.wechat.v3;
|
package cn.felord.payment.wechat.v3;
|
||||||
|
|
||||||
@@ -89,12 +88,13 @@ public class WechatMarketingFavorApi extends AbstractApi {
|
|||||||
* @return the request entity
|
* @return the request entity
|
||||||
*/
|
*/
|
||||||
private RequestEntity<?> createStocksFunction(WechatPayV3Type type, StocksCreateParams params) {
|
private RequestEntity<?> createStocksFunction(WechatPayV3Type type, StocksCreateParams params) {
|
||||||
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
|
||||||
|
|
||||||
String mchId = v3.getMchId();
|
|
||||||
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
||||||
.build()
|
.build()
|
||||||
.toUri();
|
.toUri();
|
||||||
|
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
String mchId = v3.getMchId();
|
||||||
params.setBelongMerchant(mchId);
|
params.setBelongMerchant(mchId);
|
||||||
return Post(uri, params);
|
return Post(uri, params);
|
||||||
}
|
}
|
||||||
@@ -211,7 +211,7 @@ public class WechatMarketingFavorApi extends AbstractApi {
|
|||||||
private RequestEntity<?> startAndRestartAndPauseStockFunction(WechatPayV3Type type, String stockId) {
|
private RequestEntity<?> startAndRestartAndPauseStockFunction(WechatPayV3Type type, String stockId) {
|
||||||
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
String mchId = v3.getMchId();
|
String mchId = v3.getMchId();
|
||||||
Map<String, String> body = new HashMap<>();
|
Map<String, String> body = new HashMap<>(1);
|
||||||
body.put("stock_creator_mchid", mchId);
|
body.put("stock_creator_mchid", mchId);
|
||||||
|
|
||||||
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
|
||||||
|
|||||||
@@ -14,13 +14,21 @@
|
|||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
package cn.felord.payment.wechat.v3;
|
package cn.felord.payment.wechat.v3;
|
||||||
|
|
||||||
import cn.felord.payment.PayException;
|
import cn.felord.payment.PayException;
|
||||||
import cn.felord.payment.wechat.v3.model.*;
|
import cn.felord.payment.wechat.v3.model.CallbackParams;
|
||||||
|
import cn.felord.payment.wechat.v3.model.CouponConsumeData;
|
||||||
|
import cn.felord.payment.wechat.v3.model.ResponseSignVerifyParams;
|
||||||
|
import cn.felord.payment.wechat.v3.model.TransactionConsumeData;
|
||||||
|
import cn.felord.payment.wechat.v3.model.combine.CombineTransactionConsumeData;
|
||||||
|
import cn.felord.payment.wechat.v3.model.discountcard.*;
|
||||||
|
import cn.felord.payment.wechat.v3.model.payscore.PayScoreUserConfirmConsumeData;
|
||||||
|
import cn.felord.payment.wechat.v3.model.payscore.PayScoreUserPaidConsumeData;
|
||||||
|
import cn.felord.payment.wechat.v3.model.payscore.PayScoreUserPermissionConsumeData;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
@@ -36,6 +44,8 @@ import java.util.function.Consumer;
|
|||||||
/**
|
/**
|
||||||
* 微信支付回调工具.
|
* 微信支付回调工具.
|
||||||
* <p>
|
* <p>
|
||||||
|
* 注意:<strong>开发者应该保证回调调用的幂等性</strong>
|
||||||
|
* <p>
|
||||||
* 支付通知http应答码为200或204才会当作正常接收,当回调处理异常时,应答的HTTP状态码应为500,或者4xx。
|
* 支付通知http应答码为200或204才会当作正常接收,当回调处理异常时,应答的HTTP状态码应为500,或者4xx。
|
||||||
*
|
*
|
||||||
* @author felord.cn
|
* @author felord.cn
|
||||||
@@ -77,16 +87,17 @@ public class WechatPayCallback {
|
|||||||
/**
|
/**
|
||||||
* 微信支付代金券核销回调.
|
* 微信支付代金券核销回调.
|
||||||
*
|
*
|
||||||
* @param params the params
|
* @param params the params
|
||||||
* @param couponConsumeDataConsumer the coupon consume data consumer
|
* @param consumeDataConsumer the consume data consumer
|
||||||
* @return the map
|
* @return the map
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public Map<String, ?> couponCallback(ResponseSignVerifyParams params, Consumer<CouponConsumeData> couponConsumeDataConsumer) {
|
public Map<String, ?> couponCallback(ResponseSignVerifyParams params, Consumer<CouponConsumeData> consumeDataConsumer) {
|
||||||
String data = callback(params, EventType.COUPON);
|
String data = this.callback(params, EventType.COUPON);
|
||||||
CouponConsumeData couponConsumeData = MAPPER.readValue(data, CouponConsumeData.class);
|
CouponConsumeData consumeData = MAPPER.readValue(data, CouponConsumeData.class);
|
||||||
couponConsumeDataConsumer.accept(couponConsumeData);
|
consumeDataConsumer.accept(consumeData);
|
||||||
Map<String, Object> responseBody = new HashMap<>();
|
Map<String, Object> responseBody = new HashMap<>(2);
|
||||||
responseBody.put("code", 200);
|
responseBody.put("code", 200);
|
||||||
responseBody.put("message", "SUCCESS");
|
responseBody.put("message", "SUCCESS");
|
||||||
return responseBody;
|
return responseBody;
|
||||||
@@ -98,15 +109,16 @@ public class WechatPayCallback {
|
|||||||
* <p>
|
* <p>
|
||||||
* 无需开发者判断,只有扣款成功微信才会回调此接口
|
* 无需开发者判断,只有扣款成功微信才会回调此接口
|
||||||
*
|
*
|
||||||
* @param params the params
|
* @param params the params
|
||||||
* @param transactionConsumeDataConsumer the transaction consume data consumer
|
* @param consumeDataConsumer the consume data consumer
|
||||||
* @return the map
|
* @return the map
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public Map<String, ?> transactionCallback(ResponseSignVerifyParams params, Consumer<TransactionConsumeData> transactionConsumeDataConsumer) {
|
public Map<String, ?> transactionCallback(ResponseSignVerifyParams params, Consumer<TransactionConsumeData> consumeDataConsumer) {
|
||||||
String data = callback(params, EventType.TRANSACTION);
|
String data = this.callback(params, EventType.TRANSACTION);
|
||||||
TransactionConsumeData transactionConsumeData = MAPPER.readValue(data, TransactionConsumeData.class);
|
TransactionConsumeData consumeData = MAPPER.readValue(data, TransactionConsumeData.class);
|
||||||
transactionConsumeDataConsumer.accept(transactionConsumeData);
|
consumeDataConsumer.accept(consumeData);
|
||||||
return Collections.singletonMap("code", "SUCCESS");
|
return Collections.singletonMap("code", "SUCCESS");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -116,21 +128,121 @@ public class WechatPayCallback {
|
|||||||
* <p>
|
* <p>
|
||||||
* 无需开发者判断,只有扣款成功微信才会回调此接口
|
* 无需开发者判断,只有扣款成功微信才会回调此接口
|
||||||
*
|
*
|
||||||
* @param params the params
|
* @param params the params
|
||||||
* @param combineTransactionConsumeDataConsumer the combine transaction consume data consumer
|
* @param consumeDataConsumer the consume data consumer
|
||||||
* @return the map
|
* @return the map
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public Map<String, ?> combineTransactionCallback(ResponseSignVerifyParams params, Consumer<CombineTransactionConsumeData> combineTransactionConsumeDataConsumer) {
|
public Map<String, ?> combineTransactionCallback(ResponseSignVerifyParams params, Consumer<CombineTransactionConsumeData> consumeDataConsumer) {
|
||||||
String data = callback(params, EventType.TRANSACTION);
|
String data = this.callback(params, EventType.TRANSACTION);
|
||||||
CombineTransactionConsumeData combineTransactionConsumeData = MAPPER.readValue(data, CombineTransactionConsumeData.class);
|
CombineTransactionConsumeData consumeData = MAPPER.readValue(data, CombineTransactionConsumeData.class);
|
||||||
combineTransactionConsumeDataConsumer.accept(combineTransactionConsumeData);
|
consumeDataConsumer.accept(consumeData);
|
||||||
return Collections.singletonMap("code", "SUCCESS");
|
return Collections.singletonMap("code", "SUCCESS");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback string.
|
* 微信支付分确认订单、支付成功回调通知.
|
||||||
|
* <p>
|
||||||
|
* 该链接是通过商户 <a target= "_blank" href= "https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_1.shtml">创建支付分订单</a> 提交notify_url参数,必须为https协议。如果链接无法访问,商户将无法接收到微信通知。 通知url必须为直接可访问的url,不能携带参数。示例: “https://pay.weixin.qq.com/wxpay/pay.action”
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @param payScoreConsumer the pay score consumer
|
||||||
|
* @return the map
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@SneakyThrows
|
||||||
|
public Map<String, ?> payscoreUserOrderCallback(ResponseSignVerifyParams params, PayScoreConsumer payScoreConsumer) {
|
||||||
|
CallbackParams callbackParams = resolve(params);
|
||||||
|
String eventType = callbackParams.getEventType();
|
||||||
|
|
||||||
|
if (Objects.equals(eventType, EventType.PAYSCORE_USER_CONFIRM.event)) {
|
||||||
|
String data = this.decrypt(callbackParams);
|
||||||
|
PayScoreUserConfirmConsumeData confirmConsumeData = MAPPER.readValue(data, PayScoreUserConfirmConsumeData.class);
|
||||||
|
payScoreConsumer.getConfirmConsumeDataConsumer().accept(confirmConsumeData);
|
||||||
|
} else if (Objects.equals(eventType, EventType.PAYSCORE_USER_PAID.event)) {
|
||||||
|
String data = this.decrypt(callbackParams);
|
||||||
|
PayScoreUserPaidConsumeData paidConsumeData = MAPPER.readValue(data, PayScoreUserPaidConsumeData.class);
|
||||||
|
payScoreConsumer.getPaidConsumeDataConsumer().accept(paidConsumeData);
|
||||||
|
} else {
|
||||||
|
log.error("wechat pay event type is not matched, callbackParams {}", callbackParams);
|
||||||
|
throw new PayException(" wechat pay event type is not matched");
|
||||||
|
}
|
||||||
|
|
||||||
|
return Collections.singletonMap("code", "SUCCESS");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 授权/解除授权服务回调通知API.
|
||||||
|
* <p>
|
||||||
|
* 微信支付分通过授权/解除授权服务通知接口将用户过授权/解除授权服务消息通知给商户
|
||||||
|
* <p>
|
||||||
|
* 普通授权模式是通过[商户入驻配置申请表]提交service_notify_url设置,预授权模式是通过[商户预授权]提交的notify_url设置,必须为https协议。如果链接无法访问,商户将无法接收到微信通知。 通知url必须为直接可访问的url,不能携带参数。示例: “https://pay.weixin.qq.com/wxpay/pay.action”
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @param consumeDataConsumer the consume data consumer
|
||||||
|
* @return the map
|
||||||
|
*/
|
||||||
|
@SneakyThrows
|
||||||
|
public Map<String, ?> permissionCallback(ResponseSignVerifyParams params, Consumer<PayScoreUserPermissionConsumeData> consumeDataConsumer) {
|
||||||
|
CallbackParams callbackParams = resolve(params);
|
||||||
|
String eventType = callbackParams.getEventType();
|
||||||
|
boolean closed;
|
||||||
|
if (Objects.equals(eventType, EventType.PAYSCORE_USER_OPEN.event)) {
|
||||||
|
closed = false;
|
||||||
|
} else if (Objects.equals(eventType, EventType.PAYSCORE_USER_CLOSE.event)) {
|
||||||
|
closed = true;
|
||||||
|
} else {
|
||||||
|
log.error("wechat pay event type is not matched, callbackParams {}", callbackParams);
|
||||||
|
throw new PayException(" wechat pay event type is not matched");
|
||||||
|
}
|
||||||
|
String data = this.decrypt(callbackParams);
|
||||||
|
PayScoreUserPermissionConsumeData consumeData = MAPPER.readValue(data, PayScoreUserPermissionConsumeData.class);
|
||||||
|
consumeData.setClosed(closed);
|
||||||
|
consumeDataConsumer.accept(consumeData);
|
||||||
|
return Collections.singletonMap("code", "SUCCESS");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户领卡、守约状态变化、扣费状态变化通知API
|
||||||
|
* <p>
|
||||||
|
* 用户领取优惠卡后或者用户守约状态发生变更后或扣费状态变化后,微信会把对应信息发送给商户。
|
||||||
|
* <p>
|
||||||
|
* 该链接是通过商户<a target= "_blank" href= "https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/discount-card/chapter3_1.shtml">预受理领卡请求</a>中提交notify_url参数,必须为https协议。如果链接无法访问,商户将无法接收到微信通知。 通知url必须为直接可访问的url,不能携带参数。示例: “https://pay.weixin.qq.com/wxpay/pay.action”
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @param discountCardConsumer the discount card consumer
|
||||||
|
* @return the map
|
||||||
|
*/
|
||||||
|
@SneakyThrows
|
||||||
|
public Map<String, ?> discountCardCallback(ResponseSignVerifyParams params, DiscountCardConsumer discountCardConsumer) {
|
||||||
|
|
||||||
|
CallbackParams callbackParams = resolve(params);
|
||||||
|
String eventType = callbackParams.getEventType();
|
||||||
|
|
||||||
|
if (Objects.equals(eventType, EventType.DISCOUNT_CARD_AGREEMENT_ENDED.event)) {
|
||||||
|
String data = this.decrypt(callbackParams);
|
||||||
|
DiscountCardAgreementEndConsumeData agreementEndConsumeData = MAPPER.readValue(data, DiscountCardAgreementEndConsumeData.class);
|
||||||
|
discountCardConsumer.getAgreementEndConsumeDataConsumer().accept(agreementEndConsumeData);
|
||||||
|
} else if (Objects.equals(eventType, EventType.DISCOUNT_CARD_USER_ACCEPTED.event)) {
|
||||||
|
String data = this.decrypt(callbackParams);
|
||||||
|
DiscountCardAcceptedConsumeData acceptedConsumeData = MAPPER.readValue(data, DiscountCardAcceptedConsumeData.class);
|
||||||
|
discountCardConsumer.getAcceptedConsumeDataConsumer().accept(acceptedConsumeData);
|
||||||
|
} else if (Objects.equals(eventType, EventType.DISCOUNT_CARD_USER_PAID.event)) {
|
||||||
|
String data = this.decrypt(callbackParams);
|
||||||
|
DiscountCardUserPaidConsumeData paidConsumeData = MAPPER.readValue(data, DiscountCardUserPaidConsumeData.class);
|
||||||
|
discountCardConsumer.getCardUserPaidConsumeDataConsumer().accept(paidConsumeData);
|
||||||
|
} else {
|
||||||
|
log.error("wechat pay event type is not matched, callbackParams {}", callbackParams);
|
||||||
|
throw new PayException(" wechat pay event type is not matched");
|
||||||
|
}
|
||||||
|
return Collections.singletonMap("code", "SUCCESS");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback.
|
||||||
*
|
*
|
||||||
* @param params the params
|
* @param params the params
|
||||||
* @param eventType the event type
|
* @param eventType the event type
|
||||||
@@ -138,24 +250,48 @@ public class WechatPayCallback {
|
|||||||
*/
|
*/
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
private String callback(ResponseSignVerifyParams params, EventType eventType) {
|
private String callback(ResponseSignVerifyParams params, EventType eventType) {
|
||||||
if (signatureProvider.responseSignVerify(params)) {
|
CallbackParams callbackParams = this.resolve(params);
|
||||||
CallbackParams callbackParams = MAPPER.readValue(params.getBody(), CallbackParams.class);
|
|
||||||
|
|
||||||
if (!Objects.equals(callbackParams.getEventType(), eventType.event)) {
|
if (!Objects.equals(callbackParams.getEventType(), eventType.event)) {
|
||||||
log.error("wechat pay event type is not matched, callbackParams {}", callbackParams);
|
log.error("wechat pay event type is not matched, callbackParams {}", callbackParams);
|
||||||
throw new PayException(" wechat pay event type is not matched");
|
throw new PayException(" wechat pay event type is not matched");
|
||||||
}
|
}
|
||||||
CallbackParams.Resource resource = callbackParams.getResource();
|
return this.decrypt(callbackParams);
|
||||||
String associatedData = resource.getAssociatedData();
|
}
|
||||||
String nonce = resource.getNonce();
|
|
||||||
String ciphertext = resource.getCiphertext();
|
/**
|
||||||
String data = signatureProvider.decryptResponseBody(tenantId, associatedData, nonce, ciphertext);
|
* Resolve callback params.
|
||||||
Assert.hasText(data, "decryptData is required");
|
*
|
||||||
return data;
|
* @param params the params
|
||||||
|
* @return the callback params
|
||||||
|
* @throws JsonProcessingException the json processing exception
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
private CallbackParams resolve(ResponseSignVerifyParams params) throws JsonProcessingException {
|
||||||
|
if (signatureProvider.responseSignVerify(params)) {
|
||||||
|
return MAPPER.readValue(params.getBody(), CallbackParams.class);
|
||||||
}
|
}
|
||||||
throw new PayException("invalid wechat pay callback");
|
throw new PayException("invalid wechat pay callback");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decrypt.
|
||||||
|
*
|
||||||
|
* @param callbackParams the callback params
|
||||||
|
* @return the string
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
private String decrypt(CallbackParams callbackParams) {
|
||||||
|
CallbackParams.Resource resource = callbackParams.getResource();
|
||||||
|
String associatedData = resource.getAssociatedData();
|
||||||
|
String nonce = resource.getNonce();
|
||||||
|
String ciphertext = resource.getCiphertext();
|
||||||
|
String data = signatureProvider.decryptResponseBody(tenantId, associatedData, nonce, ciphertext);
|
||||||
|
Assert.hasText(data, "decryptData is required");
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 事件类型用于处理回调.
|
* 事件类型用于处理回调.
|
||||||
*
|
*
|
||||||
@@ -163,12 +299,66 @@ public class WechatPayCallback {
|
|||||||
* @since 1.0.0.RELEASE
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
enum EventType {
|
enum EventType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付分确认订单事件.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAYSCORE_USER_CONFIRM("PAYSCORE.USER_CONFIRM"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付分用户支付成功订单事件.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAYSCORE_USER_PAID("PAYSCORE.USER_PAID"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付分授权事件.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAYSCORE_USER_OPEN("PAYSCORE.USER_OPEN_SERVICE"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付分解除授权事件.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
PAYSCORE_USER_CLOSE("PAYSCORE.USER_CLOSE_SERVICE"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户领取微信先享卡事件.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
DISCOUNT_CARD_USER_ACCEPTED("DISCOUNT_CARD.USER_ACCEPTED"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信先享卡守约状态变化事件.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
DISCOUNT_CARD_AGREEMENT_ENDED("DISCOUNT_CARD.AGREEMENT_ENDED"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信先享卡扣费状态变化事件.
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
DISCOUNT_CARD_USER_PAID("DISCOUNT_CARD.USER_PAID"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 优惠券核销事件.
|
* 优惠券核销事件.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
COUPON("COUPON.USE"),
|
COUPON("COUPON.USE"),
|
||||||
/**
|
/**
|
||||||
* 支付成功事件.
|
* 支付成功事件.
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
TRANSACTION("TRANSACTION.SUCCESS");
|
TRANSACTION("TRANSACTION.SUCCESS");
|
||||||
|
|
||||||
@@ -187,5 +377,4 @@ public class WechatPayCallback {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -199,8 +199,7 @@ public class WechatPayClient {
|
|||||||
Assert.notNull(httpMethod, "httpMethod is required");
|
Assert.notNull(httpMethod, "httpMethod is required");
|
||||||
HttpHeaders headers = requestEntity.getHeaders();
|
HttpHeaders headers = requestEntity.getHeaders();
|
||||||
|
|
||||||
T entityBody = requestEntity.getBody();
|
String body = requestEntity.hasBody() ? Objects.requireNonNull(requestEntity.getBody()).toString() : "";
|
||||||
String body = requestEntity.hasBody() ? Objects.requireNonNull(entityBody).toString() : "";
|
|
||||||
if (WechatPayV3Type.MARKETING_IMAGE_UPLOAD.pattern().contains(canonicalUrl)) {
|
if (WechatPayV3Type.MARKETING_IMAGE_UPLOAD.pattern().contains(canonicalUrl)) {
|
||||||
body = Objects.requireNonNull(headers.get("Meta-Info")).get(0);
|
body = Objects.requireNonNull(headers.get("Meta-Info")).get(0);
|
||||||
}
|
}
|
||||||
@@ -211,7 +210,7 @@ public class WechatPayClient {
|
|||||||
HttpHeaders httpHeaders = new HttpHeaders();
|
HttpHeaders httpHeaders = new HttpHeaders();
|
||||||
httpHeaders.addAll(headers);
|
httpHeaders.addAll(headers);
|
||||||
httpHeaders.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
|
httpHeaders.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
|
||||||
// 兼容图片上传,自定义优先级最高
|
// for upload
|
||||||
if (Objects.isNull(httpHeaders.getContentType())) {
|
if (Objects.isNull(httpHeaders.getContentType())) {
|
||||||
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
||||||
}
|
}
|
||||||
@@ -236,13 +235,13 @@ public class WechatPayClient {
|
|||||||
HttpHeaders headers = responseEntity.getHeaders();
|
HttpHeaders headers = responseEntity.getHeaders();
|
||||||
ObjectNode body = responseEntity.getBody();
|
ObjectNode body = responseEntity.getBody();
|
||||||
HttpStatus statusCode = responseEntity.getStatusCode();
|
HttpStatus statusCode = responseEntity.getStatusCode();
|
||||||
|
// 微信请求id
|
||||||
|
String requestId = headers.getFirst("Request-ID");
|
||||||
if (!statusCode.is2xxSuccessful()) {
|
if (!statusCode.is2xxSuccessful()) {
|
||||||
throw new PayException("wechat pay server error,statusCode " + statusCode + ",result : " + body);
|
throw new PayException("wechat pay server error, Request-ID "+requestId+" , statusCode " + statusCode + ",result : " + body);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResponseSignVerifyParams params = new ResponseSignVerifyParams();
|
ResponseSignVerifyParams params = new ResponseSignVerifyParams();
|
||||||
// 微信请求回调id
|
|
||||||
// String RequestId = response.header("Request-ID");
|
|
||||||
// 微信平台证书序列号 用来取微信平台证书
|
// 微信平台证书序列号 用来取微信平台证书
|
||||||
params.setWechatpaySerial(headers.getFirst("Wechatpay-Serial"));
|
params.setWechatpaySerial(headers.getFirst("Wechatpay-Serial"));
|
||||||
//获取应答签名
|
//获取应答签名
|
||||||
@@ -262,7 +261,7 @@ public class WechatPayClient {
|
|||||||
responseConsumer.accept(responseEntity);
|
responseConsumer.accept(responseEntity);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new PayException("wechat pay signature failed");
|
throw new PayException("wechat pay signature failed, Request-ID "+requestId );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,11 +278,13 @@ public class WechatPayClient {
|
|||||||
|
|
||||||
String body = responseEntity.getBody();
|
String body = responseEntity.getBody();
|
||||||
HttpStatus statusCode = responseEntity.getStatusCode();
|
HttpStatus statusCode = responseEntity.getStatusCode();
|
||||||
|
// 微信请求id
|
||||||
|
String requestId = requestEntity.getHeaders().getFirst("Request-ID");
|
||||||
if (!statusCode.is2xxSuccessful()) {
|
if (!statusCode.is2xxSuccessful()) {
|
||||||
throw new PayException("wechat pay server error,statusCode " + statusCode + ",result : " + body);
|
throw new PayException("wechat pay server error, Request-ID "+requestId+" , statusCode " + statusCode + ",result : " + body);
|
||||||
}
|
}
|
||||||
if (Objects.isNull(body)) {
|
if (Objects.isNull(body)) {
|
||||||
throw new PayException("cant obtain wechat response body");
|
throw new PayException("cant obtain wechat response body, Request-ID "+requestId);
|
||||||
}
|
}
|
||||||
return body;
|
return body;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,469 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.WechatPayProperties;
|
||||||
|
import cn.felord.payment.wechat.enumeration.WeChatServer;
|
||||||
|
import cn.felord.payment.wechat.enumeration.WechatPayV3Type;
|
||||||
|
import cn.felord.payment.wechat.v3.model.payscore.*;
|
||||||
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
|
import org.springframework.util.LinkedMultiValueMap;
|
||||||
|
import org.springframework.util.MultiValueMap;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.web.util.UriComponentsBuilder;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付分API.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
public class WechatPayScoreApi extends AbstractApi {
|
||||||
|
/**
|
||||||
|
* Instantiates a new Abstract api.
|
||||||
|
*
|
||||||
|
* @param wechatPayClient the wechat pay client
|
||||||
|
* @param tenantId the tenant id
|
||||||
|
*/
|
||||||
|
public WechatPayScoreApi(WechatPayClient wechatPayClient, String tenantId) {
|
||||||
|
super(wechatPayClient, tenantId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付分-查询用户授权状态API.
|
||||||
|
* <p>
|
||||||
|
* 免确认订单起始接口,【免确认订单模式】是高级接口权限,参见:<a href="https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter2_5.shtml">业务流程说明</a>
|
||||||
|
* <p>
|
||||||
|
* 用户申请使用服务时,商户可通过此接口查询用户是否“已授权”本服务。在“已授权”状态下的服务,用户才可以申请使用。
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> userServiceState(UserServiceStateParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_USER_SERVICE_STATE, params)
|
||||||
|
.function((wechatPayV3Type, userServiceStateParams) -> {
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
|
||||||
|
MultiValueMap<String, String> expandParams = new LinkedMultiValueMap<>();
|
||||||
|
expandParams.add("appid", v3.getAppId());
|
||||||
|
expandParams.add("service_id", params.getServiceId());
|
||||||
|
expandParams.add("openid", params.getOpenId());
|
||||||
|
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.expand(expandParams)
|
||||||
|
.toUri();
|
||||||
|
return Get(uri);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建支付分订单API
|
||||||
|
* <p>
|
||||||
|
* 用户申请使用服务时,商户可通过此接口申请创建微信支付分订单。
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> createServiceOrder(UserServiceOrderParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_CREATE_USER_SERVICE_ORDER, params)
|
||||||
|
.function((wechatPayV3Type, orderParams) -> {
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
|
||||||
|
orderParams.setAppid(v3.getAppId());
|
||||||
|
orderParams.setNotifyUrl(v3.getDomain().concat(orderParams.getNotifyUrl()));
|
||||||
|
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.toUri();
|
||||||
|
return Post(uri, orderParams);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询支付分订单API
|
||||||
|
* <p>
|
||||||
|
* 用于查询单笔微信支付分订单详细信息。
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> queryServiceOrder(QueryServiceOrderParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_QUERY_USER_SERVICE_ORDER, params)
|
||||||
|
.function((wechatPayV3Type, orderParams) -> {
|
||||||
|
MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<>();
|
||||||
|
|
||||||
|
String outOrderNo = orderParams.getOutOrderNo();
|
||||||
|
if (StringUtils.hasText(outOrderNo)) {
|
||||||
|
queryParams.add("out_order_no", outOrderNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
String queryId = orderParams.getQueryId();
|
||||||
|
if (StringUtils.hasText(queryId)) {
|
||||||
|
queryParams.add("query_id", queryId);
|
||||||
|
}
|
||||||
|
queryParams.add("service_id", orderParams.getServiceId());
|
||||||
|
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
queryParams.add("appid", v3.getAppId());
|
||||||
|
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.queryParams(queryParams)
|
||||||
|
.build()
|
||||||
|
.toUri();
|
||||||
|
return Get(uri);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消支付分订单API
|
||||||
|
* <p>
|
||||||
|
* 微信支付分订单创建之后,由于某些原因导致订单不能正常支付时,可使用此接口取消订单。
|
||||||
|
* <p>
|
||||||
|
* 订单为以下状态时可以取消订单:CREATED(已创单)、DOING(进行中)(包括商户完结支付分订单后,且支付分订单收款状态为待支付USER_PAYING)
|
||||||
|
* <p>
|
||||||
|
* 注意:
|
||||||
|
* • DOING状态包含了订单用户确认、已完结-待支付(USER_PAYING)的状态,因此这种状态下订单也是可以被取消的,请确认当前操作是否正确,防止误操作将完结后需要支付分收款的单据取消。
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> cancelServiceOrder(CancelServiceOrderParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_CANCEL_USER_SERVICE_ORDER, params)
|
||||||
|
.function((wechatPayV3Type, orderParams) -> {
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.expand(orderParams.getOutOrderNo())
|
||||||
|
.toUri();
|
||||||
|
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
orderParams.setAppid(v3.getAppId());
|
||||||
|
orderParams.setOutOrderNo(null);
|
||||||
|
return Post(uri, orderParams);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单金额API
|
||||||
|
* <p>
|
||||||
|
* 完结订单总金额与实际金额不符时,可通过该接口修改订单金额。
|
||||||
|
* 例如:充电宝场景,由于机器计费问题导致商户完结订单时扣除用户99元,用户客诉成功后,商户需要按照实际的消费金额(如10元)扣费,当服务订单支付状态处于“待支付”时,商户可使用此能力修改订单金额。
|
||||||
|
* <p>
|
||||||
|
* 注意:
|
||||||
|
* • 若此笔订单已收款成功,商户直接使用退款能力,将差价退回用户即可。
|
||||||
|
* <p>
|
||||||
|
* • 修改次数>=1,第n次修改后金额 <第n-1次修改后金额
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> modifyServiceOrder(ModifyServiceOrderParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_MODIFY_USER_SERVICE_ORDER, params)
|
||||||
|
.function((wechatPayV3Type, orderParams) -> {
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.expand(orderParams.getOutOrderNo())
|
||||||
|
.toUri();
|
||||||
|
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
orderParams.setAppid(v3.getAppId());
|
||||||
|
orderParams.setOutOrderNo(null);
|
||||||
|
return Post(uri, orderParams);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完结支付分订单API
|
||||||
|
* <p>
|
||||||
|
* 前置条件:服务订单状态为“进行中”且订单状态说明需为[USER_CONFIRM:用户确认]
|
||||||
|
* <p>
|
||||||
|
* 完结微信支付分订单。用户使用服务完成后,商户可通过此接口完结订单。
|
||||||
|
* <p>
|
||||||
|
* 特别说明:
|
||||||
|
* • 完结接口调用成功后,微信支付将自动发起免密代扣。 若扣款失败,微信支付将自动再次发起免密代扣(按照一定频次),直到扣成功为止。
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> completeServiceOrder(CompleteServiceOrderParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_COMPLETE_USER_SERVICE_ORDER, params)
|
||||||
|
.function((wechatPayV3Type, orderParams) -> {
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.expand(orderParams.getOutOrderNo())
|
||||||
|
.toUri();
|
||||||
|
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
orderParams.setAppid(v3.getAppId());
|
||||||
|
orderParams.setOutOrderNo(null);
|
||||||
|
return Post(uri, orderParams);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户发起催收扣款API
|
||||||
|
* <p>
|
||||||
|
* 前置条件:服务订单支付状态处于“待支付”状态
|
||||||
|
* <p>
|
||||||
|
* 当微信支付分订单支付状态处于“待支付”时,商户可使用该接口向用户发起收款。
|
||||||
|
* <p>
|
||||||
|
* 注意:
|
||||||
|
* • 此能力不影响微信支付分代商户向用户发起收款的策略。
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> payServiceOrder(PayServiceOrderParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_PAY_USER_SERVICE_ORDER, params)
|
||||||
|
.function((wechatPayV3Type, orderParams) -> {
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.expand(orderParams.getOutOrderNo())
|
||||||
|
.toUri();
|
||||||
|
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
orderParams.setAppid(v3.getAppId());
|
||||||
|
orderParams.setOutOrderNo(null);
|
||||||
|
return Post(uri, orderParams);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步服务订单信息API
|
||||||
|
* <p>
|
||||||
|
* 前提条件:同步商户渠道收款成功信息时,即场景类型=“Order_Paid”,订单的状态需为[MCH_COMPLETE:商户完结订单]
|
||||||
|
* <p>
|
||||||
|
* 由于收款商户进行的某些“线下操作”会导致微信支付侧的订单状态与实际情况不符。例如,用户通过线下付款的方式已经完成支付,而微信支付侧并未支付成功,此时可能导致用户重复支付。因此商户需要通过订单同步接口将订单状态同步给微信支付,修改订单在微信支付系统中的状态。
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> syncServiceOrder(SyncServiceOrderParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_SYNC_USER_SERVICE_ORDER, params)
|
||||||
|
.function((wechatPayV3Type, orderParams) -> {
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.expand(orderParams.getOutOrderNo())
|
||||||
|
.toUri();
|
||||||
|
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
orderParams.setAppid(v3.getAppId());
|
||||||
|
orderParams.setOutOrderNo(null);
|
||||||
|
return Post(uri, orderParams);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创单结单合并API
|
||||||
|
* <p>
|
||||||
|
* 相对需确认模式,免确认模式减少了用户确认授权这步操作,因此在免确认模式下商户无法获取用户的授权状态,为了解决商户的困扰,我们为免确认模式特别提供了查询授权状态和调起授权页面的api接口,这些接口仅在免确认模式下需要调用,且必须调用。
|
||||||
|
* <p>
|
||||||
|
* <p>
|
||||||
|
* 该接口适用于无需微信支付分做订单风控判断的业务场景,在服务完成后,通过该接口对用户进行免密代扣。
|
||||||
|
* <p>
|
||||||
|
* 注意:
|
||||||
|
* • 限制条件:【免确认订单模式】,用户已授权状态下,可调用该接口。
|
||||||
|
* <p>
|
||||||
|
* <p>
|
||||||
|
* 特别提醒:创单结单合并接口暂未对外开放,如有需要请咨询对接的微信支付运营人员,申请开通调用权限。
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> directCompleteServiceOrder(DirectCompleteServiceOrderParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_DIRECT_COMPLETE, params)
|
||||||
|
.function((wechatPayV3Type, orderParams) -> {
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.toUri();
|
||||||
|
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
orderParams.setAppid(v3.getAppId());
|
||||||
|
String notifyUrl = orderParams.getNotifyUrl();
|
||||||
|
if (StringUtils.hasText(notifyUrl)) {
|
||||||
|
orderParams.setNotifyUrl(v3.getDomain().concat(notifyUrl));
|
||||||
|
}
|
||||||
|
return Post(uri, orderParams);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户预授权API
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> permissions(ServiceOrderPermissionParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_PERMISSIONS, params)
|
||||||
|
.function((wechatPayV3Type, orderParams) -> {
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.toUri();
|
||||||
|
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
String notifyUrl = orderParams.getNotifyUrl();
|
||||||
|
orderParams.setAppid(v3.getAppId());
|
||||||
|
if (StringUtils.hasText(notifyUrl)) {
|
||||||
|
orderParams.setNotifyUrl(v3.getDomain().concat(notifyUrl));
|
||||||
|
}
|
||||||
|
return Post(uri, orderParams);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询与用户授权记录(授权协议号)API
|
||||||
|
* <p>
|
||||||
|
* 通过authorization_code,商户查询与用户授权关系
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> queryPermissionsByAuthCode(PermissionsAuthCodeParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_PERMISSIONS_AUTH_CODE, params)
|
||||||
|
.function((wechatPayV3Type, orderParams) -> {
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.queryParam("service_id", orderParams.getServiceId())
|
||||||
|
.build()
|
||||||
|
.expand(orderParams.getAuthorizationCode())
|
||||||
|
.toUri();
|
||||||
|
|
||||||
|
return Get(uri);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解除用户授权关系(授权协议号)API
|
||||||
|
* <p>
|
||||||
|
* 通过authorization_code,商户解除用户授权关系
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> terminatePermissionsByAuthCode(PermissionsAuthCodeParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_TERMINATE_PERMISSIONS_AUTH_CODE, params)
|
||||||
|
.function((wechatPayV3Type, orderParams) -> {
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.expand(orderParams.getAuthorizationCode())
|
||||||
|
.toUri();
|
||||||
|
orderParams.setAuthorizationCode(null);
|
||||||
|
return Post(uri, orderParams);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询与用户授权记录(openid)API
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> queryPermissionsByOpenId(PermissionsOpenIdParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_PERMISSIONS_OPENID, params)
|
||||||
|
.function((wechatPayV3Type, orderParams) -> {
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.queryParam("appid", v3.getAppId())
|
||||||
|
.queryParam("service_id", orderParams.getServiceId())
|
||||||
|
.build()
|
||||||
|
.expand(orderParams.getOpenid())
|
||||||
|
.toUri();
|
||||||
|
return Get(uri);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解除用户授权关系(openid)API
|
||||||
|
*
|
||||||
|
* @param params the params
|
||||||
|
* @return the wechat response entity
|
||||||
|
*/
|
||||||
|
public WechatResponseEntity<ObjectNode> terminatePermissionsByOpenId(PermissionsOpenIdParams params) {
|
||||||
|
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
|
||||||
|
this.client().withType(WechatPayV3Type.PAY_SCORE_TERMINATE_PERMISSIONS_OPENID, params)
|
||||||
|
.function((wechatPayV3Type, orderParams) -> {
|
||||||
|
|
||||||
|
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
|
||||||
|
.build()
|
||||||
|
.expand(orderParams.getOpenid())
|
||||||
|
.toUri();
|
||||||
|
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
|
||||||
|
orderParams.setAppid(v3.getAppId());
|
||||||
|
orderParams.setOpenid(null);
|
||||||
|
return Post(uri, orderParams);
|
||||||
|
})
|
||||||
|
.consumer(wechatResponseEntity::convert)
|
||||||
|
.request();
|
||||||
|
return wechatResponseEntity;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,7 +15,8 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
*/ package cn.felord.payment.wechat.v3;
|
*/
|
||||||
|
package cn.felord.payment.wechat.v3;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
@@ -30,7 +29,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class CouponConsumeData {
|
public class CouponConsumeData {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Available begin time.
|
* The Available begin time.
|
||||||
*/
|
*/
|
||||||
@@ -54,7 +52,7 @@ public class CouponConsumeData {
|
|||||||
/**
|
/**
|
||||||
* The Coupon type.
|
* The Coupon type.
|
||||||
*/
|
*/
|
||||||
private String couponType;
|
private CouponType couponType;
|
||||||
/**
|
/**
|
||||||
* The Create time.
|
* The Create time.
|
||||||
*/
|
*/
|
||||||
@@ -70,7 +68,7 @@ public class CouponConsumeData {
|
|||||||
/**
|
/**
|
||||||
* The No cash.
|
* The No cash.
|
||||||
*/
|
*/
|
||||||
private boolean noCash;
|
private Boolean noCash;
|
||||||
/**
|
/**
|
||||||
* The Normal coupon information.
|
* The Normal coupon information.
|
||||||
*/
|
*/
|
||||||
@@ -78,7 +76,7 @@ public class CouponConsumeData {
|
|||||||
/**
|
/**
|
||||||
* The Singleitem.
|
* The Singleitem.
|
||||||
*/
|
*/
|
||||||
private boolean singleitem;
|
private Boolean singleitem;
|
||||||
/**
|
/**
|
||||||
* The Singleitem discount off.
|
* The Singleitem discount off.
|
||||||
*/
|
*/
|
||||||
@@ -96,5 +94,19 @@ public class CouponConsumeData {
|
|||||||
*/
|
*/
|
||||||
private String stockId;
|
private String stockId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 券类型
|
||||||
|
*
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
public enum CouponType{
|
||||||
|
/**
|
||||||
|
* 满减券
|
||||||
|
*/
|
||||||
|
NORMAL,
|
||||||
|
/**
|
||||||
|
* 减至券
|
||||||
|
*/
|
||||||
|
CUT_TO
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
@@ -15,7 +14,6 @@
|
|||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
package cn.felord.payment.wechat.v3.model;
|
package cn.felord.payment.wechat.v3.model;
|
||||||
|
|
||||||
@@ -34,37 +32,78 @@ public class CouponUseRule {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Available items.
|
* 可核销商品编码
|
||||||
*/
|
*/
|
||||||
private List<String> availableItems;
|
private List<String> availableItems;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Available merchants.
|
* 可用商户
|
||||||
*/
|
*/
|
||||||
private List<String> availableMerchants;
|
private List<String> availableMerchants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Combine use.
|
* 是否可以叠加使用
|
||||||
*/
|
*/
|
||||||
private Boolean combineUse;
|
private Boolean combineUse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Coupon available time.
|
* 券生效时间
|
||||||
*/
|
*/
|
||||||
private CouponAvailableTime couponAvailableTime;
|
private CouponAvailableTime couponAvailableTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Fixed normal coupon.
|
* 固定面额满减券使用规则
|
||||||
*/
|
*/
|
||||||
private FixedNormalCoupon fixedNormalCoupon;
|
private FixedNormalCoupon fixedNormalCoupon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Goods tag.
|
* 订单优惠标记
|
||||||
*/
|
*/
|
||||||
private List<String> goodsTag;
|
private List<String> goodsTag;
|
||||||
|
/**
|
||||||
|
* 指定支付方式
|
||||||
|
*/
|
||||||
|
private List<String> limitPay;
|
||||||
|
/**
|
||||||
|
* 指定银行卡BIN
|
||||||
|
*/
|
||||||
|
private LimitCard limitCard;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Trade type.
|
* 支付方式,枚举值:
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li>MICROAPP:小程序支付</li>
|
||||||
|
* <li>APPPAY:APP支付</li>
|
||||||
|
* <li>PPAY:免密支付</li>
|
||||||
|
* <li>CARD:刷卡支付</li>
|
||||||
|
* <li>FACE:人脸支付</li>
|
||||||
|
* <li>OTHER:其他支付</li>
|
||||||
|
* </ul>
|
||||||
*/
|
*/
|
||||||
private String tradeType;
|
private String tradeType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定银行卡BIN
|
||||||
|
* <p>
|
||||||
|
* 限定该批次核销的指定银行卡BIN,当批次限定了指定银行卡时方可生效
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class LimitCard {
|
||||||
|
/**
|
||||||
|
* 银行卡名称
|
||||||
|
* <p>
|
||||||
|
* 将在微信支付收银台向用户展示,最多4个中文字
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 指定卡BIN
|
||||||
|
* <p>
|
||||||
|
* 使用指定卡BIN的银行卡支付方可享受优惠,按json格式
|
||||||
|
* 特殊规则:单个卡BIN的字符长度为【6,9】,条目个数限制为【1,10】。
|
||||||
|
* 示例值:['62123456','62123457']
|
||||||
|
*/
|
||||||
|
private List<String> bin;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
@@ -17,6 +16,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cn.felord.payment.wechat.v3.model;
|
package cn.felord.payment.wechat.v3.model;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ public class SettleInfo {
|
|||||||
/**
|
/**
|
||||||
* 是否指定分账
|
* 是否指定分账
|
||||||
*/
|
*/
|
||||||
private boolean profitSharing;
|
private Boolean profitSharing;
|
||||||
/**
|
/**
|
||||||
* 补差金额
|
* 补差金额
|
||||||
*/
|
*/
|
||||||
private int subsidyAmount;
|
private Integer subsidyAmount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
package cn.felord.payment.wechat.v3.model;
|
package cn.felord.payment.wechat.v3.model;
|
||||||
|
|
||||||
@@ -72,7 +71,7 @@ public class StocksCreateParams {
|
|||||||
/**
|
/**
|
||||||
* 扩展属性
|
* 扩展属性
|
||||||
*/
|
*/
|
||||||
private String ext_info;
|
private String extInfo;
|
||||||
/**
|
/**
|
||||||
* 批次使用规则
|
* 批次使用规则
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
package cn.felord.payment.wechat.v3.model;
|
package cn.felord.payment.wechat.v3.model;
|
||||||
|
|
||||||
@@ -37,28 +36,14 @@ public class StocksQueryParams {
|
|||||||
* 必填
|
* 必填
|
||||||
* <p>
|
* <p>
|
||||||
* 条件查询批次列表API 页码从0开始,默认第0页,传递1可能出错。
|
* 条件查询批次列表API 页码从0开始,默认第0页,传递1可能出错。
|
||||||
* <p>
|
|
||||||
* 查询代金券可用商户API 分页页码,最大1000。
|
|
||||||
* <p>
|
|
||||||
* 查询代金券可用单品API 最大500。
|
|
||||||
*/
|
*/
|
||||||
private Integer offset = 0;
|
private Integer offset = 0;
|
||||||
/**
|
/**
|
||||||
* 必填
|
* 必填
|
||||||
* <p>
|
* <p>
|
||||||
* 条件查询批次列表API 分页大小,最大10。
|
* 条件查询批次列表API 分页大小,最大10。
|
||||||
* <p>
|
|
||||||
* 查询代金券可用商户API 最大50。
|
|
||||||
* <p>
|
|
||||||
* 查询代金券可用单品API 最大100。
|
|
||||||
*/
|
*/
|
||||||
private Integer limit = 10;
|
private Integer limit = 10;
|
||||||
/* *//**
|
|
||||||
* 根据API而定
|
|
||||||
* <p>
|
|
||||||
* 批次ID
|
|
||||||
*//*
|
|
||||||
private String stockId;*/
|
|
||||||
/**
|
/**
|
||||||
* 选填
|
* 选填
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
@@ -19,6 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
package cn.felord.payment.wechat.v3.model;
|
package cn.felord.payment.wechat.v3.model;
|
||||||
|
|
||||||
|
import cn.felord.payment.wechat.enumeration.TradeState;
|
||||||
|
import cn.felord.payment.wechat.enumeration.TradeType;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -71,17 +72,19 @@ public class TransactionConsumeData {
|
|||||||
*/
|
*/
|
||||||
private String successTime;
|
private String successTime;
|
||||||
/**
|
/**
|
||||||
* The Trade state.
|
* 在 1.0.0.RELEASE 直接返回了枚举字符串,1.0.2.RELEASE 中变更为枚举
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
private String tradeState;
|
private TradeState tradeState;
|
||||||
/**
|
/**
|
||||||
* The Trade state desc.
|
* The Trade state desc.
|
||||||
*/
|
*/
|
||||||
private String tradeStateDesc;
|
private String tradeStateDesc;
|
||||||
/**
|
/**
|
||||||
* The Trade type.
|
* 在 1.0.0.RELEASE 直接返回了枚举字符串,1.0.2.RELEASE 中变更为枚举
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
private String tradeType;
|
private TradeType tradeType;
|
||||||
/**
|
/**
|
||||||
* The Transaction id.
|
* The Transaction id.
|
||||||
*/
|
*/
|
||||||
@@ -127,11 +130,11 @@ public class TransactionConsumeData {
|
|||||||
/**
|
/**
|
||||||
* The Total.
|
* The Total.
|
||||||
*/
|
*/
|
||||||
private int total;
|
private Integer total;
|
||||||
/**
|
/**
|
||||||
* The Payer total.
|
* The Payer total.
|
||||||
*/
|
*/
|
||||||
private int payerTotal;
|
private Integer payerTotal;
|
||||||
/**
|
/**
|
||||||
* The Currency.
|
* The Currency.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
@@ -32,12 +31,16 @@ import lombok.Data;
|
|||||||
public class CombineAmount {
|
public class CombineAmount {
|
||||||
/**
|
/**
|
||||||
* 符合ISO 4217标准的三位字母代码,必填,人民币:CNY 。
|
* 符合ISO 4217标准的三位字母代码,必填,人民币:CNY 。
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
private String currency = "CNY";
|
private String currency = "CNY";
|
||||||
/**
|
/**
|
||||||
* 子单金额,单位为分,必填
|
* 子单金额,单位为分,必填
|
||||||
* <p>
|
* <p>
|
||||||
* 境外场景下,标价金额要超过商户结算币种的最小单位金额,例如结算币种为美元,则标价金额必须大于1美分
|
* 境外场景下,标价金额要超过商户结算币种的最小单位金额,例如结算币种为美元,则标价金额必须大于1美分
|
||||||
|
*
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
*/
|
*/
|
||||||
private Long totalAmount;
|
private Long totalAmount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
package cn.felord.payment.wechat.v3.model.combine;
|
package cn.felord.payment.wechat.v3.model.combine;
|
||||||
|
|
||||||
@@ -22,8 +21,17 @@ import cn.felord.payment.wechat.v3.model.H5Info;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合单支付 H5场景信息.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.0.RELEASE
|
||||||
|
*/
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
public class CombineH5SceneInfo extends CombineSceneInfo {
|
public class CombineH5SceneInfo extends CombineSceneInfo {
|
||||||
|
/**
|
||||||
|
* H5 支付信息.
|
||||||
|
*/
|
||||||
private H5Info h5Info;
|
private H5Info h5Info;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
@@ -15,11 +14,12 @@
|
|||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
package cn.felord.payment.wechat.v3.model;
|
package cn.felord.payment.wechat.v3.model.combine;
|
||||||
|
|
||||||
import cn.felord.payment.wechat.v3.model.combine.CombinePayerInfo;
|
import cn.felord.payment.wechat.enumeration.TradeState;
|
||||||
|
import cn.felord.payment.wechat.enumeration.TradeType;
|
||||||
|
import cn.felord.payment.wechat.v3.model.SceneInfo;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -35,7 +35,7 @@ import java.util.List;
|
|||||||
public class CombineTransactionConsumeData {
|
public class CombineTransactionConsumeData {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合单商户appid.
|
* 合单商户appid,即合单发起方的appid
|
||||||
*/
|
*/
|
||||||
private String combineAppid;
|
private String combineAppid;
|
||||||
|
|
||||||
@@ -75,52 +75,53 @@ public class CombineTransactionConsumeData {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Amount.
|
* 订单金额信息
|
||||||
*/
|
*/
|
||||||
private CombineAmount amount;
|
private CombineAmount amount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Attach.
|
* 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用。
|
||||||
*/
|
*/
|
||||||
private String attach;
|
private String attach;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Bank type.
|
* 付款银行类型,参见<a target= "_blank" href= "https://pay.weixin.qq.com/wiki/doc/apiv3/terms_definition/chapter1_1_3.shtml#part-4">开户银行对照表</a>
|
||||||
*/
|
*/
|
||||||
private String bankType;
|
private String bankType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Mchid.
|
* 子单发起方商户号,必须与发起方Appid有绑定关系。(即电商平台mchid)
|
||||||
*/
|
*/
|
||||||
private String mchid;
|
private String mchid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Out trade no.
|
* 子单商户侧订单号
|
||||||
*/
|
*/
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Sub mchid.
|
* 二级商户商户号,由微信支付生成并下发。
|
||||||
|
* 服务商子商户的商户号,被合单方。直连商户不用传二级商户号。
|
||||||
*/
|
*/
|
||||||
private String subMchid;
|
private String subMchid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Success time.
|
* 支付完成时间
|
||||||
*/
|
*/
|
||||||
private String successTime;
|
private String successTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Trade state.
|
* 交易状态
|
||||||
*/
|
*/
|
||||||
private String tradeState;
|
private TradeState tradeState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Trade type.
|
* 交易类型
|
||||||
*/
|
*/
|
||||||
private String tradeType;
|
private TradeType tradeType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Transaction id.
|
* 微信支付侧订单号
|
||||||
*/
|
*/
|
||||||
private String transactionId;
|
private String transactionId;
|
||||||
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Copyright 2019-2020 felord.cn
|
* Copyright 2019-2020 felord.cn
|
||||||
|
|||||||
@@ -0,0 +1,190 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.discountcard;
|
||||||
|
|
||||||
|
import cn.felord.payment.wechat.enumeration.ContractStatus;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户领取微信先享卡通知解密
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DiscountCardAcceptedConsumeData {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Appid.
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* The Card id.
|
||||||
|
*/
|
||||||
|
private String cardId;
|
||||||
|
/**
|
||||||
|
* The Card template id.
|
||||||
|
*/
|
||||||
|
private String cardTemplateId;
|
||||||
|
/**
|
||||||
|
* The Create time.
|
||||||
|
*/
|
||||||
|
private String createTime;
|
||||||
|
/**
|
||||||
|
* The Mchid.
|
||||||
|
*/
|
||||||
|
private String mchid;
|
||||||
|
/**
|
||||||
|
* The Objectives.
|
||||||
|
*/
|
||||||
|
private List<Objective> objectives;
|
||||||
|
/**
|
||||||
|
* The Openid.
|
||||||
|
*/
|
||||||
|
private String openid;
|
||||||
|
/**
|
||||||
|
* The Out card code.
|
||||||
|
*/
|
||||||
|
private String outCardCode;
|
||||||
|
/**
|
||||||
|
* The Rewards.
|
||||||
|
*/
|
||||||
|
private List<Reward> rewards;
|
||||||
|
/**
|
||||||
|
* The Sharer openid.
|
||||||
|
*/
|
||||||
|
private String sharerOpenid;
|
||||||
|
/**
|
||||||
|
* The State.
|
||||||
|
*/
|
||||||
|
private ContractStatus state;
|
||||||
|
/**
|
||||||
|
* The Time range.
|
||||||
|
*/
|
||||||
|
private TimeRange timeRange;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户先享卡目标列表
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class Objective {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Count.
|
||||||
|
*/
|
||||||
|
private Long count;
|
||||||
|
/**
|
||||||
|
* The Description.
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* The Name.
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* The Objective id.
|
||||||
|
*/
|
||||||
|
private String objectiveId;
|
||||||
|
/**
|
||||||
|
* The Unit.
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户先享卡优惠列表
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class Reward {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Amount.
|
||||||
|
*/
|
||||||
|
private Long amount;
|
||||||
|
/**
|
||||||
|
* The Count.
|
||||||
|
*/
|
||||||
|
private Long count;
|
||||||
|
/**
|
||||||
|
* The Count type.
|
||||||
|
*/
|
||||||
|
private CountType countType;
|
||||||
|
/**
|
||||||
|
* The Description.
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* The Name.
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* The Reward id.
|
||||||
|
*/
|
||||||
|
private String rewardId;
|
||||||
|
/**
|
||||||
|
* The Unit.
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Time range.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class TimeRange {
|
||||||
|
/**
|
||||||
|
* The Betin time.
|
||||||
|
*/
|
||||||
|
private String betinTime;
|
||||||
|
/**
|
||||||
|
* The End time.
|
||||||
|
*/
|
||||||
|
private String endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 优惠数量的类型标识
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
public enum CountType{
|
||||||
|
/**
|
||||||
|
* 不限数量
|
||||||
|
*/
|
||||||
|
COUNT_UNLIMITED,
|
||||||
|
/**
|
||||||
|
* 有限数量
|
||||||
|
*/
|
||||||
|
COUNT_LIMIT
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.discountcard;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付先享卡用户守约状态变化通知解密
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DiscountCardAgreementEndConsumeData {
|
||||||
|
/**
|
||||||
|
* The Appid.
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* The Card id.
|
||||||
|
*/
|
||||||
|
private String cardId;
|
||||||
|
/**
|
||||||
|
* The Card template id.
|
||||||
|
*/
|
||||||
|
private String cardTemplateId;
|
||||||
|
/**
|
||||||
|
* The Create time.
|
||||||
|
*/
|
||||||
|
private String createTime;
|
||||||
|
/**
|
||||||
|
* The Mchid.
|
||||||
|
*/
|
||||||
|
private String mchid;
|
||||||
|
/**
|
||||||
|
* The Objectives.
|
||||||
|
*/
|
||||||
|
private List<Objective> objectives;
|
||||||
|
/**
|
||||||
|
* The Openid.
|
||||||
|
*/
|
||||||
|
private String openid;
|
||||||
|
/**
|
||||||
|
* The Out card code.
|
||||||
|
*/
|
||||||
|
private String outCardCode;
|
||||||
|
/**
|
||||||
|
* The Rewards.
|
||||||
|
*/
|
||||||
|
private List<Reward> rewards;
|
||||||
|
/**
|
||||||
|
* The State.
|
||||||
|
*/
|
||||||
|
private String state;
|
||||||
|
/**
|
||||||
|
* The Time range.
|
||||||
|
*/
|
||||||
|
private TimeRange timeRange;
|
||||||
|
/**
|
||||||
|
* The Total amount.
|
||||||
|
*/
|
||||||
|
private Long totalAmount;
|
||||||
|
/**
|
||||||
|
* The Unfinished reason.
|
||||||
|
*/
|
||||||
|
private String unfinishedReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Objective.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class Objective {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Count.
|
||||||
|
*/
|
||||||
|
private Long count;
|
||||||
|
/**
|
||||||
|
* The Description.
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* The Name.
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* The Objective completion records.
|
||||||
|
*/
|
||||||
|
private List<ObjectiveCompletionRecord> objectiveCompletionRecords;
|
||||||
|
/**
|
||||||
|
* The Objective id.
|
||||||
|
*/
|
||||||
|
private String objectiveId;
|
||||||
|
/**
|
||||||
|
* The Unit.
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Time range.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class TimeRange {
|
||||||
|
/**
|
||||||
|
* The Betin time.
|
||||||
|
*/
|
||||||
|
private String betinTime;
|
||||||
|
/**
|
||||||
|
* The End time.
|
||||||
|
*/
|
||||||
|
private String endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Reward.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class Reward {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Amount.
|
||||||
|
*/
|
||||||
|
private Long amount;
|
||||||
|
/**
|
||||||
|
* The Count.
|
||||||
|
*/
|
||||||
|
private Long count;
|
||||||
|
/**
|
||||||
|
* The Count type.
|
||||||
|
*/
|
||||||
|
private String countType;
|
||||||
|
/**
|
||||||
|
* The Description.
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* The Name.
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* The Reward id.
|
||||||
|
*/
|
||||||
|
private String rewardId;
|
||||||
|
/**
|
||||||
|
* The Reward usage records.
|
||||||
|
*/
|
||||||
|
private List<RewardUsageRecord> rewardUsageRecords;
|
||||||
|
/**
|
||||||
|
* The Unit.
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.discountcard;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 先享卡回调消费复合消费器
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DiscountCardConsumer {
|
||||||
|
/**
|
||||||
|
* The Accepted consume data consumer.
|
||||||
|
*/
|
||||||
|
private Consumer<DiscountCardAcceptedConsumeData> acceptedConsumeDataConsumer;
|
||||||
|
/**
|
||||||
|
* The Agreement end consume data consumer.
|
||||||
|
*/
|
||||||
|
private Consumer<DiscountCardAgreementEndConsumeData> agreementEndConsumeDataConsumer;
|
||||||
|
/**
|
||||||
|
* The Card user paid consume data consumer.
|
||||||
|
*/
|
||||||
|
private Consumer<DiscountCardUserPaidConsumeData> cardUserPaidConsumeDataConsumer;
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.discountcard;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预受理领卡请求参数
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DiscountCardPreRequestParams {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户领卡号,必传
|
||||||
|
*/
|
||||||
|
private String outCardCode;
|
||||||
|
/**
|
||||||
|
* 先享卡模板ID,必传
|
||||||
|
*/
|
||||||
|
private String cardTemplateId;
|
||||||
|
/**
|
||||||
|
* APPID,必传,自动从配置中注入
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* 通知商户URL,必传
|
||||||
|
*/
|
||||||
|
private String notifyUrl;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.discountcard;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 先享卡扣费状态变化通知解密.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DiscountCardUserPaidConsumeData {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Appid.
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* The Card id.
|
||||||
|
*/
|
||||||
|
private String cardId;
|
||||||
|
/**
|
||||||
|
* The Card template id.
|
||||||
|
*/
|
||||||
|
private String cardTemplateId;
|
||||||
|
/**
|
||||||
|
* The Mchid.
|
||||||
|
*/
|
||||||
|
private String mchid;
|
||||||
|
/**
|
||||||
|
* The Openid.
|
||||||
|
*/
|
||||||
|
private String openid;
|
||||||
|
/**
|
||||||
|
* The Out card code.
|
||||||
|
*/
|
||||||
|
private String outCardCode;
|
||||||
|
/**
|
||||||
|
* The Pay information.
|
||||||
|
*/
|
||||||
|
private PayInformation payInformation;
|
||||||
|
/**
|
||||||
|
* The State.
|
||||||
|
*/
|
||||||
|
private String state;
|
||||||
|
/**
|
||||||
|
* The Total amount.
|
||||||
|
*/
|
||||||
|
private Long totalAmount;
|
||||||
|
/**
|
||||||
|
* The Unfinished reason.
|
||||||
|
*/
|
||||||
|
private String unfinishedReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Pay information.
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class PayInformation {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Pay amount.
|
||||||
|
*/
|
||||||
|
private Long payAmount;
|
||||||
|
/**
|
||||||
|
* The Pay state.
|
||||||
|
*/
|
||||||
|
private String payState;
|
||||||
|
/**
|
||||||
|
* The Pay time.
|
||||||
|
*/
|
||||||
|
private String payTime;
|
||||||
|
/**
|
||||||
|
* The Transaction id.
|
||||||
|
*/
|
||||||
|
private String transactionId;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.discountcard;
|
||||||
|
|
||||||
|
import cn.felord.payment.wechat.enumeration.StrategyType;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Objective completion record.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ObjectiveCompletionRecord {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Completion count.
|
||||||
|
*/
|
||||||
|
private Long completionCount;
|
||||||
|
/**
|
||||||
|
* The Completion time.
|
||||||
|
*/
|
||||||
|
private String completionTime;
|
||||||
|
/**
|
||||||
|
* The Completion type.
|
||||||
|
*/
|
||||||
|
private StrategyType completionType;
|
||||||
|
/**
|
||||||
|
* The Description.
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* The Objective completion serial no.
|
||||||
|
*/
|
||||||
|
private String objectiveCompletionSerialNo;
|
||||||
|
/**
|
||||||
|
* The Objective id.
|
||||||
|
*/
|
||||||
|
private String objectiveId;
|
||||||
|
/**
|
||||||
|
* The Remark.
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.discountcard;
|
||||||
|
|
||||||
|
import cn.felord.payment.wechat.v3.model.payscore.PayScoreUserConfirmConsumeData;
|
||||||
|
import cn.felord.payment.wechat.v3.model.payscore.PayScoreUserPaidConsumeData;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付分回调复合消费器
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayScoreConsumer {
|
||||||
|
/**
|
||||||
|
* The Confirm consume data consumer.
|
||||||
|
*/
|
||||||
|
private Consumer<PayScoreUserConfirmConsumeData> confirmConsumeDataConsumer;
|
||||||
|
/**
|
||||||
|
* The Paid consume data consumer.
|
||||||
|
*/
|
||||||
|
private Consumer<PayScoreUserPaidConsumeData> paidConsumeDataConsumer;
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.discountcard;
|
||||||
|
|
||||||
|
import cn.felord.payment.wechat.enumeration.StrategyType;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Reward usage record.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RewardUsageRecord {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Amount.
|
||||||
|
*/
|
||||||
|
private Long amount;
|
||||||
|
/**
|
||||||
|
* The Description.
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* The Remark.
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* The Reward id.
|
||||||
|
*/
|
||||||
|
private String rewardId;
|
||||||
|
/**
|
||||||
|
* The Reward usage serial no.
|
||||||
|
*/
|
||||||
|
private String rewardUsageSerialNo;
|
||||||
|
/**
|
||||||
|
* The Usage count.
|
||||||
|
*/
|
||||||
|
private Long usageCount;
|
||||||
|
/**
|
||||||
|
* The Usage time.
|
||||||
|
*/
|
||||||
|
private String usageTime;
|
||||||
|
/**
|
||||||
|
* The Usage type.
|
||||||
|
*/
|
||||||
|
private StrategyType usageType;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.discountcard;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增加用户记录请求参数
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserRecordsParams {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Out card code.
|
||||||
|
*/
|
||||||
|
private String outCardCode;
|
||||||
|
/**
|
||||||
|
* The Card template id.
|
||||||
|
*/
|
||||||
|
private String cardTemplateId;
|
||||||
|
/**
|
||||||
|
* The Objective completion records.
|
||||||
|
*/
|
||||||
|
private List<ObjectiveCompletionRecord> objectiveCompletionRecords;
|
||||||
|
/**
|
||||||
|
* The Reward usage records.
|
||||||
|
*/
|
||||||
|
private List<RewardUsageRecord> rewardUsageRecords;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消支付分订单请求参数
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CancelServiceOrderParams {
|
||||||
|
/**
|
||||||
|
* 商户服务订单号,必填
|
||||||
|
*/
|
||||||
|
private String outOrderNo;
|
||||||
|
/**
|
||||||
|
* 与传入的商户号建立了支付绑定关系的appid,必填
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* 服务ID,必填
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
/**
|
||||||
|
* 取消原因,最长50个字符,必填
|
||||||
|
*/
|
||||||
|
private String reason;
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完结支付分订单请求参数
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CompleteServiceOrderParams {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户服务订单号,必填
|
||||||
|
* <p>
|
||||||
|
* 商户系统内部服务订单号(不是交易单号),要求此参数只能由数字、大小写字母_-|*组成,且在同一个商户号下唯一。详见[商户订单号]。
|
||||||
|
*/
|
||||||
|
private String outOrderNo;
|
||||||
|
/**
|
||||||
|
* 与传入的商户号建立了支付绑定关系的appid,必填
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* 服务ID,必填
|
||||||
|
* <p>
|
||||||
|
* 该服务ID有本接口对应产品的权限。
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
/**
|
||||||
|
* 后付费项目,必填
|
||||||
|
*/
|
||||||
|
private List<PostPayment> postPayments;
|
||||||
|
/**
|
||||||
|
* 后付费商户优惠,选填
|
||||||
|
*/
|
||||||
|
private List<PostDiscount> postDiscounts;
|
||||||
|
/**
|
||||||
|
* 总金额,单位分,必填
|
||||||
|
* <p>
|
||||||
|
* 不能超过完结订单时候的总金额,只能为整数,详见 <a target= "_blank" href= "https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=4_2">支付金额</a>。此参数需满足:总金额 =(修改后付费项目1…+修改后完结付费项目n)-(修改 后付费商户优惠项目1…+修改后付费商户优惠项目n)
|
||||||
|
*/
|
||||||
|
private Long totalAmount;
|
||||||
|
/**
|
||||||
|
* 服务时间段,条件选填
|
||||||
|
* <p>
|
||||||
|
* 服务时间范围,创建订单未填写服务结束时间,则完结的时候,服务结束时间必填
|
||||||
|
* 如果传入,用户侧则显示此参数。
|
||||||
|
*/
|
||||||
|
private TimeRange timeRange;
|
||||||
|
/**
|
||||||
|
* 服务位置,选填
|
||||||
|
*/
|
||||||
|
private CompleteLocation location;
|
||||||
|
/**
|
||||||
|
* 微信支付服务分账标记,选填
|
||||||
|
* <p>
|
||||||
|
* 完结订单分账接口标记。分账开通流程,详见 <a target = "_blank" href = "https://pay.weixin.qq.com/wiki/doc/api/allocation.php?chapter=26_2">分账</a>
|
||||||
|
* false:不分账,默认:false
|
||||||
|
* true:分账。
|
||||||
|
*/
|
||||||
|
private Boolean profitSharing = Boolean.TRUE;
|
||||||
|
/**
|
||||||
|
* 订单优惠标记,选填
|
||||||
|
* <p>
|
||||||
|
* 代金券或立减金优惠的参数,说明详见代金券或立减金优惠
|
||||||
|
*/
|
||||||
|
private String goodsTag;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务位置信息
|
||||||
|
* <p>
|
||||||
|
* 如果传入,用户侧则显示此参数。
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class CompleteLocation {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预计服务结束地点,条件选填。
|
||||||
|
* <p>
|
||||||
|
* 结束使用服务的地点,不超过50个字符,超出报错处理 。 创建订单传入了【服务开始地点】,此项才能填写
|
||||||
|
* 【建议】
|
||||||
|
* 1、预计结束地点为空时,实际结束地点与开始地点相同,不填写
|
||||||
|
* 2、预计结束地点不为空时,实际结束地点与预计结束地点相同,不填写
|
||||||
|
*/
|
||||||
|
private String endLocation;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创单结单合并API请求参数
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DirectCompleteServiceOrderParams {
|
||||||
|
/**
|
||||||
|
* The Appid.
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* The Attach.
|
||||||
|
*/
|
||||||
|
private String attach;
|
||||||
|
/**
|
||||||
|
* The Goods tag.
|
||||||
|
*/
|
||||||
|
private String goodsTag;
|
||||||
|
/**
|
||||||
|
* The Location.
|
||||||
|
*/
|
||||||
|
private Location location;
|
||||||
|
/**
|
||||||
|
* The Notify url.
|
||||||
|
*/
|
||||||
|
private String notifyUrl;
|
||||||
|
/**
|
||||||
|
* The Openid.
|
||||||
|
*/
|
||||||
|
private String openid;
|
||||||
|
/**
|
||||||
|
* The Out order no.
|
||||||
|
*/
|
||||||
|
private String outOrderNo;
|
||||||
|
/**
|
||||||
|
* The Post discounts.
|
||||||
|
*/
|
||||||
|
private List<PostDiscount> postDiscounts;
|
||||||
|
/**
|
||||||
|
* The Post payments.
|
||||||
|
*/
|
||||||
|
private List<PostPayment> postPayments;
|
||||||
|
/**
|
||||||
|
* The Profit sharing.
|
||||||
|
*/
|
||||||
|
private Boolean profitSharing;
|
||||||
|
/**
|
||||||
|
* The Service id.
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
/**
|
||||||
|
* The Service introduction.
|
||||||
|
*/
|
||||||
|
private String serviceIntroduction;
|
||||||
|
/**
|
||||||
|
* The Time range.
|
||||||
|
*/
|
||||||
|
private TimeRange timeRange;
|
||||||
|
/**
|
||||||
|
* The Total amount.
|
||||||
|
*/
|
||||||
|
private Long totalAmount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务位置信息
|
||||||
|
* <p>
|
||||||
|
* 如果传入,用户侧则显示此参数。
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Location {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务开始地点,选填。
|
||||||
|
* <p>
|
||||||
|
* 开始使用服务的地点,不超过50个字符,超出报错处理。
|
||||||
|
* 【建议】
|
||||||
|
* 1、用户下单时【未确定】服务结束地点,不填写。
|
||||||
|
* 2、服务在同一地点开始和结束,不填写。
|
||||||
|
* 3、用户下单时【已确定】服务结束地点,填写。
|
||||||
|
*/
|
||||||
|
private String startLocation;
|
||||||
|
/**
|
||||||
|
* 预计服务结束地点,有开始地点时为必填。
|
||||||
|
*
|
||||||
|
* 1、结束使用服务的地点,不超过50个字符,超出报错处理 。
|
||||||
|
* 2、填写了服务开始地点,才能填写服务结束地点。
|
||||||
|
*/
|
||||||
|
private String endLocation;
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改微信支付分订单金额请求参数.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ModifyServiceOrderParams {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户服务订单号,必填
|
||||||
|
* <p>
|
||||||
|
* 商户系统内部服务订单号(不是交易单号),要求此参数只能由数字、大小写字母_-|*组成,且在同一个商户号下唯一。详见[商户订单号]。
|
||||||
|
*/
|
||||||
|
private String outOrderNo;
|
||||||
|
/**
|
||||||
|
* 与传入的商户号建立了支付绑定关系的appid,必填
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* 服务ID,必填
|
||||||
|
* <p>
|
||||||
|
* 该服务ID有本接口对应产品的权限。需要与创建订单时保持一致。
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
/**
|
||||||
|
* 后付费项目,必填
|
||||||
|
*/
|
||||||
|
private List<PostPayment> postPayments;
|
||||||
|
/**
|
||||||
|
* 后付费商户优惠,选填
|
||||||
|
*/
|
||||||
|
private List<PostDiscount> postDiscounts;
|
||||||
|
/**
|
||||||
|
* 总金额,单位分,必填
|
||||||
|
*
|
||||||
|
* 不能超过完结订单时候的总金额,只能为整数,详见 <a target= "_blank" href= "https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=4_2">支付金额</a>。此参数需满足:总金额 =(修改后付费项目1…+修改后完结付费项目n)-(修改 后付费商户优惠项目1…+修改后付费商户优惠项目n)
|
||||||
|
*/
|
||||||
|
private Long totalAmount;
|
||||||
|
/**
|
||||||
|
* 取消原因,最长50个字符,必填
|
||||||
|
*/
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付分用户确认订单回调解密.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayScoreUserConfirmConsumeData {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Appid.
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* The Attach.
|
||||||
|
*/
|
||||||
|
private String attach;
|
||||||
|
/**
|
||||||
|
* The Location.
|
||||||
|
*/
|
||||||
|
private Location location;
|
||||||
|
/**
|
||||||
|
* The Mchid.
|
||||||
|
*/
|
||||||
|
private String mchid;
|
||||||
|
/**
|
||||||
|
* The Openid.
|
||||||
|
*/
|
||||||
|
private String openid;
|
||||||
|
/**
|
||||||
|
* The Order id.
|
||||||
|
*/
|
||||||
|
private String orderId;
|
||||||
|
/**
|
||||||
|
* The Out order no.
|
||||||
|
*/
|
||||||
|
private String outOrderNo;
|
||||||
|
/**
|
||||||
|
* The Post discounts.
|
||||||
|
*/
|
||||||
|
private List<PostDiscount> postDiscounts;
|
||||||
|
/**
|
||||||
|
* The Post payments.
|
||||||
|
*/
|
||||||
|
private List<PostPayment> postPayments;
|
||||||
|
/**
|
||||||
|
* The Risk fund.
|
||||||
|
*/
|
||||||
|
private RiskFund riskFund;
|
||||||
|
/**
|
||||||
|
* The Service id.
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
/**
|
||||||
|
* The Service introduction.
|
||||||
|
*/
|
||||||
|
private String serviceIntroduction;
|
||||||
|
/**
|
||||||
|
* The State.
|
||||||
|
*/
|
||||||
|
private String state;
|
||||||
|
/**
|
||||||
|
* The State description.
|
||||||
|
*/
|
||||||
|
private String stateDescription;
|
||||||
|
/**
|
||||||
|
* The Time range.
|
||||||
|
*/
|
||||||
|
private TimeRange timeRange;
|
||||||
|
/**
|
||||||
|
* The Total amount.
|
||||||
|
*/
|
||||||
|
private String totalAmount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付分支付成功回调解密
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayScoreUserPaidConsumeData {
|
||||||
|
/**
|
||||||
|
* The Appid.
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* The Attach.
|
||||||
|
*/
|
||||||
|
private String attach;
|
||||||
|
/**
|
||||||
|
* The Collection.
|
||||||
|
*/
|
||||||
|
private PaymentCollection collection;
|
||||||
|
/**
|
||||||
|
* The Location.
|
||||||
|
*/
|
||||||
|
private Location location;
|
||||||
|
/**
|
||||||
|
* The Mchid.
|
||||||
|
*/
|
||||||
|
private String mchid;
|
||||||
|
/**
|
||||||
|
* The Need collection.
|
||||||
|
*/
|
||||||
|
private Boolean needCollection;
|
||||||
|
/**
|
||||||
|
* The Notify url.
|
||||||
|
*/
|
||||||
|
private String notifyUrl;
|
||||||
|
/**
|
||||||
|
* The Openid.
|
||||||
|
*/
|
||||||
|
private String openid;
|
||||||
|
/**
|
||||||
|
* The Order id.
|
||||||
|
*/
|
||||||
|
private String orderId;
|
||||||
|
/**
|
||||||
|
* The Out order no.
|
||||||
|
*/
|
||||||
|
private String outOrderNo;
|
||||||
|
/**
|
||||||
|
* The Post discounts.
|
||||||
|
*/
|
||||||
|
private List<PostDiscount> postDiscounts;
|
||||||
|
/**
|
||||||
|
* The Post payments.
|
||||||
|
*/
|
||||||
|
private List<PostPayment> postPayments;
|
||||||
|
/**
|
||||||
|
* The Risk fund.
|
||||||
|
*/
|
||||||
|
private RiskFund riskFund;
|
||||||
|
/**
|
||||||
|
* The Service id.
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
/**
|
||||||
|
* The Service introduction.
|
||||||
|
*/
|
||||||
|
private String serviceIntroduction;
|
||||||
|
/**
|
||||||
|
* The State.
|
||||||
|
*/
|
||||||
|
private String state;
|
||||||
|
/**
|
||||||
|
* The Time range.
|
||||||
|
*/
|
||||||
|
private TimeRange timeRange;
|
||||||
|
/**
|
||||||
|
* The Total amount.
|
||||||
|
*/
|
||||||
|
private String totalAmount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 授权、解除授权服务回调解密.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayScoreUserPermissionConsumeData {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是解除授权,此参数并非微信返回参数
|
||||||
|
*
|
||||||
|
* 是:true,不是:false
|
||||||
|
*
|
||||||
|
* 用来判断是授权还是解除授权
|
||||||
|
*/
|
||||||
|
private boolean closed;
|
||||||
|
/**
|
||||||
|
* The Appid.
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* The Mchid.
|
||||||
|
*/
|
||||||
|
private String mchid;
|
||||||
|
/**
|
||||||
|
* The Openid.
|
||||||
|
*/
|
||||||
|
private String openid;
|
||||||
|
/**
|
||||||
|
* The Openorclose time.
|
||||||
|
*/
|
||||||
|
private String openorcloseTime;
|
||||||
|
/**
|
||||||
|
* 只在 微信支付分授权回调中返回
|
||||||
|
*/
|
||||||
|
private String outRequestNo;
|
||||||
|
/**
|
||||||
|
* The Service id.
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
/**
|
||||||
|
* The User service status.
|
||||||
|
*/
|
||||||
|
private String userServiceStatus;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户发起催收扣款请求参数.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayServiceOrderParams {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户服务订单号,必填
|
||||||
|
* <p>
|
||||||
|
* 商户系统内部服务订单号(不是交易单号),要求此参数只能由数字、大小写字母_-|*组成,且在同一个商户号下唯一。详见[商户订单号]。
|
||||||
|
*/
|
||||||
|
private String outOrderNo;
|
||||||
|
/**
|
||||||
|
* 与传入的商户号建立了支付绑定关系的appid,必填
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* 服务ID,必填
|
||||||
|
* <p>
|
||||||
|
* 该服务ID有本接口对应产品的权限。
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付分支付成功回调,收款信息,非0元完结后返回
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PaymentCollection {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Details.
|
||||||
|
*/
|
||||||
|
private List<Detail> details;
|
||||||
|
/**
|
||||||
|
* The Paid amount.
|
||||||
|
*/
|
||||||
|
private Long paidAmount;
|
||||||
|
/**
|
||||||
|
* The Paying amount.
|
||||||
|
*/
|
||||||
|
private Long payingAmount;
|
||||||
|
/**
|
||||||
|
* The State.
|
||||||
|
*/
|
||||||
|
private String state;
|
||||||
|
/**
|
||||||
|
* The Total amount.
|
||||||
|
*/
|
||||||
|
private Long totalAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收款明细列表
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class Detail {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Amount.
|
||||||
|
*/
|
||||||
|
private Long amount;
|
||||||
|
/**
|
||||||
|
* The Paid time.
|
||||||
|
*/
|
||||||
|
private String paidTime;
|
||||||
|
/**
|
||||||
|
* The Paid type.
|
||||||
|
*/
|
||||||
|
private String paidType;
|
||||||
|
/**
|
||||||
|
* The Promotion detail.
|
||||||
|
*/
|
||||||
|
private List<PromotionDetail> promotionDetail;
|
||||||
|
/**
|
||||||
|
* The Seq.
|
||||||
|
*/
|
||||||
|
private Long seq;
|
||||||
|
/**
|
||||||
|
* The Transaction id.
|
||||||
|
*/
|
||||||
|
private String transactionId;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 适用于以下API:
|
||||||
|
* <p>
|
||||||
|
* 查询与用户授权记录(授权协议号)API
|
||||||
|
* <p>
|
||||||
|
* 解除用户授权关系(授权协议号)API
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PermissionsAuthCodeParams {
|
||||||
|
/**
|
||||||
|
* 服务ID,必填
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
/**
|
||||||
|
* 授权协议号,必填
|
||||||
|
*/
|
||||||
|
private String authorizationCode;
|
||||||
|
/**
|
||||||
|
* 仅仅适用于解除用户授权关系(授权协议号)API
|
||||||
|
*/
|
||||||
|
private String reason;
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 适用于以下API:
|
||||||
|
* <p>
|
||||||
|
* 查询与用户授权记录(openid)API
|
||||||
|
* <p>
|
||||||
|
* 解除用户授权关系(openid)API
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PermissionsOpenIdParams {
|
||||||
|
/**
|
||||||
|
* openid,必填
|
||||||
|
*/
|
||||||
|
private String openid;
|
||||||
|
/**
|
||||||
|
* 仅仅适用于解除用户授权关系(openid)API
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* 服务ID,必填
|
||||||
|
* <p>
|
||||||
|
* 该服务ID有本接口对应产品的权限。
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
/**
|
||||||
|
* 仅仅适用于解除用户授权关系(openid)API
|
||||||
|
*/
|
||||||
|
private String reason;
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后付费商户优惠,选填
|
||||||
|
* <p>
|
||||||
|
* 最多包含30条商户优惠。如果传入,用户侧则显示此参数。
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PostDiscount {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 优惠名称,条件选填
|
||||||
|
*
|
||||||
|
* 优惠名称说明;name和description若填写,则必须同时填写,优惠名称不可重复描述。
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 优惠说明,条件选填
|
||||||
|
*
|
||||||
|
* 优惠使用条件说明。{@link PostDiscount#name}若填写,则必须同时填写。
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* 总金额,单位分,必填
|
||||||
|
* todo 新增没有此字段,修改必填,感觉不太符合常理
|
||||||
|
*/
|
||||||
|
private Long amount;
|
||||||
|
/**
|
||||||
|
* 优惠数量,选填。
|
||||||
|
* <p>
|
||||||
|
* 优惠的数量。
|
||||||
|
* 特殊规则:数量限制100,不填时默认1。
|
||||||
|
*/
|
||||||
|
private Long count = 1L;
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后付费项目,选填
|
||||||
|
* <p>
|
||||||
|
* 最多包含100条付费项目。如果传入,用户侧则显示此参数。
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PostPayment {
|
||||||
|
/**
|
||||||
|
* 付费项目名称,选填。 修改订单必填
|
||||||
|
* <p>
|
||||||
|
* 相同订单号下不能出现相同的付费项目名称,当参数长度超过20个字符时,报错处理。
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 金额,条件选填。修改订单必填
|
||||||
|
* <p>
|
||||||
|
* 此付费项目总金额,大于等于0,单位为分,等于0时代表不需要扣费,只能为整数,详见支付金额。如果填写了“付费项目名称”,则amount或description必须填写其一,或都填。
|
||||||
|
*/
|
||||||
|
private Long amount;
|
||||||
|
/**
|
||||||
|
* 计费说明,条件选填。
|
||||||
|
* <p>
|
||||||
|
* 描述计费规则,不超过30个字符,超出报错处理。如果填写了“付费项目名称”,则amount或description必须填写其一,或都填。
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* 付费数量,选填。
|
||||||
|
* <p>
|
||||||
|
* 付费项目的数量。
|
||||||
|
* 特殊规则:数量限制100,不填时默认1。
|
||||||
|
*/
|
||||||
|
private Long count = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付分支付成功回调,优惠功能
|
||||||
|
*
|
||||||
|
* 注:针对2020年5月27日10:00:00以后完结的订单生效
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PromotionDetail {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Amount.
|
||||||
|
*/
|
||||||
|
private Long amount;
|
||||||
|
/**
|
||||||
|
* The Coupon id.
|
||||||
|
*/
|
||||||
|
private String couponId;
|
||||||
|
/**
|
||||||
|
* The Currency.
|
||||||
|
*/
|
||||||
|
private String currency;
|
||||||
|
/**
|
||||||
|
* The Goods detail.
|
||||||
|
*/
|
||||||
|
private List<GoodsDetail> goodsDetail;
|
||||||
|
/**
|
||||||
|
* The Merchant contribute.
|
||||||
|
*/
|
||||||
|
private Long merchantContribute;
|
||||||
|
/**
|
||||||
|
* The Name.
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* The Other contribute.
|
||||||
|
*/
|
||||||
|
private Long otherContribute;
|
||||||
|
/**
|
||||||
|
* The Scope.
|
||||||
|
*/
|
||||||
|
private String scope;
|
||||||
|
/**
|
||||||
|
* The Stock id.
|
||||||
|
*/
|
||||||
|
private String stockId;
|
||||||
|
/**
|
||||||
|
* The Type.
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* The Wechatpay contribute.
|
||||||
|
*/
|
||||||
|
private Long wechatpayContribute;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Goods detail.
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class GoodsDetail {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Discount amount.
|
||||||
|
*/
|
||||||
|
private Long discountAmount;
|
||||||
|
/**
|
||||||
|
* The Goods id.
|
||||||
|
*/
|
||||||
|
private String goodsId;
|
||||||
|
/**
|
||||||
|
* The Goods remark.
|
||||||
|
*/
|
||||||
|
private String goodsRemark;
|
||||||
|
/**
|
||||||
|
* The Quantity.
|
||||||
|
*/
|
||||||
|
private Long quantity;
|
||||||
|
/**
|
||||||
|
* The Unit price.
|
||||||
|
*/
|
||||||
|
private Long unitPrice;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询支付分订单请求参数
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class QueryServiceOrderParams {
|
||||||
|
/**
|
||||||
|
* 商户服务订单号,同{@link QueryServiceOrderParams#queryId} 二选一,而且不能同时为null
|
||||||
|
*/
|
||||||
|
private String outOrderNo;
|
||||||
|
/**
|
||||||
|
* 回跳查询ID,同{@link QueryServiceOrderParams#outOrderNo} 二选一,而且不能同时为null
|
||||||
|
*/
|
||||||
|
private String queryId;
|
||||||
|
/**
|
||||||
|
* 服务ID,必填
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单风险金信息,必填
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RiskFund {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 风险金名称,必填
|
||||||
|
*/
|
||||||
|
private Type name;
|
||||||
|
/**
|
||||||
|
* 风险金额,必填
|
||||||
|
* <p>
|
||||||
|
* 1、数字,必须>0(单位分)。
|
||||||
|
* 2、风险金额>=每个服务ID的风险金额上限。
|
||||||
|
* 3、当商户优惠字段为空时,付费项目总金额≤服务ID的风险金额上限 (未填写金额的付费项目,视为该付费项目金额为0)。
|
||||||
|
* 4、完结金额可大于、小于或等于风险金额。详细可见QA <a target= "_blank" href= "https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter11_2.shtml#menu1">关于订单风险金额问题</a>
|
||||||
|
*/
|
||||||
|
private Long amount;
|
||||||
|
/**
|
||||||
|
* 风险说明,选填
|
||||||
|
* <p>
|
||||||
|
* 文字,不超过30个字。
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 风险金类型
|
||||||
|
*/
|
||||||
|
enum Type {
|
||||||
|
/**
|
||||||
|
* 押金
|
||||||
|
*/
|
||||||
|
DEPOSIT,
|
||||||
|
/**
|
||||||
|
* 预付款
|
||||||
|
*/
|
||||||
|
ADVANCE,
|
||||||
|
/**
|
||||||
|
* 保证金
|
||||||
|
*/
|
||||||
|
CASH_DEPOSIT,
|
||||||
|
/**
|
||||||
|
* 预估订单费用
|
||||||
|
* <p>
|
||||||
|
* 【先享模式】(评估不通过不可使用服务)
|
||||||
|
*/
|
||||||
|
ESTIMATE_ORDER_COST
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户预授权API请求参数
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ServiceOrderPermissionParams {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务id,必填
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
/**
|
||||||
|
* 服务商申请的公众号或移动应用APPID,必填
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* 授权协议号,必填
|
||||||
|
* <p>
|
||||||
|
* 预授权成功时的授权协议号,要求此参数只能由数字、大小写字母_-*组成,且在同一个商户号下唯一。详见[商户订单号]。
|
||||||
|
*/
|
||||||
|
private String authorizationCode;
|
||||||
|
/**
|
||||||
|
* 商户接收授权回调通知的地址,选填
|
||||||
|
*/
|
||||||
|
private String notifyUrl;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步服务订单信息请求参数.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SyncServiceOrderParams {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户服务订单号,必填
|
||||||
|
* <p>
|
||||||
|
* 商户系统内部服务订单号(不是交易单号),要求此参数只能由数字、大小写字母_-|*组成,且在同一个商户号下唯一。详见[商户订单号]。
|
||||||
|
*/
|
||||||
|
private String outOrderNo;
|
||||||
|
/**
|
||||||
|
* 与传入的商户号建立了支付绑定关系的appid,必填
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* 服务ID,必填
|
||||||
|
* <p>
|
||||||
|
* 该服务ID有本接口对应产品的权限。与订单要保持一致。
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
/**
|
||||||
|
* 场景类型,必填,场景类型为“Order_Paid”,字符串表示“订单收款成功” 。
|
||||||
|
*/
|
||||||
|
private String type = "Order_Paid";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内容信息详情,场景类型为Order_Paid时,为必填项。
|
||||||
|
*/
|
||||||
|
private SyncDetail detail;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内容信息详情
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class SyncDetail{
|
||||||
|
/**
|
||||||
|
* 收款成功时间
|
||||||
|
* <p>
|
||||||
|
* 支付成功时间,支持两种格式:yyyyMMddHHmmss和yyyyMMdd
|
||||||
|
* ● 传入20091225091010表示2009年12月25日9点10分10秒。
|
||||||
|
* ● 传入20091225默认认为时间为2009年12月25日0点0分0秒。
|
||||||
|
* 用户通过其他方式付款成功的实际时间需满足条件:服务开始时间<调用商户完结订单接口的时间<用户通过其他方式付款成功的实际时间≤商户调用支付分订单同步接口的时间。
|
||||||
|
* 【服务开始时间】
|
||||||
|
* 1、当完结订单有填写【实际服务开始时间】时,【服务开始时间】=完结订单【实际服务开始时间】。
|
||||||
|
* 2、当完结订单未填写【实际服务开始时间】时,【服务开始时间】=创建订单【服务开始时间】
|
||||||
|
* 场景类型为Order_Paid时,必填。
|
||||||
|
* 支持两种格式:yyyyMMddHHmmss和yyyyMMdd
|
||||||
|
* ● 传入20091225091010表示2009年12月25日9点10分10秒。
|
||||||
|
* ● 传入20091225表示时间为2009年12月25日23点59分59秒。
|
||||||
|
* 注意:微信支付分会根据此时间更新用户侧的守约记录、负面记录信息;因此请务必如实填写用户实际付款成功时间,以免造成不必要的客诉。
|
||||||
|
*/
|
||||||
|
private String paidTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务时间段,必填
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TimeRange {
|
||||||
|
/**
|
||||||
|
* 服务开始时间
|
||||||
|
* <p>
|
||||||
|
* 用户端展示用途。
|
||||||
|
* 用户下单时确认的服务开始时间(比如用户今天下单,明天开始接受服务,这里指的是明天的服务开始时间)。
|
||||||
|
* <p>
|
||||||
|
* 支持三种格式:yyyyMMddHHmmss、yyyyMMdd和 OnAccept
|
||||||
|
* <p>
|
||||||
|
* ● 传入20091225091010表示2009年12月25日9点10分10秒。
|
||||||
|
* <p>
|
||||||
|
* ● 传入20091225默认认为时间为2009年12月25日
|
||||||
|
* <p>
|
||||||
|
* ● 传入OnAccept表示用户确认订单成功时间为【服务开始时间】。
|
||||||
|
* <p>
|
||||||
|
* 根据传入时间精准度进行校验
|
||||||
|
* <p>
|
||||||
|
* 1)若传入时间精准到秒,则校验精准到秒:【服务开始时间】>【商户调用创建订单接口时间
|
||||||
|
* <p>
|
||||||
|
* 2)若传入时间精准到日,则校验精准到日:【服务开始时间】>=【商户调用创建订单接口时间】
|
||||||
|
*/
|
||||||
|
private String startTime;
|
||||||
|
/**
|
||||||
|
* 服务开始时间备注说明,服务开始时间有填时,可填写服务开始时间备注,不超过20个字符,超出报错处理。
|
||||||
|
*/
|
||||||
|
private String startTimeRemark;
|
||||||
|
/**
|
||||||
|
* 用户端展示用途,支持两种格式:yyyyMMddHHmmss和yyyyMMdd
|
||||||
|
* ● 传入20091225091010表示2009年12月25日9点10分10秒。
|
||||||
|
* <p>
|
||||||
|
* ● 传入20091225默认认为时间为2009年12月25日
|
||||||
|
* 根据传入时间精准度进行校验
|
||||||
|
* <p>
|
||||||
|
* 1、若传入时间精准到秒,则校验精准到秒:
|
||||||
|
* <p>
|
||||||
|
* 1)【预计服务结束时间】>【服务开始时间】
|
||||||
|
* <p>
|
||||||
|
* 2)【预计服务结束时间】>【商户调用接口时间+1分钟】
|
||||||
|
* <p>
|
||||||
|
* 2、若传入时间精准到日,则校验精准到日:
|
||||||
|
* <p>
|
||||||
|
* 1)【预计服务结束时间】>=【服务开始时间】
|
||||||
|
* <p>
|
||||||
|
* 2)【预计服务结束时间】>=【商户调用接口时间】
|
||||||
|
* 【建议】
|
||||||
|
* 1、用户下单时【未确定】服务结束时间,不填写。
|
||||||
|
* 2、用户下单时【已确定】服务结束时间,填写。
|
||||||
|
*/
|
||||||
|
private String endTime;
|
||||||
|
/**
|
||||||
|
* 预计服务结束时间备注说明,预计服务结束时间有填时,可填写预计服务结束时间备注,不超过20个字符,超出报错处理。
|
||||||
|
*/
|
||||||
|
private String endTimeRemark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建支付分订单请求参数.
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserServiceOrderParams {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户服务订单号,必填
|
||||||
|
* <p>
|
||||||
|
* 商户系统内部服务订单号(不是交易单号),要求此参数只能由数字、大小写字母_-|*组成,且在同一个商户号下唯一。详见[商户订单号]。
|
||||||
|
*/
|
||||||
|
private String outOrderNo;
|
||||||
|
/**
|
||||||
|
* 与传入的商户号建立了支付绑定关系的appid,必填
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
/**
|
||||||
|
* 服务ID,必填
|
||||||
|
* <p>
|
||||||
|
* 该服务ID有本接口对应产品的权限。
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
/**
|
||||||
|
* 服务信息,必填
|
||||||
|
* <p>
|
||||||
|
* 用于介绍本订单所提供的服务 ,当参数长度超过20个字符时,报错处理。
|
||||||
|
*/
|
||||||
|
private String serviceIntroduction;
|
||||||
|
/**
|
||||||
|
* 后付费项目,选填
|
||||||
|
*/
|
||||||
|
private List<PostPayment> postPayments;
|
||||||
|
/**
|
||||||
|
* 后付费商户优惠,选填
|
||||||
|
*/
|
||||||
|
private List<PostDiscount> postDiscounts;
|
||||||
|
/**
|
||||||
|
* 服务时间段,必填
|
||||||
|
*/
|
||||||
|
private TimeRange timeRange;
|
||||||
|
/**
|
||||||
|
* 服务位置,选填
|
||||||
|
*/
|
||||||
|
private Location location;
|
||||||
|
/**
|
||||||
|
* 订单风险金,必填
|
||||||
|
*/
|
||||||
|
private RiskFund riskFund;
|
||||||
|
/**
|
||||||
|
* 商户数据包,选填
|
||||||
|
* <p>
|
||||||
|
* 商户数据包可存放本订单所需信息,需要先urlencode后传入。 当商户数据包总长度超出256字符时,报错处理。
|
||||||
|
*/
|
||||||
|
private String attach;
|
||||||
|
/**
|
||||||
|
* 商户回调地址,必填
|
||||||
|
*/
|
||||||
|
private String notifyUrl;
|
||||||
|
/**
|
||||||
|
* 微信用户在商户对应appid下的唯一标识,条件选填
|
||||||
|
* <p>
|
||||||
|
* 免确认订单:必填
|
||||||
|
* 需确认订单:不填
|
||||||
|
*/
|
||||||
|
private String openid;
|
||||||
|
/**
|
||||||
|
* 是否需要用户确认,选填
|
||||||
|
* <p>
|
||||||
|
* false:免确认订单
|
||||||
|
* true:需确认订单
|
||||||
|
* 默认值true
|
||||||
|
*/
|
||||||
|
private Boolean needUserConfirm = Boolean.TRUE;
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright 2019-2020 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.payscore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户授权状态参数.
|
||||||
|
* <p>
|
||||||
|
* {@code appid} 从对应租户的配置中自动注入。
|
||||||
|
*
|
||||||
|
* @author felord.cn
|
||||||
|
* @since 1.0.2.RELEASE
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserServiceStateParams {
|
||||||
|
/**
|
||||||
|
* 微信支付分 服务ID , 需要微信侧运营操作绑定到商户。
|
||||||
|
*/
|
||||||
|
private String serviceId;
|
||||||
|
/**
|
||||||
|
* 微信用户在商户对应appid下的唯一标识。
|
||||||
|
*/
|
||||||
|
private String openId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,11 +5,11 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>cn.felord</groupId>
|
<groupId>cn.felord</groupId>
|
||||||
<artifactId>payment-spring-boot</artifactId>
|
<artifactId>payment-spring-boot</artifactId>
|
||||||
<version>1.0.1.RELEASE</version>
|
<version>1.0.2.RELEASE</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>payment-spring-boot-starter</artifactId>
|
<artifactId>payment-spring-boot-starter</artifactId>
|
||||||
<version>1.0.1.RELEASE</version>
|
<version>1.0.2.RELEASE</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<groupId>cn.felord</groupId>
|
<groupId>cn.felord</groupId>
|
||||||
<artifactId>payment-spring-boot</artifactId>
|
<artifactId>payment-spring-boot</artifactId>
|
||||||
<version>1.0.1.RELEASE</version>
|
<version>1.0.2.RELEASE</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user