Documentation ¶
Index ¶
- Variables
- type CreateInvoiceInput
- type CryptoServiceClient
- type ExternalAPI
- type Service
- func (s *Service) CheckInvoice(ctx context.Context, invoiceIDStr string) (*models.Invoice, error)
- func (s *Service) CreateInvoice(ctx context.Context, input *CreateInvoiceInput) (*models.Invoice, error)
- func (s *Service) ListInvoices(ctx context.Context, reqFilter *desc.ListInvoicesRequest_Filter) ([]*models.Invoice, error)
- func (s *Service) UpdateInvoice(ctx context.Context, input *UpdateInvoiceInput) (*models.Invoice, error)
- type Storage
- type UpdateInvoiceInput
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvoiceNotFoundByID = func(invoiceID uuid.UUID) error { return fmt.Errorf("invoice not found by id = %q", invoiceID.String()) } ErrInvoiceNotFoundByAddress = func(address string) error { return fmt.Errorf("invoice not found by address = %q", address) } ErrInvoiceAlreadyCompleted = errors.New("invoice is already completed") )
Functions ¶
This section is empty.
Types ¶
type CreateInvoiceInput ¶
func CreateInvoiceInputFromRequest ¶
func CreateInvoiceInputFromRequest(req *desc.CreateInvoiceRequest) (*CreateInvoiceInput, error)
type CryptoServiceClient ¶
type CryptoServiceClient interface { AcceptCrypto(ctx context.Context, in *crypto_service.AcceptCryptoRequest, opts ...grpc.CallOption) (*crypto_service.AcceptCryptoResponse, error) Transfer(ctx context.Context, in *crypto_service.TransferRequest, opts ...grpc.CallOption) (*crypto_service.TransferResponse, error) }
type ExternalAPI ¶
type ExternalAPI interface {
GetPrice(ctx context.Context, in *external_api.GetPriceRequest, opts ...grpc.CallOption) (*external_api.GetPriceResponse, error)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New( ctx context.Context, storage Storage, cryptoServiceClient CryptoServiceClient, externalAPI ExternalAPI, ) *Service
func (*Service) CheckInvoice ¶
func (*Service) CreateInvoice ¶
func (*Service) ListInvoices ¶
func (*Service) UpdateInvoice ¶
type UpdateInvoiceInput ¶
type UpdateInvoiceInput struct { InvoiceID uuid.UUID Chain string Token string PayerClientID *string }
func UpdateInvoiceInputFromRequest ¶
func UpdateInvoiceInputFromRequest(req *desc.UpdateInvoiceRequest) (*UpdateInvoiceInput, error)
Click to show internal directories.
Click to hide internal directories.