Documentation
¶
Index ¶
Constants ¶
View Source
const Version string = "v1.0.0"
Version library go-pg
Variables ¶
View Source
var ( ErrUnimplemented = errors.New("not yet implement for this payment method") ErrMissingParameter = errors.New("missing parameter") ErrInvalidParameter = errors.New("parameter invalid") ErrMissingCredentials = errors.New("missing credentials") ErrInvalidCredentials = errors.New("invalid credentials") ErrMinAmount = errors.New("minimum transaction with e-wallet is Rp100 or ₱1") ErrInvalidPhoneNumber = errors.New("numeric only with min length 2 or max length 13 digit. start with +62 for ID or +63 for PH") )
View Source
var ( True bool = true False bool = false )
View Source
var DefaultOptions = &Options{ Environment: SandBox, }
DefaultOptions define all default value of configuration options payment gateway
Functions ¶
func DisableLogging ¶ added in v0.2.0
func DisableLogging()
DisableLogging set configuration for disable logging
Types ¶
type ApiRequest ¶ added in v0.2.0
type ApiRequest struct { // HttpClient http client request HttpClient *http.Client // Logging logging interface Logging Logging }
type ApiRequestInterface ¶ added in v0.2.0
type ApiRequestInterface interface { // Call do request to target Call(ctx context.Context, httpMethod, url string, header http.Header, body, result interface{}) error // DoRequest to target DoRequest(req *http.Request, result interface{}) error }
ApiRequestInterface defines all api request
func DefaultApiRequest ¶ added in v0.2.0
func DefaultApiRequest() ApiRequestInterface
DefaultApiRequest is default of ApiRequest instance
type EnvironmentType ¶ added in v0.2.0
type EnvironmentType string
const ( // Production environment type for go live to real customer Production EnvironmentType = "production" // SandBox is staging (for development) SandBox EnvironmentType = "sandBox" )
type Logging ¶ added in v0.2.0
type Logging interface { // Print write debug message without format into stdout Print(args ...interface{}) // Printf write debug message with format into stdout Printf(format string, args ...interface{}) // Println write debug message with new line into stdout Println(args ...interface{}) // Warn write warn message without format into stdout Warn(args ...interface{}) // Warnf write warn message with format into stdout Warnf(format string, args ...interface{}) // Error write error message without format into stdout Error(args ...interface{}) // Errorf print error message with format Errorf(format string, args ...interface{}) }
Logging define all method to be implemented as logging only support print, warn and error
var Log Logging
Log global variable to use as a logging interface
type Options ¶ added in v0.2.0
type Options struct { // Environment used for create transaction // Possible values are 'Production' or 'SandBox' // // Default: SandBox Environment EnvironmentType // ClientId is client_id from payment gateway // it can be apiKey or something like that ClientId string // ServerKey is client_secret from payment gateway ServerKey string // ApiCall interface to request outside // // Default: DefaultApiRequest ApiCall ApiRequestInterface // When set to true, this will log your request, response or error to stdout // Use logrus as logging // // Default: true Logging *bool }
Options is the wrap of the params needed for API Call
type PaymentGatewayProvider ¶ added in v0.2.0
type PaymentGatewayProvider int
Click to show internal directories.
Click to hide internal directories.