Documentation ¶
Overview ¶
author ATTH
Index ¶
- Constants
- func CreateSignature(msg string) string
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(s int) (string, error)
- func New(id, password, loginType string, options ...interface{}) (*Wallet, *Error)
- func TimestampString() string
- type Activity
- type Data
- type Error
- type Profile
- type Report
- type Transaction
- type Wallet
- func (w *Wallet) ClearToken()
- func (w *Wallet) ConfirmOtp(phone, otp, ref string) *Error
- func (w *Wallet) GetActivities(options ...interface{}) ([]Activity, *Error)
- func (w *Wallet) GetBalance() (string, *Error)
- func (w *Wallet) GetLastTransfer(phone string, money float32, options ...interface{}) (*Activity, *Error)
- func (w *Wallet) GetOtp() (string, *Error)
- func (w *Wallet) GetProfile() (*Profile, *Error)
- func (w *Wallet) GetRawTransaction(options ...interface{}) []byte
- func (w *Wallet) GetReport(id string) (*Report, *Error)
- func (w *Wallet) GetTransaction(options ...interface{}) (*Transaction, *Error)
- func (w *Wallet) Login() *Error
- func (w *Wallet) SetReferenceToken(token string)
- func (w *Wallet) TopupMoney(cashcard string) ([]byte, *Error)
Constants ¶
View Source
const ( RequestError = 1 LoginError = 2 TokenError = 3 UnknownError = 4 OtpError = 5 )
View Source
const ( StatusSuccess = 1 StatusFail = 0 )
Variables ¶
This section is empty.
Functions ¶
func CreateSignature ¶
func GenerateRandomBytes ¶
func GenerateRandomString ¶
func TimestampString ¶
func TimestampString() string
Types ¶
type Profile ¶
type Profile struct { Code string `json:"code"` Data struct { Occupation string `json:"occupation"` Birthdate string `json:"birthdate"` TmnID string `json:"tmnId"` MobileNumber string `json:"mobileNumber"` CurrentBalance string `json:"currentBalance"` ProfileImageStatus string `json:"profileImageStatus"` LastnameEn string `json:"lastnameEn"` HasPassword bool `json:"hasPassword"` Title string `json:"title"` ThaiID string `json:"thaiId"` ProfileType string `json:"profileType"` FirstnameEn string `json:"firstnameEn"` AddressList []struct { AddressID int `json:"addressID"` Address string `json:"address"` Province string `json:"province"` PostalCode string `json:"postalCode"` } `json:"addressList"` ImageURL string `json:"imageURL"` Fullname string `json:"fullname"` Email string `json:"email"` } `json:"data"` }
type Report ¶
type Report struct { Code string `json:"code"` Data struct { ServiceType string `json:"service_type"` Amount float64 `json:"amount"` Section2 struct { Column1 struct { Cell1 struct { Title string `json:"title"` Value string `json:"value"` } `json:"cell1"` Cell2 struct { Title string `json:"title"` Value string `json:"value"` } `json:"cell2"` } `json:"column1"` } `json:"section2"` Section4 struct { Column1 struct { Cell1 struct { Title string `json:"title"` Value string `json:"value"` } `json:"cell1"` } `json:"column1"` Column2 struct { Cell1 struct { Title string `json:"title"` Value string `json:"value"` } `json:"cell1"` } `json:"column2"` } `json:"section4"` } `json:"data"` }
type Transaction ¶
type Wallet ¶
type Wallet struct { MobileTracking string DeviceID string AccessToken string ReferenceToken string Headers map[string]string // contains filtered or unexported fields }
func (*Wallet) ClearToken ¶
func (w *Wallet) ClearToken()
func (*Wallet) ConfirmOtp ¶
func (*Wallet) GetActivities ¶
func (*Wallet) GetBalance ¶
func (*Wallet) GetLastTransfer ¶
func (*Wallet) GetProfile ¶
func (*Wallet) GetRawTransaction ¶
func (*Wallet) GetTransaction ¶
func (w *Wallet) GetTransaction(options ...interface{}) (*Transaction, *Error)
func (*Wallet) SetReferenceToken ¶
Click to show internal directories.
Click to hide internal directories.