kbank

package
v0.0.0-...-abb3e9e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIKBankCheckBalance            = "/deposit/sight/balance/%v"
	APIKBankRecentAccountActivities = "/deposit/sight/transactions/%v"
	APIKBankTestSSL                 = "/test/ssl"
)

Variables

View Source
var (
	ErrKBankConfigNotDefined = errors.New("kbank config not defined")
)

Functions

func NewKBankError

func NewKBankError(statusCode, messageTH, messageEN *string) thcerror.Error

func NewTestSSLError

func NewTestSSLError(code, errorMsg *string) thcerror.Error

Types

type AccountBalance

type AccountBalance struct {
	AvailableBalance float64
	AccountBalance   float64
	AccountStatus    string
	Error            *thcerror.Error
}

func (*AccountBalance) Status

func (ab *AccountBalance) Status() AccountStatus

type AccountBalanceResponse

type AccountBalanceResponse struct {
	StatusCode     string
	AccountBalance *AccountBalance
	Error          thcerror.Error
}

type AccountStatus

type AccountStatus string
const (
	Active  AccountStatus = "Active"
	Unknown AccountStatus = "Unknown"
)

type CertificateObject

type CertificateObject struct {
	Subject      string
	Issuer       string
	StartDate    string
	ExpireDate   string
	SerialNumber string
}

type CheckBalanceRequest

type CheckBalanceRequest struct {
	AccountNumber string
}

func NewCheckBalanceRequest

func NewCheckBalanceRequest(accountNumber string) *CheckBalanceRequest

type Client

type Client interface {
	SetHttpClient(client *http.Client)

	CheckBalance(request *CheckBalanceRequest) (*AccountBalanceResponse, error)
	RecentAccountActivities(request *RecentAccountActivitiesRequest) (*RecentAccountActivitiesResponse, error)
	TestSSL() (*TestSSLResponse, error)
}

func NewClient

func NewClient(config Config) Client

type Config

type Config struct {
	BaseUrl       string
	PartnerID     string `json:"partner_id"`
	PartnerSecret string `json:"partner_secret"`
}

type RecentAccountActivitiesRequest

type RecentAccountActivitiesRequest struct {
	AccountNumber string
}

func NewRecentAccountActivitiesRequest

func NewRecentAccountActivitiesRequest(accountNumber string) *RecentAccountActivitiesRequest

type RecentAccountActivitiesResponse

type RecentAccountActivitiesResponse struct {
	StatusCode string
	Activities []RecentAccountActivity
	Error      thcerror.Error
}

type RecentAccountActivity

type RecentAccountActivity struct {
	ToAccountNo        *string  `json:"toAccountNo"`
	ToBankCode         *string  `json:"toBankCode"`
	ToAccountName      *string  `json:"toAccountName"`
	ToAccountNameEN    *string  `json:"toAccountNameEN"`
	FromAccountId      *string  `json:"fromAccountId"`
	FromBankCode       *string  `json:"fromBankCode"`
	FromAccountNameTH  *string  `json:"fromAccountNameTH"`
	FromAccountNameEN  *string  `json:"fromAccountNameEN"`
	MerchantCode       *string  `json:"merchantCode"`
	ChannelCode        *string  `json:"channelCode"`
	ChannelDetail      *string  `json:"channelDetail"`
	ServiceBranchNo    string   `json:"serviceBranchNo"`
	ChequeNo           string   `json:"chequeNo"`
	OutstandingBalance float64  `json:"outstandingBalance"`
	FeeAmount          *float64 `json:"feeAmount"`
	TransactionAmount  float64  `json:"txnAmount"`
	TransactionDate    string   `json:"txnDate"`
	TransactionTime    string   `json:"txnTime"`
	TransactionDesc    string   `json:"txnDesc"`
	TransactionDescEN  string   `json:"txnDescEN"`
	EffectiveDate      string   `json:"effectiveDate"`
	ProxyId            *string  `json:"proxyId"`
	ProxyTypeCode      *string  `json:"proxyTypeCode"`
	TellerId           string   `json:"tellerId"`
	DebitCreditFlag    string   `json:"debitCreditFlag"`
}

type TestSSLResponse

type TestSSLResponse struct {
	StatusCode         string
	CertificateStatus  *string
	PartnerStatus      *string
	CertificateObjects []CertificateObject
	Error              thcerror.Error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL