setupintent

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 5 Imported by: 0

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