stripeoauth

package
v0.3.0-rc.7-linux-arm64 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package stripeoauth implements the Stripe Apps grant exchange.

Index

Constants

View Source
const Scope = "stripe_apps"

Variables

View Source
var (
	ErrInvalidGrant = xerror.New(xerror.KindInvalidInput, "STRIPE_INVALID_GRANT", "Stripe OAuth grant is invalid")
)

Functions

This section is empty.

Types

type Client

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

func New

func New(config Config) (*Client, error)

func (*Client) AuthorizationURL

func (c *Client) AuthorizationURL(state string) (string, error)

func (*Client) ExchangeCode

func (c *Client) ExchangeCode(ctx context.Context, code string) (TokenSet, error)

func (*Client) Refresh

func (c *Client) Refresh(ctx context.Context, token string) (TokenSet, error)

type Config

type Config struct {
	Mode         string
	InstallURL   string
	DeveloperKey string
	RedirectURI  string
}

func (Config) Enabled

func (c Config) Enabled() bool

func (Config) Validate

func (c Config) Validate() error

type TokenSet

type TokenSet struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	AccountID    string `json:"stripe_user_id"`
	Scope        string `json:"scope"`
	TokenType    string `json:"token_type"`
	LiveMode     *bool  `json:"livemode"`
}

Jump to

Keyboard shortcuts

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