stripe

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Caps added in v0.14.0

func Caps() app.ChannelCaps

Caps is the package-level capability single source: the instance method and the DisabledChannel stub (Disabled) share it, so an unconfigured stripe's admin card keeps its priority slot (200, between waffo 100 and paypal 300).

CancelTiming=immediate (LC-4, 2026-10-26 audit correction): CancelSubscription calls Subscriptions.Cancel — DELETE /v1/subscriptions/{id} — which cancels the subscription immediately. Evidence from the vendored stripe-go v87 (subscription.go): SubscriptionCancelParams carries InvoiceNow/Prorate, the final-invoice / unused-time-credit flags that only make sense for an immediate cancel; the period-end variant is cancel_at_period_end=true on the subscription UPDATE path (SubscriptionParams.CancelAtPeriodEnd), a call this adapter never makes. So the local plan may flip to free right away.

func Disabled added in v0.14.0

func Disabled() app.PaymentChannel

Disabled returns the stripe placeholder for the "no secret key" branch of a product's channel factory: registered into the ChannelSet so the admin billing-channels page shows stripe's card (schema renders, credentials can be pasted and saved — the BC-5 chicken-and-egg fix), while OrderedNames filters it out of the active checkout set. Returning the stub instead of nil also removes the typed-nil trap from factory wiring.

func Schema added in v0.14.0

func Schema() []app.FieldSpec

Schema is the package-level ConfigSchema single source (BC-6): the admin channel card, the billing_channel.stripe.* settings keys and the product factory's field lookups all read one descriptor — the instance method delegates here, and Disabled() carries the same schema so the card renders the paste-credentials form before any key exists.

Types

type Channel

type Channel struct {
	SecretKey         string
	WebhookSigningKey string
	// contains filtered or unexported fields
}

func New

func New(secretKey, webhookSigningKey string) *Channel

func (*Channel) CancelCheckout

func (c *Channel) CancelCheckout(ctx context.Context, sessionRef string) error

func (*Channel) CancelSubscription

func (c *Channel) CancelSubscription(ctx context.Context, providerSubID string) error

func (*Channel) Capabilities added in v0.13.0

func (c *Channel) Capabilities() app.ChannelCaps

func (*Channel) ChannelConfig

func (c *Channel) ChannelConfig() app.ChannelConfigInfo

func (*Channel) ConfigSchema added in v0.13.0

func (c *Channel) ConfigSchema() []app.FieldSpec

func (*Channel) CreateCheckout

func (c *Channel) CreateCheckout(ctx context.Context, req app.CheckoutRequest) (domain.CheckoutSession, error)

func (*Channel) EnvProvidedKeys added in v0.13.0

func (c *Channel) EnvProvidedKeys() []string

EnvProvidedKeys implements app.ChannelEnvViewer (billing fix #6): it lists the schema keys whose env var is currently set, so the admin API can allow clearing a required field ("empty DB row = fall back to env") and the card can surface the env fallback to the frontend.

func (*Channel) Name

func (c *Channel) Name() string

func (*Channel) ParseWebhook

func (c *Channel) ParseWebhook(ctx context.Context, req app.WebhookRequest) (domain.PaymentEvent, error)

func (*Channel) TestConnection

func (c *Channel) TestConnection(ctx context.Context) error

Jump to

Keyboard shortcuts

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