fix: #I2BCMZ 合单支付url不正确的问题

This commit is contained in:
dax
2020-12-28 16:54:01 +08:00
committed by felord.cn
parent c101cdd857
commit f2c66bef10
13 changed files with 149 additions and 82 deletions

View File

@@ -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;
/**

View File

@@ -15,7 +15,6 @@
* 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,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;
/**

View File

@@ -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;
/**
* 未完成约定原因
* <p>
* 当订单守约状态为{@link ContractStatus#UNFINISHED},返回此字段
*
* @since 1.0.3.RELEASE
*/
public enum UnfinishedReason {
/**
* 到期未完成约
*/
DUE_TO_QUIT,
/**
* 提前退出约定
*/
EARLY_QUIT
}

View File

@@ -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.
*

View File

@@ -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;

View File

@@ -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<ObjectiveCompletionRecord> objectiveCompletionRecords;
/**
@@ -190,22 +191,4 @@ public class DiscountCardAgreementEndConsumeData {
}
/**
* 未完成约定原因
* <p>
* 当订单守约状态为{@link ContractStatus#UNFINISHED},返回此字段
*
* @since 1.0.3.RELEASE
*/
enum UnfinishedReason {
/**
* 到期未完成约
*/
DUE_TO_QUIT,
/**
* 提前退出约定
*/
EARLY_QUIT
}
}

View File

@@ -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<DiscountCardAcceptedConsumeData> acceptedConsumeDataConsumer;
/**
* The Agreement end consume data consumer.
* 微信支付先享卡用户守约状态变化通知解密
*/
private Consumer<DiscountCardAgreementEndConsumeData> agreementEndConsumeDataConsumer;
/**
* The Card user paid consume data consumer.
* 先享卡扣费状态变化通知解密
*/
private Consumer<DiscountCardUserPaidConsumeData> cardUserPaidConsumeDataConsumer;
}

View File

@@ -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.
* 用户退回优惠的付款信息
* <p>
* 当状态为{@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
}
}

View File

@@ -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;

View File

@@ -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.
* 优惠金额
*
* <ol>
* <li>优惠金额用户此项本次享受的优惠对应的优惠总金额单位必须大于0。</li>
* <li>子优惠已享金额累计≤创建模板时配置的此子优惠的价值金额 例如优惠为【满10元减3元优惠券4张】时用户一次消费使用了2张优惠券优惠金额为本次优惠总金额6元优惠数量为本次使用优惠的优惠券数量2张</li>
* </ol>
*/
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;

View File

@@ -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<ObjectiveCompletionRecord> objectiveCompletionRecords;
/**
* The Reward usage records.
* 优惠使用纪录
*/
private List<RewardUsageRecord> rewardUsageRecords;

View File

@@ -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<PayScoreUserConfirmConsumeData> confirmConsumeDataConsumer;
/**
* The Paid consume data consumer.
* 用户支付回调消费接口
*/
private Consumer<PayScoreUserPaidConsumeData> paidConsumeDataConsumer;
}