stripe

package
v0.1.913 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Blackbox

type Blackbox interface {
	// contains filtered or unexported methods
}

type Client

type Client interface {
	Blackbox
	contract.StripeOperator
}

func NewClient

func NewClient(d Dependencies, opts ClientOptions) (Client, error)

func NewNoopClient added in v0.1.859

func NewNoopClient() Client

type ClientOption

type ClientOption = contract.Opt[ClientOptions]

func WithLoaded

func WithLoaded(x Loaded) ClientOption

type ClientOptions

type ClientOptions struct {
	Loaded
}

func ApplyClientOptions

func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions

type DefaultTool

type DefaultTool struct {
	T *contract.Tool[Client]
}

func NewTool

func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool

func (*DefaultTool) AddStripeCard

AddStripeCard adds a card as a Stripe payment method.

func (*DefaultTool) ConfirmStripePayment

ConfirmStripePayment confirms an existing Stripe PaymentIntent.

func (*DefaultTool) ConfirmStripeSetupIntent

ConfirmStripeSetupIntent confirms an existing SetupIntent.

CreateStripeAccountLink creates an onboarding or refresh account link for a Stripe account.

func (*DefaultTool) DecodeStripeEvent

func (d *DefaultTool) DecodeStripeEvent(ctx context.Context, opts contract.DecodeStripeEventOptions) (*stripeApi.Event, error)

DecodeStripeEvent decodes a Stripe webhook event.

func (*DefaultTool) DeleteStripeAccount

func (d *DefaultTool) DeleteStripeAccount(ctx context.Context, opts contract.DeleteStripeAccountOptions) (*stripeApi.Account, error)

DeleteStripeAccount deletes a Stripe account by ID.

func (*DefaultTool) DeleteStripeBankAccount

func (d *DefaultTool) DeleteStripeBankAccount(ctx context.Context, opts contract.DeleteStripeBankAccountOptions) error

DeleteStripeBankAccount deletes a bank account.

func (*DefaultTool) LinkStripeBankAccount

LinkStripeBankAccount links a bank account.

func (*DefaultTool) OpenStripeAccount

func (d *DefaultTool) OpenStripeAccount(ctx context.Context, opts contract.OpenStripeAccountOptions) (*stripeApi.Account, error)

OpenStripeAccount creates a new Stripe account using the provided options.

func (*DefaultTool) OpenStripePayment

OpenStripePayment creates a Stripe PaymentIntent and applies Fabriktor fees.

Fee behavior:

  • Computes a rate-based application fee using X100000 precision and banker’s rounding.
  • If bypassed, no Stripe call is made and a dummy succeeded intent is returned with a flat manual fee.
  • For non-payroll payments, the computed fee is applied directly to the intent.
  • For payroll payments, the intent is created without fees; the computed fee is attached to the returned intent for later manual charging in a separate flow.

Account routing: - Payments paid to Fabriktor use the platform account. - Payments paid to a contractor use the connected account.

func (*DefaultTool) RefundStripePayment

func (d *DefaultTool) RefundStripePayment(ctx context.Context, opts contract.RefundStripePaymentOptions) (*stripeApi.Refund, error)

RefundStripePayment creates a refund for an existing Stripe payment.

func (*DefaultTool) SortStripeBalance

SortStripeBalance groups Stripe balance amounts by availability.

func (*DefaultTool) StripeBalance

StripeBalance retrieves Stripe balance.

func (*DefaultTool) StripePaymentIntent

StripePaymentIntent retrieves a Stripe payment intent by ID.

func (*DefaultTool) StripePaymentMethod

StripePaymentMethod retrieves a Stripe payment method by ID.

func (*DefaultTool) UpdateStripeBankAccount

UpdateStripeBankAccount updates a bank account.

func (*DefaultTool) VerifyStripeCard

VerifyStripeCard creates a SetupIntent to verify a card.

type Loaded

type Loaded struct {
	AccountID      string
	APIKey         string
	APIKeyTest     string
	SecWebhook     string
	SecWebhookTest string
}

type StripeClientDependencies

type StripeClientDependencies struct {
	E contract.EnvironmentOperator
	H *http.Client
}

type StripeClientOptions

type StripeClientOptions struct {
	Loaded
}

type Tool

type Tool interface {
	contract.StripeOperator
}

Jump to

Keyboard shortcuts

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