You've already forked monobank-firefly3-bot
Initial
This commit is contained in:
32
monobank/api/client_info/models/client_info_response.go
Normal file
32
monobank/api/client_info/models/client_info_response.go
Normal file
@ -0,0 +1,32 @@
|
||||
package models
|
||||
|
||||
type ClientInfo struct {
|
||||
ClientID string `json:"clientId"`
|
||||
Name string `json:"name"`
|
||||
WebHookURL string `json:"webHookUrl"`
|
||||
Permissions string `json:"permissions"`
|
||||
Accounts []Account `json:"accounts_list"`
|
||||
Jars []Jar `json:"jars"`
|
||||
}
|
||||
|
||||
type Account struct {
|
||||
ID string `json:"id"`
|
||||
SendID string `json:"sendId"`
|
||||
Balance int `json:"balance"`
|
||||
CreditLimit int `json:"creditLimit"`
|
||||
Type string `json:"type"`
|
||||
CurrencyCode int `json:"currencyCode"`
|
||||
CashbackType string `json:"cashbackType"`
|
||||
MaskedPan []string `json:"maskedPan"`
|
||||
Iban string `json:"iban"`
|
||||
}
|
||||
|
||||
type Jar struct {
|
||||
ID string `json:"id"`
|
||||
SendID string `json:"sendId"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
CurrencyCode int `json:"currencyCode"`
|
||||
Balance int `json:"balance"`
|
||||
Goal int `json:"goal"`
|
||||
}
|
19
monobank/api/client_info/requests/client_info.go
Normal file
19
monobank/api/client_info/requests/client_info.go
Normal file
@ -0,0 +1,19 @@
|
||||
package requests
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"main/monobank"
|
||||
models2 "main/monobank/api/client_info/models"
|
||||
)
|
||||
|
||||
func ClientInfo() (models2.ClientInfo, error) {
|
||||
data := models2.ClientInfo{}
|
||||
|
||||
responseJson, err := monobank.Request("GET", "https://firefly3.monobank.ua/personal/client-info", struct{}{})
|
||||
if err != nil {
|
||||
return data, err
|
||||
}
|
||||
json.Unmarshal([]byte(responseJson), &data)
|
||||
|
||||
return data, nil
|
||||
}
|
6
monobank/api/webhook/models/data.go
Normal file
6
monobank/api/webhook/models/data.go
Normal file
@ -0,0 +1,6 @@
|
||||
package models
|
||||
|
||||
type Data struct {
|
||||
Account string `json:"account"`
|
||||
StatementItem StatementItem `json:"statementItem"`
|
||||
}
|
16
monobank/api/webhook/models/statement_item.go
Normal file
16
monobank/api/webhook/models/statement_item.go
Normal file
@ -0,0 +1,16 @@
|
||||
package models
|
||||
|
||||
type StatementItem struct {
|
||||
ID string `json:"id"`
|
||||
Time int `json:"time"`
|
||||
Description string `json:"description"`
|
||||
Mcc int `json:"mcc"`
|
||||
OriginalMcc int `json:"originalMcc"`
|
||||
Amount int `json:"amount"`
|
||||
OperationAmount int `json:"operationAmount"`
|
||||
CurrencyCode int `json:"currencyCode"`
|
||||
CommissionRate int `json:"commissionRate"`
|
||||
CashbackAmount int `json:"cashbackAmount"`
|
||||
Balance int `json:"balance"`
|
||||
Hold bool `json:"hold"`
|
||||
}
|
6
monobank/api/webhook/models/transaction.go
Normal file
6
monobank/api/webhook/models/transaction.go
Normal file
@ -0,0 +1,6 @@
|
||||
package models
|
||||
|
||||
type Transaction struct {
|
||||
Type string `json:"type"`
|
||||
Data Data `json:"data"`
|
||||
}
|
Reference in New Issue
Block a user