Documentation ¶
Index ¶
- Constants
- type Balance
- type Bank
- type BankAccountInquiry
- type CheckIsMaintenance
- type CheckIsOperational
- type Client
- func (c *Client) Call(method, path string, header map[string]string, body io.Reader, v interface{}) (err error, respErr ErrorResponse)
- func (c *Client) ExecuteRequest(req *http.Request, v interface{}) (err error, respErr ErrorResponse)
- func (c *Client) NewRequest(method string, fullPath string, headers map[string]string, body io.Reader) (*http.Request, error)
- type CoreGateway
- func (gateway *CoreGateway) Call(method, path string, header map[string]string, body io.Reader, v interface{}) (err error, respErr ErrorResponse)
- func (gateway *CoreGateway) CheckIsMaintenance() (resp CheckIsMaintenance, respError ErrorResponse, err error)
- func (gateway *CoreGateway) CheckIsOperational() (resp CheckIsOperational, respError ErrorResponse, err error)
- func (gateway *CoreGateway) Disburse(idempotencyKey string, payload DisbursementRequest) (resp Disbursement, respError ErrorResponse, err error)
- func (gateway *CoreGateway) GetAllDisbursement(perPage int, page int) (resp GetAllDisbursement, respError ErrorResponse, err error)
- func (gateway *CoreGateway) GetBankAccountInquiry(bankCode string, accountNumber string) (resp BankAccountInquiry, respError ErrorResponse, err error)
- func (gateway *CoreGateway) GetBanks(bankCode string) (resp []Bank, respError ErrorResponse, err error)
- func (gateway *CoreGateway) GetCurrentBalance() (resp Balance, respError ErrorResponse, err error)
- func (gateway *CoreGateway) GetDisbursementInfo(trxId int) (resp Disbursement, respError ErrorResponse, err error)
- func (gateway *CoreGateway) GetDisbursementQueue(trxId int) (resp DisbursementQueue, respError ErrorResponse, err error)
- type Disbursement
- type DisbursementError
- type DisbursementQueue
- type DisbursementRequest
- type ErrorResponse
- type GeneralErrorResponse
- type GetAllDisbursement
- type HTTPOption
- type LogOption
- type Logger
- func (l *Logger) Ctx(ctx context.Context) *Logger
- func (l *Logger) Debug(format string, v ...interface{})
- func (l *Logger) Error(format string, v ...interface{})
- func (l *Logger) Info(format string, v ...interface{})
- func (l *Logger) Method(name string) *Logger
- func (l *Logger) Str(key string, val string) *Logger
- func (l *Logger) Trace(format string, v ...interface{})
- func (l *Logger) Warn(format string, v ...interface{})
- type Sender
- type ValidationError
Constants ¶
View Source
const ( BankListURL = "/general/banks" BankAccountInquiryURL = "/disbursement/bank-account-inquiry" CurrentBalanceURL = "/general/balance" CheckIsOperationalURL = "/general/operational" CheckIsMaintenanceURL = "/general/maintenance" GetAllDisbursementURL = "/disbursement" GetDisbursementQueueURL = "/disbursement/[trxId]/queue" DisburseURL = "/disbursement" )
View Source
const ( APPLICATION_NAME = "sangu-flip" LOG_KEY_REQ_ID = "req_id" LOG_KEY_METHOD = "method" LOG_KEY_CALLER = "caller" LOG_LEVEL_TRACE = "trace" LOG_LEVEL_DEBUG = "debug" LOG_LEVEL_INFO = "info" LOG_LEVEL_WARN = "warn" LOG_LEVEL_ERROR = "error" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BankAccountInquiry ¶ added in v0.1.2
type CheckIsMaintenance ¶ added in v0.1.5
type CheckIsMaintenance struct {
Maintenance bool `json:"maintenance"`
}
type CheckIsOperational ¶ added in v0.1.5
type CheckIsOperational struct {
Operational bool `json:"operational"`
}
type Client ¶
type Client struct { BaseURL string UserKey string LogLevel int Logger Logger HTTPOption HTTPOption }
Client - Bigflip Client data UserKey is base64 BasicAuth
func (*Client) Call ¶
func (c *Client) Call(method, path string, header map[string]string, body io.Reader, v interface{}) (err error, respErr ErrorResponse)
Call the BigFlip API at specific `path` using the specified HTTP `method`. The result will be given to `v` if there is no error. If any error occurred and Bigflip send error response, the result will be error code, error message and data, otherwise only error code and error message
func (*Client) ExecuteRequest ¶
func (c *Client) ExecuteRequest(req *http.Request, v interface{}) (err error, respErr ErrorResponse)
ExecuteRequest : execute request
type CoreGateway ¶
type CoreGateway struct {
Client Client
}
func (*CoreGateway) Call ¶
func (gateway *CoreGateway) Call(method, path string, header map[string]string, body io.Reader, v interface{}) (err error, respErr ErrorResponse)
func (*CoreGateway) CheckIsMaintenance ¶ added in v0.1.5
func (gateway *CoreGateway) CheckIsMaintenance() (resp CheckIsMaintenance, respError ErrorResponse, err error)
func (*CoreGateway) CheckIsOperational ¶ added in v0.1.5
func (gateway *CoreGateway) CheckIsOperational() (resp CheckIsOperational, respError ErrorResponse, err error)
func (*CoreGateway) Disburse ¶ added in v0.1.5
func (gateway *CoreGateway) Disburse(idempotencyKey string, payload DisbursementRequest) (resp Disbursement, respError ErrorResponse, err error)
func (*CoreGateway) GetAllDisbursement ¶ added in v0.1.5
func (gateway *CoreGateway) GetAllDisbursement(perPage int, page int) (resp GetAllDisbursement, respError ErrorResponse, err error)
func (*CoreGateway) GetBankAccountInquiry ¶ added in v0.1.3
func (gateway *CoreGateway) GetBankAccountInquiry(bankCode string, accountNumber string) (resp BankAccountInquiry, respError ErrorResponse, err error)
func (*CoreGateway) GetBanks ¶
func (gateway *CoreGateway) GetBanks(bankCode string) (resp []Bank, respError ErrorResponse, err error)
func (*CoreGateway) GetCurrentBalance ¶ added in v0.1.5
func (gateway *CoreGateway) GetCurrentBalance() (resp Balance, respError ErrorResponse, err error)
func (*CoreGateway) GetDisbursementInfo ¶ added in v0.1.5
func (gateway *CoreGateway) GetDisbursementInfo(trxId int) (resp Disbursement, respError ErrorResponse, err error)
func (*CoreGateway) GetDisbursementQueue ¶ added in v0.1.5
func (gateway *CoreGateway) GetDisbursementQueue(trxId int) (resp DisbursementQueue, respError ErrorResponse, err error)
type Disbursement ¶ added in v0.1.5
type Disbursement struct { ID uint32 `json:"id"` UserID uint32 `json:"user_id"` Amount uint32 `json:"amount"` Status string `json:"status"` // PENDING, CANCELLED, DONE Timestamp string `json:"timestamp"` // (Format: YYYY-MM-DD H:i:s) BankCode string `json:"bank_code"` AccountNumber string `json:"account_number"` RecipientName string `json:"recipient_name"` SenderBank string `json:"sender_bank"` Remark string `json:"remark"` Receipt string `json:"receipt"` TimeServed string `json:"time_served"` // Will only show valid value when the status is DONE (Format: YYYY-MM-DD H:i:s) BundleID uint32 `json:"bundle_id"` CompanyID uint32 `json:"company_id"` RecipientCity uint32 `json:"recipient_city"` CreatedFrom string `json:"created_from"` Direction string `json:"direction"` Sender *Sender `json:"sender"` Fee uint32 `json:"fee"` }
type DisbursementError ¶ added in v0.1.5
type DisbursementError struct { Code string `json:"code"` Errors []ValidationError `json:"errors"` }
type DisbursementQueue ¶ added in v0.1.5
type DisbursementQueue struct {
Queue uint32 `json:"queue"`
}
type DisbursementRequest ¶ added in v0.1.5
type DisbursementRequest struct { AccountNumber string `json:"account_number" url:"account_number" valid:"required"` BankCode string `json:"bank_code" url:"bank_code" valid:"required"` Amount uint32 `json:"amount" url:"amount" valid:"required"` Remark string `json:"remark" url:"remark"` RecipientCity uint32 `json:"recipient_city" url:"recipient_city"` }
type ErrorResponse ¶ added in v0.1.5
type GeneralErrorResponse ¶ added in v0.1.7
type GetAllDisbursement ¶ added in v0.1.5
type GetAllDisbursement struct { TotalData uint32 `json:"total_data"` DataPerPage uint32 `json:"data_per_page"` TotalPage uint32 `json:"total_page"` Page uint32 `json:"page"` Data []Disbursement `json:"data"` }
type HTTPOption ¶ added in v0.1.5
type HTTPOption struct { Timeout time.Duration BackoffInterval time.Duration MaxJitterInterval time.Duration RetryCount int }
HTTPOption for heimdall properties
type Sender ¶ added in v0.1.5
type Sender struct { SenderName string `json:"sender_name"` PlaceOfBirth uint32 `json:"place_of_birth"` DateOfBirth string `json:"date_of_birth"` // (Format: YYYY-MM-DD) Address string `json:"address"` SenderIdentityType string `json:"sender_identity_type"` SenderIdentityNumber string `json:"sender_identity_number"` SenderCountry int16 `json:"sender_country"` Job string `json:"babu"` }
type ValidationError ¶ added in v0.1.5
Click to show internal directories.
Click to hide internal directories.