支付api

pull/20/head
huziyang 2021-05-28 14:15:23 +08:00
parent c6f71380a7
commit 55e467b994
7 changed files with 367 additions and 0 deletions

View File

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

View File

@ -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.
*
* GunsAPACHE 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);
}

View File

@ -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.
*
* GunsAPACHE 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";
}

View File

@ -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.
*
* GunsAPACHE 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);
}
}

View File

@ -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.
*
* GunsAPACHE 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);
}
}

34
kernel-d-pay/pom.xml Normal file
View File

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

View File

@ -94,6 +94,9 @@
<!--mongodb模块-->
<module>kernel-d-mongodb</module>
<!-- 支付模块 -->
<module>kernel-d-pay</module>
<!--系统管理基础业务-->
<module>kernel-s-system</module>