diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/ContractStatus.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/ContractStatus.java index 17625b5..f3fc108 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/ContractStatus.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/ContractStatus.java @@ -1,3 +1,20 @@ +/* + * + * 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; /** diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/CountType.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/CountType.java index 4fc2730..216ca86 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/CountType.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/CountType.java @@ -15,7 +15,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package cn.felord.payment.wechat.enumeration; /** diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/StrategyType.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/StrategyType.java index 2aa3bbc..6322c47 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/StrategyType.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/StrategyType.java @@ -1,3 +1,20 @@ +/* + * + * 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; /** diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/UnfinishedReason.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/UnfinishedReason.java new file mode 100644 index 0000000..f705629 --- /dev/null +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/UnfinishedReason.java @@ -0,0 +1,36 @@ +/* + * + * 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; + +/** + * 未完成约定原因 + *

+ * 当订单守约状态为{@link ContractStatus#UNFINISHED},返回此字段 + * + * @since 1.0.3.RELEASE + */ +public enum UnfinishedReason { + /** + * 到期未完成约 + */ + DUE_TO_QUIT, + /** + * 提前退出约定 + */ + EARLY_QUIT +} diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/WechatPayV3Type.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/WechatPayV3Type.java index 4ca20a2..c8decc6 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/WechatPayV3Type.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/enumeration/WechatPayV3Type.java @@ -107,19 +107,19 @@ public enum WechatPayV3Type { * * @since 1.0.0.RELEASE */ - COMBINE_JSAPI(HttpMethod.POST, "%s/v3/pay/combine-transactions/jsapi"), + COMBINE_JSAPI(HttpMethod.POST, "%s/v3/combine-transactions/jsapi"), /** * 合单下单-H5支付API. * * @since 1.0.0.RELEASE */ - COMBINE_MWEB(HttpMethod.POST, "%s/v3/pay/combine-transactions/h5"), + COMBINE_MWEB(HttpMethod.POST, "%s/v3/combine-transactions/h5"), /** * 合单下单-Native支付API. * * @since 1.0.0.RELEASE */ - COMBINE_NATIVE(HttpMethod.POST, "%s/v3/pay/combine-transactions/native"), + COMBINE_NATIVE(HttpMethod.POST, "%s/v3/combine-transactions/native"), /** * 合单查询订单API. * diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/WechatPayCallback.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/WechatPayCallback.java index ddc9301..9a0ae13 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/WechatPayCallback.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/WechatPayCallback.java @@ -24,6 +24,7 @@ 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.PayScoreConsumer; 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; diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/DiscountCardAgreementEndConsumeData.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/DiscountCardAgreementEndConsumeData.java index f900e2b..f185b9d 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/DiscountCardAgreementEndConsumeData.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/DiscountCardAgreementEndConsumeData.java @@ -19,6 +19,7 @@ package cn.felord.payment.wechat.v3.model.discountcard; import cn.felord.payment.wechat.enumeration.ContractStatus; import cn.felord.payment.wechat.enumeration.CountType; +import cn.felord.payment.wechat.enumeration.UnfinishedReason; import lombok.Data; import java.util.List; @@ -108,7 +109,7 @@ public class DiscountCardAgreementEndConsumeData { */ private String name; /** - * The Objective completion records. + * 用户先享卡目标完成纪录 */ private List objectiveCompletionRecords; /** @@ -190,22 +191,4 @@ public class DiscountCardAgreementEndConsumeData { } - /** - * 未完成约定原因 - *

- * 当订单守约状态为{@link ContractStatus#UNFINISHED},返回此字段 - * - * @since 1.0.3.RELEASE - */ - enum UnfinishedReason { - /** - * 到期未完成约 - */ - DUE_TO_QUIT, - /** - * 提前退出约定 - */ - EARLY_QUIT - } - } diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/DiscountCardConsumer.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/DiscountCardConsumer.java index 55220a8..c4ad7c9 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/DiscountCardConsumer.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/DiscountCardConsumer.java @@ -14,7 +14,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package cn.felord.payment.wechat.v3.model.discountcard; @@ -31,15 +30,15 @@ import java.util.function.Consumer; @Data public class DiscountCardConsumer { /** - * The Accepted consume data consumer. + * 用户领取微信先享卡通知解密 */ private Consumer acceptedConsumeDataConsumer; /** - * The Agreement end consume data consumer. + * 微信支付先享卡用户守约状态变化通知解密 */ private Consumer agreementEndConsumeDataConsumer; /** - * The Card user paid consume data consumer. + * 先享卡扣费状态变化通知解密 */ private Consumer cardUserPaidConsumeDataConsumer; } diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/DiscountCardUserPaidConsumeData.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/DiscountCardUserPaidConsumeData.java index a83710b..a1a31d2 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/DiscountCardUserPaidConsumeData.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/DiscountCardUserPaidConsumeData.java @@ -14,15 +14,15 @@ * 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 cn.felord.payment.wechat.enumeration.UnfinishedReason; import lombok.Data; /** - * 先享卡扣费状态变化通知解密. - * + * 先享卡扣费状态变化通知解密 * * @author felord.cn * @since 1.0.2.RELEASE @@ -31,67 +31,84 @@ import lombok.Data; public class DiscountCardUserPaidConsumeData { /** - * The Appid. + * 应用appid需要绑定微信商户平台 */ private String appid; /** - * The Card id. + * 先享卡ID,唯一标识一个先享卡 */ private String cardId; /** - * The Card template id. + * 先享卡模板ID,唯一定义此资源的标识。创建模板后可获得 */ private String cardTemplateId; /** - * The Mchid. + * 商户号 */ private String mchid; /** - * The Openid. + * 用户标识,用户在{@code appid}下的唯一标识 */ private String openid; /** - * The Out card code. + * 商户领卡号,商户在请求领卡预受理接口时传入的领卡请求号,同一个商户号下必须唯一,要求32个字符内,只能是数字、大小写字母_-|* */ private String outCardCode; /** - * The Pay information. + * 先享卡的守约状态 */ - private PayInformation payInformation; + private ContractStatus state; /** - * The State. - */ - private String state; - /** - * The Total amount. + * 享受优惠总金额,单位为 “分” */ private Long totalAmount; /** - * The Unfinished reason. + * 未完成约定原因 */ - private String unfinishedReason; + private UnfinishedReason unfinishedReason; + /** + * 用户退回优惠的付款信息 + */ + private PayInformation payInformation; /** - * The type Pay information. + * 用户退回优惠的付款信息 + *

+ * 当状态为{@link ContractStatus#UNFINISHED}(用户未完成约定)时,且需要退回已享受的优惠金额时,返回此字段; */ @Data public static class PayInformation { /** - * The Pay amount. + * 付款金额,用户需要退回优惠而付款的金额,单位为:分; */ private Long payAmount; /** - * The Pay state. + * 用户付款状态, */ - private String payState; + private PayState payState; /** - * The Pay time. + * 付款时间 */ private String payTime; /** - * The Transaction id. + * 微信支付订单号,仅在订单成功收款时才返回 */ private String transactionId; } + + /** + * 付款状态 + * @since 1.0.3.RELEASE + */ + public enum PayState { + /** + * 付款中 + */ + PAYING, + /** + * 已付款 + */ + PAID + } } diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/ObjectiveCompletionRecord.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/ObjectiveCompletionRecord.java index f4f1de9..08a449b 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/ObjectiveCompletionRecord.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/ObjectiveCompletionRecord.java @@ -14,7 +14,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package cn.felord.payment.wechat.v3.model.discountcard; @@ -22,7 +21,7 @@ import cn.felord.payment.wechat.enumeration.StrategyType; import lombok.Data; /** - * The type Objective completion record. + * 微信先享卡目标完成纪录 * * @author felord.cn * @since 1.0.2.RELEASE @@ -31,31 +30,31 @@ import lombok.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. + * 目标id */ private String objectiveId; /** - * The Remark. + * 备注说明 */ private String remark; diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/RewardUsageRecord.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/RewardUsageRecord.java index b9841c8..d247874 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/RewardUsageRecord.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/RewardUsageRecord.java @@ -14,7 +14,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package cn.felord.payment.wechat.v3.model.discountcard; @@ -22,7 +21,7 @@ import cn.felord.payment.wechat.enumeration.StrategyType; import lombok.Data; /** - * The type Reward usage record. + * 优惠使用纪录列表对象 * * @author felord.cn * @since 1.0.2.RELEASE @@ -31,35 +30,40 @@ import lombok.Data; public class RewardUsageRecord { /** - * The Amount. + * 优惠金额 + * + *

    + *
  1. 优惠金额,用户此项本次享受的优惠对应的优惠总金额,单位:分,必须大于0。
  2. + *
  3. 子优惠已享金额累计≤创建模板时配置的此子优惠的价值金额 例如:优惠为【满10元减3元优惠券4张】时,用户一次消费使用了2张优惠券,优惠金额为本次优惠总金额6元,优惠数量为本次使用优惠的优惠券数量2张
  4. + *
*/ private Long amount; /** - * The Description. + * 优惠使用描述 */ private String description; /** - * The Remark. + * 备注说明 */ private String remark; /** - * The Reward id. + * 优惠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; diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/UserRecordsParams.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/UserRecordsParams.java index ff5dcc9..78a95a0 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/UserRecordsParams.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/UserRecordsParams.java @@ -14,7 +14,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package cn.felord.payment.wechat.v3.model.discountcard; @@ -30,21 +29,20 @@ import java.util.List; */ @Data public class UserRecordsParams { - /** - * The Out card code. + * 商户领卡号,商户在请求领卡预受理接口时传入的领卡请求号,同一个商户号下必须唯一,要求32个字符内,只能是数字、大小写字母_-|* */ private String outCardCode; /** - * The Card template id. + * 先享卡模板ID,唯一定义此资源的标识。创建模板后可获得 */ private String cardTemplateId; /** - * The Objective completion records. + * 微信先享卡目标完成纪录 */ private List objectiveCompletionRecords; /** - * The Reward usage records. + * 优惠使用纪录 */ private List rewardUsageRecords; diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/PayScoreConsumer.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/payscore/PayScoreConsumer.java similarity index 77% rename from payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/PayScoreConsumer.java rename to payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/payscore/PayScoreConsumer.java index 129d258..e5e971b 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/discountcard/PayScoreConsumer.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/v3/model/payscore/PayScoreConsumer.java @@ -14,12 +14,9 @@ * 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; +package cn.felord.payment.wechat.v3.model.payscore; -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; @@ -33,11 +30,11 @@ import java.util.function.Consumer; @Data public class PayScoreConsumer { /** - * The Confirm consume data consumer. + * 用户确认回调消费接口 */ private Consumer confirmConsumeDataConsumer; /** - * The Paid consume data consumer. + * 用户支付回调消费接口 */ private Consumer paidConsumeDataConsumer; }