mirror of https://gitee.com/stylefeng/roses
支付api
parent
c6f71380a7
commit
55e467b994
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>kernel-d-pay</artifactId>
|
||||||
|
<groupId>cn.stylefeng.roses</groupId>
|
||||||
|
<version>7.0.4</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>pay-api</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,79 @@
|
||||||
|
/*
|
||||||
|
* Copyright [2020-2030] [https://www.stylefeng.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
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||||
|
*
|
||||||
|
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
* 2.请不要删除和修改Guns源码头部的版权声明。
|
||||||
|
* 3.请保留源码和相关描述文件的项目出处,作者声明等。
|
||||||
|
* 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||||
|
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||||
|
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||||
|
*/
|
||||||
|
package cn.stylefeng.roses.kernel.pay.api;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.stylefeng.roses.kernel.pay.api.pojo.TradeRefundResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付的api
|
||||||
|
*
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/04/20 20:43
|
||||||
|
*/
|
||||||
|
public interface PayApi {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PC网页支付
|
||||||
|
*
|
||||||
|
* @param orderName 订单名称
|
||||||
|
* @param outTradeNo 商家订单编号
|
||||||
|
* @param total 金额
|
||||||
|
* @param returnUrl 付款完成后跳转页面
|
||||||
|
* @return 支付页面
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/04/20 20:43
|
||||||
|
*/
|
||||||
|
String page(String orderName, String outTradeNo, String total, String returnUrl);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机支付
|
||||||
|
*
|
||||||
|
* @param orderName 订单名称
|
||||||
|
* @param outTradeNo 商家订单编号
|
||||||
|
* @param total 金额
|
||||||
|
* @param quitUrl 中途退出时返回的页面
|
||||||
|
* @param returnUrl 付款完成后跳转页面
|
||||||
|
* @return 支付页面
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/04/20 20:43
|
||||||
|
*/
|
||||||
|
String wap(String orderName, String outTradeNo, String total, String quitUrl, String returnUrl);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款
|
||||||
|
*
|
||||||
|
* @param outTradeNo 商家订单编号
|
||||||
|
* @param refundAmount 退款金额
|
||||||
|
* @return 退款结果
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/04/20 20:43
|
||||||
|
*/
|
||||||
|
TradeRefundResponse refund(String outTradeNo, String refundAmount);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
* Copyright [2020-2030] [https://www.stylefeng.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
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||||
|
*
|
||||||
|
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
* 2.请不要删除和修改Guns源码头部的版权声明。
|
||||||
|
* 3.请保留源码和相关描述文件的项目出处,作者声明等。
|
||||||
|
* 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||||
|
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||||
|
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||||
|
*/
|
||||||
|
package cn.stylefeng.roses.kernel.pay.api.constants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付模块的常量
|
||||||
|
*
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/04/20 20:43
|
||||||
|
*/
|
||||||
|
public interface PayConstants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mongodb模块的名称
|
||||||
|
*/
|
||||||
|
String PAY_MODULE_NAME = "kernel-d-pay";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常枚举的步进值
|
||||||
|
*/
|
||||||
|
String PAY_EXCEPTION_STEP_CODE = "80";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款成功的返回码
|
||||||
|
*/
|
||||||
|
String REFUND_SUCCESS_CODE = "10000";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款失败的返回码
|
||||||
|
*/
|
||||||
|
String REFUND_ERROR_CODE = "40000";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
/*
|
||||||
|
* Copyright [2020-2030] [https://www.stylefeng.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
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||||
|
*
|
||||||
|
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
* 2.请不要删除和修改Guns源码头部的版权声明。
|
||||||
|
* 3.请保留源码和相关描述文件的项目出处,作者声明等。
|
||||||
|
* 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||||
|
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||||
|
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||||
|
*/
|
||||||
|
package cn.stylefeng.roses.kernel.pay.api.exception;
|
||||||
|
|
||||||
|
import cn.stylefeng.roses.kernel.pay.api.constants.PayConstants;
|
||||||
|
import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum;
|
||||||
|
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付模块的异常
|
||||||
|
*
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/04/20 20:43
|
||||||
|
*/
|
||||||
|
public class PayException extends ServiceException {
|
||||||
|
|
||||||
|
public PayException(AbstractExceptionEnum exception) {
|
||||||
|
super(PayConstants.PAY_MODULE_NAME, exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,129 @@
|
||||||
|
/*
|
||||||
|
* Copyright [2020-2030] [https://www.stylefeng.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
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||||
|
*
|
||||||
|
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
* 2.请不要删除和修改Guns源码头部的版权声明。
|
||||||
|
* 3.请保留源码和相关描述文件的项目出处,作者声明等。
|
||||||
|
* 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||||
|
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||||
|
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||||
|
*/
|
||||||
|
package cn.stylefeng.roses.kernel.pay.api.pojo;
|
||||||
|
|
||||||
|
import cn.stylefeng.roses.kernel.pay.api.constants.PayConstants;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款响应
|
||||||
|
*
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/04/20 20:43
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class TradeRefundResponse{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款状态码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态描述
|
||||||
|
*/
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家订单号
|
||||||
|
*/
|
||||||
|
private String outTradeNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款金额
|
||||||
|
*/
|
||||||
|
private String refundFee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 各厂商系统中的交易流水号
|
||||||
|
*/
|
||||||
|
private String tradeNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款实际的发生时间
|
||||||
|
*/
|
||||||
|
private String gmtRefundPay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 买家账号
|
||||||
|
*/
|
||||||
|
private String buyerLogonId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 买家在各厂商系统中的用户id
|
||||||
|
*/
|
||||||
|
private String buyerUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 各厂商响应值
|
||||||
|
*/
|
||||||
|
private Object data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化一个新创建的 TradeRefundResponse对象
|
||||||
|
*
|
||||||
|
* @param code 状态码
|
||||||
|
* @param msg 描述
|
||||||
|
* @param data 对象值
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/04/20 20:43
|
||||||
|
*/
|
||||||
|
public TradeRefundResponse(String code, String msg, Object data){
|
||||||
|
this.code = code;
|
||||||
|
this.msg = msg;
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回错误信息
|
||||||
|
*
|
||||||
|
* @param msg 描述
|
||||||
|
* @param data 对象值
|
||||||
|
* @return TradeRefundResponse对象
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/04/20 20:43
|
||||||
|
*/
|
||||||
|
public static TradeRefundResponse error(String msg, Object data){
|
||||||
|
return new TradeRefundResponse(PayConstants.REFUND_ERROR_CODE,msg,data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回错误信息
|
||||||
|
*
|
||||||
|
* @param msg 描述
|
||||||
|
* @return TradeRefundResponse对象
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/04/20 20:43
|
||||||
|
*/
|
||||||
|
public static TradeRefundResponse error(String msg){
|
||||||
|
return error(msg,null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>roses-kernel</artifactId>
|
||||||
|
<groupId>cn.stylefeng.roses</groupId>
|
||||||
|
<version>7.0.4</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>kernel-d-pay</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>pay-api</module>
|
||||||
|
<module>pay-sdk-alipay</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- 开发规则 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.stylefeng.roses</groupId>
|
||||||
|
<artifactId>kernel-a-rule</artifactId>
|
||||||
|
<version>7.0.4</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
Loading…
Reference in New Issue