setupintent

package
v1.46.25 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 5 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

Query returns a datastore query for setup intents.

Types

type SetupIntent

type SetupIntent struct {
	mixin.Model[SetupIntent]

	CustomerId         string                 `json:"customerId,omitempty"`
	PaymentMethodId    string                 `json:"paymentMethodId,omitempty"`
	Status             Status                 `json:"status"`
	Usage              string                 `json:"usage,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"`
	Metadata           map[string]interface{} `json:"metadata,omitempty"`
}

SetupIntent represents a flow to save a payment method for future use.

func New

New creates a new SetupIntent wired to the given datastore.

func (*SetupIntent) Cancel

func (si *SetupIntent) Cancel(reason string) error

Cancel transitions the setup intent to Canceled.

func (*SetupIntent) Confirm

func (si *SetupIntent) Confirm() error

Confirm transitions the setup intent to Processing.

func (*SetupIntent) MarkSucceeded

func (si *SetupIntent) MarkSucceeded(providerRef string)

MarkSucceeded marks the setup intent as succeeded.

type Status

type Status string

Status represents the state of a SetupIntent.

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

Jump to

Keyboard shortcuts

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