1. 迁移创建支付交易单接口

This commit is contained in:
YunaiV
2020-11-28 22:52:52 +08:00
parent fdc83d4550
commit 0a14b530b6
33 changed files with 284 additions and 467 deletions

View File

@@ -0,0 +1,31 @@
package cn.iocoder.mall.payservice.enums;
import cn.iocoder.common.framework.exception.ErrorCode;
/**
* 错误码枚举类
*
* 管理员系统,使用 1-004-000-000 段
*/
public interface PayErrorCodeConstants {
// ========== APP 模块 ==========
ErrorCode PAY_APP_NOT_FOUND = new ErrorCode(1004000000, "App 不存在");
ErrorCode PAY_APP_IS_DISABLE = new ErrorCode(1004000001, "App 已经被禁用");
// ========== TRANSACTION PAY 模块 ==========
ErrorCode PAY_TRANSACTION_NOT_FOUND = new ErrorCode(100401000, "支付交易单不存在");
ErrorCode PAY_TRANSACTION_STATUS_IS_NOT_WAITING = new ErrorCode(100401001, "支付交易单不处于待支付");
ErrorCode PAY_TRANSACTION_STATUS_IS_NOT_SUCCESS = new ErrorCode(100401002, "支付交易单不处于已支付");
ErrorCode PAY_TRANSACTION_ERROR_USER = new ErrorCode(100401003, "支付交易单用户不正确");
ErrorCode PAY_TRANSACTION_EXTENSION_NOT_FOUND = new ErrorCode(100401050, "支付交易拓展单不存在");
ErrorCode PAY_TRANSACTION_EXTENSION_STATUS_IS_NOT_WAITING = new ErrorCode(100401051, "支付交易拓展单不处于待支付");
ErrorCode PAY_TRANSACTION_EXTENSION_STATUS_IS_NOT_SUCCESS = new ErrorCode(100401052, "支付交易单不处于已支付");
// ========== TRANSACTION REFUND 模块 ==========
ErrorCode PAY_REFUND_PRICE_EXCEED = new ErrorCode(100402000, "退款金额超过支付交易单可退金额");
ErrorCode PAY_REFUND_NOT_FOUND = new ErrorCode(100402001, "退款单不存在");
ErrorCode PAY_REFUND_STATUS_NOT_WAITING = new ErrorCode(100402002, "退款单不处于待处理");
}

View File

@@ -0,0 +1,45 @@
package cn.iocoder.mall.payservice.enums.transaction;
/**
* 支付交易状态枚举
*/
public enum PayTransactionStatusEnum {
WAITING(1, "等待支付"),
SUCCESS(2, "支付成功"),
CANCEL(3, "取消支付"), // 例如说,支付单超时
;
/**
* 状态
*/
private Integer value;
/**
* 名字
*/
private String name;
PayTransactionStatusEnum(Integer value, String name) {
this.value = value;
this.name = name;
}
public Integer getValue() {
return value;
}
public PayTransactionStatusEnum setValue(Integer value) {
this.value = value;
return this;
}
public String getName() {
return name;
}
public PayTransactionStatusEnum setName(String name) {
this.name = name;
return this;
}
}

View File

@@ -1 +0,0 @@
package cn.iocoder.mall.payservice.rpc;

View File

@@ -1,10 +1,19 @@
package cn.iocoder.mall.payservice.rpc.transaction;
import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionCreateReqDTO;
/**
* 支付交易单 RPC 接口
*/
public interface PayTransactionRpc {
/**
* 创建支付交易单
*
* @param createReqDTO 创建信息
* @return 支付交易单号
*/
CommonResult<Integer> createPayTransaction(PayTransactionCreateReqDTO createReqDTO);
}