forked from Al-Muhandis/yookassa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathYooKassa.API.Payment.pas
More file actions
183 lines (164 loc) · 4.93 KB
/
YooKassa.API.Payment.pas
File metadata and controls
183 lines (164 loc) · 4.93 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
unit YooKassa.API.Payment;
interface
uses
Rest.Json, Rest.Json.Types;
type
TRecipient = class
private
[JsonNameAttribute('account_id')]
FAccountId: string;
[JsonNameAttribute('gateway_id')]
FGatewayId: string;
public
property AccountId: string read FAccountId write FAccountId;
property GatewayId: string read FGatewayId write FGatewayId;
end;
TCardProduct = class
private
[JsonNameAttribute('code')]
FCode: string;
[JsonNameAttribute('name')]
FName: string;
public
property Code: string read FCode write FCode;
property Name: string read FName write FName;
end;
TCard = class
private
[JsonNameAttribute('first6')]
FFirst6: string;
[JsonNameAttribute('last4')]
FLast4: string;
[JsonNameAttribute('expiry_month')]
FExpiryMonth: TDateTime;
[JsonNameAttribute('expiry_year')]
FExpiryYear: string;
[JsonNameAttribute('card_type')]
FCardType: string;
[JsonNameAttribute('card_product')]
FCardProduct: TCardProduct;
[JsonNameAttribute('issuer_country')]
FIssuerCountry: string;
[JsonNameAttribute('issuer_name')]
FIssuerName: string;
public
property First6: string read FFirst6 write FFirst6;
property Last4: string read FLast4 write FLast4;
property ExpiryMonth: TDateTime read FExpiryMonth write FExpiryMonth;
property ExpiryYear: string read FExpiryYear write FExpiryYear;
property CardType: string read FCardType write FCardType;
property CardProduct: TCardProduct read FCardProduct write FCardProduct;
property IssuerCountry: string read FIssuerCountry write FIssuerCountry;
property IssuerName: string read FIssuerName write FIssuerName;
destructor Destroy; override;
end;
TPaymentMethod = class
private
[JsonNameAttribute('type')]
FType: string;
[JsonNameAttribute('id')]
FId: string;
[JsonNameAttribute('saved')]
FSaved: Boolean;
[JsonNameAttribute('card')]
FCard: TCard;
[JsonNameAttribute('title')]
FTitle: string;
public
property &Type: string read FType write FType;
property Id: string read FId write FId;
property Saved: Boolean read FSaved write FSaved;
property Card: TCard read FCard write FCard;
property Title: string read FTitle write FTitle;
destructor Destroy; override;
end;
TMetadata = class
end;
TConfirmation = class
private
[JsonNameAttribute('type')]
FType: string;
[JsonNameAttribute('confirmation_url')]
FConfirmationUrl: string;
public
property &Type: string read FType write FType;
property ConfirmationUrl: string read FConfirmationUrl write FConfirmationUrl;
end;
TAmount = class
private
[JsonNameAttribute('value')]
FValue: string;
[JsonNameAttribute('currency')]
FCurrency: string;
public
property Value: string read FValue write FValue;
property Currency: string read FCurrency write FCurrency;
end;
TYooKassaPayment = class
private
[JsonNameAttribute('id')]
FId: string;
[JsonNameAttribute('status')]
FStatus: string;
[JsonNameAttribute('paid')]
FPaid: Boolean;
[JsonNameAttribute('amount')]
FAmount: TAmount;
[JsonNameAttribute('confirmation')]
FConfirmation: TConfirmation;
[JsonNameAttribute('created_at')]
FCreatedAt: string;
[JsonNameAttribute('description')]
FDescription: string;
[JsonNameAttribute('expires_at')]
FExpiresAt: string;
[JsonNameAttribute('metadata')]
FMetadata: TMetadata;
[JsonNameAttribute('payment_method')]
FPaymentMethod: TPaymentMethod;
[JsonNameAttribute('recipient')]
FRecipient: TRecipient;
[JsonNameAttribute('refundable')]
FRefundable: Boolean;
[JsonNameAttribute('test')]
FTest: Boolean;
public
property Id: string read FId write FId;
property Status: string read FStatus write FStatus;
property Paid: Boolean read FPaid write FPaid;
property Amount: TAmount read FAmount write FAmount;
property Confirmation: TConfirmation read FConfirmation write FConfirmation;
property CreatedAt: string read FCreatedAt write FCreatedAt;
property Description: string read FDescription write FDescription;
property ExpiresAt: string read FExpiresAt write FExpiresAt;
property Metadata: TMetadata read FMetadata write FMetadata;
property PaymentMethod: TPaymentMethod read FPaymentMethod write FPaymentMethod;
property Recipient: TRecipient read FRecipient write FRecipient;
property Refundable: Boolean read FRefundable write FRefundable;
property Test: Boolean read FTest write FTest;
destructor Destroy; override;
end;
implementation
{ TCard }
destructor TCard.Destroy;
begin
FCardProduct.Free;
inherited;
end;
{ TPaymentMethod }
destructor TPaymentMethod.Destroy;
begin
FCard.Free;
inherited;
end;
{ TYooKassaPayment }
destructor TYooKassaPayment.Destroy;
begin
FAmount.Free;
FConfirmation.Free;
FMetadata.Free;
FPaymentMethod.Free;
FRecipient.Free;
inherited;
end;
end.