copyrights

This commit is contained in:
dax
2020-12-18 18:47:44 +08:00
parent 51e8e6f4f5
commit 5101cb701e
71 changed files with 1472 additions and 89 deletions

View File

@@ -1,7 +1,24 @@
/*
*
* 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;
/**
*
* @author felord.cn
* @since 1.0.0.RELEASE
*/

View File

@@ -1,3 +1,21 @@
/*
*
* 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.alipay;
@@ -20,7 +38,6 @@ import java.io.FileReader;
import java.io.IOException;
/**
*
* @author felord.cn
* @since 1.0.0.RELEASE
*/

View File

@@ -1,3 +1,21 @@
/*
*
* 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.alipay;
import lombok.Data;
@@ -27,7 +45,7 @@ public class AliPayProperties {
* @since 1.0.0.RELEASE
*/
@Data
public static class V1{
public static class V1 {
/**
* alipay server
*/
@@ -39,19 +57,19 @@ public class AliPayProperties {
/**
* your app private key, which must be in a single line
*/
private String appPrivateKeyPath;
private String appPrivateKeyPath;
/**
* sign type default RSA2
*/
private String signType = "RSA2";
/**
* data format only json now
* data format only json now
*/
private String format ="json";
private String format = "json";
/**
* charset default utf-8
*/
private String charset ="utf-8";
private String charset = "utf-8";
/**
* alipay public cert path
*/

View File

@@ -1,3 +1,21 @@
/*
*
* 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.autoconfigure;
import org.springframework.context.annotation.Import;
@@ -5,7 +23,6 @@ import org.springframework.context.annotation.Import;
import java.lang.annotation.*;
/**
*
* @author felord.cn
* @since 1.0.0.RELEASE
*/

View File

@@ -1,3 +1,21 @@
/*
*
* 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.autoconfigure;
import cn.felord.payment.alipay.AliPayConfiguration;
@@ -6,7 +24,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
/**
*
* @author felord.cn
* @since 1.0.0.RELEASE
*/

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
@@ -78,7 +96,7 @@ public class WechatPayConfiguration {
* @return the wechat api provider
*/
@Bean
public WechatApiProvider wechatApiProvider(WechatPayClient wechatPayClient){
public WechatApiProvider wechatApiProvider(WechatPayClient wechatPayClient) {
return new WechatApiProvider(wechatPayClient);
}
}

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import lombok.Data;
@@ -18,7 +36,7 @@ public class WechatPayProperties {
/**
* wechat pay V3 properties
*/
private Map<String,V3> v3 =new HashMap<>();
private Map<String, V3> v3 = new HashMap<>();
/**
* wechat pay v3 properties.

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import org.springframework.http.client.ClientHttpResponse;
@@ -6,7 +24,6 @@ import org.springframework.web.client.DefaultResponseErrorHandler;
import java.io.IOException;
/**
*
* @author felord.cn
* @since 1.0.0.RELEASE
*/
@@ -14,6 +31,6 @@ public class WechatPayResponseErrorHandler extends DefaultResponseErrorHandler {
@Override
public boolean hasError(ClientHttpResponse response) throws IOException {
return false;
return false;
}
}

View File

@@ -1,3 +1,21 @@
/*
*
* 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.enumeration;
@@ -11,187 +29,187 @@ public enum BankCode {
/**
* 工商银行
*/
BK_1002("1002","工商银行"),
BK_1002("1002", "工商银行"),
/**
* 农业银行
*/
BK_1005("1005","农业银行"),
BK_1005("1005", "农业银行"),
/**
* 建设银行
*/
BK_1003("1003","建设银行"),
BK_1003("1003", "建设银行"),
/**
* 中国银行
*/
BK_1026("1026","中国银行"),
BK_1026("1026", "中国银行"),
/**
* 交通银行
*/
BK_1020("1020","交通银行"),
BK_1020("1020", "交通银行"),
/**
* 招商银行
*/
BK_1001("1001","招商银行"),
BK_1001("1001", "招商银行"),
/**
* 邮储银行
*/
BK_1066("1066","邮储银行"),
BK_1066("1066", "邮储银行"),
/**
* 民生银行
*/
BK_1006("1006","民生银行"),
BK_1006("1006", "民生银行"),
/**
* 平安银行
*/
BK_1010("1010","平安银行"),
BK_1010("1010", "平安银行"),
/**
* 中信银行
*/
BK_1021("1021","中信银行"),
BK_1021("1021", "中信银行"),
/**
* 浦发银行
*/
BK_1004("1004","浦发银行"),
BK_1004("1004", "浦发银行"),
/**
* 兴业银行
*/
BK_1009("1009","兴业银行"),
BK_1009("1009", "兴业银行"),
/**
* 光大银行
*/
BK_1022("1022","光大银行"),
BK_1022("1022", "光大银行"),
/**
* 广发银行
*/
BK_1027("1027","广发银行"),
BK_1027("1027", "广发银行"),
/**
* 华夏银行
*/
BK_1025("1025","华夏银行"),
BK_1025("1025", "华夏银行"),
/**
* 宁波银行
*/
BK_1056("1056","宁波银行"),
BK_1056("1056", "宁波银行"),
/**
* 北京银行
*/
BK_4836("4836","北京银行"),
BK_4836("4836", "北京银行"),
/**
* 上海银行
*/
BK_1024("1024","上海银行"),
BK_1024("1024", "上海银行"),
/**
* 南京银行
*/
BK_1054("1054","南京银行"),
BK_1054("1054", "南京银行"),
/**
* 长子县融汇村镇银行
*/
BK_4755("4755","长子县融汇村镇银行"),
BK_4755("4755", "长子县融汇村镇银行"),
/**
* 长沙银行
*/
BK_4216("4216","长沙银行"),
BK_4216("4216", "长沙银行"),
/**
* 浙江泰隆商业银行
*/
BK_4051("4051","浙江泰隆商业银行"),
BK_4051("4051", "浙江泰隆商业银行"),
/**
* 中原银行
*/
BK_4753("4753","中原银行"),
BK_4753("4753", "中原银行"),
/**
* 企业银行(中国)
*/
BK_4761("4761","企业银行(中国)"),
BK_4761("4761", "企业银行(中国)"),
/**
* 顺德农商银行
*/
BK_4036("4036","顺德农商银行"),
BK_4036("4036", "顺德农商银行"),
/**
* 衡水银行
*/
BK_4752("4752","衡水银行"),
BK_4752("4752", "衡水银行"),
/**
* 长治银行
*/
BK_4756("4756","长治银行"),
BK_4756("4756", "长治银行"),
/**
* 大同银行
*/
BK_4767("4767","大同银行"),
BK_4767("4767", "大同银行"),
/**
* 河南省农村信用社
*/
BK_4115("4115","河南省农村信用社"),
BK_4115("4115", "河南省农村信用社"),
/**
* 宁夏黄河农村商业银行
*/
BK_4150("4150","宁夏黄河农村商业银行"),
BK_4150("4150", "宁夏黄河农村商业银行"),
/**
* 山西省农村信用社
*/
BK_4156("4156","山西省农村信用社"),
BK_4156("4156", "山西省农村信用社"),
/**
* 安徽省农村信用社
*/
BK_4166("4166","安徽省农村信用社"),
BK_4166("4166", "安徽省农村信用社"),
/**
* 甘肃省农村信用社
*/
BK_4157("4157","甘肃省农村信用社"),
BK_4157("4157", "甘肃省农村信用社"),
/**
* 天津农村商业银行
*/
BK_4153("4153","天津农村商业银行"),
BK_4153("4153", "天津农村商业银行"),
/**
* 广西壮族自治区农村信用社
*/
BK_4113("4113","广西壮族自治区农村信用社"),
BK_4113("4113", "广西壮族自治区农村信用社"),
/**
* 陕西省农村信用社
*/
BK_4108("4108","陕西省农村信用社"),
BK_4108("4108", "陕西省农村信用社"),
/**
* 深圳农村商业银行
*/
BK_4076("4076","深圳农村商业银行"),
BK_4076("4076", "深圳农村商业银行"),
/**
* 宁波鄞州农村商业银行
*/
BK_4052("4052","宁波鄞州农村商业银行"),
BK_4052("4052", "宁波鄞州农村商业银行"),
/**
* 浙江省农村信用社联合社
*/
BK_4764("4764","浙江省农村信用社联合社"),
BK_4764("4764", "浙江省农村信用社联合社"),
/**
* 江苏省农村信用社联合社
*/
BK_4217("4217","江苏省农村信用社联合社"),
BK_4217("4217", "江苏省农村信用社联合社"),
/**
* 江苏紫金农村商业银行股份有限公司
*/
BK_4072("4072","江苏紫金农村商业银行"),
BK_4072("4072", "江苏紫金农村商业银行"),
/**
* 北京中关村银行股份有限公司
*/
BK_4769("4769","北京中关村银行"),
BK_4769("4769", "北京中关村银行"),
/**
* 星展银行(中国)有限公司
*/
BK_4778("4778","星展银行(中国)"),
BK_4778("4778", "星展银行(中国)"),
/**
* 枣庄银行股份有限公司
*/
BK_4766("4766","枣庄银行"),
BK_4766("4766", "枣庄银行"),
/**
* 海口联合农村商业银行股份有限公司
*/
BK_4758("4758","海口联合农村商业银行"),
BK_4758("4758", "海口联合农村商业银行"),
/**
* 南洋商业银行(中国)有限公司
*/
BK_4763("4763","南洋商业银行(中国)");
BK_4763("4763", "南洋商业银行(中国)");
private final String code;

View File

@@ -1,3 +1,21 @@
/*
*
* 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.enumeration;
/**

View File

@@ -1,3 +1,21 @@
/*
*
* 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.enumeration;
/**
@@ -6,7 +24,7 @@ package cn.felord.payment.wechat.enumeration;
* @author felord.cn
* @since 1.0.0.RELEASE
*/
public enum CouponStatus {
public enum CouponStatus {
/**
* 可用.
*/

View File

@@ -1,3 +1,21 @@
/*
*
* 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.enumeration;
/**

View File

@@ -1,3 +1,21 @@
/*
*
* 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.enumeration;
/**

View File

@@ -1,3 +1,21 @@
/*
*
* 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.enumeration;
/**

View File

@@ -1,3 +1,21 @@
/*
*
* 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.enumeration;

View File

@@ -1,3 +1,21 @@
/*
*
* 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.enumeration;
import org.springframework.http.HttpMethod;

View File

@@ -1,3 +1,21 @@
/*
*
* 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.PayException;

View File

@@ -1,3 +1,21 @@
/*
*
* 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 org.springframework.http.*;

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
@@ -43,7 +61,7 @@ public class KeyPairFactory {
}
}
X509Certificate certificate = (X509Certificate) store.getCertificate(keyAlias);
certificate.checkValidity();
certificate.checkValidity();
String serialNumber = certificate.getSerialNumber().toString(16).toUpperCase();
PublicKey publicKey = certificate.getPublicKey();
PrivateKey storeKey = (PrivateKey) store.getKey(keyAlias, pem);

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
@@ -95,7 +113,7 @@ public class SignatureProvider {
* @return the string
*/
@SneakyThrows
public String requestSign(String tenantId,String method, String canonicalUrl, String body) {
public String requestSign(String tenantId, String method, String canonicalUrl, String body) {
Signature signer = Signature.getInstance("SHA256withRSA");
WechatMetaBean wechatMetaBean = wechatMetaContainer.getWechatMeta(tenantId);
signer.initSign(wechatMetaBean.getKeyPair().getPrivate());
@@ -160,7 +178,7 @@ public class SignatureProvider {
}
// 签名
HttpMethod httpMethod = WechatPayV3Type.CERT.method();
String authorization = requestSign(tenantId,httpMethod.name(), canonicalUrl, "");
String authorization = requestSign(tenantId, httpMethod.name(), canonicalUrl, "");
HttpHeaders headers = new HttpHeaders();
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
@@ -183,7 +201,7 @@ public class SignatureProvider {
String associatedData = encryptCertificate.get("associated_data").asText();
String nonce = encryptCertificate.get("nonce").asText();
String ciphertext = encryptCertificate.get("ciphertext").asText();
String publicKey = decryptResponseBody(tenantId,associatedData, nonce, ciphertext);
String publicKey = decryptResponseBody(tenantId, associatedData, nonce, ciphertext);
ByteArrayInputStream inputStream = new ByteArrayInputStream(publicKey.getBytes(StandardCharsets.UTF_8));
Certificate certificate = null;
@@ -210,7 +228,7 @@ public class SignatureProvider {
* @param ciphertext the ciphertext
* @return the string
*/
public String decryptResponseBody(String tenantId,String associatedData, String nonce, String ciphertext) {
public String decryptResponseBody(String tenantId, String associatedData, String nonce, String ciphertext) {
try {
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
String apiV3Key = wechatMetaContainer.getWechatMeta(tenantId).getV3().getAppV3Secret();

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
/**

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
@@ -18,7 +36,7 @@ import java.net.URI;
* @author felord.cn
* @since 1.0.0.RELEASE
*/
public class WechatCombinePayApi extends AbstractApi{
public class WechatCombinePayApi extends AbstractApi {
/**
* Instantiates a new Abstract api.
*
@@ -156,7 +174,7 @@ public class WechatCombinePayApi extends AbstractApi{
* @param combineOutTradeNo the combine out trade no
* @return the wechat response entity
*/
public WechatResponseEntity<ObjectNode> queryTransactionByOutTradeNo(String combineOutTradeNo) {
public WechatResponseEntity<ObjectNode> queryTransactionByOutTradeNo(String combineOutTradeNo) {
WechatResponseEntity<ObjectNode> wechatResponseEntity = new WechatResponseEntity<>();
this.client().withType(WechatPayV3Type.COMBINE_TRANSACTION_OUT_TRADE_NO, combineOutTradeNo)
.function((wechatPayV3Type, outTradeNo) -> {
@@ -175,7 +193,7 @@ public class WechatCombinePayApi extends AbstractApi{
* 合单关闭订单API.
* <p>
* 合单支付订单只能使用此合单关单api完成关单。
*
* <p>
* 微信服务器返回 204。
*
* @param combineCloseParams the combine close params
@@ -187,7 +205,7 @@ public class WechatCombinePayApi extends AbstractApi{
.function((wechatPayV3Type, params) -> {
URI uri = UriComponentsBuilder.fromHttpUrl(wechatPayV3Type.uri(WeChatServer.CHINA))
.build().toUri();
return Post(uri,params);
return Post(uri, params);
})
.consumer(wechatResponseEntity::convert)
.request();

View File

@@ -1,3 +1,21 @@
/*
*
* 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.enumeration.WeChatServer;
@@ -173,7 +191,7 @@ public class WechatDirectPayApi extends AbstractApi {
.build()
.expand(outTradeNo)
.toUri();
return Post(uri,queryParams);
return Post(uri, queryParams);
}
}

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
@@ -220,6 +238,7 @@ public class WechatMarketingFavorApi extends AbstractApi {
return wechatResponseEntity;
}
/**
* Query stocks function request entity.
*
@@ -374,7 +393,7 @@ public class WechatMarketingFavorApi extends AbstractApi {
WechatPayProperties.V3 v3 = this.wechatMetaBean().getV3();
queryParams.add("stock_creator_mchid", v3.getMchId());
String stockId = params.getStockId();
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
URI uri = UriComponentsBuilder.fromHttpUrl(type.uri(WeChatServer.CHINA))
.queryParams(queryParams)
.build()
.expand(stockId)
@@ -552,7 +571,7 @@ public class WechatMarketingFavorApi extends AbstractApi {
Map<String, Object> meta = new LinkedHashMap<>(2);
String originalFilename = file.getOriginalFilename();
String filename = StringUtils.hasText(originalFilename)? originalFilename :file.getName();
String filename = StringUtils.hasText(originalFilename) ? originalFilename : file.getName();
meta.put("filename", filename);
byte[] digest = SHA256.Digest.getInstance("SHA-256").digest(file.getBytes());

View File

@@ -1,3 +1,21 @@
/*
*
* 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;

View File

@@ -1,3 +1,21 @@
/*
*
* 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;

View File

@@ -1,3 +1,21 @@
/*
*
* 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.PayException;

View File

@@ -1,3 +1,21 @@
/*
*
* 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;

View File

@@ -1,4 +1,21 @@
package cn.felord.payment.wechat.v3;
/*
*
* 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 com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.Getter;

View File

@@ -1,3 +1,21 @@
/*
*
* 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 lombok.Data;

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import lombok.Data;
@@ -17,5 +35,5 @@ public class Amount {
/**
* The Currency.
*/
private String currency ="CNY";
private String currency = "CNY";
}

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import lombok.Data;

View File

@@ -1,4 +1,22 @@
/*
*
* 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;
import cn.felord.payment.wechat.v3.model.combine.CombinePayerInfo;
@@ -115,7 +133,7 @@ public class CombineTransactionConsumeData {
* @since 1.0.0.RELEASE
*/
@Data
public static class CombineAmount{
public static class CombineAmount {
/**
* 标价金额,单位为分.
*/

View File

@@ -1,4 +1,22 @@
/*
*
* 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;
import lombok.Data;
@@ -14,12 +32,24 @@ import java.util.List;
@Data
public class ConsumeInformation {
/**
* The Consume mchid.
*/
private String consumeMchid;
/**
* The Consume time.
*/
private String consumeTime;
/**
* The Goods detail.
*/
private List<GoodsDetail> goodsDetail;
/**
* The Transaction id.
*/
private String transactionId;
}

View File

@@ -1,9 +1,28 @@
/*
*
* 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;
import lombok.Data;
/**
* The type Coupon available time.
*
* @author felord.cn
* @since 1.0.0.RELEASE

View File

@@ -1,4 +1,22 @@
/*
*
* 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;
import lombok.Data;
@@ -13,21 +31,69 @@ import lombok.Data;
public class CouponConsumeData {
/**
* The Available begin time.
*/
private String availableBeginTime;
/**
* The Available end time.
*/
private String availableEndTime;
/**
* The Consume information.
*/
private ConsumeInformation consumeInformation;
/**
* The Coupon id.
*/
private String couponId;
/**
* The Coupon name.
*/
private String couponName;
/**
* The Coupon type.
*/
private String couponType;
/**
* The Create time.
*/
private String createTime;
/**
* The Description.
*/
private String description;
/**
* The Discount to.
*/
private DiscountTo discountTo;
/**
* The No cash.
*/
private boolean noCash;
/**
* The Normal coupon information.
*/
private NormalCouponInformation normalCouponInformation;
/**
* The Singleitem.
*/
private boolean singleitem;
/**
* The Singleitem discount off.
*/
private SingleitemDiscountOff singleitemDiscountOff;
/**
* The Status.
*/
private String status;
/**
* The Stock creator mchid.
*/
private String stockCreatorMchid;
/**
* The Stock id.
*/
private String stockId;

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import lombok.Data;

View File

@@ -1,4 +1,22 @@
/*
*
* 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;
import lombok.Data;
@@ -15,17 +33,38 @@ import java.util.List;
public class CouponUseRule {
/**
* The Available items.
*/
private List<String> availableItems;
/**
* The Available merchants.
*/
private List<String> availableMerchants;
/**
* The Combine use.
*/
private Boolean combineUse;
/**
* The Coupon available time.
*/
private CouponAvailableTime couponAvailableTime;
/**
* The Fixed normal coupon.
*/
private FixedNormalCoupon fixedNormalCoupon;
/**
* The Goods tag.
*/
private List<String> goodsTag;
/**
* The Trade type.
*/
private String tradeType;
}

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import lombok.Data;
@@ -5,6 +23,7 @@ import lombok.Data;
import java.util.List;
/**
* The type Detail.
*
* @author felord.cn
* @since 1.0.0.RELEASE

View File

@@ -1,4 +1,22 @@
/*
*
* 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;
import lombok.Data;
@@ -12,7 +30,13 @@ import lombok.Data;
@Data
public class DiscountTo {
/**
* The Cut to price.
*/
private Long cutToPrice;
/**
* The Max price.
*/
private Long maxPrice;
}

View File

@@ -1,4 +1,22 @@
/*
*
* 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;
import lombok.Data;

View File

@@ -1,4 +1,22 @@
/*
*
* 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;
import lombok.Data;
@@ -6,7 +24,7 @@ import lombok.Data;
/**
* 固定面额满减券使用规则, stock_type为NORMAL时必填
*
* <p>
* 满transactionMinimum 减少 couponAmount
*
* @author felord.cn

View File

@@ -1,9 +1,26 @@
/*
*
* 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;
import lombok.Data;
/**
*
* @author felord.cn
* @since 1.0.0.RELEASE
*/

View File

@@ -1,4 +1,22 @@
/*
*
* 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;
import lombok.Data;
@@ -12,9 +30,21 @@ import lombok.Data;
@Data
public class GoodsDetail {
/**
* The Discount amount.
*/
private Long discountAmount;
/**
* The Goods id.
*/
private String goodsId;
/**
* The Price.
*/
private Long price;
/**
* The Quantity.
*/
private Long quantity;
}

View File

@@ -1,8 +1,27 @@
/*
*
* 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;
import lombok.Data;
/**
* H5 信息
*
* @author felord.cn
* @since 1.0.0.RELEASE

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import lombok.Data;
@@ -12,13 +30,13 @@ import lombok.Data;
public class MchQueryParams {
/**
* 必填
*
* <p>
* 查询代金券可用商户API 分页页码最大1000。
*/
private Integer offset = 0;
/**
* 必填
*
* <p>
* 查询代金券可用商户API 最大50。
*/
private Integer limit = 10;

View File

@@ -1,4 +1,22 @@
/*
*
* 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;
import lombok.Data;
@@ -12,7 +30,13 @@ import lombok.Data;
@Data
public class NormalCouponInformation {
/**
* The Coupon amount.
*/
private Long couponAmount;
/**
* The Transaction minimum.
*/
private Long transactionMinimum;
}

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
@@ -7,7 +25,6 @@ import lombok.Data;
/**
* 优惠券样式
*
*
* @author felord.cn
* @since 1.0.0.RELEASE
*/

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
@@ -11,7 +29,13 @@ import lombok.Data;
*/
@Data
public class PayParams {
/**
* The Appid.
*/
private String appid;
/**
* The Mchid.
*/
private String mchid;
/**
* 商品描述

View File

@@ -1,8 +1,27 @@
/*
*
* 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;
import lombok.Data;
/**
* The type Payer.
*
* @author felord.cn
* @since 1.0.0.RELEASE

View File

@@ -1,4 +1,22 @@
/*
*
* 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;
import lombok.Data;
@@ -11,6 +29,7 @@ import java.util.List;
* @author felord.cn
* @since 1.0.0.RELEASE
*/
@Data
public class PromotionDetail {
/**

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import cn.felord.payment.wechat.v3.SignatureProvider;

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import lombok.Data;

View File

@@ -1,9 +1,26 @@
/*
*
* 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;
import lombok.Data;
/**
*
* @author felord.cn
* @since 1.0.0.RELEASE
*/

View File

@@ -1,4 +1,22 @@
/*
*
* 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;
import lombok.Data;

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import lombok.Data;

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import com.fasterxml.jackson.annotation.JsonFormat;

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import cn.felord.payment.wechat.enumeration.StockStatus;
@@ -35,7 +53,7 @@ public class StocksQueryParams {
* 查询代金券可用单品API 最大100。
*/
private Integer limit = 10;
/* *//**
/* *//**
* 根据API而定
* <p>
* 批次ID

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import lombok.Data;

View File

@@ -1,9 +1,26 @@
/*
*
* 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;
import lombok.Data;
/**
*
* @author felord.cn
* @since 1.0.0.RELEASE
*/

View File

@@ -1,4 +1,22 @@
/*
*
* 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;
import lombok.Data;
@@ -6,7 +24,6 @@ import lombok.Data;
import java.util.List;
/**
*
* @author felord.cn
* @since 1.0.0.RELEASE
*/

View File

@@ -1,14 +1,31 @@
/*
*
* 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;
import lombok.Data;
/**
*
* @author felord.cn
* @since 1.0.0.RELEASE
*/
@Data
public class TransactionQueryParams {
private String mchId;
private String transactionIdOrOutTradeNo;
private String mchId;
private String transactionIdOrOutTradeNo;
}

View File

@@ -1,3 +1,21 @@
/*
*
* 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;
import lombok.Data;
@@ -54,7 +72,7 @@ public class UserCouponsQueryParams {
* @author felord.cn
* @since 1.0.0.RELEASE
*/
public enum Status{
public enum Status {
/**
* Sended status.
*/

View File

@@ -1,4 +1,22 @@
/*
*
* 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.combine;

View File

@@ -1,3 +1,21 @@
/*
*
* 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.combine;
import lombok.Data;

View File

@@ -1,4 +1,22 @@
/*
*
* 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.combine;
import com.fasterxml.jackson.annotation.JsonFormat;

View File

@@ -1,3 +1,21 @@
/*
*
* 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.combine;
import cn.felord.payment.wechat.v3.model.H5Info;
@@ -7,5 +25,5 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
@Data
public class CombineH5SceneInfo extends CombineSceneInfo {
private H5Info h5Info;
private H5Info h5Info;
}

View File

@@ -1,4 +1,22 @@
/*
*
* 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.combine;
import com.fasterxml.jackson.annotation.JsonFormat;

View File

@@ -1,4 +1,22 @@
/*
*
* 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.combine;

View File

@@ -1,4 +1,22 @@
/*
*
* 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.combine;
import lombok.Data;

View File

@@ -1,4 +1,22 @@
/*
*
* 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.combine;
import cn.felord.payment.wechat.v3.model.SettleInfo;