gateway

package
v0.0.0-...-553ec8c Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckStatusError

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

CheckStatusError represents an error type specific to checking status.

func NewCheckStatusError

func NewCheckStatusError(msg string, err error) *CheckStatusError

NewCheckStatusError creates a new CheckStatusError instance with the given message and underlying error.

func (*CheckStatusError) Error

func (e *CheckStatusError) Error() string

type CreatePaymentError

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

CreatePaymentError represents an error type specific to creating payments.

func NewCreatePaymentError

func NewCreatePaymentError(msg string, err error) *CreatePaymentError

NewCreatePaymentError creates a new CreatePaymentError instance with the given message and underlying error.

func (*CreatePaymentError) Error

func (e *CreatePaymentError) Error() string

type CreationGatewayError

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

GatewayError represents a gateway error type with a specific message and underlying error.

func NewCreationGatewayError

func NewCreationGatewayError(msg string, err error) *CreationGatewayError

NewCreationGatewayError creates a new GatewayError instance with the given message and underlying error.

func (*CreationGatewayError) Error

func (e *CreationGatewayError) Error() string

type PaymentGateway

type PaymentGateway interface {
	CreatePayment(context.Context) (string, error)
	CheckStatus(context.Context, string) (PaymentStatus, error)
	TransactionID() string
	Timeout() time.Duration
	Retries() int
}

PaymentGateway is an interface that defines operations for a payment gateway.

type PaymentStatus

type PaymentStatus int

PaymentStatus represents the status of a payment.

const (
	Undefined PaymentStatus = iota
	Pending
	Succeeded
	Cancelled
)

type TransactionInfo

type TransactionInfo struct {
	TransactionID string
	Value         string
	Currency      string
}

TransactionInfo holds information about a transaction.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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