Skip to content

Commit 9d38f7e

Browse files
committed
Se genera versión nativa delphi
Metódos de cancelación PFX, CSD, XML Metódos de timbrado V1,v2v3v4 Consulta de saldo Autenticación
2 parents c103755 + 9b9deaa commit 9d38f7e

File tree

6 files changed

+1504
-0
lines changed

6 files changed

+1504
-0
lines changed

README.md

Lines changed: 1041 additions & 0 deletions
Large diffs are not rendered by default.

UNIT_TEST/UNIT_TEST.dfm

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
object Form1: TForm1
2+
Left = 0
3+
Top = 0
4+
Caption = 'Form1'
5+
ClientHeight = 166
6+
ClientWidth = 586
7+
Color = clBtnFace
8+
Font.Charset = DEFAULT_CHARSET
9+
Font.Color = clWindowText
10+
Font.Height = -11
11+
Font.Name = 'Tahoma'
12+
Font.Style = []
13+
OldCreateOrder = False
14+
PixelsPerInch = 96
15+
TextHeight = 13
16+
object Button1: TButton
17+
Left = 40
18+
Top = 24
19+
Width = 97
20+
Height = 25
21+
Caption = 'StampV1'
22+
TabOrder = 0
23+
OnClick = Button1Click
24+
end
25+
object Button2: TButton
26+
Left = 40
27+
Top = 55
28+
Width = 97
29+
Height = 25
30+
Caption = 'StampV2'
31+
TabOrder = 1
32+
OnClick = Button2Click
33+
end
34+
object Button3: TButton
35+
Left = 40
36+
Top = 86
37+
Width = 97
38+
Height = 25
39+
Caption = 'StampV3'
40+
TabOrder = 2
41+
OnClick = Button3Click
42+
end
43+
object Button4: TButton
44+
Left = 40
45+
Top = 117
46+
Width = 97
47+
Height = 25
48+
Caption = 'StampV4'
49+
TabOrder = 3
50+
OnClick = Button4Click
51+
end
52+
object Button8: TButton
53+
Left = 176
54+
Top = 24
55+
Width = 99
56+
Height = 25
57+
Caption = 'Cancel XML'
58+
TabOrder = 4
59+
OnClick = Button8Click
60+
end
61+
object Button9: TButton
62+
Left = 176
63+
Top = 55
64+
Width = 99
65+
Height = 25
66+
Caption = 'Cancel PFX'
67+
TabOrder = 5
68+
OnClick = Button9Click
69+
end
70+
object Button10: TButton
71+
Left = 176
72+
Top = 86
73+
Width = 99
74+
Height = 25
75+
Caption = 'Cancel CSD'
76+
TabOrder = 6
77+
OnClick = Button10Click
78+
end
79+
object Button5: TButton
80+
Left = 304
81+
Top = 24
82+
Width = 99
83+
Height = 25
84+
Caption = 'Authentication'
85+
TabOrder = 7
86+
OnClick = Button5Click
87+
end
88+
object Button6: TButton
89+
Left = 424
90+
Top = 24
91+
Width = 99
92+
Height = 25
93+
Caption = 'Account Balance'
94+
TabOrder = 8
95+
OnClick = Button6Click
96+
end
97+
end

UNIT_TEST/UNIT_TEST.pas

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
unit UNIT_TEST;
2+
3+
interface
4+
5+
uses
6+
ShareMem, Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7+
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
8+
9+
type
10+
TForm1 = class(TForm)
11+
Button1: TButton;
12+
Button2: TButton;
13+
Button3: TButton;
14+
Button4: TButton;
15+
Button5: TButton;
16+
Button6: TButton;
17+
Button8: TButton;
18+
Button9: TButton;
19+
Button10: TButton;
20+
procedure Button1Click(Sender: TObject);
21+
procedure Button5Click(Sender: TObject);
22+
procedure Button6Click(Sender: TObject);
23+
procedure Button2Click(Sender: TObject);
24+
procedure Button3Click(Sender: TObject);
25+
procedure Button4Click(Sender: TObject);
26+
procedure Button8Click(Sender: TObject);
27+
procedure Button9Click(Sender: TObject);
28+
procedure Button10Click(Sender: TObject);
29+
30+
private
31+
{ Private declarations }
32+
public
33+
{ Public declarations }
34+
end;
35+
36+
const
37+
User : String = 'demo';
38+
Password : String = '123456789';
39+
URL : String = 'http://services.test.sw.com.mx';
40+
41+
var
42+
Form1: TForm1;
43+
function Authentication(User, Password, URL: String):String; stdcall external 'SWServices.dll';
44+
function StampV1(URL, XML, Token: String):String; stdcall external 'SWServices.dll';
45+
function StampV2(URL, XML, Token: String):String; stdcall external 'SWServices.dll';
46+
function StampV3(URL, XML, Token: String):String; stdcall external 'SWServices.dll';
47+
function StampV4(URL, XML, Token: String):String; stdcall external 'SWServices.dll';
48+
function CancelByPFX (Token, URL, PFX, UUID, PasswordKey, RFC: String):String; stdcall external 'SWServices.dll';
49+
function CancelByXML (Token, URL, XML: String):String; stdcall external 'SWServices.dll';
50+
function CancelByCSD (Token, URL, UUID, PasswordKey, RFC, Cer, Key: String):String; stdcall external 'SWServices.dll';
51+
function AccountBalance(Token, URL: String):String; stdcall external 'SWServices.dll';
52+
53+
implementation
54+
55+
{$R *.dfm}
56+
57+
procedure TForm1.Button10Click(Sender: TObject);
58+
var
59+
XML, UUID, PasswordKey, RFC, Cer, Key: String;
60+
begin
61+
62+
63+
ShowMessage(CancelByCSD(Authentication(User, Password, URL), URL, UUID, PasswordKey, RFC, Cer, Key));
64+
end;
65+
66+
procedure TForm1.Button1Click(Sender: TObject);
67+
var
68+
XML: String;
69+
begin
70+
71+
72+
ShowMessage(StampV1(URL, XML, Authentication(User, Password, URL)) );
73+
end;
74+
75+
procedure TForm1.Button2Click(Sender: TObject);
76+
var
77+
XML: String;
78+
begin
79+
80+
81+
ShowMessage(StampV2(URL, XML, Authentication(User, Password, URL)) );
82+
end;
83+
84+
procedure TForm1.Button3Click(Sender: TObject);
85+
var
86+
XML: String;
87+
begin
88+
89+
90+
ShowMessage(StampV3(URL, XML, Authentication(User, Password, URL)) );
91+
end;
92+
93+
procedure TForm1.Button4Click(Sender: TObject);
94+
var
95+
XML: String;
96+
begin
97+
98+
99+
ShowMessage(StampV4(URL, XML, Authentication(User, Password, URL)) );
100+
end;
101+
102+
procedure TForm1.Button5Click(Sender: TObject);
103+
begin
104+
105+
ShowMessage(Authentication(User, Password, URL) );
106+
end;
107+
108+
procedure TForm1.Button6Click(Sender: TObject);
109+
begin
110+
111+
ShowMessage(AccountBalance(Authentication(User, Password, URL),URL));
112+
end;
113+
114+
procedure TForm1.Button8Click(Sender: TObject);
115+
var
116+
XML: String;
117+
begin
118+
119+
120+
ShowMessage(CancelByXML(Authentication(User, Password, URL),URL, XML));
121+
end;
122+
123+
procedure TForm1.Button9Click(Sender: TObject);
124+
var
125+
XML, PFX, UUID, PasswordKey, RFC: String;
126+
begin
127+
128+
129+
ShowMessage(CancelByPFX(Authentication(User, Password, URL), URL, PFX, UUID, PasswordKey, RFC));
130+
end;
131+
132+
end.

UNIT_TEST/__recovery/UNIT_TEST.dfm

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
object Form1: TForm1
2+
Left = 0
3+
Top = 0
4+
Caption = 'Form1'
5+
ClientHeight = 166
6+
ClientWidth = 586
7+
Color = clBtnFace
8+
Font.Charset = DEFAULT_CHARSET
9+
Font.Color = clWindowText
10+
Font.Height = -11
11+
Font.Name = 'Tahoma'
12+
Font.Style = []
13+
OldCreateOrder = False
14+
PixelsPerInch = 96
15+
TextHeight = 13
16+
object Button1: TButton
17+
Left = 40
18+
Top = 24
19+
Width = 97
20+
Height = 25
21+
Caption = 'StampV1'
22+
TabOrder = 0
23+
OnClick = Button1Click
24+
end
25+
object Button2: TButton
26+
Left = 40
27+
Top = 55
28+
Width = 97
29+
Height = 25
30+
Caption = 'StampV2'
31+
TabOrder = 1
32+
OnClick = Button2Click
33+
end
34+
object Button3: TButton
35+
Left = 40
36+
Top = 86
37+
Width = 97
38+
Height = 25
39+
Caption = 'StampV3'
40+
TabOrder = 2
41+
OnClick = Button3Click
42+
end
43+
object Button4: TButton
44+
Left = 40
45+
Top = 117
46+
Width = 97
47+
Height = 25
48+
Caption = 'StampV4'
49+
TabOrder = 3
50+
OnClick = Button4Click
51+
end
52+
object Button8: TButton
53+
Left = 176
54+
Top = 24
55+
Width = 99
56+
Height = 25
57+
Caption = 'Cancel XML'
58+
TabOrder = 4
59+
OnClick = Button8Click
60+
end
61+
object Button9: TButton
62+
Left = 176
63+
Top = 55
64+
Width = 99
65+
Height = 25
66+
Caption = 'Cancel PFX'
67+
TabOrder = 5
68+
OnClick = Button9Click
69+
end
70+
object Button10: TButton
71+
Left = 176
72+
Top = 86
73+
Width = 99
74+
Height = 25
75+
Caption = 'Cancel CSD'
76+
TabOrder = 6
77+
OnClick = Button10Click
78+
end
79+
object Button5: TButton
80+
Left = 304
81+
Top = 24
82+
Width = 99
83+
Height = 25
84+
Caption = 'Authentication'
85+
TabOrder = 7
86+
OnClick = Button5Click
87+
end
88+
object Button6: TButton
89+
Left = 424
90+
Top = 24
91+
Width = 99
92+
Height = 25
93+
Caption = 'Account Balance'
94+
TabOrder = 8
95+
OnClick = Button6Click
96+
end
97+
end

0 commit comments

Comments
 (0)