paymentspb

package
v0.0.0-...-76fafce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package paymentspb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	InvoiceAggregateChannel = "intellimall.payments.events.Invoice"

	InvoicePaidEvent = "paymentsapi.InvoicePaid"

	CommandChannel = "intellimall.payments.commands"

	ConfirmPaymentCommand = "paymentsapi.ConfirmPayment"
)

Variables

View Source
var File_paymentspb_api_proto protoreflect.FileDescriptor
View Source
var File_paymentspb_messages_proto protoreflect.FileDescriptor
View Source
var PaymentsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "paymentspb.PaymentsService",
	HandlerType: (*PaymentsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AuthorizePayment",
			Handler:    _PaymentsService_AuthorizePayment_Handler,
		},
		{
			MethodName: "ConfirmPayment",
			Handler:    _PaymentsService_ConfirmPayment_Handler,
		},
		{
			MethodName: "CreateInvoice",
			Handler:    _PaymentsService_CreateInvoice_Handler,
		},
		{
			MethodName: "AdjustInvoice",
			Handler:    _PaymentsService_AdjustInvoice_Handler,
		},
		{
			MethodName: "PayInvoice",
			Handler:    _PaymentsService_PayInvoice_Handler,
		},
		{
			MethodName: "CancelInvoice",
			Handler:    _PaymentsService_CancelInvoice_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "paymentspb/api.proto",
}

PaymentsService_ServiceDesc is the grpc.ServiceDesc for PaymentsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterPaymentsServiceHandler

func RegisterPaymentsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterPaymentsServiceHandler registers the http handlers for service PaymentsService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterPaymentsServiceHandlerClient

func RegisterPaymentsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PaymentsServiceClient) error

RegisterPaymentsServiceHandlerClient registers the http handlers for service PaymentsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PaymentsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PaymentsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PaymentsServiceClient" to call the correct interceptors.

func RegisterPaymentsServiceHandlerFromEndpoint

func RegisterPaymentsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterPaymentsServiceHandlerFromEndpoint is same as RegisterPaymentsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterPaymentsServiceHandlerServer

func RegisterPaymentsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PaymentsServiceServer) error

RegisterPaymentsServiceHandlerServer registers the http handlers for service PaymentsService to "mux". UnaryRPC :call PaymentsServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPaymentsServiceHandlerFromEndpoint instead.

func RegisterPaymentsServiceServer

func RegisterPaymentsServiceServer(s grpc.ServiceRegistrar, srv PaymentsServiceServer)

func Registrations

func Registrations(reg registry.Registry) (err error)

Types

type AdjustInvoiceRequest

type AdjustInvoiceRequest struct {
	Id     string  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Amount float64 `protobuf:"fixed64,2,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*AdjustInvoiceRequest) Descriptor deprecated

func (*AdjustInvoiceRequest) Descriptor() ([]byte, []int)

Deprecated: Use AdjustInvoiceRequest.ProtoReflect.Descriptor instead.

func (*AdjustInvoiceRequest) GetAmount

func (x *AdjustInvoiceRequest) GetAmount() float64

func (*AdjustInvoiceRequest) GetId

func (x *AdjustInvoiceRequest) GetId() string

func (*AdjustInvoiceRequest) ProtoMessage

func (*AdjustInvoiceRequest) ProtoMessage()

func (*AdjustInvoiceRequest) ProtoReflect

func (x *AdjustInvoiceRequest) ProtoReflect() protoreflect.Message

func (*AdjustInvoiceRequest) Reset

func (x *AdjustInvoiceRequest) Reset()

func (*AdjustInvoiceRequest) String

func (x *AdjustInvoiceRequest) String() string

type AdjustInvoiceResponse

type AdjustInvoiceResponse struct {
	// contains filtered or unexported fields
}

func (*AdjustInvoiceResponse) Descriptor deprecated

func (*AdjustInvoiceResponse) Descriptor() ([]byte, []int)

Deprecated: Use AdjustInvoiceResponse.ProtoReflect.Descriptor instead.

func (*AdjustInvoiceResponse) ProtoMessage

func (*AdjustInvoiceResponse) ProtoMessage()

func (*AdjustInvoiceResponse) ProtoReflect

func (x *AdjustInvoiceResponse) ProtoReflect() protoreflect.Message

func (*AdjustInvoiceResponse) Reset

func (x *AdjustInvoiceResponse) Reset()

func (*AdjustInvoiceResponse) String

func (x *AdjustInvoiceResponse) String() string

type AuthorizePaymentRequest

type AuthorizePaymentRequest struct {
	CustomerId string  `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
	Amount     float64 `protobuf:"fixed64,2,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthorizePaymentRequest) Descriptor deprecated

func (*AuthorizePaymentRequest) Descriptor() ([]byte, []int)

Deprecated: Use AuthorizePaymentRequest.ProtoReflect.Descriptor instead.

func (*AuthorizePaymentRequest) GetAmount

func (x *AuthorizePaymentRequest) GetAmount() float64

func (*AuthorizePaymentRequest) GetCustomerId

func (x *AuthorizePaymentRequest) GetCustomerId() string

func (*AuthorizePaymentRequest) ProtoMessage

func (*AuthorizePaymentRequest) ProtoMessage()

func (*AuthorizePaymentRequest) ProtoReflect

func (x *AuthorizePaymentRequest) ProtoReflect() protoreflect.Message

func (*AuthorizePaymentRequest) Reset

func (x *AuthorizePaymentRequest) Reset()

func (*AuthorizePaymentRequest) String

func (x *AuthorizePaymentRequest) String() string

type AuthorizePaymentResponse

type AuthorizePaymentResponse struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthorizePaymentResponse) Descriptor deprecated

func (*AuthorizePaymentResponse) Descriptor() ([]byte, []int)

Deprecated: Use AuthorizePaymentResponse.ProtoReflect.Descriptor instead.

func (*AuthorizePaymentResponse) GetId

func (x *AuthorizePaymentResponse) GetId() string

func (*AuthorizePaymentResponse) ProtoMessage

func (*AuthorizePaymentResponse) ProtoMessage()

func (*AuthorizePaymentResponse) ProtoReflect

func (x *AuthorizePaymentResponse) ProtoReflect() protoreflect.Message

func (*AuthorizePaymentResponse) Reset

func (x *AuthorizePaymentResponse) Reset()

func (*AuthorizePaymentResponse) String

func (x *AuthorizePaymentResponse) String() string

type CancelInvoiceRequest

type CancelInvoiceRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*CancelInvoiceRequest) Descriptor deprecated

func (*CancelInvoiceRequest) Descriptor() ([]byte, []int)

Deprecated: Use CancelInvoiceRequest.ProtoReflect.Descriptor instead.

func (*CancelInvoiceRequest) GetId

func (x *CancelInvoiceRequest) GetId() string

func (*CancelInvoiceRequest) ProtoMessage

func (*CancelInvoiceRequest) ProtoMessage()

func (*CancelInvoiceRequest) ProtoReflect

func (x *CancelInvoiceRequest) ProtoReflect() protoreflect.Message

func (*CancelInvoiceRequest) Reset

func (x *CancelInvoiceRequest) Reset()

func (*CancelInvoiceRequest) String

func (x *CancelInvoiceRequest) String() string

type CancelInvoiceResponse

type CancelInvoiceResponse struct {
	// contains filtered or unexported fields
}

func (*CancelInvoiceResponse) Descriptor deprecated

func (*CancelInvoiceResponse) Descriptor() ([]byte, []int)

Deprecated: Use CancelInvoiceResponse.ProtoReflect.Descriptor instead.

func (*CancelInvoiceResponse) ProtoMessage

func (*CancelInvoiceResponse) ProtoMessage()

func (*CancelInvoiceResponse) ProtoReflect

func (x *CancelInvoiceResponse) ProtoReflect() protoreflect.Message

func (*CancelInvoiceResponse) Reset

func (x *CancelInvoiceResponse) Reset()

func (*CancelInvoiceResponse) String

func (x *CancelInvoiceResponse) String() string

type ConfirmPayment

type ConfirmPayment struct {
	Id     string  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Amount float64 `protobuf:"fixed64,2,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfirmPayment) Descriptor deprecated

func (*ConfirmPayment) Descriptor() ([]byte, []int)

Deprecated: Use ConfirmPayment.ProtoReflect.Descriptor instead.

func (*ConfirmPayment) GetAmount

func (x *ConfirmPayment) GetAmount() float64

func (*ConfirmPayment) GetId

func (x *ConfirmPayment) GetId() string

func (*ConfirmPayment) Key

func (*ConfirmPayment) Key() string

func (*ConfirmPayment) ProtoMessage

func (*ConfirmPayment) ProtoMessage()

func (*ConfirmPayment) ProtoReflect

func (x *ConfirmPayment) ProtoReflect() protoreflect.Message

func (*ConfirmPayment) Reset

func (x *ConfirmPayment) Reset()

func (*ConfirmPayment) String

func (x *ConfirmPayment) String() string

type ConfirmPaymentRequest

type ConfirmPaymentRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfirmPaymentRequest) Descriptor deprecated

func (*ConfirmPaymentRequest) Descriptor() ([]byte, []int)

Deprecated: Use ConfirmPaymentRequest.ProtoReflect.Descriptor instead.

func (*ConfirmPaymentRequest) GetId

func (x *ConfirmPaymentRequest) GetId() string

func (*ConfirmPaymentRequest) ProtoMessage

func (*ConfirmPaymentRequest) ProtoMessage()

func (*ConfirmPaymentRequest) ProtoReflect

func (x *ConfirmPaymentRequest) ProtoReflect() protoreflect.Message

func (*ConfirmPaymentRequest) Reset

func (x *ConfirmPaymentRequest) Reset()

func (*ConfirmPaymentRequest) String

func (x *ConfirmPaymentRequest) String() string

type ConfirmPaymentResponse

type ConfirmPaymentResponse struct {
	// contains filtered or unexported fields
}

func (*ConfirmPaymentResponse) Descriptor deprecated

func (*ConfirmPaymentResponse) Descriptor() ([]byte, []int)

Deprecated: Use ConfirmPaymentResponse.ProtoReflect.Descriptor instead.

func (*ConfirmPaymentResponse) ProtoMessage

func (*ConfirmPaymentResponse) ProtoMessage()

func (*ConfirmPaymentResponse) ProtoReflect

func (x *ConfirmPaymentResponse) ProtoReflect() protoreflect.Message

func (*ConfirmPaymentResponse) Reset

func (x *ConfirmPaymentResponse) Reset()

func (*ConfirmPaymentResponse) String

func (x *ConfirmPaymentResponse) String() string

type CreateInvoiceRequest

type CreateInvoiceRequest struct {
	OrderId   string  `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
	PaymentId string  `protobuf:"bytes,2,opt,name=payment_id,json=paymentId,proto3" json:"payment_id,omitempty"`
	Amount    float64 `protobuf:"fixed64,3,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateInvoiceRequest) Descriptor deprecated

func (*CreateInvoiceRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateInvoiceRequest.ProtoReflect.Descriptor instead.

func (*CreateInvoiceRequest) GetAmount

func (x *CreateInvoiceRequest) GetAmount() float64

func (*CreateInvoiceRequest) GetOrderId

func (x *CreateInvoiceRequest) GetOrderId() string

func (*CreateInvoiceRequest) GetPaymentId

func (x *CreateInvoiceRequest) GetPaymentId() string

func (*CreateInvoiceRequest) ProtoMessage

func (*CreateInvoiceRequest) ProtoMessage()

func (*CreateInvoiceRequest) ProtoReflect

func (x *CreateInvoiceRequest) ProtoReflect() protoreflect.Message

func (*CreateInvoiceRequest) Reset

func (x *CreateInvoiceRequest) Reset()

func (*CreateInvoiceRequest) String

func (x *CreateInvoiceRequest) String() string

type CreateInvoiceResponse

type CreateInvoiceResponse struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateInvoiceResponse) Descriptor deprecated

func (*CreateInvoiceResponse) Descriptor() ([]byte, []int)

Deprecated: Use CreateInvoiceResponse.ProtoReflect.Descriptor instead.

func (*CreateInvoiceResponse) GetId

func (x *CreateInvoiceResponse) GetId() string

func (*CreateInvoiceResponse) ProtoMessage

func (*CreateInvoiceResponse) ProtoMessage()

func (*CreateInvoiceResponse) ProtoReflect

func (x *CreateInvoiceResponse) ProtoReflect() protoreflect.Message

func (*CreateInvoiceResponse) Reset

func (x *CreateInvoiceResponse) Reset()

func (*CreateInvoiceResponse) String

func (x *CreateInvoiceResponse) String() string

type InvoicePaid

type InvoicePaid struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
	// contains filtered or unexported fields
}

func (*InvoicePaid) Descriptor deprecated

func (*InvoicePaid) Descriptor() ([]byte, []int)

Deprecated: Use InvoicePaid.ProtoReflect.Descriptor instead.

func (*InvoicePaid) GetId

func (x *InvoicePaid) GetId() string

func (*InvoicePaid) GetOrderId

func (x *InvoicePaid) GetOrderId() string

func (*InvoicePaid) Key

func (*InvoicePaid) Key() string

func (*InvoicePaid) ProtoMessage

func (*InvoicePaid) ProtoMessage()

func (*InvoicePaid) ProtoReflect

func (x *InvoicePaid) ProtoReflect() protoreflect.Message

func (*InvoicePaid) Reset

func (x *InvoicePaid) Reset()

func (*InvoicePaid) String

func (x *InvoicePaid) String() string

type MockPaymentsServiceClient

type MockPaymentsServiceClient struct {
	mock.Mock
}

MockPaymentsServiceClient is an autogenerated mock type for the PaymentsServiceClient type

func NewMockPaymentsServiceClient

func NewMockPaymentsServiceClient(t mockConstructorTestingTNewMockPaymentsServiceClient) *MockPaymentsServiceClient

NewMockPaymentsServiceClient creates a new instance of MockPaymentsServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockPaymentsServiceClient) AdjustInvoice

AdjustInvoice provides a mock function with given fields: ctx, in, opts

func (*MockPaymentsServiceClient) AuthorizePayment

AuthorizePayment provides a mock function with given fields: ctx, in, opts

func (*MockPaymentsServiceClient) CancelInvoice

CancelInvoice provides a mock function with given fields: ctx, in, opts

func (*MockPaymentsServiceClient) ConfirmPayment

ConfirmPayment provides a mock function with given fields: ctx, in, opts

func (*MockPaymentsServiceClient) CreateInvoice

CreateInvoice provides a mock function with given fields: ctx, in, opts

func (*MockPaymentsServiceClient) PayInvoice

PayInvoice provides a mock function with given fields: ctx, in, opts

type MockPaymentsServiceServer

type MockPaymentsServiceServer struct {
	mock.Mock
}

MockPaymentsServiceServer is an autogenerated mock type for the PaymentsServiceServer type

func NewMockPaymentsServiceServer

func NewMockPaymentsServiceServer(t mockConstructorTestingTNewMockPaymentsServiceServer) *MockPaymentsServiceServer

NewMockPaymentsServiceServer creates a new instance of MockPaymentsServiceServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockPaymentsServiceServer) AdjustInvoice

AdjustInvoice provides a mock function with given fields: _a0, _a1

func (*MockPaymentsServiceServer) AuthorizePayment

AuthorizePayment provides a mock function with given fields: _a0, _a1

func (*MockPaymentsServiceServer) CancelInvoice

CancelInvoice provides a mock function with given fields: _a0, _a1

func (*MockPaymentsServiceServer) ConfirmPayment

ConfirmPayment provides a mock function with given fields: _a0, _a1

func (*MockPaymentsServiceServer) CreateInvoice

CreateInvoice provides a mock function with given fields: _a0, _a1

func (*MockPaymentsServiceServer) PayInvoice

PayInvoice provides a mock function with given fields: _a0, _a1

type MockUnsafePaymentsServiceServer

type MockUnsafePaymentsServiceServer struct {
	mock.Mock
}

MockUnsafePaymentsServiceServer is an autogenerated mock type for the UnsafePaymentsServiceServer type

func NewMockUnsafePaymentsServiceServer

func NewMockUnsafePaymentsServiceServer(t mockConstructorTestingTNewMockUnsafePaymentsServiceServer) *MockUnsafePaymentsServiceServer

NewMockUnsafePaymentsServiceServer creates a new instance of MockUnsafePaymentsServiceServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

type PayInvoiceRequest

type PayInvoiceRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*PayInvoiceRequest) Descriptor deprecated

func (*PayInvoiceRequest) Descriptor() ([]byte, []int)

Deprecated: Use PayInvoiceRequest.ProtoReflect.Descriptor instead.

func (*PayInvoiceRequest) GetId

func (x *PayInvoiceRequest) GetId() string

func (*PayInvoiceRequest) ProtoMessage

func (*PayInvoiceRequest) ProtoMessage()

func (*PayInvoiceRequest) ProtoReflect

func (x *PayInvoiceRequest) ProtoReflect() protoreflect.Message

func (*PayInvoiceRequest) Reset

func (x *PayInvoiceRequest) Reset()

func (*PayInvoiceRequest) String

func (x *PayInvoiceRequest) String() string

type PayInvoiceResponse

type PayInvoiceResponse struct {
	// contains filtered or unexported fields
}

func (*PayInvoiceResponse) Descriptor deprecated

func (*PayInvoiceResponse) Descriptor() ([]byte, []int)

Deprecated: Use PayInvoiceResponse.ProtoReflect.Descriptor instead.

func (*PayInvoiceResponse) ProtoMessage

func (*PayInvoiceResponse) ProtoMessage()

func (*PayInvoiceResponse) ProtoReflect

func (x *PayInvoiceResponse) ProtoReflect() protoreflect.Message

func (*PayInvoiceResponse) Reset

func (x *PayInvoiceResponse) Reset()

func (*PayInvoiceResponse) String

func (x *PayInvoiceResponse) String() string

type PaymentsServiceClient

type PaymentsServiceClient interface {
	AuthorizePayment(ctx context.Context, in *AuthorizePaymentRequest, opts ...grpc.CallOption) (*AuthorizePaymentResponse, error)
	ConfirmPayment(ctx context.Context, in *ConfirmPaymentRequest, opts ...grpc.CallOption) (*ConfirmPaymentResponse, error)
	CreateInvoice(ctx context.Context, in *CreateInvoiceRequest, opts ...grpc.CallOption) (*CreateInvoiceResponse, error)
	AdjustInvoice(ctx context.Context, in *AdjustInvoiceRequest, opts ...grpc.CallOption) (*AdjustInvoiceResponse, error)
	PayInvoice(ctx context.Context, in *PayInvoiceRequest, opts ...grpc.CallOption) (*PayInvoiceResponse, error)
	CancelInvoice(ctx context.Context, in *CancelInvoiceRequest, opts ...grpc.CallOption) (*CancelInvoiceResponse, error)
}

PaymentsServiceClient is the client API for PaymentsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type PaymentsServiceServer

type PaymentsServiceServer interface {
	AuthorizePayment(context.Context, *AuthorizePaymentRequest) (*AuthorizePaymentResponse, error)
	ConfirmPayment(context.Context, *ConfirmPaymentRequest) (*ConfirmPaymentResponse, error)
	CreateInvoice(context.Context, *CreateInvoiceRequest) (*CreateInvoiceResponse, error)
	AdjustInvoice(context.Context, *AdjustInvoiceRequest) (*AdjustInvoiceResponse, error)
	PayInvoice(context.Context, *PayInvoiceRequest) (*PayInvoiceResponse, error)
	CancelInvoice(context.Context, *CancelInvoiceRequest) (*CancelInvoiceResponse, error)
	// contains filtered or unexported methods
}

PaymentsServiceServer is the server API for PaymentsService service. All implementations must embed UnimplementedPaymentsServiceServer for forward compatibility

type UnimplementedPaymentsServiceServer

type UnimplementedPaymentsServiceServer struct {
}

UnimplementedPaymentsServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPaymentsServiceServer) AdjustInvoice

func (UnimplementedPaymentsServiceServer) AuthorizePayment

func (UnimplementedPaymentsServiceServer) CancelInvoice

func (UnimplementedPaymentsServiceServer) ConfirmPayment

func (UnimplementedPaymentsServiceServer) CreateInvoice

func (UnimplementedPaymentsServiceServer) PayInvoice

type UnsafePaymentsServiceServer

type UnsafePaymentsServiceServer interface {
	// contains filtered or unexported methods
}

UnsafePaymentsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PaymentsServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL