-
Notifications
You must be signed in to change notification settings - Fork 2
/
NotTest.dpr
55 lines (48 loc) · 1.07 KB
/
NotTest.dpr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
program NotTest;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
System.DateUtils,
Monobank in 'Monobank.pas',
Monobank.Types in 'Monobank.Types.pas',
Fix.REST.Client in 'Fix.REST.Client.pas';
procedure Main;
var
Mono: TMonobank;
Currency: TmonoCurrencyInfo;
UserInfo: TmonoUserInfo;
LAccount: TmonoAccount;
LStatement: TmonoStatementItem;
begin
Mono := TMonobank.Create;
Mono.Token := 'uGf9lM';
try
for Currency in Mono.Currency do
begin
Writeln(Currency.CurrencyCodeA);
end;
UserInfo := Mono.ClientInfo;
Writeln(UserInfo.Name);
for LAccount in UserInfo.accounts do
begin
for LStatement in Mono.Statement(LAccount.id, IncDay(Now, -7), Now) do
begin
Writeln(LAccount.currencyCode.ToString, ' ', DateToStr(UnixToDateTime(LStatement.time)),
' ', LStatement.amount);
end;
end;
finally
Mono.Free;
end;
end;
begin
try
Main;
{ TODO -oUser -cConsole Main : Insert code here }
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.