Documentation ¶
Index ¶
- type AccountBalance
- type AccountStatement
- type AccountStatementResponse
- type AuthToken
- type BalanceInfoResponse
- type Client
- type ClientImplementation
- func (c *ClientImplementation) Call(method, path, accessToken string, body io.Reader, v interface{}) error
- func (c *ClientImplementation) CallRaw(method, path, contentType string, headers http.Header, body io.Reader, ...) error
- func (c *ClientImplementation) Do(req *http.Request, v interface{}) error
- func (c *ClientImplementation) NewRequest(method, path, contentType string, headers http.Header, body io.Reader) (*http.Request, error)
- type Config
- type Error
- type ErrorLang
- type FundTransferRequest
- type FundTransferResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalance ¶
type AccountBalance struct { AccountNumber string Currency string `json:",omitempty"` Balance float64 `json:",string"` AvailableBalance float64 `json:",string"` FloatAmount float64 `json:",string"` HoldAmount float64 `json:",string"` Plafon float64 `json:",string"` Indonesian string `json:",omitempty"` English string `json:",omitempty"` }
AccountBalance represents account balance information
type AccountStatement ¶
type AccountStatement struct { TransactionDate string BranchCode string TransactionType string TransactionAmount float64 `json:",string"` TransactionName string Trailer string }
AccountStatement represents account statement information
type AccountStatementResponse ¶
type AccountStatementResponse struct { Error StartDate string EndDate string Currency string StartBalance float64 `json:",string"` Data []AccountStatement }
AccountStatementResponse represents account statement response message
type AuthToken ¶
type AuthToken struct { Error AccessToken string `json:"access_token"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` Scope string `json:"scope"` }
AuthToken represents response of BCA OAuth 2.0 response message
type BalanceInfoResponse ¶
type BalanceInfoResponse struct { Error AccountDetailDataSuccess []AccountBalance `json:",omitempty"` AccountDetailDataFailed []AccountBalance `json:",omitempty"` }
BalanceInfoResponse represents account balance information response message
type Client ¶
type Client interface { Call(method, path string, body io.Reader, v interface{}) error CallRaw(method, path string, headers http.Header, body io.Reader, v interface{}) error }
Client is an interface for making call to BCA API
type ClientImplementation ¶
type ClientImplementation struct { APIKey string APISecret string OriginHost string URL string HTTPClient *http.Client LogLevel int Logger *log.Logger }
ClientImplementation represents config that used for HTTP client needs
func NewClient ¶
func NewClient(cfg Config) ClientImplementation
NewClient is used to initialize new ClientImplementation
func (*ClientImplementation) Call ¶
func (c *ClientImplementation) Call(method, path, accessToken string, body io.Reader, v interface{}) error
Call is the implementation for invoking BCA API with its authentication
func (*ClientImplementation) CallRaw ¶
func (c *ClientImplementation) CallRaw(method, path, contentType string, headers http.Header, body io.Reader, v interface{}) error
CallRaw is the implementation for invoking API without any wrapper
type Config ¶
type Config struct { ClientID string ClientSecret string APIKey string APISecret string URL string CorporateID string OriginHost string LogLevel int }
Config represents configuration that needed by BCA API
type FundTransferRequest ¶
type FundTransferRequest struct { CorporateID string SourceAccountNumber string TransactionID string TransactionDate string ReferenceID string CurrencyCode string Amount float64 `json:",string"` BeneficiaryAccountNumber string Remark1 string Remark2 string }
FundTransferRequest represents fund transfer request message