Compare commits

..

No commits in common. "c9635a647ca78c18f5af7124e138fc167f4a277c" and "7d629a9c04dba5d4a6d5f20a276f75530558683c" have entirely different histories.

30 changed files with 606 additions and 13760 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitToolBoxBlameSettings">
<option name="version" value="2" />
</component>
</project>

File diff suppressed because it is too large Load Diff

119
api/bundle/bundle.proto Normal file
View File

@ -0,0 +1,119 @@
syntax = "proto3";
package bundle;
option go_package = "./bundle";
service Bundle {
rpc CreateBundle(BundleProfile) returns (CommonResponse) {}
rpc UpdateBundle(BundleProfile) returns (CommonResponse) {}
rpc DeleteBundle(DelBundleRequest) returns (CommonResponse) {}
rpc BundleList(BundleListRequest) returns (BundleListResponse) {}
rpc BundleDetail(BundleDetailRequest) returns (BundleDetailResponse) {}
rpc CreateOrderRecord(OrderRecord) returns (CommonResponse) {}
rpc UpdateOrderRecord(OrderRecord) returns (CommonResponse) {}
rpc UpdateOrderRecordByOrderNo(OrderRecord) returns (CommonResponse) {}
rpc OrderRecordsList(OrderRecordsRequest) returns (OrderRecordsResponse) {}
rpc OrderRecordsDetail(OrderRecordsDetailRequest) returns (OrderRecordsDetailResponse) {}
}
message CommonResponse {
string msg = 1 [json_name = "msg"];
string uuid = 2 [json_name = "uuid"];
string orderNo = 3 [json_name = "orderNo"];
}
message BundleProfile {
string uuid = 1 [json_name = "uuid"];
string name = 2 [json_name = "name"];
float price = 3 [json_name = "price"];
int64 PriceType = 4 [json_name = "priceType"];
string content = 5 [json_name = "content"];
string contract = 6 [json_name = "contract"];
string language = 7 [json_name = "language"];
string createdAt = 8 [json_name = "createdAt"];
string updatedAt = 9 [json_name = "updatedAt"];
string companySign = 10 [json_name = "companySign"];
int64 contractDuration = 11 [json_name = "contractDuration"];
}
message DelBundleRequest {
string uuid = 1 [json_name = "uuid"];
}
message BundleListRequest {
int32 page = 1 [json_name = "page"];
int32 pageSize = 2 [json_name = "pageSize"];
string name = 3 [json_name = "name"];
string content = 4 [json_name = "content"];
string language = 5 [json_name = "language"];
}
message BundleListResponse {
repeated BundleProfile bundles = 1 [json_name = "bundles"];
int32 total = 2 [json_name = "total"];
}
message BundleDetailRequest {
string uuid = 1 [json_name = "uuid"];
}
message BundleDetailResponse {
BundleProfile bundle = 1 [json_name = "bundle"];
string msg = 2 [json_name = "msg"];
}
message OrderRecord {
string uuid = 1 [json_name = "uuid"];
string bundleUuid = 2 [json_name = "bundleUuid"];
string customerID = 3 [json_name = "customerID"];
string customerNum = 4 [json_name = "customerNum"];
string customerName = 5 [json_name = "customerName"];
float amount = 6 [json_name = "amount"];
int64 amountType = 7 [json_name = "amountType"];
string signContract = 8 [json_name = "signContract"];
string signature = 9 [json_name = "signature"];
string signedTime = 10 [json_name = "signedTime"];
int64 payType = 11 [json_name = "payType"];
string payTime = 12 [json_name = "payTime"];
string checkoutSessionId = 13 [json_name = "checkoutSessionId"];
string checkoutSessionUrl = 14 [json_name = "checkoutSessionUrl"];
int64 status = 15 [json_name = "status"];
string orderNo = 16 [json_name = "orderNo"];
string bundleName = 17 [json_name = "bundleName"];
string contractNo = 18 [json_name = "contractNo"];
}
message OrderRecordsRequest {
int32 page = 1 [json_name = "page"];
int32 pageSize = 2 [json_name = "pageSize"];
string customerNum = 3 [json_name = "customerNum"];
string customerName = 4 [json_name = "customerName"];
string bundleUUID = 5 [json_name = "bundleUUID"];
string orderNo = 6 [json_name = "orderNo"];
int64 status = 7 [json_name = "status"];
string bundleName = 8 [json_name = "bundleName"];
string startSignedTime = 9 [json_name = "startSignedTime"];
string endSignedTime = 10 [json_name = "endSignedTime"];
string startPayTime = 11 [json_name = "startPayTime"];
string endPayTime = 12 [json_name = "endPayTime"];
string customerID = 13 [json_name = "customerID"];
}
message OrderRecordsResponse {
repeated OrderRecord orderRecords = 1 [json_name = "orderRecords"];
int32 total = 2 [json_name = "total"];
}
message OrderRecordsDetailRequest {
string uuid = 1 [json_name = "uuid"];
string orderNo = 2 [json_name = "orderNo"];
string customerID = 3 [json_name = "customerID"];
}
message OrderRecordsDetailResponse {
OrderRecord orderRecord = 1 [json_name = "orderRecord"];
string msg = 2 [json_name = "msg"];
}

View File

@ -7,8 +7,6 @@ import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/protobuf/types/descriptorpb"
_ "github.com/mwitkow/go-proto-validators"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
)
@ -77,45 +75,3 @@ func (this *OrderRecordsDetailResponse) Validate() error {
}
return nil
}
func (this *ValueAddBundleProfile) Validate() error {
return nil
}
func (this *CreateValueAddBundleRequest) Validate() error {
if !(this.Num > 29) {
return github_com_mwitkow_go_proto_validators.FieldError("Num", fmt.Errorf(`至少数为30,最多数为100`))
}
if !(this.Num < 101) {
return github_com_mwitkow_go_proto_validators.FieldError("Num", fmt.Errorf(`至少数为30,最多数为100`))
}
return nil
}
func (this *CreateValueAddBundleResponse) Validate() error {
return nil
}
func (this *ValueAddBundleListRequest) Validate() error {
return nil
}
func (this *ValueAddBundleListResponse) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *ValueAddBundleDetailRequest) Validate() error {
return nil
}
func (this *ValueAddBundleDetailResponse) Validate() error {
if this.Data != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
return nil
}
func (this *FinancialConfirmationRequest) Validate() error {
return nil
}

View File

@ -38,11 +38,6 @@ type BundleClient interface {
UpdateOrderRecordByOrderNo(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
OrderRecordsList(ctx context.Context, in *OrderRecordsRequest, opts ...grpc_go.CallOption) (*OrderRecordsResponse, common.ErrorWithAttachment)
OrderRecordsDetail(ctx context.Context, in *OrderRecordsDetailRequest, opts ...grpc_go.CallOption) (*OrderRecordsDetailResponse, common.ErrorWithAttachment)
UpdateFinancialConfirmationStatus(ctx context.Context, in *FinancialConfirmationRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
//增值套餐
CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment)
ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment)
ValueAddBundleDetail(ctx context.Context, in *ValueAddBundleDetailRequest, opts ...grpc_go.CallOption) (*ValueAddBundleDetailResponse, common.ErrorWithAttachment)
}
type bundleClient struct {
@ -50,20 +45,16 @@ type bundleClient struct {
}
type BundleClientImpl struct {
CreateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
UpdateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
DeleteBundle func(ctx context.Context, in *DelBundleRequest) (*CommonResponse, error)
BundleList func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
BundleDetail func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponse, error)
CreateOrderRecord func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
UpdateOrderRecord func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
UpdateOrderRecordByOrderNo func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
OrderRecordsList func(ctx context.Context, in *OrderRecordsRequest) (*OrderRecordsResponse, error)
OrderRecordsDetail func(ctx context.Context, in *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
UpdateFinancialConfirmationStatus func(ctx context.Context, in *FinancialConfirmationRequest) (*CommonResponse, error)
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
CreateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
UpdateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
DeleteBundle func(ctx context.Context, in *DelBundleRequest) (*CommonResponse, error)
BundleList func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
BundleDetail func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponse, error)
CreateOrderRecord func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
UpdateOrderRecord func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
UpdateOrderRecordByOrderNo func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
OrderRecordsList func(ctx context.Context, in *OrderRecordsRequest) (*OrderRecordsResponse, error)
OrderRecordsDetail func(ctx context.Context, in *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
}
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
@ -138,30 +129,6 @@ func (c *bundleClient) OrderRecordsDetail(ctx context.Context, in *OrderRecordsD
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OrderRecordsDetail", in, out)
}
func (c *bundleClient) UpdateFinancialConfirmationStatus(ctx context.Context, in *FinancialConfirmationRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateFinancialConfirmationStatus", in, out)
}
func (c *bundleClient) CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment) {
out := new(CreateValueAddBundleResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateValueAddBundle", in, out)
}
func (c *bundleClient) ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment) {
out := new(ValueAddBundleListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ValueAddBundleList", in, out)
}
func (c *bundleClient) ValueAddBundleDetail(ctx context.Context, in *ValueAddBundleDetailRequest, opts ...grpc_go.CallOption) (*ValueAddBundleDetailResponse, common.ErrorWithAttachment) {
out := new(ValueAddBundleDetailResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ValueAddBundleDetail", in, out)
}
// BundleServer is the server API for Bundle service.
// All implementations must embed UnimplementedBundleServer
// for forward compatibility
@ -176,11 +143,6 @@ type BundleServer interface {
UpdateOrderRecordByOrderNo(context.Context, *OrderRecord) (*CommonResponse, error)
OrderRecordsList(context.Context, *OrderRecordsRequest) (*OrderRecordsResponse, error)
OrderRecordsDetail(context.Context, *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
UpdateFinancialConfirmationStatus(context.Context, *FinancialConfirmationRequest) (*CommonResponse, error)
//增值套餐
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
ValueAddBundleDetail(context.Context, *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
mustEmbedUnimplementedBundleServer()
}
@ -219,18 +181,6 @@ func (UnimplementedBundleServer) OrderRecordsList(context.Context, *OrderRecords
func (UnimplementedBundleServer) OrderRecordsDetail(context.Context, *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method OrderRecordsDetail not implemented")
}
func (UnimplementedBundleServer) UpdateFinancialConfirmationStatus(context.Context, *FinancialConfirmationRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateFinancialConfirmationStatus not implemented")
}
func (UnimplementedBundleServer) CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateValueAddBundle not implemented")
}
func (UnimplementedBundleServer) ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ValueAddBundleList not implemented")
}
func (UnimplementedBundleServer) ValueAddBundleDetail(context.Context, *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ValueAddBundleDetail not implemented")
}
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
@ -549,122 +499,6 @@ func _Bundle_OrderRecordsDetail_Handler(srv interface{}, ctx context.Context, de
return interceptor(ctx, in, info, handler)
}
func _Bundle_UpdateFinancialConfirmationStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(FinancialConfirmationRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("UpdateFinancialConfirmationStatus", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_CreateValueAddBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateValueAddBundleRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("CreateValueAddBundle", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_ValueAddBundleList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ValueAddBundleListRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("ValueAddBundleList", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_ValueAddBundleDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ValueAddBundleDetailRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("ValueAddBundleDetail", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -712,22 +546,6 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "OrderRecordsDetail",
Handler: _Bundle_OrderRecordsDetail_Handler,
},
{
MethodName: "UpdateFinancialConfirmationStatus",
Handler: _Bundle_UpdateFinancialConfirmationStatus_Handler,
},
{
MethodName: "CreateValueAddBundle",
Handler: _Bundle_CreateValueAddBundle_Handler,
},
{
MethodName: "ValueAddBundleList",
Handler: _Bundle_ValueAddBundleList_Handler,
},
{
MethodName: "ValueAddBundleDetail",
Handler: _Bundle_ValueAddBundleDetail_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "pb/bundle.proto",

File diff suppressed because it is too large Load Diff

View File

@ -1,743 +0,0 @@
syntax = "proto3";
package payment;
option go_package = "./payment";
//import "pb/descriptor.proto";
service PaymentCent{
//
rpc CreatePay(CreatePayRequest) returns (CreatePayResponse); //
rpc NotifyPay(NotifyPayRequest) returns (NotifyPayResponse); //
rpc QueryPayByOutTradeNo(PayQueryRequest) returns (PayQueryResponse);//
rpc QueryExportPay(ExportPayRequest) returns (ExportPayResponse); //
rpc CreateRefund(CreateRefundRequest) returns (CreateRefundResponse); // 退
rpc StripeGermanyWebhook(GetCheckoutWebhookRequest) returns(GetCheckoutWebhookResponse){};// stripe支付回调,
rpc AliCommonWebhook(NotifyPayRequest) returns (NotifyPayResponse){}; //
rpc WechatFengLianWebhook(NotifyPayRequest) returns (NotifyPayResponse){}; //
rpc AntomWebhook(AntomNotifyPayRequest) returns (AntomNotifyPayResponse){}; // Antom支付回调
rpc QueryAntomPayByCheckoutSessionId(AntomPayQueryRequest) returns (AntomPayQueryResponse){}; // checkoutSessionIds查询支付情况
// ==========
// stripe支付
rpc CreateStripeCheckoutSession(CreateStripeCheckoutSessionRequest) returns (CreateStripeCheckoutSessionResponse){}; //
// rpc CommonCheckoutWebhook(GetCheckoutWebhookRequest) returns(GetCheckoutWebhookResponse){}; // ,
//
rpc AliWapPay(AliWapPayRequest) returns (AliWapPayResponse) {}; // ali网页支付
rpc AliAppPay(AliAppPayRequest) returns (AliAppPayResponse) {}; // aliApp支付
rpc AliNativePay(AliNativePayRequest) returns (AliNativePayResponse) {}; // aliApp当面支付
rpc AliPcWabPay(AliPcWabPayRequest) returns (AliPcWabPayResponse) {}; // ali电脑网页支付
rpc AliReFund(AliReFundRequest) returns (AliReFundResponse) {}; // ali退款
rpc AliNotify(AliNotifyRequest) returns (AliNotifyResponse) {}; // ali回调
rpc AliQueryByOutTradeNo(AliQueryByOutTradeNoRequest) returns (AliQueryByOutTradeNoResponse) {}; // ali查询订单
rpc AliRefundQueryByOutTradeNo(AliRefundQueryByOutTradeNoRequest) returns (AliRefundQueryByOutTradeNoResponse) {}; // ali查询退款订单
//
rpc WechatJsApiPay(WechatJsApiPayRequest) returns (WechatJsApiPayResponse) {}; // jsapi +
rpc WechatJsApiQueryByOutTradeNo(WechatJsApiQueryByOutTradeNoRequest) returns (WechatJsApiQueryByOutTradeNoResponse) {}; // outTrandeNo jsapi
rpc GetPayByOutTradeNo(GetPayByOutTradeNoRequest) returns (GetPayByOutTradeNoResponse) {}; // outTrandeNo id
rpc WechatJsApiRefunds(WechatJsApiRefundsRequest) returns (WechatJsApiRefundsResponse) {}; //
rpc SetPayOk(WechatPayOkRequest) returns (CommonResponse) {}; //
rpc WechatAppPay(WechatAppPayRequest) returns (WechatAppPayResponse) {}; // app +
rpc WechatAppQueryByOutTradeNo(WechatAppQueryByOutTradeNoRequest) returns (WechatAppQueryByOutTradeNoResponse) {}; // outTrandeNo App
rpc WechatNativePay(WechatNativePayRequest) returns (WechatNativePayResponse) {}; // native +
rpc WechatNativeQueryByOutTradeNo(WechatNativeQueryByOutTradeNoRequest) returns (WechatNativeQueryByOutTradeNoResponse) {}; // outTrandeNo App
rpc WechatRefundQueryByOutRefundNo(WechatRefundQueryByOutRefundNoRequest) returns (WechatRefundQueryByOutRefundNoResponse) {}; // wx查询退款订单
rpc WechatH5Pay(WechatH5PayRequest) returns (WechatH5PayResponse) {}; // H5 +
rpc WechatH5QueryByOutTradeNo(WechatH5QueryByOutTradeNoRequest) returns (WechatH5QueryByOutTradeNoResponse) {}; // outTrandeNo H5
}
message AntomPayQueryRequest {
repeated string checkoutSessionIds = 1 [json_name = "checkoutSessionIds"];
}
message AntomPayQueryResponse {
repeated PaymentOrderInfo infos = 1 [json_name = "infos"];
}
message AntomNotifyPayRequest {
string notifyType = 1 [json_name = "notifyType"];
string requestId = 2 [json_name = "requestId"];
string paymentId = 3 [json_name = "paymentId"];
string paymentTime = 4 [json_name = "paymentTime"];
string resultStatus = 5 [json_name = "resultStatus"];
string resultMessage = 6 [json_name = "resultMessage"];
string channelCode = 7 [json_name = "channelCode"];
}
message AntomNotifyPayResponse {
string status = 1 [json_name = "status"];
string outTradeNo = 2 [json_name = "outTradeNo"];
}
message CreatePayRequest {
string postUrl = 1 [json_name = "postUrl"]; //
string subject = 2 [json_name = "subject"]; //
string productUUID = 3 [json_name = "productUUID"]; // uid
string productName = 4 [json_name = "productName"]; //
string productImg = 5 [json_name = "productImg"]; //
string productDescription = 6 [json_name = "productDescription"]; //
string quitUrl = 7 [json_name = "quitUrl"]; // 退url
string notifyUrl = 8 [json_name = "notifyUrl"]; // url
string returnUrl = 9 [json_name = "returnUrl"]; // url
string outTradeNo = 10 [json_name = "outTradeNo"]; //
string channelTradeNo = 11 [json_name = "channelTradeNo"]; //
string checkSessionId = 12 [json_name = "checkSessionId"]; // stripe的支付会话id
int64 amount = 13 [json_name = "amount"]; //
string currency = 14 [json_name = "currency"]; //
string payee = 15 [json_name = "payee"]; //
string channelType = 16 [json_name = "channelType"]; // alipay- wxpay- stripe-Stripe支付
string platform = 17 [json_name = "platform"]; // app还是h5还是jsapi还是wap
string domain = 18 [json_name = "domain"]; // 使
string businessType = 19 [json_name = "businessType"]; // mq发送
string language = 20 [json_name = "language"]; //
string clientIp = 21 [json_name = "clientIp"];
string openID = 22 [json_name = "openID"]; //
int32 timeExpire = 23 [json_name = "timeExpire"]; //
string locale = 24 [json_name = "locale"]; // stripe参数
}
message CreatePayResponse {
string url = 1 [json_name = "url"];
string logRecordID = 2 [json_name = "log_record_ID"];
string msg = 3 [json_name="msg"];
string appid = 4 [json_name = "appid"];
string timeStamp = 5 [json_name = "timeStamp"];
string package = 6 [json_name = "package"];
string signType = 7 [json_name = "signType"];
string nonceStr = 8 [json_name = "nonceStr"];
string paySign = 9 [json_name = "paySign"];
string prepayId = 10 [json_name = "prepayId"];
string partnerId = 11 [json_name = "partnerId"];
string checkoutSessionId = 12 [json_name = "checkoutSessionId"];
}
message CreateRefundRequest {
string postUrl = 1 [json_name = "postUrl"]; //
string subject = 2 [json_name = "subject"]; //
string productUUID = 3 [json_name = "productUUID"]; // uid
string outTradeNo = 4 [json_name = "outTradeNo"]; //
string channelTradeNo = 5 [json_name = "channelTradeNo"]; //
string checkSessionId = 6 [json_name = "checkSessionId"]; // stripe的支付会话id
int64 refundAmount = 7 [json_name = "refundAmount"]; // 退
string currency = 8 [json_name = "currency"]; //
string payee = 9 [json_name = "payee"]; //
string channelType = 10 [json_name = "channelType"]; // alipay- wxpay- stripe-Stripe支付
string platform = 11 [json_name = "platform"]; // app还是h5还是jsapi还是wap
string domain = 12 [json_name = "domain"]; // 使
string businessType = 13 [json_name = "businessType"]; // mq发送
string language = 14 [json_name = "language"]; //
string clientIp = 15 [json_name = "clientIp"];
string openID = 16 [json_name = "openID"]; //
int64 creatorId = 17 [json_name = "creatorId"]; // id
string creatorName = 18 [json_name = "creatorName"]; //
string refundReason = 19 [json_name = "refundReason"]; // 退
}
message CreateRefundResponse {
int64 code = 1 [json_name = "code"];
string msg = 2 [json_name="msg"];
}
message NotifyPayRequest {
string postUrl = 1; //
HttpRequest http_request = 2;
string rawQuery = 3 [json_name="raw_query"];
}
message NotifyPayResponse {
string msg = 1;
string outTradeNo = 2;
}
message HttpRequest {
string method = 1;
string url = 2;
map<string, string> headers = 3;
bytes body = 4;
}
message CommonMsg{
string msg = 1;
}
message EmptyRequest{}
message CreateStripeCheckoutSessionRequest {
string productUUID = 1 [json_name = "productUUID"];
string productName = 2 [json_name = "productName"];
int64 productQuantity = 3 [json_name = "productQuantity"];
int64 productAllPrice = 4 [json_name = "productAllPrice"];
string productDescription = 5 [json_name = "productDescription"];
string productImageUrl = 6 [json_name = "productImageUrl"];
string productPriceCurrency = 7 [json_name = "productPriceCurrency"];
string createrID = 8 [json_name = "createrID"];
string createrName = 9 [json_name = "createrName"];
string domain = 10 [json_name = "domain"];
string successUrl = 11 [json_name = "successUrl"];
string cancelUrl = 12 [json_name = "cancelUrl"];
string outTradeNo = 13 [json_name = "outTradeNo"];
string locale = 14 [json_name = "locale"];
}
message CreateStripeCheckoutSessionResponse {
string checkoutSessionId = 1 [json_name = "checkoutSessionId"];
string checkoutSessionUrl = 2 [json_name = "checkoutSessionUrl"];
}
message GetCheckoutWebhookRequest {
string postUrl = 1; //
string type = 2; // "payment_intent.succeeded"
string payload = 3; // JSON payload
string signature = 4; // Stripe-Signature头的值
string webhookKey = 5; // Webhook密钥
}
message GetCheckoutWebhookResponse {
bool success = 1; //
string message = 2; //
string outTradeNo = 3 [json_name = "outTradeNo"];
string paymentIntentStatus = 4 [json_name = "paymentIntentStatus"];
}
message GetStripePaymentIntentInfoRequest {
string checkoutSessionId = 1 [json_name = "checkoutSessionId"];
string createrID = 2 [json_name = "createrID"];
}
message GetStripePaymentIntentInfoResponse {
string checkoutSessionId = 1 [json_name = "checkoutSessionId"];
string checkoutSessionStatus = 2 [json_name = "checkoutSessionStatus"];
string paymentIntentId = 3 [json_name = "paymentIntentId"];
string paymentIntentCreated = 4 [json_name = "paymentIntentCreated"];
string paymentIntentStatus = 5 [json_name = "paymentIntentStatus"];
string chargeId = 6 [json_name = "chargeId"];
int64 payPrice = 7 [json_name = "payPrice"];
string payExchangeRate = 8 [json_name = "payExchangeRate"];
string payCurrency = 9 [json_name = "payCurrency"];
string accountCurrency = 10 [json_name = "accountCurrency"];
int64 afterRatePayPrice = 11 [json_name = "afterRatePayPrice"];
int64 payHandingFee = 12 [json_name = "payHandingFee"];
int64 afterRatePayNetAmount = 13 [json_name = "afterRatePayNetAmount"];
string customerId = 14 [json_name = "customerId"];
int64 refundPrice = 15 [json_name = "refundPrice"];
string outTradeNo = 16 [json_name = "outTradeNo"];
}
message GetRefundInfoRequest {
string refundId = 1 [json_name = "refundId"];
string createrID = 2 [json_name = "createrID"];
}
message GetRefundInfoResponse {
string refundStatus = 1 [json_name = "refundStatus"];
}
message AliWapPayRequest {
string subject = 1 [json_name = "subject"];
string productCode = 2 [json_name = "product_code"];
string outTradeNo = 3 [json_name = "out_trade_no"];
string quitUrl = 4 [json_name = "quit_url"];
string notifyUrl = 5 [json_name = "notify_url"];
string returnUrl = 6 [json_name = "return_url"];
int32 totalAmount = 7 [json_name = "total_amount"];
int32 timeExpire = 8 [json_name = "time_expire"];
string domain = 9 ;
string platform = 10 ;
}
message AliWapPayResponse {
string url = 1 [json_name = "url"];
string logRecordID = 2 [json_name = "log_record_ID"];
string msg = 3 [json_name="msg"];
}
message AliAppPayRequest {
string subject = 1 [json_name = "subject"];
string productCode = 2 [json_name = "product_code"];
string outTradeNo = 3 [json_name = "out_trade_no"];
string quitUrl = 4 [json_name = "quit_url"];
string notifyUrl = 5 [json_name = "notify_url"];
string returnUrl = 6 [json_name = "return_url"];
string totalAmount = 7 [json_name = "total_amount"];
int32 timeExpire = 8 [json_name = "time_expire"];
string domain = 9 ;
string platform = 10 ;
int32 payType = 11 ;
}
message AliAppPayResponse {
string url = 1 [json_name = "url"];
string logRecordID = 2 [json_name = "log_record_ID"];
string msg = 3 [json_name="msg"];
}
message AliNativePayRequest {
string subject = 1 [json_name = "subject"];
string outTradeNo = 2 [json_name = "out_trade_no"];
string notifyUrl = 3 [json_name = "notify_url"];
int32 totalAmount = 4 [json_name = "total_amount"];
int32 timeExpire = 5 [json_name = "time_expire"];
string domain = 6 [json_name = "domain"];
string platform = 7 [json_name = "platform"];
}
message AliNativePayResponse {
string url = 1 [json_name = "url"];
string msg = 2 [json_name="msg"];
}
message AliPcWabPayRequest {
string subject = 1 [json_name = "subject"];
string outTradeNo = 2 [json_name = "out_trade_no"];
string notifyUrl = 3 [json_name = "notify_url"];
int32 totalAmount = 4 [json_name = "total_amount"];
int32 timeExpire = 5 [json_name = "time_expire"];
string domain = 6 [json_name = "domain"];
string platform = 7 [json_name = "platform"];
string quitUrl = 8 [json_name = "quit_url"];
string returnUrl = 9 [json_name = "return_url"];
}
message AliPcWabPayResponse {
string pageRedirectionData = 1 [json_name = "page_redirection_data"];
string msg = 2 [json_name="msg"];
}
message AliReFundRequest {
string outTradeNo = 1 [json_name = "out_trade_no"];
int32 totalAmount = 2 [json_name = "total_amount"];
}
message AliReFundResponse {
string tradeNo = 1 [json_name = "trade_no"];
string outTradeNo = 2 [json_name = "out_trade_no"];
string buyer_logon_id = 3 [json_name = "buyer_logon_id"];
string refund_fee = 4 [json_name = "refund_fee"];
string msg = 5 [json_name="msg"];
}
message AliNotifyRequest {
string rawQuery = 1 [json_name="raw_query"];
}
message AliNotifyResponse {
string notifyTime = 1 [json_name="notify_time"];
string notifyType = 2 [json_name="notify_type"];
string notifyId = 3 [json_name="notify_id"];
string appId = 4 [json_name="app_id"];
string version = 5 [json_name="version"];
string signType = 6 [json_name="sign_type"];
string sign = 7 [json_name="sign"];
string tradeNo = 8 [json_name="trade_no"];
string outTradeNo = 9 [json_name="out_trade_no"] ;
string buyerLogonId = 10 [json_name="buyer_logon_id"] ;
string buyerId = 11 [json_name="buyer_id"] ;
string tradeStatus = 12 [json_name="trade_status"] ;
}
message AliQueryByOutTradeNoRequest {
string outTradeNo = 1 [json_name = "outTradeNo"];
}
message AliQueryByOutTradeNoResponse {
string tradeNo = 1 [json_name = "trade_no"];
string outTradeNo = 2 [json_name = "out_trade_no"];
string buyerLogonId = 3 [json_name = "buyer_logon_id"];
string tradeStatus = 4 [json_name = "trade_status"];
string totalAmount = 5 [json_name = "total_amount"];
string buyerUserID = 6 [json_name = "buyer_user_id"];
}
message AliRefundQueryByOutTradeNoRequest {
string outTradeNo = 1 [json_name = "outTradeNo"];
}
message AliRefundQueryByOutTradeNoResponse {
string tradeNo = 1 [json_name = "trade_no"];
string outTradeNo = 2 [json_name = "out_trade_no"];
string out_request_no = 3 [json_name = "out_request_no"];
string total_amount = 4 [json_name = "total_amount"];
string refund_amount = 5 [json_name = "refund_amount"];
string refund_status = 6 [json_name = "refund_status"];
}
message WechatJsApiPayRequest {
string Description = 1 [json_name = "description"];
string OutTradeNo = 2 [json_name = "outTradeNo"];
int64 Cent = 3 [json_name = "cent"];
string OpenID = 4 [json_name = "openID"];
string NotifyUrl = 5 [json_name = "notifyUrl"];
string AppID = 6 [json_name = "appID"];
string ClientIP = 7 [json_name = "ClientIP"];
uint32 recordId = 9 ;
string domain = 10 ;
string platform = 11 ;
string scene = 12 ;
int32 timeExpire = 13 [json_name = "time_expire"];
}
message WechatJsApiPayResponse {
string Appid = 1 [json_name = "appid"];
string TimeStamp = 2 [json_name = "timeStamp"];
string Package = 3 [json_name = "package"];
string SignType = 4 [json_name = "signType"];
string NonceStr = 5 [json_name = "nonceStr"];
string PaySign = 6 [json_name = "paySign"];
string PrepayId = 7 [json_name = "prepayId"];
}
message WechatAppPayResponse {
string Appid = 1 [json_name = "appid"];
string TimeStamp = 2 [json_name = "timeStamp"];
string Package = 3 [json_name = "package"];
string SignType = 4 [json_name = "signType"];
string NonceStr = 5 [json_name = "nonceStr"];
string PaySign = 6 [json_name = "paySign"];
string PrepayId = 7 [json_name = "prepayId"];
string PartnerId = 8 [json_name = "partnerId"];
string msg = 9 [json_name="msg"];
}
message WechatJsApiQueryByOutTradeNoRequest {
string outTradeNo = 1 [json_name = "outTradeNo"];
}
message WechatJsApiQueryByOutTradeNoResponse {
string appID = 1 [json_name = "appID"];
string mchID = 2 [json_name = "mch_id"];
string outTradeNo = 3 [json_name = "out_trade_no"];
string transactionId = 4 [json_name = "transaction_id"];
string tradeType = 5 [json_name = "trade_type"];
string tradeState = 6 [json_name = "trade_state"];
string bankType = 7 [json_name = "bank_ype"];
string successTime = 8 [json_name = "success_time"];
string openID = 9 [json_name = "open_id"];
int32 total = 10 [json_name = "total"];
}
message WechatAppQueryByOutTradeNoRequest {
string outTradeNo = 1 [json_name = "outTradeNo"];
}
message WechatAppQueryByOutTradeNoResponse {
string appID = 1 [json_name = "appID"];// ID
string mchID = 2 [json_name = "mch_id"];// ID
// string subAppId = 3 [json_name = "sub_appid"]; // ID
// string subMchId = 4 [json_name = "sub_mchid"];// ID
string outTradeNo = 5 [json_name = "out_trade_no"];//
string transactionId = 6 [json_name = "transaction_id"];// ID
string tradeType = 7 [json_name = "trade_type"];//
string tradeState = 8 [json_name = "trade_state"];//
string tradeStateDesc = 9 [json_name = "trade_state_desc"]; //
string bankType = 10 [json_name = "bank_type"]; //
string attach = 11 [json_name = "attach"]; //
string successTime = 12 [json_name = "success_time"];//
message Payer {//
string openid = 1 [json_name = "openid"];
}
message Amount {//
int64 total = 1 [json_name = "total"];//
int64 payerTotal = 2 [json_name = "payer_total"];//
string currency = 3 [json_name = "currency"];//
string payerCurrency = 4 [json_name = "payer_currency"];//
}
message PromotionDetail {//
string couponId = 1 [json_name = "coupon_id"];// ID
string name = 2 [json_name = "name"];//
string scope = 3 [json_name = "scope"];//
string type = 4 [json_name = "type"];//
int64 amount = 5 [json_name = "amount"];//
string stockId = 6 [json_name = "stock_id"];// ID
int64 wechatpayContribute = 7 [json_name = "wechatpay_contribute"];//
int64 merchantContribute = 8 [json_name = "merchant_contribute"];//
int64 otherContribute = 9 [json_name = "other_contribute"];//
string currency = 10 [json_name = "currency"];//
}
//
repeated PromotionDetail promotionDetail = 13 [json_name = "promotion_detail"];
//
Payer payer = 14;
//
Amount amount = 15;
}
message GetPayByOutTradeNoRequest {
string OutTradeNo = 4 [json_name = "OutTradeNo"];
}
message GetPayByOutTradeNoResponse {
string outTradeNo = 1 ;
uint32 recordId = 2 ;
string cent = 3 ;
string platform = 4 ;
string domain = 5 ;
string scene = 6 ;
}
message WechatJsApiRefundsResponse {
string RefundId = 1 [json_name = "RefundId"];
string OutRefundNo = 2 [json_name = "OutRefundNo"];
string TransactionId = 3 [json_name = "TransactionId"];
string OutTradeNo = 4 [json_name = "OutTradeNo"];
string SuccessTime = 5 [json_name = "SuccessTime"];
string CreateTime = 6 [json_name = "CreateTime"];
string Status = 7 [json_name = "Status"];
string Amount = 8 [json_name = "Amount"];
}
message WechatNativePayRequest {
string description = 1 [json_name = "description"];
string outTradeNo = 2 [json_name = "outTradeNo"];
int32 cent = 3 [json_name = "cent"];
string notifyUrl = 5 [json_name = "notifyUrl"];
string appID = 6 [json_name = "appID"];
string clientIP = 7 [json_name = "ClientIP"];
uint32 recordId = 8 ;
string domain = 9 ;
string platform = 10 ;
string scene = 11 ;
int32 timeExpire = 12 [json_name = "time_expire"];
}
message WechatNativePayResponse {
string codeUrl = 1 [json_name = "code_url"];
}
message WechatNativeQueryByOutTradeNoRequest {
string outTradeNo = 1 [json_name = "outTradeNo"];
}
message WechatRefundQueryByOutRefundNoRequest {
string outRefundNo = 1 [json_name = "out_refund_no"];
}
message WechatRefundQueryByOutRefundNoResponse {
string refundId = 1 [json_name = "refund_id"];
string outRefundNo = 2 [json_name = "out_refund_no"];
string transactionId = 3 [json_name = "transaction_id"];
string outTradeNo = 4 [json_name = "out_trade_no"];
string channel = 5 [json_name = "channel"];
string userReceivedAccount = 6 [json_name = "user_received_account"];
string successTime = 7 [json_name = "success_time"];
string createTime = 8 [json_name = "create_time"];
string status = 9 [json_name = "status"];
int32 total = 10 [json_name = "total"];
}
message WechatNativeQueryByOutTradeNoResponse {
string appID = 1 [json_name = "appID"];
string mchID = 2 [json_name = "mch_id"];
string outTradeNo = 3 [json_name = "out_trade_no"];
string transactionId = 4 [json_name = "transaction_id"];
string tradeType = 5 [json_name = "trade_type"];
string tradeState = 6 [json_name = "trade_state"];
string bankType = 7 [json_name = "bank_ype"];
string successTime = 8 [json_name = "success_time"];
string openID = 9 [json_name = "open_id"];
int32 total = 10 [json_name = "total"];
}
message WechatAppPayRequest {
string Description = 1 [json_name = "description"];
string OutTradeNo = 2 [json_name = "outTradeNo"];
int64 Cent = 3 [json_name = "cent"];
string OpenID = 4 [json_name = "openID"];
string NotifyUrl = 5 [json_name = "notifyUrl"];
string AppID = 6 [json_name = "appID"];
string ClientIP = 7 [json_name = "ClientIP"];
uint32 recordId = 9 ;
string domain = 10 ;
string platform = 11 ;
string scene = 12 ;
int32 timeExpire = 13 [json_name = "time_expire"];
}
message WechatJsApiRefundsRequest {
string Reason = 1 [json_name = "Reason"];
string OutTradeNo = 2 [json_name = "OutTradeNo"];
string OutRefundNo = 3 [json_name = "OutRefundNo"];
string NotifyUrl = 4 [json_name = "NotifyUrl"];
int64 Cent = 5 [json_name = "Cent"];
string OpenID = 6 [json_name = "OpenID"];
int64 Total =7[json_name = "Total"];
}
message WechatH5PayRequest {
string Description = 1 [json_name = "description"];
string OutTradeNo = 2 [json_name = "outTradeNo"];
int64 Cent = 3 [json_name = "cent"];
string OpenID = 4 [json_name = "openID"];
string NotifyUrl = 5 [json_name = "notifyUrl"];
string AppID = 6 [json_name = "appID"];
string ClientIP = 7 [json_name = "ClientIP"];
uint32 recordId = 9 ;
string domain = 10 ;
string platform = 11 ;
string scene = 12 ;
int32 timeExpire = 13 [json_name = "time_expire"];
}
message WechatH5PayResponse {
string h5Url = 1 [json_name = "h5_url"];
}
message WechatH5QueryByOutTradeNoRequest {
string outTradeNo = 1 [json_name = "outTradeNo"];
}
message WechatH5QueryByOutTradeNoResponse {
string appID = 1 [json_name = "appID"];
string mchID = 2 [json_name = "mch_id"];
string outTradeNo = 3 [json_name = "out_trade_no"];
string transactionId = 4 [json_name = "transaction_id"];
string tradeType = 5 [json_name = "trade_type"];
string tradeState = 6 [json_name = "trade_state"];
string tradeStateDesc = 7 [json_name = "trade_state_desc"];
string bankType = 8 [json_name = "bank_ype"];
string successTime = 9 [json_name = "success_time"];
string openID = 10 [json_name = "open_id"];
int32 total = 11 [json_name = "total"];
}
message WechatPayOkRequest {
string outTradeNo = 1 ;
string body = 2 ;
}
message CommonResponse {
bool Success = 1 [json_name = "success"];
uint32 ID = 2 ;
}
message PayQueryRequest {
string payType = 1;
string outTradeNo = 2;
}
message PayQueryResponse {
repeated PaymentOrderInfo infos = 1;
}
message PaymentOrderInfo {
int64 id = 1;
string createdAt = 2;
string updatedAt = 3;
string outTradeNo = 4; //
string channelTradeNo = 5; //
int64 amount = 6; //
string currency = 7; //
string status = 8;
string payTime = 9;
string refundTime = 10;
string payee = 11;
string channelType = 12; // alipay- wxpay- stripe-Stripe支付
string platform = 13; // app还是h5还是jsapi还是wap
string domain = 14; // 使
string businessType = 15; // mq发送
int64 logId = 16;
string checkSessionId = 17;
string productUUID = 18;
string productName = 19;
string productImg = 20;
string productDescription = 21;
int64 fee = 22; //
int64 netIncome = 23; // 退
}
message ExportPayRequest {
string startTime = 1; //
string endTime = 2; //
string reportType = 3;
string reportRangeNum = 4; //
string channelType = 5; //
string currency = 6;
string sortBy = 7; // asc,desc
}
message ExportPayResponse {
string reportType = 1; //
int32 orderNum = 2; //
repeated Overview overview = 3; //
repeated ChannelIncome channelIncomes = 4; //
repeated BusinessInfo businessInfos = 5; //
repeated OrderDetail orderDetails = 6; // sheet2,
}
message OrderDetail {
int64 paymentOrderId = 1;
string createdAt = 2;
string updatedAt = 3;
string outTradeNo = 4; //
string channelTradeNo = 5; //
string currency = 6; //
int64 payAmount = 7; //
int64 fee = 8; //
int64 netIncome = 9; //
string status = 10;
string payTime = 11;
string channelType = 12; // alipay- wxpay- stripe-Stripe支付
string platform = 13; // app还是h5还是jsapi还是wap
string domain = 14; // 使
string businessType = 15; // mq发送
int64 logId = 16;
string checkSessionId = 17;
string productUUID = 18;
string productName = 19;
string productImg = 20;
string productDescription = 21;
}
message BusinessInfo {
string BusinessName = 1; //
string currency = 2; //
int32 orderNum = 3; //
int64 totalIncome = 4; //
int64 totalFee = 5; //
int64 totalRefundAmount = 6; // 退
int64 netIncome = 7; //
}
message Overview {
string currency = 1; //
int32 orderNum = 2; //
int64 totalIncome = 3; //
int64 totalFee = 4; //
int64 totalRefundAmount = 5; // 退
int64 netIncome = 6; //
}
message ChannelIncome {
string channelType = 1; //
string currency = 2; //
int32 orderNum = 3; //
int64 totalIncome = 4; //
int64 totalFee = 5; //
int64 totalRefundAmount = 6; // 退
int64 netIncome = 7; //
}

View File

@ -1,301 +0,0 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: pb/payment.proto
package payment
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *AntomPayQueryRequest) Validate() error {
return nil
}
func (this *AntomPayQueryResponse) Validate() error {
for _, item := range this.Infos {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Infos", err)
}
}
}
return nil
}
func (this *AntomNotifyPayRequest) Validate() error {
return nil
}
func (this *AntomNotifyPayResponse) Validate() error {
return nil
}
func (this *CreatePayRequest) Validate() error {
return nil
}
func (this *CreatePayResponse) Validate() error {
return nil
}
func (this *CreateRefundRequest) Validate() error {
return nil
}
func (this *CreateRefundResponse) Validate() error {
return nil
}
func (this *NotifyPayRequest) Validate() error {
if this.HttpRequest != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.HttpRequest); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("HttpRequest", err)
}
}
return nil
}
func (this *NotifyPayResponse) Validate() error {
return nil
}
func (this *HttpRequest) Validate() error {
// Validation of proto3 map<> fields is unsupported.
return nil
}
func (this *CommonMsg) Validate() error {
return nil
}
func (this *EmptyRequest) Validate() error {
return nil
}
func (this *CreateStripeCheckoutSessionRequest) Validate() error {
return nil
}
func (this *CreateStripeCheckoutSessionResponse) Validate() error {
return nil
}
func (this *GetCheckoutWebhookRequest) Validate() error {
return nil
}
func (this *GetCheckoutWebhookResponse) Validate() error {
return nil
}
func (this *GetStripePaymentIntentInfoRequest) Validate() error {
return nil
}
func (this *GetStripePaymentIntentInfoResponse) Validate() error {
return nil
}
func (this *GetRefundInfoRequest) Validate() error {
return nil
}
func (this *GetRefundInfoResponse) Validate() error {
return nil
}
func (this *AliWapPayRequest) Validate() error {
return nil
}
func (this *AliWapPayResponse) Validate() error {
return nil
}
func (this *AliAppPayRequest) Validate() error {
return nil
}
func (this *AliAppPayResponse) Validate() error {
return nil
}
func (this *AliNativePayRequest) Validate() error {
return nil
}
func (this *AliNativePayResponse) Validate() error {
return nil
}
func (this *AliPcWabPayRequest) Validate() error {
return nil
}
func (this *AliPcWabPayResponse) Validate() error {
return nil
}
func (this *AliReFundRequest) Validate() error {
return nil
}
func (this *AliReFundResponse) Validate() error {
return nil
}
func (this *AliNotifyRequest) Validate() error {
return nil
}
func (this *AliNotifyResponse) Validate() error {
return nil
}
func (this *AliQueryByOutTradeNoRequest) Validate() error {
return nil
}
func (this *AliQueryByOutTradeNoResponse) Validate() error {
return nil
}
func (this *AliRefundQueryByOutTradeNoRequest) Validate() error {
return nil
}
func (this *AliRefundQueryByOutTradeNoResponse) Validate() error {
return nil
}
func (this *WechatJsApiPayRequest) Validate() error {
return nil
}
func (this *WechatJsApiPayResponse) Validate() error {
return nil
}
func (this *WechatAppPayResponse) Validate() error {
return nil
}
func (this *WechatJsApiQueryByOutTradeNoRequest) Validate() error {
return nil
}
func (this *WechatJsApiQueryByOutTradeNoResponse) Validate() error {
return nil
}
func (this *WechatAppQueryByOutTradeNoRequest) Validate() error {
return nil
}
func (this *WechatAppQueryByOutTradeNoResponse) Validate() error {
for _, item := range this.PromotionDetail {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("PromotionDetail", err)
}
}
}
if this.Payer != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Payer); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Payer", err)
}
}
if this.Amount != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Amount); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Amount", err)
}
}
return nil
}
func (this *WechatAppQueryByOutTradeNoResponse_Payer) Validate() error {
return nil
}
func (this *WechatAppQueryByOutTradeNoResponse_Amount) Validate() error {
return nil
}
func (this *WechatAppQueryByOutTradeNoResponse_PromotionDetail) Validate() error {
return nil
}
func (this *GetPayByOutTradeNoRequest) Validate() error {
return nil
}
func (this *GetPayByOutTradeNoResponse) Validate() error {
return nil
}
func (this *WechatJsApiRefundsResponse) Validate() error {
return nil
}
func (this *WechatNativePayRequest) Validate() error {
return nil
}
func (this *WechatNativePayResponse) Validate() error {
return nil
}
func (this *WechatNativeQueryByOutTradeNoRequest) Validate() error {
return nil
}
func (this *WechatRefundQueryByOutRefundNoRequest) Validate() error {
return nil
}
func (this *WechatRefundQueryByOutRefundNoResponse) Validate() error {
return nil
}
func (this *WechatNativeQueryByOutTradeNoResponse) Validate() error {
return nil
}
func (this *WechatAppPayRequest) Validate() error {
return nil
}
func (this *WechatJsApiRefundsRequest) Validate() error {
return nil
}
func (this *WechatH5PayRequest) Validate() error {
return nil
}
func (this *WechatH5PayResponse) Validate() error {
return nil
}
func (this *WechatH5QueryByOutTradeNoRequest) Validate() error {
return nil
}
func (this *WechatH5QueryByOutTradeNoResponse) Validate() error {
return nil
}
func (this *WechatPayOkRequest) Validate() error {
return nil
}
func (this *CommonResponse) Validate() error {
return nil
}
func (this *PayQueryRequest) Validate() error {
return nil
}
func (this *PayQueryResponse) Validate() error {
for _, item := range this.Infos {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Infos", err)
}
}
}
return nil
}
func (this *PaymentOrderInfo) Validate() error {
return nil
}
func (this *ExportPayRequest) Validate() error {
return nil
}
func (this *ExportPayResponse) Validate() error {
for _, item := range this.Overview {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Overview", err)
}
}
}
for _, item := range this.ChannelIncomes {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ChannelIncomes", err)
}
}
}
for _, item := range this.BusinessInfos {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("BusinessInfos", err)
}
}
}
for _, item := range this.OrderDetails {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("OrderDetails", err)
}
}
}
return nil
}
func (this *OrderDetail) Validate() error {
return nil
}
func (this *BusinessInfo) Validate() error {
return nil
}
func (this *Overview) Validate() error {
return nil
}
func (this *ChannelIncome) Validate() error {
return nil
}

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,4 @@ RedisDBNAme = "1"
[ai]
Host = "https://erpapi.fontree.cn"
TelNum = "18021272627"
Password = "Gy.123456"
[service]
IsHTTPS = false
Password = "Gy.123456"

View File

@ -30,7 +30,4 @@ RedisDBNAme = "2"
[ai]
Host = "https://erpapi.fontree.cn"
TelNum = "18021272627"
Password = "Gy.123456"
[service]
IsHTTPS = false
Password = "Gy.123456"

View File

@ -33,4 +33,4 @@ TelNum = "18021272627"
Password = "Gy.123456"
[stripe]
Webhookkey = "whsec_uOQpG6IZTqtfLuePIDtfLCGJPqedSCCN"
Webhookkey = "whsec_5ru2Z9KsFixSvamAHgcvCBxufRTuHsyQ"

View File

@ -28,9 +28,3 @@ dubbo:
retries: 3
interface: com.fontree.microservices.common.micro.account
# filter: echo,metrics,token,accesslog,sign,tps,generic_service,execute,pshutdown,auth,fonValidateFilter
PaymentClientImpl:
interface: com.fontree.microservices.common.payment # must be compatible with grpc or dubbo-java
filter: cshutdown,sign,auth
params:
.accessKeyId: "Paymentksl"
.secretAccessKey: "BSDY-FDF1-Fontree_payment"

View File

@ -26,11 +26,3 @@ dubbo:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.micro.account
PaymentCentClientImpl:
protocol: tri
retries: 0
interface: com.fontree.microservices.common.payment.cent # must be compatible with grpc or dubbo-java
# filter: cshutdown,sign,auth
params:
.accessKeyId: "Paymentksl"
.secretAccessKey: "BSDY-FDF1-Fontree_payment"

5
go.mod
View File

@ -18,9 +18,8 @@ go 1.18
//github.com/fonchain_enterprise/utils/jwt => ../utils/jwt
//github.com/fonchain_enterprise/utils/logger => ../utils/logger
//replace github.com/fonchain_enterprise/utils/objstorage => ../../tyfon-/utils/objstorage
replace github.com/fonchain_enterprise/utils/objstorage => ../utils/objstorage
//
require (
dubbo.apache.org/dubbo-go/v3 v3.0.2
github.com/dubbogo/grpc-go v1.42.9
@ -124,7 +123,6 @@ require (
require (
cloud.google.com/go v0.65.0 // indirect
github.com/360EntSecGroup-Skylar/excelize v1.4.1 // indirect
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // indirect
github.com/alibaba/sentinel-golang v1.0.4 // indirect
github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect
@ -162,7 +160,6 @@ require (
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
github.com/nxadm/tail v1.4.11 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect

5
go.sum
View File

@ -37,8 +37,6 @@ contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZ
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
dubbo.apache.org/dubbo-go/v3 v3.0.2 h1:+WuMFN6RSjXHT41QS1Xi5tFfaPuczIVoeQuKq7pISYI=
dubbo.apache.org/dubbo-go/v3 v3.0.2/go.mod h1:bODgByAf72kzG/5YIfZIODXx81pY3gaAdIQ8B4mN/Yk=
github.com/360EntSecGroup-Skylar/excelize v1.4.1 h1:l55mJb6rkkaUzOpSsgEeKYtS6/0gHwBYyfo5Jcjv/Ks=
github.com/360EntSecGroup-Skylar/excelize v1.4.1/go.mod h1:vnax29X2usfl7HHkBrX5EvSCJcmH3dT9luvxzu8iGAE=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
@ -610,8 +608,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
@ -817,7 +813,6 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.3-0.20181224173747-660f15d67dbb/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=

View File

@ -9,205 +9,205 @@ const (
)
var EnMessages = map[string]string{
"获取套餐列表失败": "Failed to get bundle list",
"创建套餐信息失败": "Failed to create bundle information",
"创建套餐信息成功": "Successfully created bundle information",
"更新套餐信息失败": "Failed to update bundle information",
"更新套餐信息成功": "Successfully updated bundle information",
"删除套餐信息失败": "Failed to delete bundle information",
"删除套餐信息成功": "Successfully deleted bundle information",
"获取套餐信息失败": "Failed to get bundle information",
"创建订单信息失败": "Failed to create order information",
"创建订单信息成功": "Successfully created order information",
"更新订单信息失败": "Failed to update order information",
"更新订单信息成功": "Successfully updated order information",
"获取订单信息失败": "Failed to get order information",
"获取订单列表失败": "Failed to get order list",
"缺少套餐UUID": "Missing bundle UUID",
"缺少客户签名信息": "Missing customer signature",
"插入签名失败": "Failed to insert signature",
"缺少订单号": "Missing order number",
"缺少订单信息": "Missing order information",
"获取套餐列表失败": "Failed to get bundle list",
"创建套餐信息失败": "Failed to create bundle information",
"创建套餐信息成功": "Successfully created bundle information",
"更新套餐信息失败": "Failed to update bundle information",
"更新套餐信息成功": "Successfully updated bundle information",
"删除套餐信息失败": "Failed to delete bundle information",
"删除套餐信息成功": "Successfully deleted bundle information",
"获取套餐信息失败": "Failed to get bundle information",
"创建订单信息失败": "Failed to create order information",
"创建订单信息成功": "Successfully created order information",
"更新订单信息失败": "Failed to update order information",
"更新订单信息成功": "Successfully updated order information",
"获取订单信息失败": "Failed to get order information",
"获取订单列表失败": "Failed to get order list",
"缺少套餐UUID": "Missing bundle UUID",
"缺少客户签名信息": "Missing customer signature",
"插入签名失败": "Failed to insert signature",
"缺少订单号": "Missing order number",
"缺少订单信息": "Missing order information",
"非当前用户订单信息不可操作": "Cannot operate on order information of other users",
"订单已支付": "Order has been paid",
"订单已支付": "Order has been paid",
"您已购买过套餐,无法再次购买": "You have already purchased this bundle and cannot purchase again",
"查询支付信息失败": "Failed to query payment information",
"下载文件失败": "Failed to download file",
"上传文件失败": "Failed to upload file",
"时间格式错误": "Invalid time format",
"查询支付信息失败": "Failed to query payment information",
"下载文件失败": "Failed to download file",
"上传文件失败": "Failed to upload file",
"时间格式错误": "Invalid time format",
"账号或密码错误": "The account or password is incorrect",
"账号或验证码错误": "The account or verification code is incorrect",
"账号已存在": "Account already exists",
"没有找到数据": "No data found",
"已经发送过,验证码尚可用": "It was sent. The verification code is still working",
"系统提示:已经发送过,验证码尚可用": "System message: Already sent, verification code is still available",
"账号或密码错误": "The account or password is incorrect",
"账号或验证码错误": "The account or verification code is incorrect",
"账号已存在": "Account already exists",
"没有找到数据": "No data found",
"已经发送过,验证码尚可用": "It was sent. The verification code is still working",
"系统提示:已经发送过,验证码尚可用": "System message: Already sent, verification code is still available",
"您的手机号当天发送次数过多,请联系管理员通过密码登录": "Your mobile phone number is sent too many times that day, please contact the administrator to log in through the password",
"您的手机号验证码错误,请确认之后注册": "Your phone number verification code is incorrect, please confirm and register",
"手机号不合法": "The phone number is illegal",
"手机号未更改": "The phone number has not been changed",
"新手机号过期": "New phone number expired",
"验证码错误": "Verification code error",
"验证码未发送": "The verification code was not sent",
"账号不存在": "Account does not exist",
"已实名": "In real name",
"实名审核中,请勿重复提交": "During real-name audit, please do not submit repeatedly",
"用户状态异常,无法进行审核": "The user is abnormal and cannot be audited. Procedure",
"验证码已失效": "The verification code is invalid",
"服务器错误": "Server error",
"验证失败,请控制拼图对齐缺口": "Verification failed, please control puzzle alignment gap",
"滑块验证状态不存在,请退出重试": "The slider verification status does not exist. Please exit and try again",
"您的手机号验证码错误,请确认之后注册": "Your phone number verification code is incorrect, please confirm and register",
"手机号不合法": "The phone number is illegal",
"手机号未更改": "The phone number has not been changed",
"新手机号过期": "New phone number expired",
"验证码错误": "Verification code error",
"验证码未发送": "The verification code was not sent",
"账号不存在": "Account does not exist",
"已实名": "In real name",
"实名审核中,请勿重复提交": "During real-name audit, please do not submit repeatedly",
"用户状态异常,无法进行审核": "The user is abnormal and cannot be audited. Procedure",
"验证码已失效": "The verification code is invalid",
"服务器错误": "Server error",
"验证失败,请控制拼图对齐缺口": "Verification failed, please control puzzle alignment gap",
"滑块验证状态不存在,请退出重试": "The slider verification status does not exist. Please exit and try again",
}
var DeDEMessages = map[string]string{
"获取套餐列表失败": "Fehler beim Abrufen der Bundle-Liste",
"创建套餐信息失败": "Fehler beim Erstellen von Bundle-Informationen",
"创建套餐信息成功": "Bundle-Informationen erfolgreich erstellt",
"更新套餐信息失败": "Fehler beim Aktualisieren von Bundle-Informationen",
"更新套餐信息成功": "Bundle-Informationen erfolgreich aktualisiert",
"删除套餐信息失败": "Fehler beim Löschen von Bundle-Informationen",
"删除套餐信息成功": "Bundle-Informationen erfolgreich gelöscht",
"获取套餐信息失败": "Fehler beim Abrufen von Bundle-Informationen",
"创建订单信息失败": "Fehler beim Erstellen von Bestellinformationen",
"创建订单信息成功": "Bestellinformationen erfolgreich erstellt",
"更新订单信息失败": "Fehler beim Aktualisieren von Bestellinformationen",
"更新订单信息成功": "Bestellinformationen erfolgreich aktualisiert",
"获取订单信息失败": "Fehler beim Abrufen von Bestellinformationen",
"获取订单列表失败": "Fehler beim Abrufen der Bestellliste",
"缺少套餐UUID": "Fehlende Bundle-UUID",
"缺少客户签名信息": "Fehlende Kundenunterschrift",
"插入签名失败": "Fehler beim Einfügen der Signatur",
"缺少订单号": "Fehlende Bestellnummer",
"缺少订单信息": "Fehlende Bestellinformationen",
"获取套餐列表失败": "Fehler beim Abrufen der Bundle-Liste",
"创建套餐信息失败": "Fehler beim Erstellen von Bundle-Informationen",
"创建套餐信息成功": "Bundle-Informationen erfolgreich erstellt",
"更新套餐信息失败": "Fehler beim Aktualisieren von Bundle-Informationen",
"更新套餐信息成功": "Bundle-Informationen erfolgreich aktualisiert",
"删除套餐信息失败": "Fehler beim Löschen von Bundle-Informationen",
"删除套餐信息成功": "Bundle-Informationen erfolgreich gelöscht",
"获取套餐信息失败": "Fehler beim Abrufen von Bundle-Informationen",
"创建订单信息失败": "Fehler beim Erstellen von Bestellinformationen",
"创建订单信息成功": "Bestellinformationen erfolgreich erstellt",
"更新订单信息失败": "Fehler beim Aktualisieren von Bestellinformationen",
"更新订单信息成功": "Bestellinformationen erfolgreich aktualisiert",
"获取订单信息失败": "Fehler beim Abrufen von Bestellinformationen",
"获取订单列表失败": "Fehler beim Abrufen der Bestellliste",
"缺少套餐UUID": "Fehlende Bundle-UUID",
"缺少客户签名信息": "Fehlende Kundenunterschrift",
"插入签名失败": "Fehler beim Einfügen der Signatur",
"缺少订单号": "Fehlende Bestellnummer",
"缺少订单信息": "Fehlende Bestellinformationen",
"非当前用户订单信息不可操作": "Bestellinformationen anderer Benutzer können nicht bearbeitet werden",
"订单已支付": "Bestellung wurde bezahlt",
"订单已支付": "Bestellung wurde bezahlt",
"您已购买过套餐,无法再次购买": "Sie haben dieses Bundle bereits gekauft und können es nicht erneut kaufen",
"查询支付信息失败": "Fehler beim Abfragen von Zahlungsinformationen",
"下载文件失败": "Fehler beim Herunterladen der Datei",
"上传文件失败": "Fehler beim Hochladen der Datei",
"时间格式错误": "Ungültiges Zeitformat",
"查询支付信息失败": "Fehler beim Abfragen von Zahlungsinformationen",
"下载文件失败": "Fehler beim Herunterladen der Datei",
"上传文件失败": "Fehler beim Hochladen der Datei",
"时间格式错误": "Ungültiges Zeitformat",
"账号或密码错误": "Konto oder Passwort falsch",
"账号或验证码错误": "Konto oder Verifizierungscode falsch",
"账号已存在": "Konto existiert bereits",
"没有找到数据": "Keine Daten gefunden",
"已经发送过,验证码尚可用": "Es wurde gesendet. Der Verifizierungscode funktioniert noch",
"系统提示:已经发送过,验证码尚可用": "Systemnachricht: Bereits gesendet, Verifizierungscode ist noch verfügbar",
"账号或密码错误": "Konto oder Passwort falsch",
"账号或验证码错误": "Konto oder Verifizierungscode falsch",
"账号已存在": "Konto existiert bereits",
"没有找到数据": "Keine Daten gefunden",
"已经发送过,验证码尚可用": "Es wurde gesendet. Der Verifizierungscode funktioniert noch",
"系统提示:已经发送过,验证码尚可用": "Systemnachricht: Bereits gesendet, Verifizierungscode ist noch verfügbar",
"您的手机号当天发送次数过多,请联系管理员通过密码登录": "Ihre Telefonnummer wurde an diesem Tag zu oft gesendet. Bitte wenden Sie sich an den Administrator, um sich über das Passwort anzumelden",
"您的手机号验证码错误,请确认之后注册": "Ihre Telefonnummer Verifizierungscode ist falsch, bitte bestätigen und registrieren",
"手机号不合法": "Telefonnummer ungültig",
"手机号未更改": "Telefonnummer wurde nicht geändert",
"新手机号过期": "Neue Telefonnummer abgelaufen",
"验证码错误": "Verifizierungscode falsch",
"验证码未发送": "Der Verifizierungscode wurde nicht gesendet",
"账号不存在": "Konto existiert nicht",
"已实名": "In echt",
"实名审核中,请勿重复提交": "Während der Echtheitsprüfung bitte nicht wiederholen",
"用户状态异常,无法进行审核": "Der Benutzer ist abnorm und kann nicht geprüft werden. Verfahren",
"验证码已失效": "Der Verifizierungscode ist ungültig",
"服务器错误": "Serverfehler",
"验证失败,请控制拼图对齐缺口": "Überprüfung fehlgeschlagen, bitte Steuerung Puzzle-Ausrichtungslücke",
"滑块验证状态不存在,请退出重试": "Die krümmbestätigung existiert nicht. Bitte beenden sie den vorgang",
"您的手机号验证码错误,请确认之后注册": "Ihre Telefonnummer Verifizierungscode ist falsch, bitte bestätigen und registrieren",
"手机号不合法": "Telefonnummer ungültig",
"手机号未更改": "Telefonnummer wurde nicht geändert",
"新手机号过期": "Neue Telefonnummer abgelaufen",
"验证码错误": "Verifizierungscode falsch",
"验证码未发送": "Der Verifizierungscode wurde nicht gesendet",
"账号不存在": "Konto existiert nicht",
"已实名": "In echt",
"实名审核中,请勿重复提交": "Während der Echtheitsprüfung bitte nicht wiederholen",
"用户状态异常,无法进行审核": "Der Benutzer ist abnorm und kann nicht geprüft werden. Verfahren",
"验证码已失效": "Der Verifizierungscode ist ungültig",
"服务器错误": "Serverfehler",
"验证失败,请控制拼图对齐缺口": "Überprüfung fehlgeschlagen, bitte Steuerung Puzzle-Ausrichtungslücke",
"滑块验证状态不存在,请退出重试": "Die krümmbestätigung existiert nicht. Bitte beenden sie den vorgang",
}
var JaJPMessages = map[string]string{
"获取套餐列表失败": "バンドルリストの取得に失敗しました",
"创建套餐信息失败": "バンドル情報の作成に失敗しました",
"创建套餐信息成功": "バンドル情報の作成に成功しました",
"更新套餐信息失败": "バンドル情報の更新に失敗しました",
"更新套餐信息成功": "バンドル情報の更新に成功しました",
"删除套餐信息失败": "バンドル情報の削除に失敗しました",
"删除套餐信息成功": "バンドル情報の削除に成功しました",
"获取套餐信息失败": "バンドル情報の取得に失敗しました",
"创建订单信息失败": "注文情報の作成に失敗しました",
"创建订单信息成功": "注文情報の作成に成功しました",
"更新订单信息失败": "注文情報の更新に失敗しました",
"更新订单信息成功": "注文情報の更新に成功しました",
"获取订单信息失败": "注文情報の取得に失敗しました",
"获取订单列表失败": "注文リストの取得に失敗しました",
"缺少套餐UUID": "バンドルUUIDがありません",
"缺少客户签名信息": "顧客署名情報がありません",
"插入签名失败": "署名の挿入に失敗しました",
"缺少订单号": "注文番号がありません",
"缺少订单信息": "注文情報がありません",
"获取套餐列表失败": "バンドルリストの取得に失敗しました",
"创建套餐信息失败": "バンドル情報の作成に失敗しました",
"创建套餐信息成功": "バンドル情報の作成に成功しました",
"更新套餐信息失败": "バンドル情報の更新に失敗しました",
"更新套餐信息成功": "バンドル情報の更新に成功しました",
"删除套餐信息失败": "バンドル情報の削除に失敗しました",
"删除套餐信息成功": "バンドル情報の削除に成功しました",
"获取套餐信息失败": "バンドル情報の取得に失敗しました",
"创建订单信息失败": "注文情報の作成に失敗しました",
"创建订单信息成功": "注文情報の作成に成功しました",
"更新订单信息失败": "注文情報の更新に失敗しました",
"更新订单信息成功": "注文情報の更新に成功しました",
"获取订单信息失败": "注文情報の取得に失敗しました",
"获取订单列表失败": "注文リストの取得に失敗しました",
"缺少套餐UUID": "バンドルUUIDがありません",
"缺少客户签名信息": "顧客署名情報がありません",
"插入签名失败": "署名の挿入に失敗しました",
"缺少订单号": "注文番号がありません",
"缺少订单信息": "注文情報がありません",
"非当前用户订单信息不可操作": "他のユーザーの注文情報を操作できません",
"订单已支付": "注文は支払われました",
"订单已支付": "注文は支払われました",
"您已购买过套餐,无法再次购买": "このバンドルはすでに購入済みであり、再度購入することはできません",
"查询支付信息失败": "支払い情報のクエリに失敗しました",
"下载文件失败": "ファイルのダウンロードに失敗しました",
"上传文件失败": "ファイルのアップロードに失敗しました",
"时间格式错误": "無効な時間形式",
"查询支付信息失败": "支払い情報のクエリに失敗しました",
"下载文件失败": "ファイルのダウンロードに失敗しました",
"上传文件失败": "ファイルのアップロードに失敗しました",
"时间格式错误": "無効な時間形式",
"账号或密码错误": "アカウントまたはパスワードが間違っています",
"账号或验证码错误": "アカウントまたは検証コードが間違っています",
"账号已存在": "アカウントはすでに存在します",
"没有找到数据": "データが見つかりません",
"已经发送过,验证码尚可用": "送信されました。検証コードは引き続き有効です",
"系统提示:已经发送过,验证码尚可用": "システムメッセージ:すでに送信され、検証コードは引き続き有効です",
"账号或密码错误": "アカウントまたはパスワードが間違っています",
"账号或验证码错误": "アカウントまたは検証コードが間違っています",
"账号已存在": "アカウントはすでに存在します",
"没有找到数据": "データが見つかりません",
"已经发送过,验证码尚可用": "送信されました。検証コードは引き続き有効です",
"系统提示:已经发送过,验证码尚可用": "システムメッセージ:すでに送信され、検証コードは引き続き有効です",
"您的手机号当天发送次数过多,请联系管理员通过密码登录": "その日の電話番号が送信されすぎています。管理者に連絡してパスワードでログインしてください",
"您的手机号验证码错误,请确认之后注册": "電話番号の検証コードが間違っています。確認して登録してください",
"手机号不合法": "電話番号が無効です",
"手机号未更改": "電話番号が変更されていません",
"新手机号过期": "新しい電話番号の有効期限が切れました",
"验证码错误": "検証コードが間違っています",
"验证码未发送": "検証コードが送信されていません",
"账号不存在": "アカウントが存在しません",
"已实名": "実名",
"实名审核中,请勿重复提交": "実名審査中、繰り返し提出しないでください",
"用户状态异常,无法进行审核": "ユーザーが異常であり、審査できません。手続き",
"验证码已失效": "検証コードが無効です",
"服务器错误": "サーバーエラー",
"验证失败,请控制拼图对齐缺口": "検証に失敗しました。パズルの整列ギャップを制御してください",
"滑块验证状态不存在,请退出重试": "スライダー検証状態が存在しません,リトライをログアウトしてください",
"您的手机号验证码错误,请确认之后注册": "電話番号の検証コードが間違っています。確認して登録してください",
"手机号不合法": "電話番号が無効です",
"手机号未更改": "電話番号が変更されていません",
"新手机号过期": "新しい電話番号の有効期限が切れました",
"验证码错误": "検証コードが間違っています",
"验证码未发送": "検証コードが送信されていません",
"账号不存在": "アカウントが存在しません",
"已实名": "実名",
"实名审核中,请勿重复提交": "実名審査中、繰り返し提出しないでください",
"用户状态异常,无法进行审核": "ユーザーが異常であり、審査できません。手続き",
"验证码已失效": "検証コードが無効です",
"服务器错误": "サーバーエラー",
"验证失败,请控制拼图对齐缺口": "検証に失敗しました。パズルの整列ギャップを制御してください",
"滑块验证状态不存在,请退出重试": "スライダー検証状態が存在しません,リトライをログアウトしてください",
}
var ZhTWMessages = map[string]string{
"获取套餐列表失败": "獲取套餐列表失敗",
"创建套餐信息失败": "創建套餐信息失敗",
"创建套餐信息成功": "創建套餐信息成功",
"更新套餐信息失败": "更新套餐信息失敗",
"更新套餐信息成功": "更新套餐信息成功",
"删除套餐信息失败": "刪除套餐信息失敗",
"删除套餐信息成功": "刪除套餐信息成功",
"获取套餐信息失败": "獲取套餐信息失敗",
"创建订单信息失败": "創建訂單信息失敗",
"创建订单信息成功": "創建訂單信息成功",
"更新订单信息失败": "更新訂單信息失敗",
"更新订单信息成功": "更新訂單信息成功",
"获取订单信息失败": "獲取訂單信息失敗",
"获取订单列表失败": "獲取訂單列表失敗",
"缺少套餐UUID": "缺少套餐UUID",
"缺少客户签名信息": "缺少客戶簽名信息",
"插入签名失败": "插入簽名失敗",
"缺少订单号": "缺少訂單號",
"缺少订单信息": "缺少訂單信息",
"获取套餐列表失败": "獲取套餐列表失敗",
"创建套餐信息失败": "創建套餐信息失敗",
"创建套餐信息成功": "創建套餐信息成功",
"更新套餐信息失败": "更新套餐信息失敗",
"更新套餐信息成功": "更新套餐信息成功",
"删除套餐信息失败": "刪除套餐信息失敗",
"删除套餐信息成功": "刪除套餐信息成功",
"获取套餐信息失败": "獲取套餐信息失敗",
"创建订单信息失败": "創建訂單信息失敗",
"创建订单信息成功": "創建訂單信息成功",
"更新订单信息失败": "更新訂單信息失敗",
"更新订单信息成功": "更新訂單信息成功",
"获取订单信息失败": "獲取訂單信息失敗",
"获取订单列表失败": "獲取訂單列表失敗",
"缺少套餐UUID": "缺少套餐UUID",
"缺少客户签名信息": "缺少客戶簽名信息",
"插入签名失败": "插入簽名失敗",
"缺少订单号": "缺少訂單號",
"缺少订单信息": "缺少訂單信息",
"非当前用户订单信息不可操作": "非當前用戶訂單信息不可操作",
"订单已支付": "訂單已支付",
"订单已支付": "訂單已支付",
"您已购买过套餐,无法再次购买": "您已購買過套餐,無法再次購買",
"查询支付信息失败": "查詢支付信息失敗",
"下载文件失败": "下載文件失敗",
"上传文件失败": "上傳文件失敗",
"时间格式错误": "時間格式錯誤",
"查询支付信息失败": "查詢支付信息失敗",
"下载文件失败": "下載文件失敗",
"上传文件失败": "上傳文件失敗",
"时间格式错误": "時間格式錯誤",
"账号或密码错误": "帳號或密碼錯誤",
"账号或验证码错误": "帳號或驗證碼錯誤",
"账号已存在": "帳號已存在",
"没有找到数据": "沒有找到數據",
"已经发送过,验证码尚可用": "已經發送過,驗證碼尚可用",
"系统提示:已经发送过,验证码尚可用": "系統提示:已經發送過,驗證碼尚可用",
"账号或密码错误": "帳號或密碼錯誤",
"账号或验证码错误": "帳號或驗證碼錯誤",
"账号已存在": "帳號已存在",
"没有找到数据": "沒有找到數據",
"已经发送过,验证码尚可用": "已經發送過,驗證碼尚可用",
"系统提示:已经发送过,验证码尚可用": "系統提示:已經發送過,驗證碼尚可用",
"您的手机号当天发送次数过多,请联系管理员通过密码登录": "您的手機號當天發送次數過多,請聯繫管理員通過密碼登錄",
"您的手机号验证码错误,请确认之后注册": "您的手機號驗證碼錯誤,請確認之後註冊",
"手机号不合法": "手機號不合法",
"手机号未更改": "手機號未更改",
"新手机号过期": "新手機號過期",
"验证码错误": "驗證碼錯誤",
"验证码未发送": "驗證碼未發送",
"账号不存在": "帳號不存在",
"已实名": "已實名",
"实名审核中,请勿重复提交": "實名審核中,請勿重複提交",
"用户状态异常,无法进行审核": "用戶狀態異常,無法進行審核",
"验证码已失效": "驗證碼已失效",
"服务器错误": "服務器錯誤",
"验证失败,请控制拼图对齐缺口": "驗證失敗,請控制拼圖對齊缺口",
"滑块验证状态不存在,请退出重试": "滑塊驗證狀態不存在,請退出重試",
"您的手机号验证码错误,请确认之后注册": "您的手機號驗證碼錯誤,請確認之後註冊",
"手机号不合法": "手機號不合法",
"手机号未更改": "手機號未更改",
"新手机号过期": "新手機號過期",
"验证码错误": "驗證碼錯誤",
"验证码未发送": "驗證碼未發送",
"账号不存在": "帳號不存在",
"已实名": "已實名",
"实名审核中,请勿重复提交": "實名審核中,請勿重複提交",
"用户状态异常,无法进行审核": "用戶狀態異常,無法進行審核",
"验证码已失效": "驗證碼已失效",
"服务器错误": "服務器錯誤",
"验证失败,请控制拼图对齐缺口": "驗證失敗,請控制拼圖對齊缺口",
"滑块验证状态不存在,请退出重试": "滑塊驗證狀態不存在,請退出重試",
}

View File

@ -4,14 +4,12 @@ import (
"fonchain-fiee/pkg/middleware"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/service/bundle"
"github.com/gin-gonic/gin"
)
func BundleOrderRouter(r *gin.RouterGroup) {
r.POST("/stripe-pay/callback", bundle.StripeCheckoutSessionWebhook)
r.POST("/antom/callback", bundle.AntomWebhook) // Antom回调
bundleOrderRoute := r.Group("bundle-order")
bundleOrderRoute.Use(middleware.CheckLogin(service.AccountProvider))
@ -23,12 +21,6 @@ func BundleOrderRouter(r *gin.RouterGroup) {
bundleOrderClientRoute.POST("bundle-order-list", bundle.OrderRecordsList)
}
bundleOrderWebRoute := bundleOrderRoute.Group("web")
{
bundleOrderWebRoute.POST("financial-confirm", bundle.UpdateFinancialConfirmationStatus)
bundleOrderWebRoute.POST("order-export", bundle.ExportOrderInfo)
}
bundleOrderAppRoute := bundleOrderRoute.Group("app")
{
bundleOrderAppRoute.POST("order-signature", bundle.CreateBundleOrderSignature)
@ -36,8 +28,7 @@ func BundleOrderRouter(r *gin.RouterGroup) {
bundleOrderAppRoute.POST("order-detail", bundle.OrderRecordsDetail)
// stripe
//bundleOrderAppRoute.POST("create-stripe-pay", bundle.CreateStripeCheckoutSession) // stripe支付
bundleOrderAppRoute.POST("create-stripe-pay", bundle.CreateAntomPay) // Antom国际支付
bundleOrderAppRoute.POST("create-stripe-pay", bundle.CreateStripeCheckoutSession)
}
}

View File

@ -10,9 +10,8 @@ import (
"fonchain-fiee/pkg/service/redirect"
"fonchain-fiee/pkg/service/upload"
"fonchain-fiee/pkg/service/version"
"net/http"
"github.com/gin-contrib/gzip"
"net/http"
"github.com/gin-contrib/pprof"
"github.com/gin-gonic/gin"
@ -40,7 +39,6 @@ func NewRouter() *gin.Engine {
BundleRouter(privateGroup)
BundleOrderRouter(privateGroup)
ValueAddBundleRouter(privateGroup)
{
v1.POST("version", version.Version) //版本号公共
@ -103,7 +101,7 @@ func NewRouter() *gin.Engine {
}
//静态文件
r.StaticFS("/api/static", http.Dir("./runtime"))
r.StaticFS("/static", http.Dir("./runtime"))
r.NoRoute(func(c *gin.Context) {
c.JSON(http.StatusNotFound, gin.H{
"status": 1,

View File

@ -1,26 +0,0 @@
package router
import (
"fonchain-fiee/pkg/middleware"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/service/bundle"
"github.com/gin-gonic/gin"
)
func ValueAddBundleRouter(r *gin.RouterGroup) {
valueAddBundleRoute := r.Group("valueAdd-bundle")
valueAddBundleRoute.Use(middleware.CheckLogin(service.AccountProvider))
// 增值套餐
{
bundleClientRoute := valueAddBundleRoute.Group("system")
{
bundleClientRoute.POST("create", bundle.CreateValueAddBundle)
bundleClientRoute.POST("list", bundle.ValueAddBundleList)
bundleClientRoute.POST("detail", bundle.ValueAddBundleDetail)
}
}
}

View File

@ -39,23 +39,6 @@ func Success(c *gin.Context, datas ...interface{}) {
c.Abort()
}
func Success1(c *gin.Context, msg string, datas ...interface{}) {
var data interface{}
if datas != nil {
data = datas[0]
} else {
data = struct{}{}
}
c.JSON(http.StatusOK, Response{
Status: Ok,
Code: Ok,
Data: data,
Msg: msg,
})
c.Abort()
}
// Error 统一错误返回
func Error(c *gin.Context, err error) {
@ -74,20 +57,7 @@ func Error(c *gin.Context, err error) {
c.Abort()
}
// Error 统一错误返回
func Error1(c *gin.Context, err error) {
c.JSON(http.StatusOK, Response{
Code: Failed,
Status: Failed,
Msg: err.Error(),
Data: struct{}{},
})
c.Abort()
}
// 重试
// 重试
func Retry(c *gin.Context, err error) {
errMsg := ""
if err != nil {

View File

@ -3,8 +3,6 @@ package bundle
import (
"context"
"errors"
"fmt"
"fonchain-fiee/api/account"
"fonchain-fiee/api/bundle"
"fonchain-fiee/api/order"
"fonchain-fiee/pkg/model/login"
@ -12,12 +10,9 @@ import (
"fonchain-fiee/pkg/service/bundle/common"
"fonchain-fiee/pkg/service/bundle/logic"
bundleModel "fonchain-fiee/pkg/service/bundle/model"
"math/big"
"strconv"
"strings"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"strconv"
)
func CreateBundleOrderSignature(c *gin.Context) {
@ -33,11 +28,10 @@ func CreateBundleOrderSignature(c *gin.Context) {
return
}
// 不去校验 签名
/*if req.Signature == "" {
if req.Signature == "" {
service.Error(c, errors.New(common.MissOrderSignature))
return
}*/
}
// 获取 用户信息
userInfo := login.GetUserInfoFromC(c)
@ -94,44 +88,16 @@ func CreateBundleOrderSignature(c *gin.Context) {
return
}
//获取增值套餐信息
if req.ValueAddBundleUuid != "" {
valueAddBundleDetail, err := service.BundleProvider.ValueAddBundleDetail(context.Background(), &bundle.ValueAddBundleDetailRequest{
Uuid: req.ValueAddBundleUuid,
})
if err != nil {
service.Error(c, err)
return
}
req.ValueAddBundleUuid = valueAddBundleDetail.Data.Uuid
req.ValueAddOriginalPrice = valueAddBundleDetail.Data.OriginalPrice
req.ValueAddDiscountPrice = valueAddBundleDetail.Data.DiscountPrice
req.AddBundleCommonUid = valueAddBundleDetail.Data.AddBundleCommonUid
if valueAddBundleDetail.Data.Choose { // 可选条数
req.ValueAddBundleAmount = valueAddBundleDetail.Data.DiscountPrice * float32(req.Num)
discount, _ := new(big.Float).Sub(big.NewFloat(float64(valueAddBundleDetail.Data.OriginalPrice)), big.NewFloat(float64(valueAddBundleDetail.Data.DiscountPrice))).Float32()
req.ValueAddSavedAmount = discount * float32(req.Num)
} else { // 固定条数
req.ValueAddBundleAmount = valueAddBundleDetail.Data.TotalPrice
req.ValueAddSavedAmount = valueAddBundleDetail.Data.SavedAmount
}
req.TotalAmount, _ = new(big.Float).Add(big.NewFloat(float64(req.ValueAddBundleAmount)), big.NewFloat(float64(bundleDetail.Bundle.Price))).Float32()
}
req.BundleName = bundleDetail.Bundle.Name
req.Amount = bundleDetail.Bundle.Price
req.AmountType = bundleDetail.Bundle.PriceType
req.BundleCommonUid = bundleDetail.Bundle.BundleCommonUid
req.TotalAmount = req.Amount + req.ValueAddBundleAmount
req.PayType = 1 // 默认 人民币
req.ContractNo = common.GenerateContractNo(lastContractNo)
// 当前 未将 签名 写入合同中
signContract, signContractErr := logic.SignContractV2(req.CustomerNum, bundleDetail.Bundle.Contract, req.TotalAmount, bundleDetail.Bundle.ContractDuration)
signContract, signContractErr := logic.SignContract(req.CustomerNum, bundleDetail.Bundle.Contract, req.Signature, bundleDetail.Bundle.CompanySign, req.ContractNo, userInfo.Name, userInfo.SubscriberNumber, userInfo.TelNum, userInfo.PlaceOfResidence, bundleDetail.Bundle.Price, bundleDetail.Bundle.ContractDuration)
if signContractErr != nil {
service.Error(c, signContractErr)
return
@ -250,31 +216,6 @@ func OrderRecordsList(c *gin.Context) {
return
}
for _, orderRecord := range res.OrderRecords {
if orderRecord.CustomerID != "" {
var userID uint64
userID, err = strconv.ParseUint(orderRecord.CustomerID, 10, 64)
if err != nil {
err = nil
continue
}
userInfo, _ := service.AccountProvider.Info(context.Background(), &account.InfoRequest{
Domain: "app",
ID: userID,
})
if userInfo != nil {
orderRecord.Sex = userInfo.Sex
orderRecord.Nationality = userInfo.Nationality
orderRecord.CertificatePicture = userInfo.CertificatePicture
orderRecord.PlaceOfResidence = userInfo.PlaceOfResidence
orderRecord.GroupPhoto = userInfo.GroupPhoto
orderRecord.TelNum = userInfo.TelNum
}
}
}
service.Success(c, res)
}
@ -286,10 +227,10 @@ func OrderRecordsDetail(c *gin.Context) {
return
}
/*// 获取 用户信息
// 获取 用户信息
userInfo := login.GetUserInfoFromC(c)
req.CustomerID = strconv.FormatUint(userInfo.ID, 10)*/
req.CustomerID = strconv.FormatUint(userInfo.ID, 10)
res, err := service.BundleProvider.OrderRecordsDetail(context.Background(), &req)
if err != nil {
@ -299,135 +240,3 @@ func OrderRecordsDetail(c *gin.Context) {
service.Success(c, res)
}
// web
func UpdateFinancialConfirmationStatus(c *gin.Context) {
var req bundle.FinancialConfirmationRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
// 不限制 支付状态 未支付 也可确认
//detail, err := service.BundleProvider.OrderRecordsDetail(context.Background(), &bundle.OrderRecordsDetailRequest{
// OrderNo: req.OrderNo,
//})
//if err != nil {
// service.Error(c, err)
// return
//}
//if detail.OrderRecord.Status != bundleModel.OrderPaid {
// service.Error(c, errors.New("订单未支付,不可确认"))
// return
//}
res, err := service.BundleProvider.UpdateFinancialConfirmationStatus(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func ExportOrderInfo(c *gin.Context) {
var req bundle.OrderRecordsRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.OrderRecordsList(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
rows := make([][]interface{}, 0)
for _, orderRecord := range res.OrderRecords {
if orderRecord.CustomerID != "" {
var userID uint64
userID, err = strconv.ParseUint(orderRecord.CustomerID, 10, 64)
if err != nil {
err = nil
continue
}
userInfo, _ := service.AccountProvider.Info(context.Background(), &account.InfoRequest{
Domain: "app",
ID: userID,
})
if userInfo != nil {
orderRecord.Sex = userInfo.Sex
orderRecord.Nationality = userInfo.Nationality
orderRecord.TelNum = userInfo.TelNum
}
}
status := ""
if orderRecord.Status == bundleModel.OrderSigned {
status = "未支付"
} else if orderRecord.Status == bundleModel.OrderPaid {
status = "已支付"
}
financialConfirmation := ""
if orderRecord.FinancialConfirmation == bundleModel.UnConfirm {
financialConfirmation = "未确认"
} else if orderRecord.FinancialConfirmation == bundleModel.Confirmed {
financialConfirmation = "已确认"
}
rows = append(rows, []interface{}{
orderRecord.OrderNo,
orderRecord.CustomerNum,
orderRecord.CustomerName,
orderRecord.Sex,
orderRecord.TelNum,
orderRecord.Nationality,
orderRecord.BundleName,
orderRecord.SignedTime,
orderRecord.Amount,
orderRecord.Num,
orderRecord.ValueAddBundleAmount,
orderRecord.TotalAmount,
status,
orderRecord.PayTime,
financialConfirmation,
})
}
dirPath := "./runtime"
filePath, err := logic.WriteToExcel(dirPath, rows)
if err != nil {
service.Error(c, err)
return
}
var httpType string = "http" // Default to http
// Safely check if Origin exists in c.Keys
if origin, exists := c.Keys["Origin"]; exists && origin != nil {
originStr, ok := origin.(string)
if ok && originStr != "" {
fmt.Printf("c.Request.Origin %+v\n", originStr)
parts := strings.Split(originStr, ":")
if len(parts) > 0 {
httpType = parts[0]
}
}
} else {
// Fallback: Check if the request was made over TLS
if c.Request.TLS != nil || c.Request.Header.Get("X-Forwarded-Proto") == "https" {
httpType = "https"
}
}
var exportUrl = strings.Replace(strings.Replace(filePath, ".", fmt.Sprintf("%s://%s", httpType, c.Request.Host), 1), "runtime", "api/static", 1)
//var exportUrl = fmt.Sprintf("%s%s/%s", httpType, c.Request.Host, dirPath + path)
fmt.Println("exportUrl : ", exportUrl)
service.Success(c, &bundleModel.ExportResponse{ExportUrl: exportUrl})
}

View File

@ -12,17 +12,11 @@ const (
MissOrderNo = "缺少订单号"
MissOrderUUID = "缺少订单信息"
NotMatchOrderInfo = "非当前用户订单信息不可操作"
InvalidOrderAmount = "订单金额错误"
NotMatchOrderInfo = "非当前用户订单信息不可操作"
HadPay = "订单已支付"
HadOrder = "您已购买过套餐,无法再次购买"
InvalidValueAddBundleNum = "套餐数量无效"
)
const (
ErrorExportOrderInfo = "导出订单信息失败"
HadOrder = "您已购买过套餐,无法再次购买"
)
// stripe

View File

@ -1,42 +0,0 @@
package logic
import (
"errors"
"fmt"
"fonchain-fiee/pkg/service/bundle/common"
"time"
"github.com/360EntSecGroup-Skylar/excelize"
)
func WriteToExcel(dirPath string, orderInfos [][]interface{}) (string, error) {
headRow := []interface{}{"订单编号", "用户编号", "姓名", "性别", "手机号", "国籍", "套餐名称", "签署时间", "套餐费用", "增值服务视频条数", "增值金额", "总额", "支付状态", "支付时间", "财务确认状态"}
xlsx := excelize.NewFile()
index := "Sheet1"
style, _ := xlsx.NewStyle(`{"alignment":{
"horizontal":"center"
}}`)
xlsx.SetCellStyle(index, "A1", "A1", style)
xlsx.SetSheetRow(index, "A1", &headRow)
rowIndex := 2
for i := 0; i < len(orderInfos); i++ {
xlsx.SetCellStyle(index, fmt.Sprintf("A%v", rowIndex), fmt.Sprintf("O%v", rowIndex), style)
xlsx.SetSheetRow(index, fmt.Sprintf("A%v", rowIndex), &orderInfos[i])
rowIndex++
}
//path := dirPath + "/" + artShowInfo.ArtistName + "-" + artShowInfo.ShowSeq + "-price" + ".xlsx"
path := dirPath + "/orderInfo_" + time.Now().Format("20060102150405") + ".xlsx"
err := xlsx.SaveAs(path)
if err != nil {
fmt.Println("save rows err :", err)
return "", errors.New(common.ErrorExportOrderInfo)
}
return path, nil
}

View File

@ -1,117 +0,0 @@
package logic
import (
"errors"
"fmt"
"fonchain-fiee/pkg/model"
"fonchain-fiee/pkg/service/bundle/common"
"fonchain-fiee/pkg/service/upload"
"github.com/signintech/gopdf"
"go.uber.org/zap"
"log"
"os"
"strconv"
"time"
)
func SignContractV2(customerNum, contract string, price float32, contractDuration int64) (outputUrl string, err error) {
filePath := model.MediaPath + customerNum + time.Now().Format("20060102150405") + ".pdf"
downloadFileErr := DownloadFile(filePath, contract)
if downloadFileErr != nil {
zap.L().Error("download file error: ", zap.Error(downloadFileErr))
//service.Error(c, errors.New(common.ErrorDownloadFile))
return outputUrl, errors.New(common.ErrorDownloadFile)
}
signFile := model.MediaPath + customerNum + "signed" + time.Now().Format("20060102150405") + ".pdf"
/*signErr := InsertSignature(filePath, signFile, signImgPath, contractNo, idNo, telNum, address, price)
if signErr != nil {
zap.L().Error("insert signature error: ", zap.Error(signErr))
return outputUrl, errors.New(common.ErrorInsertSignature)
}*/
signErr := InsertSignatureV2(filePath, signFile, price, contractDuration)
if signErr != nil {
zap.L().Error("insert signature error: ", zap.Error(signErr))
return outputUrl, errors.New(common.ErrorInsertSignature)
}
os.Remove(filePath)
outputUrl, ossErr := upload.PutBos(signFile, upload.PdfType, true)
if ossErr != nil {
return "", errors.New(common.ErrorUploadFile)
}
return outputUrl, nil
}
func InsertSignatureV2(templatePath, outputPath string, price float32, contractDuration int64) error {
pdf := gopdf.GoPdf{}
pdf.Start(gopdf.Config{PageSize: *gopdf.PageSizeA4})
// 导入模板文件中的页面
err := pdf.ImportPagesFromSource(templatePath, "/MediaBox")
if err != nil {
log.Fatalf("无法导入页面: %v", err)
}
// 获取模板文件的总页数
totalPages := pdf.GetNumberOfPages()
fmt.Printf("模板文件的总页数: %d\n", totalPages)
pricePage := 3
limitTimePage := 4
tffErr := pdf.AddTTFFont("simfang", "./data/simfang.ttf")
if tffErr != nil {
fmt.Printf("加载中文字体失败: %v\n", tffErr)
log.Fatalf("加载中文字体失败: %v", tffErr)
}
// 设置字体和字号
err = pdf.SetFont("simfang", "", 14)
if err != nil {
fmt.Printf("设置字体失败: %v\n", err)
log.Fatalf("设置字体失败: %v", err)
}
// 填 金额
pdf.SetPage(pricePage)
pdf.SetX(383)
pdf.SetY(351)
pdf.Cell(nil, strconv.FormatFloat(float64(price), 'f', 2, 64))
pdf.SetX(345)
pdf.SetY(383)
pdf.Cell(nil, strconv.FormatFloat(float64(price), 'f', 2, 64))
// 写 有效期
pdf.SetPage(limitTimePage)
// 英文格式的时间
t := time.Now().AddDate(int(contractDuration), 0, 0)
pdf.SetX(160)
pdf.SetY(387)
pdf.Cell(nil, t.Format("2006-01-02"))
pdf.SetX(330)
pdf.SetY(403)
pdf.Cell(nil, t.Format("2006"))
pdf.SetX(396)
pdf.SetY(403)
pdf.Cell(nil, t.Format("01"))
pdf.SetX(443)
pdf.SetY(403)
pdf.Cell(nil, t.Format("02"))
// 生成新的 PDF
if err = pdf.WritePdf(outputPath); err != nil {
//zap.L().Error("WritePdf err", zap.Error(err))
return errors.New("error writing final PDF")
}
return nil
}

View File

@ -4,12 +4,3 @@ const (
OrderSigned = 1
OrderPaid = 2
)
const (
UnConfirm = 1
Confirmed = 2
)
type ExportResponse struct {
ExportUrl string `json:"exportUrl"`
}

View File

@ -2,24 +2,20 @@ package bundle
import (
"context"
"encoding/json"
"errors"
"fmt"
"fonchain-fiee/api/bundle"
"fonchain-fiee/api/order"
"fonchain-fiee/api/payment"
"fonchain-fiee/pkg/config"
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/service/bundle/common"
bundleModel "fonchain-fiee/pkg/service/bundle/model"
"io"
"math"
"net/http"
"strconv"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"io"
"net/http"
"strconv"
)
func CreateStripeCheckoutSession(c *gin.Context) {
@ -43,31 +39,12 @@ func CreateStripeCheckoutSession(c *gin.Context) {
return
}
fmt.Println("detail.OrderRecord.CustomerID :", detail.OrderRecord.CustomerID)
// 判断 是否是 本人操作
if strconv.FormatUint(userInfo.ID, 10) != detail.OrderRecord.CustomerID {
service.Error(c, errors.New(common.NotMatchOrderInfo))
return
}
fmt.Println("detail.OrderRecord.TotalAmount :", detail.OrderRecord.TotalAmount)
fmt.Println("req.ProductAllPrice :", req.ProductAllPrice)
fmt.Println("detail.OrderRecord.TotalAmount*100 :", detail.OrderRecord.TotalAmount*100)
//金额校验
orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100)))
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
if orderAmountInCents != reqAmountInCents {
fmt.Println("111111111111111111111111111111111111")
service.Error(c, errors.New(common.InvalidOrderAmount))
return
}
fmt.Println("detail.OrderRecord.Status :", detail.OrderRecord.Status)
fmt.Println("detail.OrderRecord.CheckoutSessionId :", detail.OrderRecord.CheckoutSessionId)
fmt.Println("detail.OrderRecord.PayTime :", detail.OrderRecord.PayTime)
// 如果 当前订单 是 已签未支付 且 存在 checkoutSessionId 需要 查询 支付结果
if detail.OrderRecord.Status == bundleModel.OrderSigned && detail.OrderRecord.CheckoutSessionId != "" && detail.OrderRecord.PayTime == "" {
// 查询支付结果
@ -110,9 +87,6 @@ func CreateStripeCheckoutSession(c *gin.Context) {
return
}
fmt.Println("result.CheckoutSessionId :", result.CheckoutSessionId)
fmt.Println("result.CheckoutSessionUrl :", result.CheckoutSessionUrl)
//更新订单状态
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{
Uuid: detail.OrderRecord.Uuid,
@ -129,131 +103,6 @@ func CreateStripeCheckoutSession(c *gin.Context) {
}
func CreateAntomPay(c *gin.Context) {
var req order.CreateStripeCheckoutSessionRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
// 获取 用户信息
userInfo := login.GetUserInfoFromC(c)
// 检查 订单信息
detail, detailErr := service.BundleProvider.OrderRecordsDetail(context.Background(), &bundle.OrderRecordsDetailRequest{
OrderNo: req.OutTradeNo,
})
if detailErr != nil {
service.Error(c, detailErr)
return
}
fmt.Println("detail.OrderRecord.CustomerID :", detail.OrderRecord.CustomerID)
// 判断 是否是 本人操作
if strconv.FormatUint(userInfo.ID, 10) != detail.OrderRecord.CustomerID {
service.Error(c, errors.New(common.NotMatchOrderInfo))
return
}
fmt.Println("detail.OrderRecord.TotalAmount :", detail.OrderRecord.TotalAmount)
fmt.Println("req.ProductAllPrice :", req.ProductAllPrice)
fmt.Println("detail.OrderRecord.TotalAmount*100 :", detail.OrderRecord.TotalAmount*100)
//金额校验
orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100)))
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
if orderAmountInCents != reqAmountInCents {
fmt.Println("111111111111111111111111111111111111")
service.Error(c, errors.New(common.InvalidOrderAmount))
return
}
fmt.Println("detail.OrderRecord.Status :", detail.OrderRecord.Status)
fmt.Println("detail.OrderRecord.CheckoutSessionId :", detail.OrderRecord.CheckoutSessionId)
fmt.Println("detail.OrderRecord.PayTime :", detail.OrderRecord.PayTime)
// 如果 当前订单 是 已签未支付 且 存在 checkoutSessionId 需要 查询 支付结果
if detail.OrderRecord.Status == bundleModel.OrderSigned && detail.OrderRecord.CheckoutSessionId != "" && detail.OrderRecord.PayTime == "" {
// 查询支付结果
stripeInfosRes, stripeInfosErr := service.PaymentProvider.QueryAntomPayByCheckoutSessionId(context.Background(), &payment.AntomPayQueryRequest{
CheckoutSessionIds: []string{detail.OrderRecord.CheckoutSessionId},
})
if stripeInfosErr != nil {
service.Error(c, errors.New(common.ErrorQueryStripeInfo))
return
}
if stripeInfosRes != nil && len(stripeInfosRes.Infos) > 0 {
for _, info := range stripeInfosRes.Infos {
if info.OutTradeNo == detail.OrderRecord.OrderNo && info.Status == "paid" {
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{
Uuid: detail.OrderRecord.Uuid,
Status: bundleModel.OrderPaid,
PayTime: common.GetBeijingTime(),
})
fmt.Println("detail.OrderRecord.Uuid :", detail.OrderRecord.Uuid)
if updateOrderRecordErr != nil {
service.Error(c, detailErr)
return
}
service.Success(c, &service.Response{
Msg: common.HadPay,
Code: 0,
})
return
}
}
}
}
var antomReq payment.CreatePayRequest
antomReq.Payee = "Antom"
antomReq.Platform = "antom"
antomReq.ChannelType = "antom"
antomReq.ProductDescription = req.ProductDescription
antomReq.BusinessType = "useless"
antomReq.Domain = "fiee"
antomReq.Amount = req.ProductAllPrice
antomReq.Currency = req.ProductPriceCurrency
antomReq.OutTradeNo = req.OutTradeNo
antomReq.ReturnUrl = req.SuccessUrl
//调用微服务获取支付地址
result, err := service.PaymentProvider.CreatePay(context.Background(), &antomReq)
if err != nil {
service.Error(c, err)
return
}
fmt.Println("result.CheckoutSessionId :", result.CheckoutSessionId)
fmt.Println("result.Url :", result.Url)
//更新订单状态
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{
Uuid: detail.OrderRecord.Uuid,
CheckoutSessionId: result.CheckoutSessionId,
CheckoutSessionUrl: result.Url,
})
fmt.Println("=====================================")
resp := &order.CreateStripeCheckoutSessionResponse{}
resp.CheckoutSessionUrl = result.Url
resp.CheckoutSessionId = result.CheckoutSessionId
fmt.Println("resp:", resp)
if updateOrderRecordErr != nil {
fmt.Println("有更新报错:", updateOrderRecordErr)
service.Error(c, updateOrderRecordErr)
return
}
service.Success(c, resp)
}
func StripeCheckoutSessionWebhook(c *gin.Context) {
var req order.GetCheckoutWebhookRequest
c.Request.Body = http.MaxBytesReader(c.Writer, c.Request.Body, int64(65536))
@ -287,82 +136,3 @@ func StripeCheckoutSessionWebhook(c *gin.Context) {
}
service.Success(c)
}
func AntomWebhook(c *gin.Context) {
var err error
data, err := io.ReadAll(c.Request.Body)
if err != nil {
service.Error(c, err)
return
}
// 将数据转换为字符串形式并记录日志(如果数据过大则不记录)
dataStr := string(data)
fmt.Println("================ Antom回调参数", dataStr)
// 将读取到的数据解析为 map[string]interface{}
var reqMap map[string]interface{}
if err := json.Unmarshal(data, &reqMap); err != nil {
service.Error(c, err)
return
}
// 提取需要的字段
notifyType, _ := reqMap["notifyType"].(string)
resultMap, resultExists := reqMap["result"].(map[string]interface{})
if !resultExists {
service.Error(c, errors.New("result 字段不存在或类型错误"))
return
}
requestId, _ := reqMap["paymentRequestId"].(string)
paymentId, _ := reqMap["paymentId"].(string)
paymentTime, _ := reqMap["paymentTime"].(string)
// 提取 result 字段中的子字段
resultStatus, _ := resultMap["resultStatus"].(string)
resultMessage, _ := resultMap["resultMessage"].(string)
// 打印提取的字段(可以根据需要处理)
fmt.Println("通知类型:", notifyType)
fmt.Println("订单号:", requestId)
fmt.Println("支付ID:", paymentId)
fmt.Println("支付时间:", paymentTime)
fmt.Println("支付结果状态:", resultStatus)
fmt.Println("支付结果消息:", resultMessage)
/*
* S: notifyType 为PAYMENT_RESULT时表示支付成功 notifyType 为PAYMENT_PENDING时表示支付处理中
* F: 表示支付失败
* */
params := &payment.AntomNotifyPayRequest{
NotifyType: notifyType,
RequestId: requestId,
PaymentId: paymentId,
PaymentTime: paymentTime,
ResultStatus: resultStatus,
ResultMessage: resultMessage,
ChannelCode: "Antom", // fiee对应payment的渠道码
}
resp, err := service.PaymentProvider.AntomWebhook(c, params)
if err != nil {
service.Error(c, err)
return
}
fmt.Println("resp.Status:", resp.Status)
if resp.Status == "paid" {
//支付成功
_, updateStatusErr := service.BundleProvider.UpdateOrderRecordByOrderNo(context.Background(), &bundle.OrderRecord{
OrderNo: resp.OutTradeNo,
PayTime: common.GetBeijingTime(),
Status: bundleModel.OrderPaid,
})
if updateStatusErr != nil {
service.Error(c, err)
return
}
}
service.Success(c)
}

View File

@ -1,69 +0,0 @@
package bundle
import (
"context"
"fmt"
"fonchain-fiee/api/bundle"
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
)
func CreateValueAddBundle(c *gin.Context) {
var req bundle.CreateValueAddBundleRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error1(c, err)
return
}
res, err := service.BundleProvider.CreateValueAddBundle(context.Background(), &req)
if err != nil {
fmt.Println(err)
service.Error1(c, err)
return
}
service.Success1(c, res.Msg, res)
}
func ValueAddBundleList(c *gin.Context) {
var req bundle.ValueAddBundleListRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error1(c, err)
return
}
// 获取 用户信息
userInfo := login.GetUserInfoFromC(c)
req.UserId = int32(userInfo.ID)
//req.UserId = 39
res, err := service.BundleProvider.ValueAddBundleList(context.Background(), &req)
if err != nil {
service.Error1(c, err)
return
}
service.Success1(c, res.Msg, res)
}
func ValueAddBundleDetail(c *gin.Context) {
var req bundle.ValueAddBundleDetailRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error1(c, err)
return
}
res, err := service.BundleProvider.ValueAddBundleDetail(context.Background(), &req)
if err != nil {
service.Error1(c, err)
return
}
service.Success1(c, res.Msg, res)
}

View File

@ -8,7 +8,6 @@ import (
"fonchain-fiee/api/account"
"fonchain-fiee/api/bundle"
"fonchain-fiee/api/order"
"fonchain-fiee/api/payment"
pkConfig "fonchain-fiee/pkg/config"
"os"
)
@ -17,13 +16,11 @@ var AccountProvider = new(account.AccountClientImpl)
var BundleProvider = new(bundle.BundleClientImpl)
var OrderProvider = new(order.OrderClientImpl)
var PaymentProvider = new(payment.PaymentCentClientImpl)
func init() {
config.SetConsumerService(BundleProvider)
config.SetConsumerService(OrderProvider)
config.SetConsumerService(AccountProvider)
config.SetConsumerService(PaymentProvider)
if err := config.Load(); err != nil {
panic(err)