stripe

package
v0.5.16 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InAppPurchaseSuccess = "payment_intent.succeeded"
	InAppPurchaseFail    = "payment_intent.payment_failed"
)
View Source
const (
	CheckoutSeesionPaid              = "paid"                // 已支付
	CheckoutSeesionNoPaymentRequired = "no_payment_required" // 无需支付
	CheckoutSeesionUnpaid            = "unpaid"              // 未支付
)
View Source
const (
	CheckoutSeesionCompleted = "checkout.session.completed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildPaymentLinkConfig

type BuildPaymentLinkConfig struct {
	TradeNo  string
	Price    string
	Quantity int
	Metadata map[string]string
}

type Option

type Option func(*Options)

func WithSecretKey

func WithSecretKey(secretKey string) Option

func WithWebhookSecret

func WithWebhookSecret(webhookSecret string) Option

type Options

type Options struct {
	SecretKey     string
	WebhookSecret string
}

type Stripe

type Stripe struct {
	// contains filtered or unexported fields
}

func NewStripe

func NewStripe(opts ...Option) *Stripe

func (*Stripe) BuildPaymentLinkURL

func (s *Stripe) BuildPaymentLinkURL(conf *BuildPaymentLinkConfig) (string, error)

func (*Stripe) Provide

func (s *Stripe) Provide(ctx context.Context) any

func (*Stripe) VerifyPaymentIntentWebhook

func (s *Stripe) VerifyPaymentIntentWebhook(req *http.Request) (*stripe.CheckoutSession, error)

Jump to

Keyboard shortcuts

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