stripe

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

func PaymentToCard

func PaymentToCard(pay *payment.Payment) *stripe.CardParams

Covert a payment model into a card card we can use for authorization

func StripeSupportedCurrencies

func StripeSupportedCurrencies() []currency.Type

StripeSupportedCurrencies returns all currencies Stripe supports

func SubscriptionToCard

func SubscriptionToCard(sub *subscription.Subscription) *stripe.CardParams

func UpdatePayoutFromStripe

func UpdatePayoutFromStripe(tr *transfer.Transfer, str *Payout)

func UpdateTransferFromStripe

func UpdateTransferFromStripe(tr *transfer.Transfer, str *Transfer)

Update transfer from Stripe

Types

type Card

type Card _stripe.Card

type CardParams

type CardParams _stripe.CardParams

type Charge

type Charge _stripe.Charge

type ChargeListParams

type ChargeListParams _stripe.ChargeListParams

type ChargeParams

type ChargeParams _stripe.ChargeParams

type Client

type Client struct {
	*client.API
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, accessToken string) *Client

func (Client) Authorize

func (c Client) Authorize(pay *payment.Payment) (*Token, error)

Do authorization, return token

func (Client) AuthorizeSubscription

func (c Client) AuthorizeSubscription(sub *subscription.Subscription) (*Token, error)

func (Client) CancelSubscription

func (c Client) CancelSubscription(sub *subscription.Subscription) (*Subscription, error)

Subscribe to a plan

func (Client) Capture

func (c Client) Capture(chargeId string) (*Charge, error)

Capture charge

func (Client) DeleteCard

func (c Client) DeleteCard(cardId string, usr *user.User) (*Card, error)

Update card associated with Stripe customer

func (Client) GetCard

func (c Client) GetCard(cardId string, customerId string) (*Card, error)

Get an exising Stripe card

func (Client) GetCharge

func (c Client) GetCharge(chargeId string) (*Charge, error)

func (Client) GetCustomer

func (c Client) GetCustomer(token string, usr *user.User) (*Customer, error)

Get Stripe customer

func (Client) NewCard

func (c Client) NewCard(token string, usr *user.User) (*Card, error)

func (Client) NewCharge

func (c Client) NewCharge(source interface{}, pay *payment.Payment) (*Charge, error)

Create new charge

func (Client) NewCustomer

func (c Client) NewCustomer(token string, user *user.User) (*Customer, error)

func (Client) NewPlan

func (c Client) NewPlan(p *plan.Plan) (*Plan, error)

Add new subscription to Stripe

func (Client) NewSubscription

func (c Client) NewSubscription(source interface{}, sub *subscription.Subscription) (*Subscription, error)

func (Client) Payout

func (c Client) Payout(tr *transfer.Transfer) (*Payout, error)

func (Client) RefundPayment

func (c Client) RefundPayment(pay *payment.Payment, refundAmount currency.Cents) (*payment.Payment, error)

Attempts to refund payment and updates the payment in datastore

func (Client) Transfer

func (c Client) Transfer(tr *transfer.Transfer) (*Transfer, error)

func (Client) UpdateCard

func (c Client) UpdateCard(token string, usr *user.User) (*Card, error)

Update card associated with Stripe customer

func (Client) UpdateCharge

func (c Client) UpdateCharge(pay *payment.Payment) (*Charge, error)

Update Stripe charge

func (Client) UpdateCustomer

func (c Client) UpdateCustomer(usr *user.User) (*Customer, error)

Update Stripe customer

func (Client) UpdatePlan

func (c Client) UpdatePlan(p *plan.Plan) (*Plan, error)

func (Client) UpdateSubscription

func (c Client) UpdateSubscription(sub *subscription.Subscription) (*Subscription, error)

type Customer

type Customer _stripe.Customer

type Dispute

type Dispute _stripe.Dispute

type Event

type Event struct {
	ID       string             `json:"id"`
	Account  string             `json:"account"`
	Live     bool               `json:"livemode"`
	Created  int64              `json:"created"`
	Data     *_stripe.EventData `json:"data"`
	Webhooks uint64             `json:"pending_webhooks"`
	Type     string             `json:"type"`
	Request  string             `json:"request"`
}

type Payout

type Payout _stripe.Payout

type Plan

type Plan _stripe.Plan

type PlanList

type PlanList _stripe.PlanList

type PlanListParams

type PlanListParams _stripe.PlanListParams

type PlanParams

type PlanParams _stripe.PlanParams

type Reversal

type Reversal _stripe.TransferReversal

type StripeProcessor

type StripeProcessor struct {
	*processor.BaseProcessor
	// contains filtered or unexported fields
}

StripeProcessor implements the processor.PaymentProcessor interface

func NewProcessor

func NewProcessor(accessToken, webhookSecret string) *StripeProcessor

NewProcessor creates a new Stripe processor

func (*StripeProcessor) Authorize

Authorize authorizes a payment without capturing

func (*StripeProcessor) Capture

func (sp *StripeProcessor) Capture(ctx context.Context, transactionID string, amount currency.Cents) (*processor.PaymentResult, error)

Capture captures a previously authorized payment

func (*StripeProcessor) Charge

Charge processes a payment

func (*StripeProcessor) GetTransaction

func (sp *StripeProcessor) GetTransaction(ctx context.Context, txID string) (*processor.Transaction, error)

GetTransaction retrieves transaction details

func (*StripeProcessor) IsAvailable

func (sp *StripeProcessor) IsAvailable(ctx context.Context) bool

IsAvailable checks if the processor is configured and available

func (*StripeProcessor) Refund

Refund processes a refund

func (*StripeProcessor) Type

Type returns the processor type

func (*StripeProcessor) ValidateWebhook

func (sp *StripeProcessor) ValidateWebhook(ctx context.Context, payload []byte, signature string) (*processor.WebhookEvent, error)

ValidateWebhook validates an incoming webhook

type StripeSubscriptionProcessor

type StripeSubscriptionProcessor struct {
	*StripeProcessor
}

StripeSubscriptionProcessor extends StripeProcessor with subscription support

func NewSubscriptionProcessor

func NewSubscriptionProcessor(accessToken, webhookSecret string) *StripeSubscriptionProcessor

NewSubscriptionProcessor creates a processor with subscription support

func (*StripeSubscriptionProcessor) CancelSubscription

func (sp *StripeSubscriptionProcessor) CancelSubscription(ctx context.Context, subscriptionID string, immediately bool) error

CancelSubscription cancels a subscription

func (*StripeSubscriptionProcessor) CreateSubscription

CreateSubscription creates a recurring subscription

func (*StripeSubscriptionProcessor) GetSubscription

func (sp *StripeSubscriptionProcessor) GetSubscription(ctx context.Context, subscriptionID string) (*processor.Subscription, error)

GetSubscription retrieves subscription details

func (*StripeSubscriptionProcessor) ListSubscriptions

func (sp *StripeSubscriptionProcessor) ListSubscriptions(ctx context.Context, customerID string) ([]*processor.Subscription, error)

ListSubscriptions lists subscriptions for a customer

func (*StripeSubscriptionProcessor) UpdateSubscription

func (sp *StripeSubscriptionProcessor) UpdateSubscription(ctx context.Context, subscriptionID string, req processor.SubscriptionUpdate) (*processor.Subscription, error)

UpdateSubscription modifies a subscription

type Subscription

type Subscription _stripe.Subscription

type Token

type Token _stripe.Token

type Transfer

type Transfer _stripe.Transfer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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