Documentation
¶
Index ¶
- Constants
- func MustGetTestKey() string
- func PaginateURL(path string, count, offset int) string
- type Client
- func (c *Client) Call(ctx context.Context, method, path string, body, v interface{}) error
- func (c *Client) CheckBalance(ctx context.Context) (response.Response, error)
- func (c *Client) GetSessionTimeout(ctx context.Context) (response.Response, error)
- func (c *Client) ResolveCardBIN(ctx context.Context, bin int) (response.Response, error)
- func (c *Client) UpdateSessionTimeout(ctx context.Context, timeout int) (response.Response, error)
- type DefaultPaystackService
- type Logger
- type Metadata
- type Service
Constants ¶
View Source
const ( // DefaultHTTPTimeout defaultHTTPTimeout is the default timeout on the http Client DefaultHTTPTimeout = 60 * time.Second // base URL for all Paystack API requests BaseURL = "https://api.paystack.co" )
Variables ¶
This section is empty.
Functions ¶
func MustGetTestKey ¶
func MustGetTestKey() string
Types ¶
type Client ¶
type Client struct { Client *http.Client // HTTP Client used to communicate with the API. // the API Key used to authenticate all Paystack API requests Key string BaseURL *url.URL LoggingEnabled bool }
Client manages communication with the Paystack API
func (*Client) CheckBalance ¶
CheckBalance docs https://developers.paystack.co/v1.0/reference#resolve-card-bin
func (*Client) GetSessionTimeout ¶
GetSessionTimeout fetches payment session timeout
func (*Client) ResolveCardBIN ¶
ResolveCardBIN docs https://developers.paystack.co/v1.0/reference#resolve-card-bin
type DefaultPaystackService ¶
type DefaultPaystackService struct {
Client *Client
}
type Logger ¶
type Logger interface {
Printf(format string, v ...interface{})
}
Logger interface for custom loggers
type Metadata ¶
type Metadata map[string]interface{}
Metadata is an key-value pairs added to Paystack API requests
type Service ¶
type Service interface { Call(ctx context.Context, method, path string, body, v interface{}) error ResolveCardBIN(ctx context.Context, bin int) (response.Response, error) CheckBalance(ctx context.Context) (response.Response, error) GetSessionTimeout(ctx context.Context) (response.Response, error) UpdateSessionTimeout(ctx context.Context, timeout int) (response.Response, error) // contains filtered or unexported methods }
Click to show internal directories.
Click to hide internal directories.