internal

package
v0.0.0-...-05ebe4c Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Audience = "https://tmszero.auth0.com/api/v2/"
View Source
const ClientID = "zKvMNhqDmWPU5zNLXRxOSh5VFN4ZSiZk"
View Source
const ClientSecret = "eLv1jal9u4fIU79auoUwJeu-Hzg6RGDPqIoQ38imKAKHntFKOf2zjoT0CUCfH_L4"
View Source
const LIVE_URI = "https://api.paypal.com"
View Source
const OAuthURL = "https://tmszero.auth0.com/oauth/token"
View Source
const SANDBOX_URI = "https://api.sandbox.paypal.com"

Variables

This section is empty.

Functions

func NewDefaultTwilio

func NewDefaultTwilio() *twilio

func NewTwilio

func NewTwilio(sid, token, from string) *twilio

Types

type Auth0Client

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

func NewAuth0Client

func NewAuth0Client() *Auth0Client

func (*Auth0Client) AssignRoles

func (a *Auth0Client) AssignRoles(userid string, roles ...string)

func (*Auth0Client) CreateUser

func (a *Auth0Client) CreateUser(u *User) (err error)

func (*Auth0Client) DeleteUser

func (a *Auth0Client) DeleteUser(userid string)

func (*Auth0Client) GetRole

func (a *Auth0Client) GetRole(role string) *Role

func (*Auth0Client) GetRoles

func (a *Auth0Client) GetRoles(roles ...string) []*Role

func (*Auth0Client) GetUserByID

func (a *Auth0Client) GetUserByID(userid string) *User

func (*Auth0Client) GetUsers

func (a *Auth0Client) GetUsers(query string) []*User

func (*Auth0Client) GetUsersByRole

func (a *Auth0Client) GetUsersByRole(role string) []*User

func (*Auth0Client) ResetPassword

func (a *Auth0Client) ResetPassword(userid string, passwd string)

func (*Auth0Client) SendRequest

func (a *Auth0Client) SendRequest(req *http.Request) (*http.Response, error)

type Client

type Client struct {
	Client   *http.Client
	ClientID string
	Secret   string
	APIBase  string
	Token    *TokenResponse
	// contains filtered or unexported fields
}

func NewClient

func NewClient(env Env) *Client

func (*Client) CaptureOrder

func (c *Client) CaptureOrder(id string) (*http.Response, error)

func (*Client) GetCheckoutOrder

func (c *Client) GetCheckoutOrder(id string) ([]byte, error)

func (*Client) GetPaymentCapture

func (c *Client) GetPaymentCapture(id string) ([]byte, error)

func (*Client) IssueRefund

func (c *Client) IssueRefund(id string, email string) ([]byte, error)

func (*Client) SendWithAuth

func (c *Client) SendWithAuth(req *http.Request) (*http.Response, error)

func (*Client) VerifyWebHookSig

func (c *Client) VerifyWebHookSig(req *http.Request, webhookID string) bool

type Env

type Env int
const (
	SANDBOX Env = iota
	LIVE
)

type Role

type Role struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Desc string `json:"description"`
}

type TokenResponse

type TokenResponse struct {
	Scope       string `json:"scope"`
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	AppID       string `json:"app_id"`
	ExpiresIn   int    `json:"expires_in"`
	Nonce       string `json:"nonce"`
}

type User

type User struct {
	Email       string                     `json:"email"`
	UserID      string                     `json:"user_id,omitempty"`
	Name        string                     `json:"name"`
	AppMetadata map[string]json.RawMessage `json:"app_metadata"`
	Password    string                     `json:"password,omitempty"`
	Connection  string                     `json:"connection,omitempty"`
	Username    string                     `json:"username"`
}

Jump to

Keyboard shortcuts

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