refund

package
v1.42.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

Types

type Refund

type Refund struct {
	mixin.Model[Refund]

	Amount          int64                  `json:"amount"`
	Currency        currency.Type          `json:"currency"`
	Status          Status                 `json:"status"`
	ProviderRef     string                 `json:"providerRef"`
	Reason          string                 `json:"reason,omitempty"`
	ReceiptNumber   string                 `json:"receiptNumber,omitempty"`
	FailureReason   string                 `json:"failureReason,omitempty"`
	PaymentIntentId string                 `json:"paymentIntentId,omitempty"`
	InvoiceId       string                 `json:"invoiceId,omitempty"`
	Metadata        map[string]interface{} `json:"metadata,omitempty"`
}

Refund represents a reversal of a previous payment.

func New

func New(db *datastore.Datastore) *Refund

func (*Refund) Defaults

func (r *Refund) Defaults()

func (*Refund) MarkFailed

func (r *Refund) MarkFailed(reason string) error

MarkFailed transitions the refund to Failed with a reason.

func (*Refund) MarkSucceeded

func (r *Refund) MarkSucceeded() error

MarkSucceeded transitions the refund to Succeeded.

type Status

type Status string

Status represents the state of a refund.

const (
	Pending   Status = "pending"
	Succeeded Status = "succeeded"
	Failed    Status = "failed"
	Canceled  Status = "canceled"
)

Jump to

Keyboard shortcuts

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