paymentintent

package
v1.42.51 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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