TodoPagoConectorSS 1.8.0 → 1.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/issue_template.md +34 -0
  3. data/.gitignore +37 -0
  4. data/README.md +1553 -0
  5. data/TodoPago/DataProvider.rb +273 -0
  6. data/TodoPago/DiscoverPaymentMethodsTest.rb +71 -0
  7. data/TodoPago/GetAuthorizeAnswerTest.rb +61 -0
  8. data/TodoPago/GetCredentialsTest.rb +70 -0
  9. data/TodoPago/GetOperationsTest.rb +72 -0
  10. data/TodoPago/MockClient.rb +195 -0
  11. data/TodoPago/ReturnRequestTest.rb +64 -0
  12. data/TodoPago/SendAuthorizeRequestTest.rb +63 -0
  13. data/TodoPago/coverage/.last_run.json +5 -0
  14. data/TodoPago/coverage/.resultset.json +892 -0
  15. data/TodoPago/coverage/.resultset.json.lock +0 -0
  16. data/TodoPago/coverage/assets/0.10.0/application.css +799 -0
  17. data/TodoPago/coverage/assets/0.10.0/application.js +1707 -0
  18. data/TodoPago/coverage/assets/0.10.0/colorbox/border.png +0 -0
  19. data/TodoPago/coverage/assets/0.10.0/colorbox/controls.png +0 -0
  20. data/TodoPago/coverage/assets/0.10.0/colorbox/loading.gif +0 -0
  21. data/TodoPago/coverage/assets/0.10.0/colorbox/loading_background.png +0 -0
  22. data/TodoPago/coverage/assets/0.10.0/favicon_green.png +0 -0
  23. data/TodoPago/coverage/assets/0.10.0/favicon_red.png +0 -0
  24. data/TodoPago/coverage/assets/0.10.0/favicon_yellow.png +0 -0
  25. data/TodoPago/coverage/assets/0.10.0/loading.gif +0 -0
  26. data/TodoPago/coverage/assets/0.10.0/magnify.png +0 -0
  27. data/TodoPago/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  28. data/TodoPago/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  29. data/TodoPago/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  30. data/TodoPago/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  31. data/TodoPago/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  32. data/TodoPago/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  33. data/TodoPago/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  34. data/TodoPago/coverage/assets/0.10.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  35. data/TodoPago/coverage/assets/0.10.0/smoothness/images/ui-icons_222222_256x240.png +0 -0
  36. data/TodoPago/coverage/assets/0.10.0/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  37. data/TodoPago/coverage/assets/0.10.0/smoothness/images/ui-icons_454545_256x240.png +0 -0
  38. data/TodoPago/coverage/assets/0.10.0/smoothness/images/ui-icons_888888_256x240.png +0 -0
  39. data/TodoPago/coverage/assets/0.10.0/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  40. data/TodoPago/coverage/index.html +5510 -0
  41. data/TodoPago/test.rb +203 -0
  42. data/TodoPago/test_validations.rb +108 -0
  43. data/TodoPago/tests_coverage.rb +11 -0
  44. data/TodoPagoConector.gemspec +14 -0
  45. data/lib/Authorize.wsdl +320 -0
  46. data/lib/Classes/user.rb +30 -0
  47. data/lib/Connectors/RestConnector.rb +65 -0
  48. data/lib/Connectors/ServiceConnector.rb +32 -0
  49. data/lib/Connectors/SoapConnector.rb +139 -0
  50. data/lib/Exceptions/connection_exception.rb +6 -0
  51. data/lib/Exceptions/empty_field_exception.rb +6 -0
  52. data/lib/Exceptions/empty_field_password_exception.rb +8 -0
  53. data/lib/Exceptions/empty_field_user_exception.rb +8 -0
  54. data/lib/Exceptions/prueba.rb +5 -0
  55. data/lib/Exceptions/response_exception.rb +6 -0
  56. data/lib/FraudControlValidation.rb +406 -0
  57. data/lib/Operations.wsdl +319 -0
  58. data/lib/ServiceReferences/Authorize.wsdl +320 -0
  59. data/lib/ServiceReferences/EchoService.wsdl +125 -0
  60. data/lib/ServiceReferences/Operations.wsdl +319 -0
  61. data/lib/Validation/FraudControlValidation.rb +406 -0
  62. data/lib/config/postalCodes.json +26 -0
  63. data/lib/config/validations.json +623 -0
  64. data/lib/prueba.rb +4 -0
  65. data/lib/user.rb +41 -0
  66. metadata +65 -1
data/TodoPago/test.rb ADDED
@@ -0,0 +1,203 @@
1
+ #encoding: utf-8
2
+ require_relative "../lib/todo_pago_conector.rb"
3
+ require_relative "../lib/Classes/user.rb"
4
+
5
+ require_relative "../lib/Exceptions/empty_field_user_exception.rb"
6
+ require_relative "../lib/Exceptions/empty_field_password_exception.rb"
7
+ require_relative "../lib/Exceptions/connection_exception.rb"
8
+ require_relative "../lib/Exceptions/response_exception.rb"
9
+ require 'xmlsimple'
10
+ require 'json'
11
+
12
+ j_header_http = {
13
+ 'Authorization'=>'TODOPAGO ABCDEF1234567890'
14
+ }
15
+
16
+ endpoint = 'https://developers.todopago.com.ar/'
17
+
18
+
19
+ conector = TodoPagoConector.new(j_header_http, "test")
20
+
21
+
22
+
23
+ ##############################################Authorize################################################
24
+ optionsSAR_operacion = Hash.new
25
+ optionsSAR_operacion[:MERCHANT] = "3150"
26
+ optionsSAR_operacion[:OPERATIONID] = "8000"
27
+ optionsSAR_operacion[:CURRENCYCODE] = "032"
28
+ optionsSAR_operacion[:AMOUNT] = "1.00"
29
+
30
+ #Control de Fraude
31
+ optionsSAR_operacion[:CSBTCITY]="Villa General Belgrano"
32
+ optionsSAR_operacion[:CSBTCOUNTRY]= "AR"
33
+ optionsSAR_operacion[:CSBTEMAIL]= "todopago@hotmail.com"
34
+ optionsSAR_operacion[:CSBTFIRSTNAME]= "Juan"
35
+ optionsSAR_operacion[:CSBTLASTNAME]= "Peréz"
36
+ optionsSAR_operacion[:CSBTPHONENUMBER]= "541160913988"
37
+ optionsSAR_operacion[:CSBTPOSTALCODE]= " 1010"
38
+ optionsSAR_operacion[:CSBTSTATE]= "B"
39
+ optionsSAR_operacion[:CSBTSTREET1]= "Cerrito 740"
40
+
41
+ optionsSAR_operacion[:CSBTCUSTOMERID]= "453458"
42
+ optionsSAR_operacion[:CSBTIPADDRESS]= "192.0.0.4"
43
+ optionsSAR_operacion[:CSPTCURRENCY]= "ARS"
44
+ optionsSAR_operacion[:CSPTGRANDTOTALAMOUNT]= "10.01"
45
+ optionsSAR_operacion[:CSMDD6]= ""
46
+ optionsSAR_operacion[:CSMDD7]= ""
47
+ optionsSAR_operacion[:CSMDD8]= ""
48
+ optionsSAR_operacion[:CSMDD9]= ""
49
+ optionsSAR_operacion[:CSMDD10]= ""
50
+ optionsSAR_operacion[:CSMDD11]= ""
51
+
52
+ optionsSAR_operacion[:CSSTCITY]= "Villa General Belgrano"
53
+ optionsSAR_operacion[:CSSTCOUNTRY]= "AR"
54
+ optionsSAR_operacion[:CSSTEMAIL]= "some@someurl.com"
55
+ optionsSAR_operacion[:CSSTFIRSTNAME]= "Juan"
56
+ optionsSAR_operacion[:CSSTLASTNAME]= "Perez"
57
+ optionsSAR_operacion[:CSSTPHONENUMBER]= "541160913988"
58
+ optionsSAR_operacion[:CSSTPOSTALCODE]= " 1010"
59
+ optionsSAR_operacion[:CSSTSTATE]= "B"
60
+ optionsSAR_operacion[:CSSTSTREET1]= "Cerrito 740"
61
+
62
+ optionsSAR_operacion[:CSITPRODUCTCODE]= "electronic_good"
63
+ optionsSAR_operacion[:CSITPRODUCTDESCRIPTION]= "Test Prd Description "
64
+ optionsSAR_operacion[:CSITPRODUCTNAME]= "TestPrd"
65
+ optionsSAR_operacion[:CSITPRODUCTSKU]= "SKU1234"
66
+ optionsSAR_operacion[:CSITTOTALAMOUNT]= "10.01"
67
+ optionsSAR_operacion[:CSITQUANTITY]= "1"
68
+ optionsSAR_operacion[:CSITUNITPRICE]= "10.01"
69
+
70
+ optionsSAR_operacion[:CSMDD12]= ""
71
+ optionsSAR_operacion[:CSMDD13]= ""
72
+ optionsSAR_operacion[:CSMDD14]= ""
73
+ optionsSAR_operacion[:CSMDD15]= ""
74
+ optionsSAR_operacion[:CSMDD16]= ""
75
+
76
+ #Fin Control de Fraude
77
+
78
+ #Optionals
79
+ optionsSAR_operacion[:AVAILABLEPAYMENTMETHODSIDS]= "1#194#43#45"
80
+ optionsSAR_operacion[:PUSHNOTIFYMETHOD]= ""
81
+ optionsSAR_operacion[:PUSHNOTIFYENDPOINT]= ""
82
+ optionsSAR_operacion[:PUSHNOTIFYSTATES]= ""
83
+ optionsSAR_operacion[:MININSTALLMENTS]= "1"
84
+ optionsSAR_operacion[:MAXINSTALLMENTS]= "6"
85
+ optionsSAR_operacion[:TIMEOUT]= "300000"
86
+
87
+ optionsSAR_comercio = Hash.new
88
+ optionsSAR_comercio[:security]="1234567890ABCDEF1234567890ABCDEF"
89
+ optionsSAR_comercio[:MERCHANT]= "2153"
90
+ optionsSAR_comercio[:EncodingMethod]="XML"
91
+ optionsSAR_comercio[:URL_OK]= "http://someurl.com/ok/"
92
+ optionsSAR_comercio[:URL_ERROR]= "http://someurl.com/error/"
93
+ optionsSAR_comercio[:EMAILCLIENTE]= "mail@someurl.com"
94
+ optionsSAR_comercio[:Session]= "ABCDEF-1234-12221-FDE1-00000200"
95
+
96
+ puts('--------------------RESPONSE --------------------------------------------------------------------------')
97
+ response = conector.sendAuthorizeRequest(optionsSAR_comercio,optionsSAR_operacion)
98
+ puts('SendAuthorizeRequest:')
99
+ puts(response)
100
+ puts('------------------------------------------------------------------------------------------------')
101
+
102
+
103
+ #GAA
104
+ optionsAnwser=Hash.new
105
+ optionsAnwser[:security]= "f3d8b72c94ab4a06be2ef7c95490f7d3"
106
+ optionsAnwser[:MERCHANT]= "2153"
107
+ optionsAnwser[:RequestKey]= "710268a7-7688-c8bf-68c9-430107e6b9da"
108
+ optionsAnwser[:AnswerKey]= "693ca9cc-c940-06a4-8d96-1ab0d66f3ee6"
109
+
110
+ response = conector.getAuthorizeAnswer(optionsAnwser)
111
+ puts('GetAuthorizeAnswer:')
112
+ puts(response)
113
+
114
+ puts(response)
115
+ puts('------------------------------------------------------------------------------------------------')
116
+
117
+
118
+
119
+ ######################################PaymentMethods#########################################
120
+ #GAPM
121
+ optionsPaymentMethods=Hash.new
122
+ optionsPaymentMethods[:MERCHANT]= "2153"
123
+
124
+ response = conector.getAllPaymentMethods(optionsPaymentMethods)
125
+ puts('GetAllPaymentMethods:')
126
+ puts(response)
127
+
128
+ #Pasar del XML a Hash - Rails
129
+ #require 'active_support'
130
+ #hash = Hash.from_xml(response)
131
+ #Pasar del XML a Hash - sin Rails
132
+ #require 'xmlsimple'
133
+ #hash = XmlSimple.xml_in(response)
134
+ puts('------------------------------------------------------------------------------------------------')
135
+
136
+ #####################################Operations###############################################
137
+ #GS
138
+ optionsOperations=Hash.new
139
+ optionsOperations[:MERCHANT]= ""
140
+ optionsOperations[:OPERATIONID]= "02"
141
+
142
+ response = conector.getOperations(optionsOperations)
143
+ puts('GetStatus:')
144
+ puts(response)
145
+ #Pasar del XML a Hash - Rails
146
+ #require 'active_support'
147
+ #hash = Hash.from_xml(response)
148
+ #Pasar del XML a Hash - sin Rails
149
+ #require 'xmlsimple'
150
+ #hash = XmlSimple.xml_in(response)
151
+ puts('------------------------------------------------------------------------------------------------')
152
+
153
+
154
+ ############################################returnRequest##############################################
155
+ puts("DEVOLUCION DE 1 PESO")
156
+ optionRR=Hash.new
157
+ optionRR[:Merchant] = "2866"
158
+ optionRR[:Security] = "1540601877EB2059EF50240E46ABD10E"
159
+ optionRR[:RequestKey] = "eeda0188-ec60-d72a-dab8-26bfd0fa5f10"
160
+ optionRR[:AMOUNT] = "1"
161
+
162
+ response = conector.returnRequest(optionRR)
163
+ puts(response)
164
+ puts('------------------------------------------------------------------------------------------------')
165
+
166
+ ############################################voidRequest##############################################
167
+ puts("DEVOLUCION TOTAL")
168
+ optionRR=Hash.new
169
+ optionRR[:Merchant] = "2866"
170
+ optionRR[:Security] = "1540601877EB2059EF50240E46ABD10E"
171
+ optionRR[:RequestKey] = "eeda0188-ec60-d72a-dab8-26bfd0fa5f10"
172
+
173
+ response = conector.voidRequest(optionRR)
174
+ puts(response)
175
+ puts('------------------------------------------------------------------------------------------------')
176
+
177
+ ############################################Operations##############################################
178
+ puts("GET BY RANGE")
179
+ #GBRDT
180
+ optionsGBRDT=Hash.new
181
+ optionsGBRDT[:Merchant]= "2658"
182
+ optionsGBRDT[:STARTDATE]= "2016-01-01"
183
+ optionsGBRDT[:ENDDATE]= "2016-02-19"
184
+ optionsGBRDT[:PAGENUMBER] = 1
185
+
186
+ response = conector.getByRangeDateTime(optionsGBRDT)
187
+ puts(response)
188
+ puts('------------------------------------------------------------------------------------------------')
189
+
190
+
191
+ ######################################GET CREDENTIALS###############################################
192
+ puts("GET CREDENTIALS")
193
+ #Credentials
194
+ u = User.new("email@ejemplo.com", "password1")
195
+ begin
196
+ response = conector.getCredentials(u)
197
+ puts response.merchant
198
+ puts response.apiKey
199
+ rescue Exception => msg
200
+ puts(msg)
201
+ end
202
+ puts('------------------------------------------------------------------------------------------------')
203
+
@@ -0,0 +1,108 @@
1
+ #encoding: utf-8
2
+ require "../lib/FraudControlValidation"
3
+ require "../lib/todo_pago_conector.rb"
4
+ require "../lib/user.rb"
5
+ require "../lib/Exceptions/empty_field_user_exception.rb"
6
+ require "../lib/Exceptions/empty_field_password_exception.rb"
7
+ require "../lib/Exceptions/connection_exception.rb"
8
+ require "../lib/Exceptions/response_exception.rb"
9
+
10
+ j_header_http = {
11
+ 'Authorization'=>'TODOPAGO 1540601877EB2059EF50240E46ABD10E', 'Username'=>'>Test'
12
+ }
13
+
14
+ endpoint = 'https://developers.todopago.com.ar/'
15
+
16
+ puts 'inicio .... '
17
+
18
+ TpConnector = TodoPagoConector.new(j_header_http, "test")
19
+
20
+ puts '******* .... '
21
+
22
+
23
+ parameters = Hash.new
24
+ parameters["CSBTCITY"]= "Villa General BelgranoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!$%&/()?" # MANDATORIO.
25
+ parameters["CSBTCOUNTRY"]= "ARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!$%&/()?" # MANDATORIO.
26
+ parameters["CSBTEMAIL"]= "some@someurl.com" # MANDATORIO.
27
+ parameters["CSBTFIRSTNAME"]= "JuanAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!$%&/()?" # MANDATORIO.
28
+ parameters["CSBTLASTNAME"]="PerezAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!$%&/()?" # MANDATORIO.
29
+ parameters["CSBTPHONENUMBER"]="5411609-13988" # MANDATORIO.
30
+ parameters["CSBTPOSTALCODE"]="" # MANDATORIO.
31
+ parameters["CSBTSTATE"]="B" # MANDATORIO
32
+ parameters["CSBTSTREET1"] = "Some Street 2153AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!$%&/()?" # MANDATORIO.
33
+ parameters["CSBTSTREET2"]="t" # NO MANDATORIO
34
+ parameters["CSBTCUSTOMERID"]="" # MANDATORIO.
35
+ parameters["CSBTIPADDRESS"]="154.0.0.4" # MANDATORIO.
36
+ parameters["CSPTCURRENCY"]="" # MANDATORIO.
37
+ parameters["CSPTGRANDTOTALAMOUNT"]="40" # MANDATORIO.
38
+ parameters["CSMDD6"]="" # NO MANDATORIO.
39
+ parameters["CSMDD7"]="" # NO MANDATORIO.
40
+ parameters["CSMDD8"]="" # NO MANDATORIO.
41
+ parameters["CSMDD9"]="" # NO MANDATORIO.
42
+ parameters["CSMDD10"]="" # NO MANDATORIO.
43
+ parameters["CSMDD11"]="" # NO MANDATORIO.
44
+ parameters["CSSTCITY"] = "Villa General BelgranoPerezAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!$%&/()?" # MANDATORIO.
45
+ parameters["CSSTCOUNTRY"]="ARPerezAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!$%&/()?" # MANDATORIO.
46
+ parameters["CSSTEMAIL"]="some@someurl.com" # MANDATORIO.
47
+ parameters["CSSTFIRSTNAME"]= "JuanPerezAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!$%&/()?" # MANDATORIO.
48
+ parameters["CSSTLASTNAME"] = "PerezPerezAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!$%&/()?" # MANDATORIO.
49
+ parameters["CSSTPHONENUMBER"]="5411609-13988" # MANDATORIO.
50
+ parameters["CSSTPOSTALCODE"]="1111" # MANDATORIO.
51
+ parameters["CSSTSTATE"]="B" # MANDATORIO
52
+ parameters["CSSTSTREET1"]= "Some Street 2153PerezAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!$%&/()?" # MANDATORIO.
53
+ parameters["CSSTSTREET2"]="t" # NO MANDATORIO.
54
+
55
+ parameters["CSITPRODUCTCODE"]= "electronic_good#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa#bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" # CONDICIONAL
56
+ parameters["CSITPRODUCTDESCRIPTION"]= "Test Prd Description#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa#bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" # CONDICIONAL.
57
+ parameters["CSITPRODUCTNAME"]= "TestPrd#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa#bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" # CONDICIONAL.
58
+ parameters["CSITPRODUCTSKU"]= "SKU1234#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa#bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" # CONDICIONAL.
59
+ parameters["CSITTOTALAMOUNT"]="10.01#10.01#10.01#10.01" # CONDICIONAL.
60
+ parameters["CSITQUANTITY"]="1#1#1#1" # CONDICIONAL.
61
+ parameters["CSITUNITPRICE"]="10.01#10.01#10.01#10.01"
62
+ parameters["CSMDD12"]="" # NO MADATORIO.
63
+ parameters["CSMDD13"]="" # NO MANDATORIO.
64
+ parameters["CSMDD14"]="" # NO MANDATORIO.
65
+ parameters["CSMDD15"]="" # NO MANDATORIO.
66
+ parameters["CSMDD16"]="" # NO MANDATORIO.
67
+ parameters["CSMDD44"]="" # NO MANDATORIO.
68
+
69
+
70
+
71
+ optionsSAR_comercio = Hash.new
72
+ optionsSAR_comercio[:Security]="1234567890ABCDEF1234567890ABCDEF"
73
+ optionsSAR_comercio[:MERCHANT]= "2153"
74
+ optionsSAR_comercio[:EncodingMethod]="XML"
75
+ optionsSAR_comercio[:URL_OK]= "http://someurl.com/ok/"
76
+ optionsSAR_comercio[:URL_ERROR]= "http://someurl.com/error/"
77
+ optionsSAR_comercio[:EMAILCLIENTE]= "mail@someurl.com"
78
+ optionsSAR_comercio[:Session]= "ABCDEF-1234-12221-FDE1-00000200"
79
+
80
+ puts 'ya cargue las cosas ... '
81
+
82
+ #########################
83
+ #res = TpConnector.sendAuthorizeRequest(optionsSAR_comercio, parameters)
84
+ #
85
+ #puts res
86
+ #
87
+ #exit
88
+ #################################
89
+
90
+
91
+ Fcv = FraudControlValidation.new()
92
+ result = Fcv.validate(parameters)
93
+
94
+ puts 'RESULT : '
95
+ puts result
96
+ puts 'errores : '
97
+
98
+ if(!Fcv.campError.empty?)
99
+ Fcv.campError.each do |field , message|
100
+ puts field + ': ' + message
101
+ end
102
+ end
103
+ exit
104
+
105
+
106
+
107
+
108
+
@@ -0,0 +1,11 @@
1
+ #encoding: utf-8
2
+
3
+ require 'simplecov'
4
+ SimpleCov.start
5
+
6
+ require_relative "DiscoverPaymentMethodsTest.rb"
7
+ require_relative "GetAuthorizeAnswerTest.rb"
8
+ require_relative "GetCredentialsTest.rb"
9
+ require_relative "GetOperationsTest.rb"
10
+ require_relative "ReturnRequestTest.rb"
11
+ require_relative "SendAuthorizeRequestTest.rb"
@@ -0,0 +1,14 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'TodoPagoConectorSS'
3
+ s.version = '1.8.3'
4
+ s.date = '2016-10-13'
5
+ s.summary="test conector"
6
+ s.description = "Conector para la plataforma de pagos"
7
+ s.authors = ["Softtek"]
8
+ s.files = Dir.chdir(File.expand_path('..', __FILE__)) do
9
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
10
+ end
11
+ s.add_runtime_dependency "savon"
12
+ s.add_runtime_dependency "rest-client"
13
+ s.add_runtime_dependency "json"
14
+ end
@@ -0,0 +1,320 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
3
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
4
+ xmlns:ns="http://api.todopago.com.ar"
5
+ xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
6
+ xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
7
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
8
+ xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
9
+ xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
10
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
11
+ xmlns:tns="http://api.todopago.com.ar"
12
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
13
+ xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
14
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
15
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
16
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17
+ xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
18
+ xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
19
+ targetNamespace="http://api.todopago.com.ar">
20
+ <wsdl:types>
21
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
22
+ attributeFormDefault="unqualified"
23
+ elementFormDefault="qualified"
24
+ targetNamespace="http://api.todopago.com.ar">
25
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
26
+ <element name="SendAuthorizeRequest">
27
+ <complexType>
28
+ <sequence>
29
+ <element name="Security" type="string"/>
30
+ <element name="Session" type="string" minOccurs="0" nillable="true"/>
31
+ <element name="Merchant" type="string"/>
32
+ <element name="URL_OK" type="string" minOccurs="0" nillable="true"/>
33
+ <element name="URL_ERROR" type="string" minOccurs="0" nillable="true"/>
34
+ <element name="EncodingMethod"
35
+ type="string"
36
+ minOccurs="0"
37
+ nillable="true"/>
38
+ <element name="Payload" type="anyType" minOccurs="0" nillable="true"/>
39
+ </sequence>
40
+ </complexType>
41
+ </element>
42
+ <element name="SendAuthorizeRequestResponse">
43
+ <complexType>
44
+ <sequence>
45
+ <element name="StatusCode" type="int"/>
46
+ <element name="StatusMessage"
47
+ type="string"
48
+ minOccurs="0"
49
+ nillable="true"/>
50
+ <element name="URL_Request" type="string" minOccurs="0" nillable="true"/>
51
+ <element name="RequestKey" type="string" minOccurs="0" nillable="true"/>
52
+ <element name="PublicRequestKey" type="string" minOccurs="0" nillable="true"/>
53
+ </sequence>
54
+ </complexType>
55
+ </element>
56
+ <element name="GetAuthorizeAnswer">
57
+ <complexType>
58
+ <sequence>
59
+ <element name="Security" type="string"/>
60
+ <element name="Session" type="string" minOccurs="0" nillable="true"/>
61
+ <element name="Merchant" type="string"/>
62
+ <element name="RequestKey" type="string" minOccurs="0" nillable="true"/>
63
+ <element name="AnswerKey" type="string" minOccurs="0" nillable="true"/>
64
+ </sequence>
65
+ </complexType>
66
+ </element>
67
+ <element name="GetAuthorizeAnswerResponse">
68
+ <complexType>
69
+ <sequence>
70
+ <element name="StatusCode" type="int"/>
71
+ <element name="StatusMessage"
72
+ type="string"
73
+ minOccurs="0"
74
+ nillable="true"/>
75
+ <element name="AuthorizationKey"
76
+ type="string"
77
+ minOccurs="0"
78
+ nillable="true"/>
79
+ <element name="EncodingMethod"
80
+ type="string"
81
+ minOccurs="0"
82
+ nillable="true"/>
83
+ <element name="Payload" type="anyType" minOccurs="0" nillable="true"/>
84
+ </sequence>
85
+ </complexType>
86
+ </element>
87
+ <element name="VoidRequest">
88
+ <complexType>
89
+ <sequence>
90
+ <element name="Security" type="string" minOccurs="0" maxOccurs="1" nillable="true"/>
91
+ <element name="Merchant" type="string" minOccurs="1" maxOccurs="1" nillable="false"/>
92
+ <element name="Channel" type="string" minOccurs="1" maxOccurs="1" nillable="false"/>
93
+ <element name="AuthorizationKey" type="string" minOccurs="0" maxOccurs="1" nillable="true"/>
94
+ <element name="RequestKey" type="string" minOccurs="0" maxOccurs="1" nillable="true"/>
95
+ </sequence>
96
+ </complexType>
97
+ </element>
98
+ <element name="VoidResponse">
99
+ <complexType>
100
+ <sequence>
101
+ <element name="StatusCode" type="int" minOccurs="1" maxOccurs="1" nillable="false"/>
102
+ <element name="StatusMessage" type="string" minOccurs="0" maxOccurs="1" nillable="true"/>
103
+ <element name="AuthorizationKey" type="string" minOccurs="0" maxOccurs="1" nillable="true"/>
104
+ <element name="AUTHORIZATIONCODE" type="string" minOccurs="0" maxOccurs="1" nillable="true"/>
105
+ </sequence>
106
+ </complexType>
107
+ </element>
108
+ <element name="ReturnRequest">
109
+ <complexType>
110
+ <sequence>
111
+ <element name="Security" type="string" minOccurs="0" maxOccurs="1" nillable="true"/>
112
+ <element name="Merchant" type="string" minOccurs="1" maxOccurs="1" nillable="false"/>
113
+ <element name="Channel" type="string" minOccurs="1" maxOccurs="1" nillable="false"/>
114
+ <element name="AuthorizationKey" type="string" minOccurs="0" maxOccurs="1" nillable="true"/>
115
+ <element name="RequestKey" type="string" minOccurs="0" maxOccurs="1" nillable="true"/>
116
+ <element name="CURRENCYCODE" type="string" minOccurs="0" maxOccurs="1" nillable="true"/>
117
+ <element name="AMOUNT" type="float" minOccurs="0" maxOccurs="1" nillable="true"/>
118
+ </sequence>
119
+ </complexType>
120
+ </element>
121
+ <element name="ReturnResponse">
122
+ <complexType>
123
+ <sequence>
124
+ <element name="StatusCode" type="int" minOccurs="1" maxOccurs="1" nillable="false"/>
125
+ <element name="StatusMessage" type="string" minOccurs="0" maxOccurs="1" nillable="true"/>
126
+ <element name="AuthorizationKey" type="string" minOccurs="0" maxOccurs="1" nillable="true"/>
127
+ <element name="AUTHORIZATIONCODE" type="string" minOccurs="0" maxOccurs="1" nillable="true"/>
128
+ </sequence>
129
+ </complexType>
130
+ </element>
131
+ </schema>
132
+ </wsdl:types>
133
+ <wsdl:message name="GetAuthorizeAnswer">
134
+ <wsdl:part name="parameters" element="ns:GetAuthorizeAnswer"/>
135
+ </wsdl:message>
136
+ <wsdl:message name="GetAuthorizeAnswerResponse">
137
+ <wsdl:part name="parameters" element="ns:GetAuthorizeAnswerResponse"/>
138
+ </wsdl:message>
139
+ <wsdl:message name="SendAuthorizeRequest">
140
+ <wsdl:part name="parameters" element="ns:SendAuthorizeRequest"/>
141
+ </wsdl:message>
142
+ <wsdl:message name="SendAuthorizeRequestResponse">
143
+ <wsdl:part name="parameters" element="ns:SendAuthorizeRequestResponse"/>
144
+ </wsdl:message>
145
+ <wsdl:message name="VoidRequest">
146
+ <wsdl:part name="parameters" element="ns:VoidRequest"/>
147
+ </wsdl:message>
148
+ <wsdl:message name="VoidResponse">
149
+ <wsdl:part name="parameters" element="ns:VoidResponse"/>
150
+ </wsdl:message>
151
+ <wsdl:message name="ReturnRequest">
152
+ <wsdl:part name="parameters" element="ns:ReturnRequest"/>
153
+ </wsdl:message>
154
+ <wsdl:message name="ReturnResponse">
155
+ <wsdl:part name="parameters" element="ns:ReturnResponse"/>
156
+ </wsdl:message>
157
+ <wsdl:portType name="AuthorizePortType">
158
+ <wsdl:operation name="GetAuthorizeAnswer">
159
+ <wsdl:documentation>Service definition of Operation GetAuthorizeAnswer: Utilizada para recuerar los datos de la Respuesta de la Autorizacion en el Caso de Clientes no PCI</wsdl:documentation>
160
+ <wsdl:input message="ns:GetAuthorizeAnswer"/>
161
+ <wsdl:output message="ns:GetAuthorizeAnswerResponse"
162
+ wsaw:Action="//api.todopago.com.ar/AuthorizePortType/GetAuthorizeAnswerResponse"/>
163
+ </wsdl:operation>
164
+ <wsdl:operation name="SendAuthorizeRequest">
165
+ <wsdl:documentation>Service definition of Operation SendAuthorizeRequest: Utilizada para enviar los datos que se utilizaran en el requerimiento de Autorizacion, para Clientes PCI</wsdl:documentation>
166
+ <wsdl:input message="ns:SendAuthorizeRequest"/>
167
+ <wsdl:output message="ns:SendAuthorizeRequestResponse"
168
+ wsaw:Action="//api.todopago.com.ar/AuthorizePortType/SendAuthorizeRequestResponse"/>
169
+ </wsdl:operation>
170
+ <wsdl:operation name="VoidRequest">
171
+ <wsdl:documentation>Service definition of Operation Void: Utilizada para Anular una Transaccion</wsdl:documentation>
172
+ <wsdl:input message="ns:VoidRequest"/>
173
+ <wsdl:output message="ns:VoidResponse"
174
+ wsaw:Action="//api.todopago.com.ar/AuthorizePortType/VoidResponse"/>
175
+ </wsdl:operation>
176
+ <wsdl:operation name="ReturnRequest">
177
+ <wsdl:documentation>Service definition of Operation Return: Utilizada para Devolver total o parcialmente una Transaccion</wsdl:documentation>
178
+ <wsdl:input message="ns:ReturnRequest"/>
179
+ <wsdl:output message="ns:ReturnResponse"
180
+ wsaw:Action="//api.todopago.com.ar/AuthorizePortType/ReturnResponse"/>
181
+ </wsdl:operation>
182
+ </wsdl:portType>
183
+ <wsdl:binding name="AuthorizeSoap11Binding" type="ns:AuthorizePortType">
184
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
185
+ <wsdl:operation name="SendAuthorizeRequest">
186
+ <soap:operation soapAction="" style="document"/>
187
+ <wsdl:input>
188
+ <soap:body use="literal"/>
189
+ </wsdl:input>
190
+ <wsdl:output>
191
+ <soap:body use="literal"/>
192
+ </wsdl:output>
193
+ </wsdl:operation>
194
+ <wsdl:operation name="GetAuthorizeAnswer">
195
+ <soap:operation soapAction="" style="document"/>
196
+ <wsdl:input>
197
+ <soap:body use="literal"/>
198
+ </wsdl:input>
199
+ <wsdl:output>
200
+ <soap:body use="literal"/>
201
+ </wsdl:output>
202
+ </wsdl:operation>
203
+ <wsdl:operation name="VoidRequest">
204
+ <soap:operation soapAction="" style="document"/>
205
+ <wsdl:input>
206
+ <soap:body use="literal"/>
207
+ </wsdl:input>
208
+ <wsdl:output>
209
+ <soap:body use="literal"/>
210
+ </wsdl:output>
211
+ </wsdl:operation>
212
+ <wsdl:operation name="ReturnRequest">
213
+ <soap:operation soapAction="" style="document"/>
214
+ <wsdl:input>
215
+ <soap:body use="literal"/>
216
+ </wsdl:input>
217
+ <wsdl:output>
218
+ <soap:body use="literal"/>
219
+ </wsdl:output>
220
+ </wsdl:operation>
221
+ </wsdl:binding>
222
+ <wsdl:binding name="AuthorizeSoap12Binding" type="ns:AuthorizePortType">
223
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
224
+ <wsdl:operation name="SendAuthorizeRequest">
225
+ <soap12:operation soapAction="" style="document"/>
226
+ <wsdl:input>
227
+ <soap12:body use="literal"/>
228
+ </wsdl:input>
229
+ <wsdl:output>
230
+ <soap12:body use="literal"/>
231
+ </wsdl:output>
232
+ </wsdl:operation>
233
+ <wsdl:operation name="GetAuthorizeAnswer">
234
+ <soap12:operation soapAction="" style="document"/>
235
+ <wsdl:input>
236
+ <soap12:body use="literal"/>
237
+ </wsdl:input>
238
+ <wsdl:output>
239
+ <soap12:body use="literal"/>
240
+ </wsdl:output>
241
+ </wsdl:operation>
242
+ <wsdl:operation name="VoidRequest">
243
+ <soap12:operation soapAction="" style="document"/>
244
+ <wsdl:input>
245
+ <soap12:body use="literal"/>
246
+ </wsdl:input>
247
+ <wsdl:output>
248
+ <soap12:body use="literal"/>
249
+ </wsdl:output>
250
+ </wsdl:operation>
251
+ <wsdl:operation name="ReturnRequest">
252
+ <soap12:operation soapAction="" style="document"/>
253
+ <wsdl:input>
254
+ <soap12:body use="literal"/>
255
+ </wsdl:input>
256
+ <wsdl:output>
257
+ <soap12:body use="literal"/>
258
+ </wsdl:output>
259
+ </wsdl:operation>
260
+ </wsdl:binding>
261
+ <wsdl:binding name="AuthorizeHttpBinding" type="ns:AuthorizePortType">
262
+ <http:binding verb="POST"/>
263
+ <wsdl:operation name="SendAuthorizeRequest">
264
+ <http:operation location="SendAuthorizeRequest"/>
265
+ <wsdl:input>
266
+ <mime:content type="text/xml" part="parameters"/>
267
+ </wsdl:input>
268
+ <wsdl:output>
269
+ <mime:content type="text/xml" part="parameters"/>
270
+ </wsdl:output>
271
+ </wsdl:operation>
272
+ <wsdl:operation name="GetAuthorizeAnswer">
273
+ <http:operation location="GetAuthorizeAnswer"/>
274
+ <wsdl:input>
275
+ <mime:content type="text/xml" part="parameters"/>
276
+ </wsdl:input>
277
+ <wsdl:output>
278
+ <mime:content type="text/xml" part="parameters"/>
279
+ </wsdl:output>
280
+ </wsdl:operation>
281
+ <wsdl:operation name="VoidRequest">
282
+ <http:operation location="VoidRequest"/>
283
+ <wsdl:input>
284
+ <mime:content type="text/xml" part="parameters"/>
285
+ </wsdl:input>
286
+ <wsdl:output>
287
+ <mime:content type="text/xml" part="parameters"/>
288
+ </wsdl:output>
289
+ </wsdl:operation>
290
+ <wsdl:operation name="ReturnRequest">
291
+ <http:operation location="ReturnRequest"/>
292
+ <wsdl:input>
293
+ <mime:content type="text/xml" part="parameters"/>
294
+ </wsdl:input>
295
+ <wsdl:output>
296
+ <mime:content type="text/xml" part="parameters"/>
297
+ </wsdl:output>
298
+ </wsdl:operation>
299
+ </wsdl:binding>
300
+ <wsdl:service name="Authorize">
301
+ <wsdl:port name="AuthorizeHttpsSoap11Endpoint" binding="ns:AuthorizeSoap11Binding">
302
+ <soap:address location="https://192.168.135.35:8443/services/Authorize.AuthorizeHttpsSoap11Endpoint"/>
303
+ </wsdl:port>
304
+ <wsdl:port name="AuthorizeHttpSoap11Endpoint" binding="ns:AuthorizeSoap11Binding">
305
+ <soap:address location="http://192.168.135.35:8480/services/Authorize.AuthorizeHttpSoap11Endpoint"/>
306
+ </wsdl:port>
307
+ <wsdl:port name="AuthorizeHttpSoap12Endpoint" binding="ns:AuthorizeSoap12Binding">
308
+ <soap12:address location="http://192.168.135.35:8480/services/Authorize.AuthorizeHttpSoap12Endpoint"/>
309
+ </wsdl:port>
310
+ <wsdl:port name="AuthorizeHttpsSoap12Endpoint" binding="ns:AuthorizeSoap12Binding">
311
+ <soap12:address location="https://192.168.135.35:8443/services/Authorize.AuthorizeHttpsSoap12Endpoint"/>
312
+ </wsdl:port>
313
+ <wsdl:port name="AuthorizeHttpsEndpoint" binding="ns:AuthorizeHttpBinding">
314
+ <http:address location="https://192.168.135.35:8443/services/Authorize.AuthorizeHttpsEndpoint"/>
315
+ </wsdl:port>
316
+ <wsdl:port name="AuthorizeHttpEndpoint" binding="ns:AuthorizeHttpBinding">
317
+ <http:address location="http://192.168.135.35:8480/services/Authorize.AuthorizeHttpEndpoint"/>
318
+ </wsdl:port>
319
+ </wsdl:service>
320
+ </wsdl:definitions>