forked from alonsoalmeida/Mecado-Pago
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MercadoPago_u.pas
680 lines (576 loc) · 20 KB
/
MercadoPago_u.pas
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
unit MercadoPago_u;
interface
uses
DBXJSON, JSON, System.SysUtils, System.StrUtils, System.Classes,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls,
RestClient_u;
type
TMPRestClient = Class ( TRestClient )
private
protected
constructor Create ; override ;
End;
TRetBusca = record
RetStatus, RetDataCredt: String;
end;
TBoleto = record
BoletoRetorno : Boolean;
BoletoLink, BoletoBarra, BoletoID, BoletoVencimento : String;
end;
// INFORMAÇÕES DA CONTA DO USUÁRRIO
TMPUser = record
ID,
nickname,
first_name,
last_name,
email :String;
end;
TMPCobro = record
ID : String;
date_created,
status,
external_reference,
merchant_order_id,
reason,
currency_id,
payment_type,
json :String;
transaction_amount,
total_paid_amount,
shipping_cost :Real;
end;
TProcedureMPCobro = procedure ( x : TMPCobro ) of object ;
TMercadoPago = Class( TComponent )
private
sResposta : String ;
FMemoRetorno : WideString;
FMemoError : String;
FClient_ID : String;
FClient_Secret : String;
FSandBox : Boolean;
FUser : TMPUser;
FStatus : String;
FBoleto : TBoleto;
FContaSaldo : Double;
req : TRequest ;
Json : TJSONObject;
TimerApagaStatus: TTimer ;
FPublicKey : String;
FAccessToken : String;
FCollector_ID : String;
FStatusCon : TRetBusca;
// DADOS DO BOLETO
Vdate_of_expiration,
Vtransaction_amount,
Vexternal_reference,
Vdescription,
Vpayment_method_id,
// DOADOS DO COMPRADOS
Vemail,
Vfirst_name,
Vlast_name,
Vtype, //TIPO DE DOCUMENTO, CPF OU CNPJ CASO BRASIL
Vnumber, //NUMERO DO CPF OU CNPJ
//ENDEREÇO DO COMPRADOR
Vzip_code,
Vstreet_name,
Vstreet_number,
Vneighborhood,
Vcity,
Vfederal_unit : String;
vError : String;
// ESTORNO
Rid,
Rpayments,
Rcurrency,
Ramount,
Rcoverage_applied,
Rcoverage_elegible,
Rdocumentation_required,
Rdocumentation_status,
Rdocumentation,
Rdate_documentation_deadline,
Rdate_created,
Rdate_last_updated,
Rlive_mode: String;
procedure TimerApagaStatusOnTimer(Sender: TObject);
procedure Status( s : String );
procedure m( s : WideString );
procedure xError( s : String );
procedure SetClient_ID(const Value: String);
procedure SetClient_Secret(const Value: String);
procedure SetMemo(const Value: WideString);
function sandboxurl( s : String ) : String ;
function JSONDateTimeToDelphiDateTime( s : String ) : TDateTime ;
procedure SetStatus(const Value: String);
procedure SetPublicKey(const Value: String);
procedure SetAccessToken(const Value: String);
function UriSaveName( s : String ) : String ;
public
constructor Create( sPublicKey, sAccessToken, sClientID, sClientSecret : String );
destructor Destroy ;
procedure get_user_me ;
function SaldoConta(s: String):String;
function CadBoleto(): String;
function GerarBoleto() : String;
function BuscarPedido(s: String): String;
function CancelarPedido(s: String): String;
function CadCliente(): String;
function GerarCliente(): String;
published
property lbStatus : String read FStatus write SetStatus ;
property MemoRetono : WideString read FMemoRetorno write SetMemo ;
property MemoError : String read FMemoError write FMemoError ;
property PublicKey : String read FPublicKey write SetPublicKey ;
property AccessToken : String read FAccessToken write SetAccessToken ;
property Client_ID : String read FClient_ID write SetClient_ID ;
property Collector_ID : String read FCollector_ID write FCollector_ID ;
property Client_Secret : String read FClient_Secret write SetClient_Secret ;
property User : TMPUser read FUser write FUser ;
property RetConsulta : TRetBusca read FStatusCon write FStatusCon ;
property Boleto : TBoleto read FBoleto write FBoleto ;
property ContaSaldo : Double read FContaSaldo write FContaSaldo ;
property SandBox : Boolean read FSandBox write FSandBox ;
// LANÇAMENTO DO BOLETO
property Bdate_of_expiration : String read Vdate_of_expiration write Vdate_of_expiration ;
property Btransaction_amount : String read Vtransaction_amount write Vtransaction_amount ;
property Bexternal_reference : String read Vexternal_reference write Vexternal_reference ;
property Bdescription : String read Vdescription write Vdescription ;
property Bpayment_method_id : String read Vpayment_method_id write Vpayment_method_id ;
property Bemail : String read Vemail write Vemail ;
property Bfirst_name : String read Vfirst_name write Vfirst_name ;
property Blast_name : String read Vlast_name write Vlast_name ;
property Btype : String read Vtype write Vtype ;
property Bnumber : String read Vnumber write Vnumber ;
property Bzip_code : String read Vzip_code write Vzip_code ;
property Bstreet_name : String read Vstreet_name write Vstreet_name ;
property Bstreet_number : String read Vstreet_number write Vstreet_number ;
property Bneighborhood : String read Vneighborhood write Vneighborhood ;
property Bcity : String read Vcity write Vcity ;
property Bfederal_unit : String read Vfederal_unit write Vfederal_unit ;
// ESTORNO
property id : String read Rid write Rid ;
property payments : String read Rpayments write Rpayments ;
property currency : String read Rcurrency write Rcurrency ;
property amount : String read Ramount write Ramount ;
property coverage_applied : String read Rcoverage_applied write Rcoverage_applied ;
property coverage_elegible : String read Rcoverage_elegible write Rcoverage_elegible ;
property documentation_required : String read Rdocumentation_required write Rdocumentation_required ;
property documentation_status : String read Rdocumentation_status write Rdocumentation_status ;
property documentation : String read Rdocumentation write Rdocumentation ;
property date_documentation_deadline : String read Rdate_documentation_deadline write Rdate_documentation_deadline ;
property date_created : String read Rdate_created write Rdate_created ;
property date_last_updated : String read Rdate_last_updated write Rdate_last_updated ;
property live_mode : String read Rlive_mode write Rlive_mode ;
end;
implementation
uses DateUtils, Character ;
function getCamposJsonString(json,value:String): String;
var
LJSONObject: TJSONObject;
function TrataObjeto(jObj:TJSONObject):string;
var i:integer;
jPar: TJSONPair;
begin
result := '';
for i := 0 to jObj.Size - 1 do
begin
jPar := jObj.Get(i);
if jPar.JsonValue Is TJSONObject then
result := TrataObjeto((jPar.JsonValue As TJSONObject)) else
if sametext(trim(jPar.JsonString.Value),value) then
begin
Result := jPar.JsonValue.Value;
break;
end;
if result <> '' then
break;
end;
end;
begin
try
LJSONObject := nil;
LJSONObject := TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(json),0) as TJSONObject;
result := TrataObjeto(LJSONObject);
finally
LJSONObject.Free;
end;
end;
function StripNonJson(s: string): string;
var
ch: char;
inString: boolean;
begin
Result := '';
inString := false;
for ch in s do
begin
if ch = '"' then
inString := not inString;
if TCharacter.IsWhiteSpace(ch) and not inString then
continue;
Result := Result + ch;
end;
end;
function JsonSinComillas(s: String): String;
begin
result := StringReplace( s, '"','', [rfReplaceAll] );
end;
procedure SaveToFile( sFileName: String ; sTexto : String );
var
f : textfile;
begin
try
AssignFile( f, sFileName );
Rewrite( f );
Write(f, sTexto );
Flush(f);
CloseFile(f);
except
end;
end;
{ TMercadoPago }
constructor TMercadoPago.Create(
sPublicKey,
sAccessToken,
sClientID,
sClientSecret : String );
begin
req := TRequest.Create ;
TimerApagaStatus := TTimer.Create( Self );
TimerApagaStatus.Interval := 2*1000 ;
TimerApagaStatus.Enabled := False ;
TimerApagaStatus.OnTimer := TimerApagaStatusOnTimer ;
PublicKey := sPublicKey ;
AccessToken := sAccessToken ;
Client_ID := sClientID ;
Client_Secret := sClientSecret ;
end;
destructor TMercadoPago.Destroy;
begin
TimerApagaStatus.Free ;
req.Free ;
end;
function TMercadoPago.CancelarPedido(s: String): String;
begin
req.uri := '/v1/payments/'+s;
req.params.Add('?access_token='+FAccessToken);
//Os cancelamentos podem ser realizados somente com status pending e in process
req.body.Add('{"status" : "cancelled"}');
try
sResposta := TMPRestClient.Put(req);
except
on E: Exception do
xError( 'Error: '+E.ClassName + ': ' +E.Message );
end;
m( 'Resposta: '+sResposta );
Json := TJsonObject(TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(StripNonJson(sResposta)),0));
vError := getCamposJsonString(sResposta, 'error');
if vError <> '' then
begin
xError( 'Error: '+( TJSONObject(Json.Get('message').JsonValue).ToString ) );
exit;
end;
end;
function TMercadoPago.JSONDateTimeToDelphiDateTime(s: String): TDateTime;
var ano, mes, dia, hora, min, seg : Word;
begin
// 12345678901234567890
// 2018-08-02T14:02:33.000-04:00
s := JsonSinComillas( s );
ano := StrToInt( Copy( s, 1, 4 ));
mes := StrToInt( Copy( s, 6, 2 ));
dia := StrToInt( Copy( s, 9, 2 ));
hora := StrToInt( Copy( s,12, 2 ));
min := StrToInt( Copy( s,15, 2 ));
seg := StrToInt( Copy( s,18, 2 ));
Result := EncodeDateTime( ano, mes, dia, hora, min, seg, 0);
end;
procedure TMercadoPago.m(s: WideString);
begin
FMemoRetorno := s;
end;
procedure TMercadoPago.xError(s: String);
begin
FMemoError := s;
end;
function TMercadoPago.BuscarPedido(s: String): String;
var
vStatus : String;
begin
Status( 'Buscando Pagamento' );
req.Clear;
if s = '' then
begin
req.uri := '/v1/payments/search';
req.params.Add('?access_token='+FAccessToken);
end
else
begin
req.uri := '/v1/payments/search?id='+s; //external_reference
req.params.Add('&access_token='+FAccessToken);
end;
try
sResposta := TMPRestClient.Get(req);
except
on E: Exception do
xError( 'Error: '+E.ClassName + ': ' +E.Message );
end;
m( 'Resposta: '+sResposta );
// raise Exception.Create(getCamposJsonString(sResposta, 'status'));
Json := TJsonObject(TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(StripNonJson(sResposta)),0));
vError := getCamposJsonString(sResposta, 'error');
if vError <> '' then
begin
xError( 'Error: '+( TJSONObject(Json.Get('message').JsonValue).ToString ) );
exit;
end;
case AnsiIndexStr(getCamposJsonString(sResposta, 'status'),
['pending', 'approved', 'in_process', 'rejected', 'cancelled', 'refunded', 'charged_back']) of
0 : FStatusCon.RetStatus := 'Pendente';
1 : FStatusCon.RetStatus := 'Aprovado';
2 : FStatusCon.RetStatus := 'Em Processo';
3 : FStatusCon.RetStatus := 'Rejeitado';
4 : FStatusCon.RetStatus := 'Cancelado';
5 : FStatusCon.RetStatus := 'Reembolso';
6 : FStatusCon.RetStatus := 'Estorno Cartão';
end;
Status( 'Buscando Pagamento '+FStatusCon.RetStatus );
end;
function TMercadoPago.CadCliente(): String;
var
Enviar : TStringList;
begin
Enviar := TStringList.Create;
Enviar.Add(
'{'+#10+
' "email": "[email protected]",'+#10+
' "first_name": "Bruce",'+#10+
' "last_name": "Wayne",'+#10+
' "phone": {'+#10+
' "area_code": "023",'+#10+
' "number": "12345678"'+#10+
' },'+#10+
' "identification": {'+#10+
' "type": "DNI",'+#10+
' "number": "12345678"'+#10+
' },'+#10+
' "address": {'+#10+
' "zip_code": "SG1 2AX",'+#10+
' "street_name": "Old Knebworth Ln"'+#10+
' },'+#10+
' "description": "Lorem Ipsum"'+#10+
' }');
Result := Enviar.Text;
end;
function TMercadoPago.GerarCliente(): String;
var
vError : String;
begin
Status( 'Adicionar Cliente' );
req.Clear ;
req.uri := '/v1/customers';
req.params.Add('?access_token='+FAccessToken);
req.body.Add( CadCliente );
try
sResposta := TMPRestClient.Post(req);
except
on E: Exception do
xError( 'Error: '+E.ClassName + ': ' +E.Message );
end;
m( 'Resposta: '+sResposta );
Json := TJsonObject(TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(StripNonJson(sResposta)),0));
vError := getCamposJsonString(sResposta, 'error');
if vError <> '' then
begin
xError( 'Error: '+( TJSONObject(Json.Get('message').JsonValue).ToString ));
exit;
end;
//FBoleto.BoletoLink := ( TJSONObject(Json.Get('transaction_details').JsonValue).ToString );
Status( 'Cliente Adicionado com sucesso!' );
end;
function TMercadoPago.CadBoleto: String;
var
Enviar : TStringList;
begin
Enviar := TStringList.Create;
Enviar.Add(
'{'+#10+
'"installments": 1,'+#10+ // NUMERO DE PACELAS
'"date_of_expiration": "'+ DateToISO8601(StrToDate(Bdate_of_expiration), False)+'",'+#10+
'"transaction_amount": "'+ Btransaction_amount+'",'+#10+
'"external_reference": "'+ Bexternal_reference+'",'+#10+ //NUMERO DO PEDIDO DE SEU SITE PARA FUTURA CONCILIAÇÃO FINANCEIRA
'"description": "'+ Bdescription+'",'+#10+
'"payment_method_id": "'+ Bpayment_method_id+'",'+#10+ // MEIO DE PAGAMENTO
// DODOS DO COMPRADOS
'"payer": {'+#10+
'"email": "'+ Bemail+'",'+#10+
'"first_name": "'+ Bfirst_name+'",'+#10+
'"last_name": "'+ Blast_name+'",'+#10+
'"identification": {'+#10+
'"type": "'+ Btype+'",'+#10+ //TIPO DE DOCUMENTO, CPF OU CNPJ CASO BRASIL
'"number": "'+ Bnumber+'"'+#10+
'},'+#10+
//ENDEREÇO DO COMPRADOR
'"address": {'+#10+
'"zip_code": "'+ Bzip_code+'",'+#10+
'"street_name": "'+ Bstreet_name+'",'+#10+
'"street_number": "'+ Bstreet_number+'",'+#10+
'"neighborhood": "'+ Bneighborhood+'",'+#10+
'"city": "'+ Bcity+'",'+#10+
'"federal_unit": "'+ Bfederal_unit+'"'+#10+
'}'+#10+
'}'+#10+
'}');
Result := Enviar.Text;
end;
function TMercadoPago.GerarBoleto: String;
var
ano, mes, dia : word;
data : TDateTime;
vError : String;
begin
Status( 'Adicionando Pagamento Por Boleto' );
req.Clear ;
req.uri := '/v1/payments'; //advanced_payments
req.params.Add('?access_token='+FAccessToken);
req.body.Add( CadBoleto );
try
sResposta := TMPRestClient.Post(req);
except
on E: Exception do
xError( 'Error: '+E.ClassName + ': ' +E.Message );
end;
m( 'Resposta: '+sResposta );
Json := TJsonObject(TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(StripNonJson(sResposta)),0));
vError := getCamposJsonString(sResposta, 'error');
if vError <> '' then
begin
xError( 'Error: '+( TJSONObject(Json.Get('message').JsonValue).ToString ) );
exit;
end;
FBoleto.BoletoLink := ( TJSONObject(Json.Get('transaction_details').JsonValue).ToString );
FBoleto.BoletoLink := getCamposJsonString(Boleto.BoletoLink, 'external_resource_url');
FBoleto.BoletoBarra := ( TJSONObject(Json.Get('barcode').JsonValue).ToString );
FBoleto.BoletoBarra := getCamposJsonString(Boleto.BoletoBarra, 'content');
FBoleto.BoletoRetorno := StrToBool( TJSONObject(Json.Get('captured').JsonValue).ToString );
FBoleto.BoletoID := ( TJSONObject(Json.Get('id').JsonValue).ToString );
ano := StrToInt(Copy(TJSONObject(Json.Get('date_of_expiration').JsonValue).ToString,2,4));
mes := StrToInt(Copy(TJSONObject(Json.Get('date_of_expiration').JsonValue).ToString,7,2));
dia := StrToInt(Copy(TJSONObject(Json.Get('date_of_expiration').JsonValue).ToString,10,2));
data := EncodeDate(ano, mes, dia);
FBoleto.BoletoVencimento := ( FormatdateTime('yyyy/mm/dd', data));
Status( 'Pagamento gerado e incluído com sucesso!' );
end;
procedure TMercadoPago.get_user_me;
var
vError : String;
begin
Status( 'Buscando dados da conta' );
req.Clear ;
req.uri := '/users/me';
req.params.Add('?access_token='+FAccessToken);
try
sResposta := TMPRestClient.Get(req);
except
on E: Exception do
xError( 'Error: '+E.ClassName + ': ' +E.Message );
end;
m( 'Resposta: '+sResposta );
Json := TJsonObject(TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(StripNonJson(sResposta)),0));
FUser.ID := JsonSinComillas( TJSONObject(Json.Get('id').JsonValue).ToString );
FUser.nickname := JsonSinComillas( TJSONObject(Json.Get('nickname').JsonValue).ToString );
FUser.first_name := JsonSinComillas( TJSONObject(Json.Get('first_name').JsonValue).ToString );
FUser.last_name := JsonSinComillas( TJSONObject(Json.Get('last_name').JsonValue).ToString );
FUser.email := JsonSinComillas( TJSONObject(Json.Get('email').JsonValue).ToString );
Status( 'Datos da conta retornados corretamente!' );
end;
function TMercadoPago.SaldoConta(s: String): String;
var
vError : String;
const
vID = '166957358';
vToken = 'APP_USR-3067742096444572-042712-95042da85e0714597f6b707e6234d23c-166957358';
begin
Status( 'Buscando saldo da conta!' );
req.Clear ;
req.uri := '/users/'+vID+'/mercadopago_account/balance';
req.params.Add('?access_token='+vToken);
//req.params.Add('&access_token='+FAccessToken);
try
sResposta := TMPRestClient.Get(req);
except
on E: Exception do
xError( 'Error: '+E.ClassName + ': ' +E.Message );
end;
m( 'Resposta: '+sResposta );
Json := TJsonObject(TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(StripNonJson(sResposta)),0));
vError := getCamposJsonString(sResposta, 'error');
if vError <> '' then
begin
xError( 'Error: '+( TJSONObject(Json.Get('message').JsonValue).ToString ) );
exit;
end;
ContaSaldo := StrToCurr(StringReplace(JsonSinComillas( TJSONObject(Json.Get('total_amount').JsonValue).ToString), '.', ',', [] ));
Status( 'Buscando saldo da conta!' );
end;
function TMercadoPago.sandboxurl(s: String): String;
begin
if FSandBox then
result := result+'/sandbox';
result := result + s;
end;
procedure TMercadoPago.SetAccessToken(const Value: String);
begin
FAccessToken := Value;
m( 'Access Token: '+Value );
end;
procedure TMercadoPago.SetClient_ID(const Value: String);
begin
FClient_ID := Value;
m( 'ClientID: '+Value );
end;
procedure TMercadoPago.SetMemo(const Value: WideString);
begin
FMemoRetorno := Value;
PublicKey := FPublicKey ;
AccessToken := FAccessToken ;
Client_ID := FClient_ID ; // Para ser visto no memorando
Client_Secret := FClient_Secret ;
end;
procedure TMercadoPago.SetPublicKey(const Value: String);
begin
FPublicKey := Value;
m( 'PublicKey: '+Value);
end;
procedure TMercadoPago.SetStatus(const Value: String);
begin
FStatus := Value;
//FStatus.Visible := False ;
end;
procedure TMercadoPago.Status(s: String);
begin
FStatus := s ;
end;
procedure TMercadoPago.TimerApagaStatusOnTimer(Sender: TObject);
begin
{if Assigned( FStatus ) then
FStatus.Visible := False ;}
end;
function TMercadoPago.UriSaveName(s: String): String;
begin
s := RightStr( s, Length(s)-1 );
result := StringReplace( s, '\','',[rfReplaceAll]);
end;
procedure TMercadoPago.SetClient_Secret(const Value: String);
begin
FClient_Secret := Value;
m( 'ClientSecret: '+Value );
end;
{ TMPRestClient }
constructor TMPRestClient.Create;
begin
inherited;
sURLDominio := 'https://api.mercadopago.com';
end;
end.