Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type Credentials
- type Midtrans
- type PG
- func (p *PG) CreateEWalletCharge(e *mds.EWallet) (*mds.ChargeResponse, error)
- func (p *PG) CreateEWalletChargeWithContext(ctx context.Context, e *mds.EWallet) (*mds.ChargeResponse, error)
- func (p *PG) SetMidtransCredentials(clientSecret string) error
- func (p *PG) SetProduction()
- func (p *PG) SetXenditCredentials(clientSecret string) error
- type Xendit
Constants ¶
View Source
const ( Production env = "production" Staging env = "staging" )
Variables ¶
View Source
var ( ErrInvalidParameter = errors.New("parameter invalid") ErrNilCredentials = errors.New("credentials nil") )
View Source
var DefaultConfig = &Config{ Environment: Staging, Logging: true, LogFunc: utils.NewLogger(), }
DefaultConfig define all default value of configuration payment gateway
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Set the environment gateway // // Default: Staging Environment env `json:"environment"` // When set to true, this will log your request, response or error to stdout // Use logrus as logging // // Default: true Logging bool `json:"logging"` // Format log when Logging is set to true // // Default: logrus.TextFormatter | [ts] - [level] - [message] LogFunc *logrus.Logger `json:"log_func"` }
type Credentials ¶
type Midtrans ¶
type Midtrans struct {
// contains filtered or unexported fields
}
Midtrans configuration
type PG ¶
type PG struct {
// contains filtered or unexported fields
}
func (*PG) CreateEWalletCharge ¶
CreateEWalletCharge charge a payment e-wallet to payment gateway midtrans
func (*PG) CreateEWalletChargeWithContext ¶
func (p *PG) CreateEWalletChargeWithContext(ctx context.Context, e *mds.EWallet) (*mds.ChargeResponse, error)
CreateEWalletChargeWithContext charge a payment e-wallet with context
func (*PG) SetMidtransCredentials ¶
SetMidtransCredentials for access Midtrans Core API
func (*PG) SetProduction ¶
func (p *PG) SetProduction()
SetProduction environment and base url gateway
func (*PG) SetXenditCredentials ¶
SetXenditCredentials for access Xendit API
Click to show internal directories.
Click to hide internal directories.