stripe

package
v0.0.0-...-9d843bf Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PaymentProcessor

type PaymentProcessor interface {
	GetName() string
	GetProducts() ([]PaymentProcessorProduct, error)
	GetWebhookSecretKey() string
	CreateCustomer(fullName, email, descr, shipName, shipPhone, shipCity, shipCountry, shipLine1, shipLine2, shipPostalCode, shipState, billCity, billCountry, billLine1, billLine2, billPostalCode, billState string) (*string, error)
	UpdateCustomer(customerID, fullName, email, descr, shipName, shipPhone, shipCity, shipCountry, shipLine1, shipLine2, shipPostalCode, shipState, billCity, billCountry, billLine1, billLine2, billPostalCode, billState string) error
	SetupNewCard(customerID string) (secret *string, err error)
	CreateSubscriptionCheckoutSessionURL(domain, successURL, canceledURL, customerID, priceID string, metadata map[string]string, customerHasShippingAddress bool) (string, error)
	CreateOneTimeCheckoutSessionURL(domain, successCallbackURL, canceledCallbackURL, customerID, priceID string, metadata map[string]string, customerHasShippingAddress bool) (string, error)
	GetCheckoutSession(sessionID string) (*stripe.CheckoutSession, error)
	GetCheckoutSessionLineItems(sessionID string) ([]*stripe.LineItem, error)
	GetCustomer(customerID string) (*stripe.Customer, error)
	ListInvoicesByCustomerID(customerID string) ([]*stripe.Invoice, error)
	GetPaymentIntent(paymentIntentID string) (*stripe.PaymentIntent, error)
	GetLatestInvoiceByCustomerID(customerID string) (*stripe.Invoice, error)
	GetPrice(priceID string) (*stripe.Price, error)
}

func NewPaymentProcessor

func NewPaymentProcessor(cfg *c.Conf, logger *slog.Logger, uuidp uuid.Provider) PaymentProcessor

type PaymentProcessorProduct

type PaymentProcessorProduct struct {
	ProductID string
	PriceID   string
	Price     int64
}

PaymentProcessorProduct Structure represents the product that exists on record in the payment processor's database.

Jump to

Keyboard shortcuts

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