payment

package
v0.0.0-...-3bb7120 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Querier

type Querier interface {
	Create(ctx context.Context, orderID int64, userID *int64, billingAddressID int64, paymentIntentID string, paymentMethodID *string, amount decimal.Decimal, currency string, status string, clientSecret *string, lastError *string, cardLast4 string, cardBrand string, createdAt pgtype.Timestamptz) error
	GetByOrderID(ctx context.Context, orderID int64) (*StripeCardPayment, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) Create

func (q *Queries) Create(ctx context.Context, orderID int64, userID *int64, billingAddressID int64, paymentIntentID string, paymentMethodID *string, amount decimal.Decimal, currency string, status string, clientSecret *string, lastError *string, cardLast4 string, cardBrand string, createdAt pgtype.Timestamptz) error

func (*Queries) GetByOrderID

func (q *Queries) GetByOrderID(ctx context.Context, orderID int64) (*StripeCardPayment, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Repository

type Repository interface {
	Querier
}

func NewRepository

func NewRepository(db *pgxpool.Pool) Repository

type StripeCardPayment

type StripeCardPayment struct {
	ID               int64
	OrderID          int64
	UserID           *int64
	BillingAddressID int64
	PaymentIntentID  string
	PaymentMethodID  *string
	Amount           decimal.Decimal
	Currency         string
	Status           string
	ClientSecret     *string
	LastError        *string
	CardLast4        string
	CardBrand        string
	CreatedAt        pgtype.Timestamptz
	UpdatedAt        pgtype.Timestamptz
}

Jump to

Keyboard shortcuts

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