Documentation ¶
Index ¶
- type AccessToken
- type Auth
- type Balance
- type ErrorResp
- type Login
- type Login2FA
- type Notifications
- type Ovo
- func (o *Ovo) GetAllBalances(ctx context.Context) (*RespBalance, error)
- func (o *Ovo) GetAllNotifications(ctx context.Context) ([]Notifications, error)
- func (o *Ovo) GetBudgets(ctx context.Context) (*RespBudget, error)
- func (o *Ovo) GetCountUnreadNotifications(ctx context.Context) (*int, error)
- func (o *Ovo) GetRefBank(ctx context.Context) (*RefBank, error)
- type OvoCash
- type OvoMain
- type OvoPoint
- type RefBank
- type RespBalance
- type RespBudget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type AccessToken struct { Mobile string `json:"mobile,omitempty"` Email string `json:"email,omitempty"` FullName string `json:"fullName,omitempty"` IsEmailVerified bool `json:"isEmailVerified,omitempty"` IsSecurityCodeSet bool `json:"isSecurityCodeSet,omitempty"` UpdateAccessToken string `json:"updateAccessToken,omitempty"` }
AccessToken stores response from Login2FAVerify()
type Auth ¶
type Auth struct { Token string `json:"token,omitempty"` TokenSeed string `json:"tokenSeed,omitempty"` TimeStamp int `json:"timeStamp,omitempty"` TokenSeedExpiredAt int `json:"tokenSeedExpiredAt,omitempty"` DisplayMessage interface{} `json:"displayMessage,omitempty"` Email string `json:"email,omitempty"` FullName string `json:"fullName,omitempty"` IsEmailVerified bool `json:"isEmailVerified,omitempty"` IsSecurityCodeSet bool `json:"isSecurityCodeSet,omitempty"` UpdateAccessToken string `json:"updateAccessToken,omitempty"` }
Auth stores response from LoginSecurityCode()
type Balance ¶
type Balance struct { OvoPoint OvoPoint `json:"600"` OvoMain OvoMain `json:"000"` OvoCash OvoCash `json:"001"` }
Balance holds balances response
type ErrorResp ¶
type ErrorResp struct { Message string `json:"message,omitempty"` Code int `json:"code,omitempty"` URL string `json:"url,omitempty"` Method string `json:"method,omitempty"` RemoteAddress string `json:"remoteAddress,omitempty"` Unixtime int `json:"unixtime,omitempty"` Retry int `json:"retry,omitempty"` Timestamp int `json:"timestamp,omitempty"` Content struct { Present bool `json:"present,omitempty"` } `json:"content,omitempty"` }
ErrorResp stores responses error from ovo API
type Login ¶
type Login struct { DeviceID string `json:"deviceId,omitempty"` Mobile string `json:"mobile,omitempty"` AppVersion string `json:"appVersion,omitempty"` MacAddress string `json:"macAddress,omitempty"` OsName string `json:"osName,omitempty"` OsVersion string `json:"osVersion,omitempty"` PushNotificationID string `json:"pushNotificationId,omitempty"` RefID string `json:"refId,omitempty"` VerificationCode string `json:"verificationCode,omitempty"` DeviceUnixtime int64 `json:"deviceUnixtime"` SecurityCode string `json:"securityCode"` UpdateAccessToken string `json:"updateAccessToken"` Message string `json:"message"` }
Login struct hold needed login field to interact with ovo API
func NewOvoLogin ¶
NewOvoLogin initialize phone number and get login to ovo API
func (*Login) Login2FAVerify ¶
func (l *Login) Login2FAVerify(ctx context.Context, refID, verificationCode string) (*AccessToken, error)
Login2FAVerify is verify OTP sent to phonenumber
type Login2FA ¶
type Login2FA struct {
RefID string `json:"refId,omitempty"`
}
Login2FA holds response when call Login2FA
type Notifications ¶
type Notifications struct { ID string `json:"id"` ChannelType string `json:"channelType"` MessageType string `json:"messageType"` Subject interface{} `json:"subject"` Message string `json:"message"` DateCreated string `json:"dateCreated"` Status string `json:"status"` Receiver struct { ID string `json:"id"` Type string `json:"type"` } `json:"receiver"` }
Notifications holds response from GetAllNotifications()
type Ovo ¶
Ovo holds struct token and hold methods
func (*Ovo) GetAllBalances ¶
func (o *Ovo) GetAllBalances(ctx context.Context) (*RespBalance, error)
GetAllBalances gets all balances in account
func (*Ovo) GetAllNotifications ¶
func (o *Ovo) GetAllNotifications(ctx context.Context) ([]Notifications, error)
GetAllNotifications gets all notifications
func (*Ovo) GetBudgets ¶
func (o *Ovo) GetBudgets(ctx context.Context) (*RespBudget, error)
GetBudgets gets all budget in account
func (*Ovo) GetCountUnreadNotifications ¶
GetCountUnreadNotifications get count number of notification that unread will return pointer of int because the number can be zero
type OvoCash ¶
type OvoCash struct { CardBalance int `json:"card_balance"` CardNo string `json:"card_no"` PaymentMethod string `json:"payment_method"` }
OvoCash holds balance from ovocash
type OvoMain ¶
type OvoMain struct { CardBalance int `json:"card_balance"` CardNo string `json:"card_no"` PaymentMethod string `json:"payment_method"` }
OvoMain holds balance from ovomain
type OvoPoint ¶
type OvoPoint struct { CardBalance float64 `json:"card_balance"` CardNo string `json:"card_no"` PaymentMethod string `json:"payment_method"` }
OvoPoint holds balance from ovopoint
type RefBank ¶
type RefBank struct { BankTypes []struct { ID int `json:"id"` Name string `json:"name"` Isdefault int `json:"isdefault"` Value string `json:"value"` } `json:"bankTypes"` BankTypeDefault interface{} `json:"bankTypeDefault"` }
RefBank holds response GetRefBank()
type RespBalance ¶
type RespBalance struct {
Balance Balance `json:"balance"`
}
RespBalance holds response from GetAllBalance
type RespBudget ¶
type RespBudget struct { Budget struct { Amount int `json:"amount"` Spending int `json:"spending"` } `json:"budget"` TotalSpending int `json:"totalSpending"` CycleDate int `json:"cycleDate"` Summary []struct { Amount int `json:"amount"` CategoryID int `json:"categoryId"` Spending int `json:"spending"` } `json:"summary"` }
RespBudget holds response from GetAllBudgets()