paymentintent

package
v1.39.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

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 (*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.

type Status

type Status string

Status represents the state of a PaymentIntent.

const (
	RequiresPaymentMethod Status = "requires_payment_method"
	RequiresConfirmation  Status = "requires_confirmation"
	RequiresAction        Status = "requires_action"
	Processing            Status = "processing"
	RequiresCapture       Status = "requires_capture"
	Succeeded             Status = "succeeded"
	Canceled              Status = "canceled"
)

Jump to

Keyboard shortcuts

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