Documentation ¶
Index ¶
- type CreatePaymentParams
- type CreateTransactionParams
- type DBTX
- type DeleteTokenParams
- type GetTokenParams
- type GetTransactionByPaymentIDSourceWalletAndMintParams
- type NullPaymentStatus
- type NullTransactionStatus
- type Payment
- type PaymentStatus
- type Queries
- func (q *Queries) Close() error
- func (q *Queries) CreatePayment(ctx context.Context, arg CreatePaymentParams) (Payment, error)
- func (q *Queries) CreateTransaction(ctx context.Context, arg CreateTransactionParams) (Transaction, error)
- func (q *Queries) DeleteExpiredTokens(ctx context.Context) error
- func (q *Queries) DeleteToken(ctx context.Context, arg DeleteTokenParams) error
- func (q *Queries) DeleteTokensByCredential(ctx context.Context, credential string) error
- func (q *Queries) GetPayment(ctx context.Context, id uuid.UUID) (Payment, error)
- func (q *Queries) GetPaymentByExternalID(ctx context.Context, externalID string) (Payment, error)
- func (q *Queries) GetPendingTransactions(ctx context.Context) ([]Transaction, error)
- func (q *Queries) GetToken(ctx context.Context, arg GetTokenParams) (Token, error)
- func (q *Queries) GetTransaction(ctx context.Context, id uuid.UUID) (Transaction, error)
- func (q *Queries) GetTransactionByPaymentIDSourceWalletAndMint(ctx context.Context, arg GetTransactionByPaymentIDSourceWalletAndMintParams) (Transaction, error)
- func (q *Queries) GetTransactionByReference(ctx context.Context, reference string) (Transaction, error)
- func (q *Queries) GetTransactionsByPaymentID(ctx context.Context, paymentID uuid.UUID) ([]Transaction, error)
- func (q *Queries) MarkPaymentsExpired(ctx context.Context) error
- func (q *Queries) MarkTransactionsAsExpired(ctx context.Context) error
- func (q *Queries) StoreToken(ctx context.Context, arg StoreTokenParams) (Token, error)
- func (q *Queries) UpdatePaymentStatus(ctx context.Context, arg UpdatePaymentStatusParams) (Payment, error)
- func (q *Queries) UpdateTransactionByReference(ctx context.Context, arg UpdateTransactionByReferenceParams) (Transaction, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type StoreTokenParams
- type Token
- type Transaction
- type TransactionStatus
- type UpdatePaymentStatusParams
- type UpdateTransactionByReferenceParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreatePaymentParams ¶
type CreatePaymentParams struct { ExternalID sql.NullString `json:"external_id"` DestinationWallet string `json:"destination_wallet"` DestinationMint string `json:"destination_mint"` Amount int64 `json:"amount"` Status PaymentStatus `json:"status"` Message sql.NullString `json:"message"` ExpiresAt sql.NullTime `json:"expires_at"` }
type CreateTransactionParams ¶
type CreateTransactionParams struct { PaymentID uuid.UUID `json:"payment_id"` Reference string `json:"reference"` SourceWallet string `json:"source_wallet"` SourceMint string `json:"source_mint"` DestinationWallet string `json:"destination_wallet"` DestinationMint string `json:"destination_mint"` Amount int64 `json:"amount"` DiscountAmount int64 `json:"discount_amount"` TotalAmount int64 `json:"total_amount"` AccruedBonusAmount int64 `json:"accrued_bonus_amount"` Message sql.NullString `json:"message"` Memo sql.NullString `json:"memo"` ApplyBonus sql.NullBool `json:"apply_bonus"` Status TransactionStatus `json:"status"` }
type DeleteTokenParams ¶
type GetTokenParams ¶
type NullPaymentStatus ¶
type NullPaymentStatus struct { PaymentStatus PaymentStatus Valid bool // Valid is true if PaymentStatus is not NULL }
func (*NullPaymentStatus) Scan ¶
func (ns *NullPaymentStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTransactionStatus ¶
type NullTransactionStatus struct { TransactionStatus TransactionStatus Valid bool // Valid is true if TransactionStatus is not NULL }
func (*NullTransactionStatus) Scan ¶
func (ns *NullTransactionStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type Payment ¶
type Payment struct { ID uuid.UUID `json:"id"` ExternalID sql.NullString `json:"external_id"` DestinationWallet string `json:"destination_wallet"` DestinationMint string `json:"destination_mint"` Amount int64 `json:"amount"` Status PaymentStatus `json:"status"` Message sql.NullString `json:"message"` ExpiresAt sql.NullTime `json:"expires_at"` CreatedAt time.Time `json:"created_at"` UpdatedAt sql.NullTime `json:"updated_at"` }
type PaymentStatus ¶
type PaymentStatus string
const ( PaymentStatusNew PaymentStatus = "new" PaymentStatusPending PaymentStatus = "pending" PaymentStatusCompleted PaymentStatus = "completed" PaymentStatusFailed PaymentStatus = "failed" PaymentStatusCanceled PaymentStatus = "canceled" PaymentStatusExpired PaymentStatus = "expired" )
func (*PaymentStatus) Scan ¶
func (e *PaymentStatus) Scan(src interface{}) error
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreatePayment ¶
func (*Queries) CreateTransaction ¶
func (q *Queries) CreateTransaction(ctx context.Context, arg CreateTransactionParams) (Transaction, error)
func (*Queries) DeleteExpiredTokens ¶
func (*Queries) DeleteToken ¶
func (q *Queries) DeleteToken(ctx context.Context, arg DeleteTokenParams) error
func (*Queries) DeleteTokensByCredential ¶
func (*Queries) GetPayment ¶
func (*Queries) GetPaymentByExternalID ¶
func (*Queries) GetPendingTransactions ¶
func (q *Queries) GetPendingTransactions(ctx context.Context) ([]Transaction, error)
func (*Queries) GetTransaction ¶
func (*Queries) GetTransactionByPaymentIDSourceWalletAndMint ¶
func (q *Queries) GetTransactionByPaymentIDSourceWalletAndMint(ctx context.Context, arg GetTransactionByPaymentIDSourceWalletAndMintParams) (Transaction, error)
func (*Queries) GetTransactionByReference ¶
func (*Queries) GetTransactionsByPaymentID ¶
func (*Queries) MarkPaymentsExpired ¶
func (*Queries) MarkTransactionsAsExpired ¶
func (*Queries) StoreToken ¶
func (*Queries) UpdatePaymentStatus ¶
func (*Queries) UpdateTransactionByReference ¶
func (q *Queries) UpdateTransactionByReference(ctx context.Context, arg UpdateTransactionByReferenceParams) (Transaction, error)
type StoreTokenParams ¶
type StoreTokenParams struct { TokenType string `json:"token_type"` Credential string `json:"credential"` AccessTokenID uuid.UUID `json:"access_token_id"` RefreshTokenID uuid.UUID `json:"refresh_token_id"` AccessExpiresAt time.Time `json:"access_expires_at"` RefreshExpiresAt time.Time `json:"refresh_expires_at"` }
type Token ¶
type Token struct { TokenType string `json:"token_type"` Credential string `json:"credential"` AccessTokenID uuid.UUID `json:"access_token_id"` RefreshTokenID uuid.UUID `json:"refresh_token_id"` AccessExpiresAt time.Time `json:"access_expires_at"` RefreshExpiresAt time.Time `json:"refresh_expires_at"` UpdatedAt sql.NullTime `json:"updated_at"` CreatedAt time.Time `json:"created_at"` }
type Transaction ¶
type Transaction struct { ID uuid.UUID `json:"id"` PaymentID uuid.UUID `json:"payment_id"` Reference string `json:"reference"` SourceWallet string `json:"source_wallet"` SourceMint string `json:"source_mint"` DestinationWallet string `json:"destination_wallet"` DestinationMint string `json:"destination_mint"` Amount int64 `json:"amount"` DiscountAmount int64 `json:"discount_amount"` TotalAmount int64 `json:"total_amount"` AccruedBonusAmount int64 `json:"accrued_bonus_amount"` Message sql.NullString `json:"message"` Memo sql.NullString `json:"memo"` ApplyBonus sql.NullBool `json:"apply_bonus"` TxSignature sql.NullString `json:"tx_signature"` Status TransactionStatus `json:"status"` CreatedAt time.Time `json:"created_at"` UpdatedAt sql.NullTime `json:"updated_at"` }
type TransactionStatus ¶
type TransactionStatus string
const ( TransactionStatusPending TransactionStatus = "pending" TransactionStatusCompleted TransactionStatus = "completed" TransactionStatusFailed TransactionStatus = "failed" TransactionStatusExpired TransactionStatus = "expired" )
func (*TransactionStatus) Scan ¶
func (e *TransactionStatus) Scan(src interface{}) error
type UpdatePaymentStatusParams ¶
type UpdatePaymentStatusParams struct { Status PaymentStatus `json:"status"` ID uuid.UUID `json:"id"` }
type UpdateTransactionByReferenceParams ¶
type UpdateTransactionByReferenceParams struct { TxSignature sql.NullString `json:"tx_signature"` Status TransactionStatus `json:"status"` Reference string `json:"reference"` }
Click to show internal directories.
Click to hide internal directories.