Documentation
¶
Index ¶
- func Query(db *datastore.Datastore) datastore.Query
- type PaymentIntent
- func (pi *PaymentIntent) Cancel(reason string) error
- func (pi *PaymentIntent) Capture(amount int64) error
- func (pi *PaymentIntent) Confirm() error
- func (pi *PaymentIntent) Defaults()
- func (pi *PaymentIntent) MarkRequiresCapture(providerRef string)
- func (pi *PaymentIntent) MarkSucceeded(providerRef string, amountReceived int64)
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PaymentIntent ¶
type PaymentIntent struct {
mixin.Model[PaymentIntent]
CustomerId string `json:"customerId,omitempty"`
Amount int64 `json:"amount"`
Currency currency.Type `json:"currency"`
Status Status `json:"status"`
PaymentMethodId string `json:"paymentMethodId,omitempty"`
CaptureMethod string `json:"captureMethod,omitempty"`
ConfirmationMethod string `json:"confirmationMethod,omitempty"`
AmountCapturable int64 `json:"amountCapturable"`
AmountReceived int64 `json:"amountReceived"`
Description string `json:"description,omitempty"`
ReceiptEmail string `json:"receiptEmail,omitempty"`
ProviderRef string `json:"providerRef"`
ProviderType string `json:"providerType"`
CanceledAt time.Time `json:"canceledAt,omitempty"`
CancellationReason string `json:"cancellationReason,omitempty"`
LastError string `json:"lastError,omitempty"`
ClientSecret string `json:"clientSecret,omitempty"`
InvoiceId string `json:"invoiceId,omitempty"`
SetupFutureUsage string `json:"setupFutureUsage,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
func New ¶
func New(db *datastore.Datastore) *PaymentIntent
func (*PaymentIntent) Cancel ¶
func (pi *PaymentIntent) Cancel(reason string) error
Cancel transitions the intent to Canceled.
func (*PaymentIntent) Capture ¶
func (pi *PaymentIntent) Capture(amount int64) error
Capture transitions from RequiresCapture to Succeeded.
func (*PaymentIntent) Confirm ¶
func (pi *PaymentIntent) Confirm() error
Confirm transitions the intent from RequiresConfirmation to Processing.
func (*PaymentIntent) Defaults ¶
func (pi *PaymentIntent) Defaults()
func (*PaymentIntent) MarkRequiresCapture ¶
func (pi *PaymentIntent) MarkRequiresCapture(providerRef string)
MarkRequiresCapture marks the intent as authorized but not yet captured.
func (*PaymentIntent) MarkSucceeded ¶
func (pi *PaymentIntent) MarkSucceeded(providerRef string, amountReceived int64)
MarkSucceeded marks the intent as succeeded after a charge completes.
Click to show internal directories.
Click to hide internal directories.