transbank-oneclick 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -0
- data/Guardfile +42 -0
- data/README.md +4 -3
- data/lib/generators/transbank_oneclick/install/templates/transbank_oneclick.rb +5 -5
- data/lib/transbank/oneclick.rb +1 -0
- data/lib/transbank/oneclick/api.rb +1 -1
- data/lib/transbank/oneclick/configuration.rb +1 -0
- data/lib/transbank/oneclick/exceptions.rb +7 -0
- data/lib/transbank/oneclick/response.rb +50 -16
- data/lib/transbank/oneclick/version.rb +1 -1
- data/spec/keys/server/server_tbk.crt +20 -0
- data/spec/keys/server/server_tbk.csr +17 -0
- data/spec/keys/server/server_tbk.key +27 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/transbank/oneclick/response_spec.rb +17 -10
- metadata +26 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cb176feea126f1c5270334ad11dcb9f1cd281fc
|
4
|
+
data.tar.gz: 2702fc1b55760fb5c0999a90e3470b54cc96f37d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09add5ae4b6990dcb26b73a20b4cbd766126065a56bc319f99ff1667545f70bcae796b57d2d7bff5d8e14161bb16f7bf6d7a98996688d96ce413f7fd4278bceb
|
7
|
+
data.tar.gz: 266771d9a7c3e1c9c69a210fd0b55f029b0eba3434a22c3a8b1c9bc4d4e417965b8eea03fcdb3b2359769a8e3a901fae4c4a661da90946d5a49a7ca2f02162d0
|
data/Gemfile
CHANGED
data/Guardfile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
## Uncomment and set this to only include directories you want to watch
|
5
|
+
# directories %w(app lib config test spec features) \
|
6
|
+
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
7
|
+
|
8
|
+
## Note: if you are using the `directories` clause above and you are not
|
9
|
+
## watching the project directory ('.'), then you will want to move
|
10
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
11
|
+
#
|
12
|
+
# $ mkdir config
|
13
|
+
# $ mv Guardfile config/
|
14
|
+
# $ ln -s config/Guardfile .
|
15
|
+
#
|
16
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
17
|
+
|
18
|
+
guard :minitest do
|
19
|
+
# with Minitest::Unit
|
20
|
+
watch(%r{^test/(.*)\/?test_(.*)\.rb$})
|
21
|
+
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
|
22
|
+
watch(%r{^test/test_helper\.rb$}) { 'test' }
|
23
|
+
|
24
|
+
# with Minitest::Spec
|
25
|
+
watch(%r{^spec/(.*)_spec\.rb$})
|
26
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
27
|
+
watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
|
28
|
+
|
29
|
+
# Rails 4
|
30
|
+
# watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
|
31
|
+
# watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
|
32
|
+
# watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "test/integration/#{m[1]}_test.rb" }
|
33
|
+
# watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
|
34
|
+
# watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" }
|
35
|
+
# watch(%r{^test/.+_test\.rb$})
|
36
|
+
# watch(%r{^test/test_helper\.rb$}) { 'test' }
|
37
|
+
|
38
|
+
# Rails < 4
|
39
|
+
# watch(%r{^app/controllers/(.*)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
|
40
|
+
# watch(%r{^app/helpers/(.*)\.rb$}) { |m| "test/helpers/#{m[1]}_test.rb" }
|
41
|
+
# watch(%r{^app/models/(.*)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
|
42
|
+
end
|
data/README.md
CHANGED
@@ -133,9 +133,10 @@ Then edit (config/initializers/transbank_oneclick.rb):
|
|
133
133
|
|
134
134
|
```ruby
|
135
135
|
Transbank::Oneclick.configure do |config|
|
136
|
-
config.url
|
137
|
-
config.cert_path
|
138
|
-
config.key_path
|
136
|
+
config.url = "ONECLICK_SOAP_URL"
|
137
|
+
config.cert_path = "RELATIVE_PATH_TO_CRT_FILE"
|
138
|
+
config.key_path = "RELATIVE_PATH_TO_KEY_FILE"
|
139
|
+
config.server_cert_path = "RELATIVE_PATH_TO_SERVER_CRT_FILE"
|
139
140
|
end
|
140
141
|
```
|
141
142
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Transbank::Oneclick.configure do |config|
|
2
|
-
|
3
|
-
# config.
|
4
|
-
# config.
|
5
|
-
# config.
|
2
|
+
# config.url = "ONECLICK_SOAP_URL"
|
3
|
+
# config.cert_path = "RELATIVE_PATH_TO_CRT_FILE"
|
4
|
+
# config.key_path = "RELATIVE_PATH_TO_KEY_FILE"
|
5
|
+
# config.server_cert_path = "RELATIVE_PATH_TO_SERVER_CRT_FILE"
|
6
6
|
|
7
7
|
# These are the default options for Net::HTTP
|
8
8
|
# it is also possible to pass them on every request
|
@@ -13,5 +13,5 @@ Transbank::Oneclick.configure do |config|
|
|
13
13
|
# ignores any exception passed as argument
|
14
14
|
# not capture any exception: config.rescue_exceptions []
|
15
15
|
# Default is [Net::ReadTimeout, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError]
|
16
|
-
# config.rescue_exceptions = [Net::ReadTimeout, Timeout::Error]
|
16
|
+
# config.rescue_exceptions = [Net::ReadTimeout, Timeout::Error, Transbank::Oneclick::Exceptions::InvalidSignature]
|
17
17
|
end
|
data/lib/transbank/oneclick.rb
CHANGED
@@ -60,6 +60,18 @@ module Transbank
|
|
60
60
|
errors.empty?
|
61
61
|
end
|
62
62
|
|
63
|
+
def signed_node
|
64
|
+
doc.at_xpath '//ds:SignedInfo', {'ds' => 'http://www.w3.org/2000/09/xmldsig#'}
|
65
|
+
end
|
66
|
+
|
67
|
+
def signature_node
|
68
|
+
doc.at_xpath('//ds:SignatureValue', {'ds' => 'http://www.w3.org/2000/09/xmldsig#'})
|
69
|
+
end
|
70
|
+
|
71
|
+
def signature_decode
|
72
|
+
Base64.decode64(signature_node.content)
|
73
|
+
end
|
74
|
+
|
63
75
|
def response_code_display
|
64
76
|
if respond_to?(:response_code)
|
65
77
|
# key = RESPONSE_CODE.keys.include?(action) ? action : :default
|
@@ -92,28 +104,50 @@ module Transbank
|
|
92
104
|
end
|
93
105
|
|
94
106
|
private
|
95
|
-
|
96
|
-
|
107
|
+
|
108
|
+
def verify
|
109
|
+
return if signature_node.nil?
|
110
|
+
|
111
|
+
signed_node.add_namespace 'soap', 'http://schemas.xmlsoap.org/soap/envelope/'
|
112
|
+
signed_node_canonicalize = signed_node.canonicalize Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0, ["soap"], nil
|
113
|
+
|
114
|
+
pub_key.verify OpenSSL::Digest::SHA1.new, signature_decode, signed_node_canonicalize
|
115
|
+
end
|
116
|
+
|
117
|
+
def server_cert
|
118
|
+
@server_cert ||= OpenSSL::X509::Certificate.new File.read(Transbank::Oneclick.configuration.server_cert_path)
|
119
|
+
end
|
120
|
+
|
121
|
+
def pub_key
|
122
|
+
server_cert.public_key
|
123
|
+
end
|
124
|
+
|
125
|
+
def attributes_display
|
126
|
+
attributes.map{|name, value| "#{name}: \"#{value}\""}.join ', '
|
127
|
+
end
|
128
|
+
|
129
|
+
def validate!
|
130
|
+
if action =~ /finishInscription|Authorize|/ and respond_to?(:response_code) and response_code != '0'
|
131
|
+
self.errors << response_code_display
|
97
132
|
end
|
98
133
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
end
|
134
|
+
if action =~ /removeUser/ and respond_to?(:text) and text != 'true'
|
135
|
+
self.errors << 'imposible eliminar la inscripción'
|
136
|
+
end
|
103
137
|
|
104
|
-
|
105
|
-
|
106
|
-
|
138
|
+
if action =~ /codeReverseOneClick/ and respond_to?(:reversed) and reversed != 'true'
|
139
|
+
self.errors << 'imposible revertir la compra'
|
140
|
+
end
|
107
141
|
|
108
|
-
|
109
|
-
|
110
|
-
|
142
|
+
if content.class != Net::HTTPOK
|
143
|
+
self.errors += xml_error.map(&:text)
|
144
|
+
self.errors << content.message if content.respond_to?(:message)
|
145
|
+
end
|
111
146
|
|
112
|
-
|
113
|
-
|
114
|
-
self.errors << content.message if content.respond_to?(:message)
|
115
|
-
end
|
147
|
+
if (self.errors.blank? || signature_node.present?) && !verify
|
148
|
+
raise Exceptions::InvalidSignature.new("Invalid signature")
|
116
149
|
end
|
150
|
+
end
|
117
151
|
end
|
118
152
|
end
|
119
153
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIDRDCCAiwCCQCysdFuou3dZjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJD
|
3
|
+
TDERMA8GA1UECBMIU2FudGlhZ28xETAPBgNVBAcTCFNhbnRpYWdvMRAwDgYDVQQK
|
4
|
+
EwdEZW1vVGJrMRAwDgYDVQQLEwdEZW1vVGJrMQswCQYDVQQDEwIxMDAeFw0xNjAz
|
5
|
+
MDQwMDIzMTlaFw0yMDAzMDMwMDIzMTlaMGQxCzAJBgNVBAYTAkNMMREwDwYDVQQI
|
6
|
+
EwhTYW50aWFnbzERMA8GA1UEBxMIU2FudGlhZ28xEDAOBgNVBAoTB0RlbW9UYmsx
|
7
|
+
EDAOBgNVBAsTB0RlbW9UYmsxCzAJBgNVBAMTAjEwMIIBIjANBgkqhkiG9w0BAQEF
|
8
|
+
AAOCAQ8AMIIBCgKCAQEA0quaDGTbuG22XTmeZJYXjmYxzb3snzq4B25GOnMCu6H8
|
9
|
+
jAJe+KaWskE2LZiUkWL6MUVIr9oMzT3qLRSIpBR/QsUJYaFs4HbXe4oVfkzyWOiP
|
10
|
+
rqV++MFW8QmNtPs8gu2FrSQIrR+ytgWKjNXRNwnoINhUL/cSqZ6EOtZZ0gxWusvc
|
11
|
+
xz4n73lVHVIV+ZbXN6vn+QXZnRchj8rAt6j9yg44KlkTtD3nGqYgiSmh57dAuRd/
|
12
|
+
BapXVVVZtrna/BaBmGVbn4kjXEwVXu6lVqnTGgYXEcyMDyyzbcp26gkRAYRYD5yy
|
13
|
+
9oLxA+0BF22D2m1L5TCp7CjPzibsEyhyOSstIeajIQIDAQABMA0GCSqGSIb3DQEB
|
14
|
+
BQUAA4IBAQAQWbBLJR8G1YTlQtkgG/2tymsmig5IatcVl1jQm53FT1nwyk032xoT
|
15
|
+
JAK99Uo5BBZtTnDW1yLIM9iByAW81Ta1PubtfVeUozjjHzWiALa4WMJMB7Z41vAj
|
16
|
+
GwAAmP+uw+Ca9LO5DDC3FYfzXFKpW91Z2Z9/GJWoyA5x3owWymauRbki7yEAlsqb
|
17
|
+
Z82xsHIWneOZSCmz7bSpbiE2jBFv/snSv6WL/q2y45WzugfMnhCsRDzpRMrBWAq2
|
18
|
+
gZiaQO2HWrJhBhoeHeQKTG378zDw8KYKhSwPUHjLD76ja6bL4YZFnqBl4GRhxq3e
|
19
|
+
Cys+ZGlKd5HZQHpSwRltFOps1/aLQXGG
|
20
|
+
-----END CERTIFICATE-----
|
@@ -0,0 +1,17 @@
|
|
1
|
+
-----BEGIN CERTIFICATE REQUEST-----
|
2
|
+
MIICqTCCAZECAQAwZDELMAkGA1UEBhMCQ0wxETAPBgNVBAgTCFNhbnRpYWdvMREw
|
3
|
+
DwYDVQQHEwhTYW50aWFnbzEQMA4GA1UEChMHRGVtb1RiazEQMA4GA1UECxMHRGVt
|
4
|
+
b1RiazELMAkGA1UEAxMCMTAwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
|
5
|
+
AQDSq5oMZNu4bbZdOZ5klheOZjHNveyfOrgHbkY6cwK7ofyMAl74ppayQTYtmJSR
|
6
|
+
YvoxRUiv2gzNPeotFIikFH9CxQlhoWzgdtd7ihV+TPJY6I+upX74wVbxCY20+zyC
|
7
|
+
7YWtJAitH7K2BYqM1dE3Cegg2FQv9xKpnoQ61lnSDFa6y9zHPifveVUdUhX5ltc3
|
8
|
+
q+f5BdmdFyGPysC3qP3KDjgqWRO0PecapiCJKaHnt0C5F38FqldVVVm2udr8FoGY
|
9
|
+
ZVufiSNcTBVe7qVWqdMaBhcRzIwPLLNtynbqCREBhFgPnLL2gvED7QEXbYPabUvl
|
10
|
+
MKnsKM/OJuwTKHI5Ky0h5qMhAgMBAAGgADANBgkqhkiG9w0BAQUFAAOCAQEAjmci
|
11
|
+
vRgYBJR1Cuhw6QpD9sMOrX8GIUlLWqV+6Vk69LM+A4O3b/vN8l1PB9RkF9e4trJm
|
12
|
+
L7EJNJ2H0oYDTSlwHW3xpHFR3CTF5OUnOKxvbJwqL7IvGG3C0RuzZeI36SjfTLrT
|
13
|
+
ENmn1WNhSVbLVR4qCSt6hxhc/zlRL3SMIJYtQoKxg32R0IGO+eXInsTisxuAlKxr
|
14
|
+
QvyHwX9W/s67Witr6Hs+6ftQCSj1ZUyxhYJORbbZwxp7XLgYGWaFIZM9FoVo3hF5
|
15
|
+
dSDgbMGeR0gorqZtxipW4eW5RY3g1e8BytHQziqIFL7OJgKpqN3/X/MeCx4Ssc8k
|
16
|
+
EN4Af+sAH0nhwTV2mg==
|
17
|
+
-----END CERTIFICATE REQUEST-----
|
@@ -0,0 +1,27 @@
|
|
1
|
+
-----BEGIN RSA PRIVATE KEY-----
|
2
|
+
MIIEpAIBAAKCAQEA0quaDGTbuG22XTmeZJYXjmYxzb3snzq4B25GOnMCu6H8jAJe
|
3
|
+
+KaWskE2LZiUkWL6MUVIr9oMzT3qLRSIpBR/QsUJYaFs4HbXe4oVfkzyWOiPrqV+
|
4
|
+
+MFW8QmNtPs8gu2FrSQIrR+ytgWKjNXRNwnoINhUL/cSqZ6EOtZZ0gxWusvcxz4n
|
5
|
+
73lVHVIV+ZbXN6vn+QXZnRchj8rAt6j9yg44KlkTtD3nGqYgiSmh57dAuRd/BapX
|
6
|
+
VVVZtrna/BaBmGVbn4kjXEwVXu6lVqnTGgYXEcyMDyyzbcp26gkRAYRYD5yy9oLx
|
7
|
+
A+0BF22D2m1L5TCp7CjPzibsEyhyOSstIeajIQIDAQABAoIBACK0OhBInRlomV4K
|
8
|
+
G9meEAtZMmMeIliop6AxvkfqokyehqfZzCNR7gk3TOF9/RtmHqj3LN4rIWi+BlGe
|
9
|
+
zFObPMuXAdCfcvwXF7A2Mww3SMT0qpaulJgN4XCbjkh+Cp3W2uqGwRcj3aC2kPha
|
10
|
+
ULisXRzsBhJQtTZT8pxuqyU6+x6SIi0y0DSLnMcFmS/aH73/TlnGN1PqA1N9CmCW
|
11
|
+
sNSZ74F/MYFmCUFuWx6te4O4bxhFhmHq+v5cP0ZhtmbTfqI/914vvcwPPglMVjih
|
12
|
+
+fwdkS+oAhDH7DLpz9nJkOJK7J8HC/F332/FZs1z4FRDHLmYsX/wQ1neROKCybjT
|
13
|
+
4ZKwAQECgYEA6FwXfMeLZNldDz4tYsCDK9r60F6/OI3ye5p+1B1moMp+AsL0+O54
|
14
|
+
8lz+vGqOQo4dVtwZ15SlSQ+U6DQma5F0xyHI9UbSLMaVHQ5LJZDAcSuC9kpBleik
|
15
|
+
S0wX9jpH8OK717015QVh0SwIKutj8wM2BM7xDvWRrldNeAa1iOieazkCgYEA6BqZ
|
16
|
+
l+qpJBX+UQ9e12Qd6ed9rv2fuseZJoiat01cFpToXmu/PXrQ+SB8muiID4I5dCZ/
|
17
|
+
NviShycrGFQtCjlu4b4syJljSNrgzL3KFK7wKEoKkFgUETeb6JFLDcmEUzXln40O
|
18
|
+
zcf8L/JZ7FPHyFCKXTPwofghLKRvaXcXxymYLykCgYAMgUBGV9rZn5URh/AbW27z
|
19
|
+
wkIzSpYR7hm5qzPeKILobl1fuqxCZVse+ABBlZ54WHudvBSr9HT8vJjv8jaLHXXi
|
20
|
+
baAKCziubjWCLc2/hM3GiWfv50kmTzHgV4UGnFZY0Wr4jldDLwn3nt4FqUtkvax/
|
21
|
+
j7+LZY3kixBBQGMurg4wiQKBgQCvoUkuClQ4ySeqwN28ULbOAuw42RPf6x85aE7i
|
22
|
+
e3g+Yik/IXsRk3jDutBvC5vBWIIPIP5MY2XFPV8/xppaTUFZMmWC2YamX3GRm99p
|
23
|
+
LULuybAar3tn19Ny9VZ8tUsbCAKca8mS70wmH9XpnS/kpQU+J4pjlXXM6RShEov8
|
24
|
+
mb3dmQKBgQClDm8i4wz7h7XVgKsBTLJrpLo1MoQjV5dp/5QUmKrNFBXLZq1LL0PI
|
25
|
+
ZrjH6W4k31erPcwQs+Ccp7fDHnlf1iQwbMs3MbvpW1NwLUg8HgUD9w42IK+2kHp6
|
26
|
+
G59TUIU8Dihuml57W4JruKlxstZelixrJKmizw2/kdxBZLvOWT+miA==
|
27
|
+
-----END RSA PRIVATE KEY-----
|
data/spec/spec_helper.rb
CHANGED
@@ -9,6 +9,9 @@ require 'rails/generators/test_case'
|
|
9
9
|
require 'generators/transbank_oneclick/install/install_generator'
|
10
10
|
require 'transbank-oneclick'
|
11
11
|
|
12
|
+
require "minitest/reporters"
|
13
|
+
Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(color: true)]
|
14
|
+
|
12
15
|
INIT_INSCRIPTION_XML = %q{<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP-ENV:mustUnderstand="1"><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></ds:SignatureMethod><ds:Reference URI="#dge763trgad"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod><ds:DigestValue>0BrXmTm2mc2ZRtl/MItcP95fKRg=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>sMXYD7Y5UiuBqHcZNAQYASx4pS0iv2szapjCIlAxyj/VLGfyuHHiKeIannYxcdE4FSL7ubOyKTDW46m3F4xvimYqBAxT6XmoWIpRTohsUL0yVcXlcd3tsyw34ik0+ESDtWxsfYEVoYktW5IceIb3ZcZyCCInvy0ef7aQxFR0tluejqFF9w2TtLcqgwdTDR2n/Xb2sRr+Propdc2rgSElWvz/EYA4yquAKQP/Lw+9+7u6twEM0o6axY+ZQq2VG8ydUjazoZ/25GyPGibQ7OmJ0FnisqpkLDMbgkSJcNcTlpqFTM9Ces0SEx1aTGMiSvP8/Kes0ceWgQgyvCoE/2vDKw==</ds:SignatureValue><ds:KeyInfo><wsse:SecurityTokenReference><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Some-State,L=SANTIAGO,O=Internet Widgits Pty Ltd,CN=597029124456</ds:X509IssuerName><ds:X509SerialNumber>18335542990572456259</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></SOAP-ENV:Header><SOAP-ENV:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="dge763trgad"><ns1:init_inscription xmlns:ns1="http://webservices.webpayserver.transbank.com/"><arg0><email>username@domain</email><username>username</username><response_url>http://domain/card</response_url></arg0></ns1:init_inscription></SOAP-ENV:Body></SOAP-ENV:Envelope>}
|
13
16
|
FINISH_INSCRIPTION_XML = %q{<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP-ENV:mustUnderstand="1"><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></ds:SignatureMethod><ds:Reference URI="#dge763trgad"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod><ds:DigestValue>IHwQM0OmsM6YCyFNI1kG5RdMtk4=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>AGO75Nn0u5YrmRaLeN055X1WBj1Ikzb1sgP4chOsMNTQDmG7fAW/FTE7ldTzHNmHolrLD2Scmb2H7Xu9k3OqfjGTM0883zyKLXZiyNPBqpW2CqiTcb+i1O490BVZcsRMVWd8P/EGoWpcuLwDYlq0j1Ym6486OZ0V0+E9Rj5U4tc3ShjHd7rJRiO2J8+rq9CmUhn++Yd+v+LGDev54UQHFp574CmWPC3s5u7JXJ1Bf2zZN4jZR1LGvtDDRWw+CRmm/k9XNpgw57+9bJQYN7xwg248vztvCX/mtPqwayNiqhXwo3cAKgCFP6WoK0XNTWWqxUVRrf6fNSxc8JqWPKBGoA==</ds:SignatureValue><ds:KeyInfo><wsse:SecurityTokenReference><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Some-State,L=SANTIAGO,O=Internet Widgits Pty Ltd,CN=597029124456</ds:X509IssuerName><ds:X509SerialNumber>18335542990572456259</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></SOAP-ENV:Header><SOAP-ENV:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="dge763trgad"><ns1:finish_inscription xmlns:ns1="http://webservices.webpayserver.transbank.com/"><arg0><token>fyegwyufgi3289rheowifewfiasocgh2e78c</token></arg0></ns1:finish_inscription></SOAP-ENV:Body></SOAP-ENV:Envelope>}
|
14
17
|
AUTHORIZE_XML = %q{<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP-ENV:mustUnderstand="1"><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></ds:SignatureMethod><ds:Reference URI="#dge763trgad"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod><ds:DigestValue>5Cly+K17xLkr7oiICa7phcdvbos=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>m7UKJYImHNr0jWN3dOqfXmOXzqNQ4UZ4wII6R/XwtZmJp1dLV71WXvABBP35mTIgKD1Bd3FbDXxrPndVw/FjliotujOBGeUk+qJKGLhm+uET1Mr5acNPtmQE2Kw7Ls4qrWkqbyIEOv8skJfnhy6qZeJgmHsgjPqARW3QTUPSfqL2Z3ysNqriRw92c8ZrKF518e/B/f1ua8ruaIz4srEcMD+4RVE0DP4ao/iNHJA5rVB4mbb9JW2Hb+isyDjCXCfZzx5K2szJksBV/BagFdF7+No44bpH37tL6H3jHw1hAkWjST/1WN1RC+1IflQIZUVBQh0IXw+AmjDQ/AceYqef7A==</ds:SignatureValue><ds:KeyInfo><wsse:SecurityTokenReference><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Some-State,L=SANTIAGO,O=Internet Widgits Pty Ltd,CN=597029124456</ds:X509IssuerName><ds:X509SerialNumber>18335542990572456259</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></SOAP-ENV:Header><SOAP-ENV:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="dge763trgad"><ns1:authorize xmlns:ns1="http://webservices.webpayserver.transbank.com/"><arg0><amount>99999</amount><tbk_user>35700491-cb03-4bbb-8ab7-29dd7b0771ab</tbk_user><username>user_1</username><buy_order>20110715115550003</buy_order></arg0></ns1:authorize></SOAP-ENV:Body></SOAP-ENV:Envelope>}
|
@@ -21,4 +24,5 @@ Transbank::Oneclick.configure do |config|
|
|
21
24
|
config.url = 'https://transbank-example.cl/oneclick'
|
22
25
|
config.cert_path = 'spec/keys/597029124456.crt'
|
23
26
|
config.key_path = 'spec/keys/597029124456.key'
|
27
|
+
config.server_cert_path = 'spec/keys/server/server_tbk.crt'
|
24
28
|
end
|
@@ -27,7 +27,7 @@ module Transbank
|
|
27
27
|
end
|
28
28
|
|
29
29
|
describe 'with response valid' do
|
30
|
-
let(:body) {
|
30
|
+
let(:body) { "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" soap:mustUnderstand=\"1\"><ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"SIG-8350\"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"soap\"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"></ds:SignatureMethod><ds:Reference URI=\"#id-8349\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"\"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"></ds:DigestMethod><ds:DigestValue>dsJH15MYSVxtlBewmw7XtFm3/oM=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>kTZH5cri06sQcJ6diYQLdzYnSGqny28GbEo1S47+27BhcWNi3bgca1t11v5Xd5xl6CNqHH6ty3xyq3fPt7ahb7zzot2z0CIJ6cvsxJ9171spZxvwrU0ywBPeo9Wh2Qpf57NYS2EUEOT2VmLEECt8mKofPq2lTEKsIxFsKFIw5mN0CL0MkBpaMTJMWEzToTY9ANWEKThiD9jp2qZs3gcqX3JzDVhmhdHtliVvKv+PXkZRu0eHqF78BW8qcE6TNPuhIcd+dOkRc2ApLhjXRg5RlPrRt0gEgAfo6IXCQ1hOnhJfsY3ygyPypHV94uNFsRlgO7DmPcoCqOAd0uprnFBFwQ==</ds:SignatureValue><ds:KeyInfo Id=\"KI-F6DDC585AC5A582DD2142559657168312524\"><wsse:SecurityTokenReference xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"STR-F6DDC585AC5A582DD2142559657168312525\"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Santiago,L=Santiago,O=DemoTbk,OU=DemoTbk,CN=10</ds:X509IssuerName><ds:X509SerialNumber>12876303082739064166</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"id-8349\"><ns2:initInscriptionResponse xmlns:ns2=\"http://webservices.webpayserver.transbank.com/\"><return><token>e7667c5f871fa39e6c05549eeddd1ff07a520a769fa84cc6994465cdb06cbb4b</token><urlWebpay>https://webpay3g.orangepeople.cl/webpayserver/bp_inscription.cgi</urlWebpay></return></ns2:initInscriptionResponse></soap:Body></soap:Envelope>" }
|
31
31
|
let(:content) { mock_content(body, '200') }
|
32
32
|
let(:response) { Response.new content, :initInscription}
|
33
33
|
|
@@ -103,11 +103,18 @@ module Transbank
|
|
103
103
|
it { response.exception.must_be_nil }
|
104
104
|
it { response.attributes.size.must_equal 0 }
|
105
105
|
end
|
106
|
+
|
107
|
+
describe 'with valid signature' do
|
108
|
+
let(:body) { %q{<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soap:mustUnderstand="1"><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="SIG-4250"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="soap"/></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#id-4249"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList=""/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>j754dDxPx/xkw/3ZgiQ8mmPesrI=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>cPQGBl2IVWR+e4zGnzo6p0G9mbdfQs/WRMWMFMCD6bXFjCxfDf51GdJsUKYUoe+x6zaecLzsSdjLQBSjnBwdvpyZnN4ggnmi3SXsn2yjHY7rLca1yo+Y/Rdet/suDExd9jOoNpoiSHYOeD+i9vei5+EX5Juip/WSMmIXX/dDBi72iCxTKlj1oRH1Y0Papweq96fM1jRnMxEHX+otb5Road6b7exhMFPGM5mtpo2pYesMzkEuOxznXpjfdRugzTrYkC/o2/R603XPCE9Q9L3HN9ULjbORxqIkPEQpjuyK+H/GRLsvCeAsDPCkhTXicPJG/e92gy7Csc21ygEWuLL97NOT/VALID==</ds:SignatureValue><ds:KeyInfo Id="KI-3EEEE6B294556BE95914575557309416374"><wsse:SecurityTokenReference wsu:Id="STR-3EEEE6B294556BE95914575557309416375"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Santiago,L=Santiago,O=DemoTbk,OU=DemoTbk,CN=10</ds:X509IssuerName><ds:X509SerialNumber>12876303082739064166</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-4249"><ns2:initInscriptionResponse xmlns:ns2="http://webservices.webpayserver.transbank.com/"><return><token>a65f2cf8077b1d45c36e698fe6bf8111ba43562565dac63f9017f4a3f154b1c8</token><urlWebpay>https://tbk.cl/webpayserver/bp_inscription.cgi</urlWebpay></return></ns2:initInscriptionResponse></soap:Body></soap:Envelope>} }
|
109
|
+
let(:content) { mock_content(body, '200') }
|
110
|
+
|
111
|
+
it { proc { Response.new content, :initInscription }.must_raise(Transbank::Oneclick::Exceptions::InvalidSignature) }
|
112
|
+
end
|
106
113
|
end
|
107
114
|
|
108
115
|
describe 'finish inscription' do
|
109
116
|
describe 'with response valid' do
|
110
|
-
let(:body) {
|
117
|
+
let(:body) { "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" soap:mustUnderstand=\"1\"><ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"SIG-8366\"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"soap\"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"></ds:SignatureMethod><ds:Reference URI=\"#id-8365\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"\"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"></ds:DigestMethod><ds:DigestValue>fJP2u/9YdHinVin6lld9n4nEAvo=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>ll/FkhjU2HdcHwHUbkUAhb20cnpMiRlt5d96DZw2AADeo/x4/NPAwsImU/o3ZrYMVXAyhRLUI/VweuAEXgd5AuQ37xxL7QFaGcWO7roX2kom6FhhHD4ORgWigfgrp7U90diqnUVmBu/7ewlUAEt+8RK+V5dt+nDuaeyyk7COLj6jwR0SXQqcDd69dYLFkaniP3foQJo0zC2JNzepZHCRCvD2I4Fl1shViTghs72GDhsZR8dw6hsCvzLNuAfJx9gd6NSkG43as6Yfse0sDJvGggCRUfaGJdCLSAqk3JcETb+RMPIm82ECjLYmLuTSCEoIm+aQeIbAn78ZMFYIJcGVCw==</ds:SignatureValue><ds:KeyInfo Id=\"KI-F6DDC585AC5A582DD2142564457877312548\"><wsse:SecurityTokenReference xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"STR-F6DDC585AC5A582DD2142564457877312549\"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Santiago,L=Santiago,O=DemoTbk,OU=DemoTbk,CN=10</ds:X509IssuerName><ds:X509SerialNumber>12876303082739064166</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"id-8365\"><ns2:finishInscriptionResponse xmlns:ns2=\"http://webservices.webpayserver.transbank.com/\"><return><authCode>1213</authCode><creditCardType>Visa</creditCardType><last4CardDigits>6623</last4CardDigits><responseCode>0</responseCode><tbkUser>d2f27f36-b038-4937-8ea6-182b3de38cfd</tbkUser></return></ns2:finishInscriptionResponse></soap:Body></soap:Envelope>" }
|
111
118
|
let(:content) { mock_content(body, '200') }
|
112
119
|
let(:response) { Response.new content, :finishInscription}
|
113
120
|
|
@@ -150,7 +157,7 @@ module Transbank
|
|
150
157
|
end
|
151
158
|
|
152
159
|
describe 'with card unregistered' do
|
153
|
-
let(:body) {
|
160
|
+
let(:body) { "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" soap:mustUnderstand=\"1\"><ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"SIG-8356\"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"soap\"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"></ds:SignatureMethod><ds:Reference URI=\"#id-8355\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"\"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"></ds:DigestMethod><ds:DigestValue>jnlzX73k8Sgqj8z3h8X92UFF/OQ=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>J9gzXDSXHWe0nKwha3rY9+aqOTIvhxq5xyjfdrwjKQPjsggI6dXIzgzKLruKp5kGQ0UeIBixjryd7twkGAiq7+T+BGy120ELFapmkNcasyDRuWo3U6PxZidhtMYdFT1ewpsyJaNqb0ck7TBIH5Vk503vnV0QUUP2tK+CDA94fDS5uvJhv2SDNccYEs89E3UVfp1DMH0OJXakdMvD0aWHK0/ChH9eAniGBSakmJf0cCPBbnN1EPGVAgUMBhatCFrGq4oT251DUY+JG9hVw22c+JJnN7WsetFh2IbthQR6bT4kVOy01aTHoHsyt7/LAPoSK738Pwme4er9wrYKJ8gWew==</ds:SignatureValue><ds:KeyInfo Id=\"KI-F6DDC585AC5A582DD2142564333510612533\"><wsse:SecurityTokenReference xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"STR-F6DDC585AC5A582DD2142564333510612534\"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Santiago,L=Santiago,O=DemoTbk,OU=DemoTbk,CN=10</ds:X509IssuerName><ds:X509SerialNumber>12876303082739064166</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"id-8355\"><ns2:finishInscriptionResponse xmlns:ns2=\"http://webservices.webpayserver.transbank.com/\"><return><responseCode>-98</responseCode></return></ns2:finishInscriptionResponse></soap:Body></soap:Envelope>" }
|
154
161
|
let(:content) { mock_content(body, '500') }
|
155
162
|
let(:response) { Response.new content, :finishInscription}
|
156
163
|
|
@@ -172,7 +179,7 @@ module Transbank
|
|
172
179
|
|
173
180
|
describe 'Authorize' do
|
174
181
|
describe 'with response valid' do
|
175
|
-
let(:body) {
|
182
|
+
let(:body) { "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" soap:mustUnderstand=\"1\"><ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"SIG-8376\"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"soap\"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"></ds:SignatureMethod><ds:Reference URI=\"#id-8375\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"\"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"></ds:DigestMethod><ds:DigestValue>IC08S2+O4xGJRy9RPz1u51eTpOs=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>j6c+/lI6OXehruaLwCqENZeNkAP7ynaZyJjEV3mty0VhlCzhjB8x6s9m372Az6Cbiv6jnNtK8EQr8VSiSZWTGDHnd+9H4O5t7fxe83m5HgcraJjt12+CFlVllBWbIQldFa5ZZjEqQrmGDd2a5ssO3qrN0SiCuLSlhSP1cPZclciD7sEEyRtcnEEbv8JcW/CMDcsila9UYUhtogOzclXz/eZ+wc6pjBkbuOgifkmeofhFRwK8M9FelavzJHwQTIOGPoUNWvCrTa6/CBDtgPXqMbTMokE9IUCbrNtd608FxUFsED1Q4zsW51FNnP5Ch95R5e10VMSFWeBiqwx0OVvopw==</ds:SignatureValue><ds:KeyInfo Id=\"KI-F6DDC585AC5A582DD2142566381917212563\"><wsse:SecurityTokenReference xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"STR-F6DDC585AC5A582DD2142566381917212564\"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Santiago,L=Santiago,O=DemoTbk,OU=DemoTbk,CN=10</ds:X509IssuerName><ds:X509SerialNumber>12876303082739064166</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"id-8375\"><ns2:authorizeResponse xmlns:ns2=\"http://webservices.webpayserver.transbank.com/\"><return><authorizationCode>1213</authorizationCode><creditCardType>Visa</creditCardType><last4CardDigits>6623</last4CardDigits><responseCode>0</responseCode><transactionId>71498</transactionId></return></ns2:authorizeResponse></soap:Body></soap:Envelope>" }
|
176
183
|
let(:content) { mock_content(body, '200') }
|
177
184
|
let(:response) { Response.new content, :authorize}
|
178
185
|
|
@@ -272,7 +279,7 @@ module Transbank
|
|
272
279
|
end
|
273
280
|
|
274
281
|
describe 'with maximum amount exceeded' do
|
275
|
-
let(:body) {
|
282
|
+
let(:body) { "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" soap:mustUnderstand=\"1\"><ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"SIG-8418\"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"soap\"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"></ds:SignatureMethod><ds:Reference URI=\"#id-8417\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"\"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"></ds:DigestMethod><ds:DigestValue>OGBAVz4h7um3+DFrHvBzahVmsDE=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>Omu6ivCCcimlQGb6PQXVlKHaLO3OD/PWT3ojxn0I3X5W0f3z5Q6XXnjkXJRLSp/SOxkFmod+jj2SZ8EawdT4jNmBq44VaA8wXHmsp8cNjRjAlU4l88MOXLTFk3lIxnDN4N6O9FV1NoPiZlLDAD8dLL4Lh9u9dxOEm0yin/nrETg8V/U3drDicae0qRBWTyHXy6puxA2Xk7HK4++lzoYsAtx65TEazW7+XlpQ09e3H25AGixbeodzoJ8QN0zmclDUCgDfPPrt30RaDVqxG5+tPs32yuP4ZNczQGP50gkivV3KBwN6Vs7+ReyljOtD1UhTmv0Hz5lIJpORviFIAbG5Og==</ds:SignatureValue><ds:KeyInfo Id=\"KI-F6DDC585AC5A582DD2142573691238412626\"><wsse:SecurityTokenReference xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"STR-F6DDC585AC5A582DD2142573691238412627\"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Santiago,L=Santiago,O=DemoTbk,OU=DemoTbk,CN=10</ds:X509IssuerName><ds:X509SerialNumber>12876303082739064166</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"id-8417\"><ns2:authorizeResponse xmlns:ns2=\"http://webservices.webpayserver.transbank.com/\"><return><creditCardType>Visa</creditCardType><last4CardDigits>6623</last4CardDigits><responseCode>-98</responseCode><transactionId>71686</transactionId></return></ns2:authorizeResponse></soap:Body></soap:Envelope>" }
|
276
283
|
let(:content) { mock_content(body, '200') }
|
277
284
|
let(:response) { Response.new content, :authorize}
|
278
285
|
|
@@ -295,7 +302,7 @@ module Transbank
|
|
295
302
|
end
|
296
303
|
|
297
304
|
describe 'with maximum payments exceeded' do
|
298
|
-
let(:body) {
|
305
|
+
let(:body) { "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" soap:mustUnderstand=\"1\"><ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"SIG-8418\"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"soap\"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"></ds:SignatureMethod><ds:Reference URI=\"#id-8417\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"\"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"></ds:DigestMethod><ds:DigestValue>A41MxtjtjqlDdpGaRgs646qfx54=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>thiXMidDm0LHzLgl88OPDMXUoKMp8U+Ps1oZG6llfF3MmFNjkRmsBcD/OitwindHrDeH0nW67OFLnuJtCFTWlW89tk8smRgec2G/MsAdapGeskDf5h3uuN79O6uCUWEkNzoeyA2l0+lthGmZeRRLLKlDn3fLFfom2XPA+T8ABhO1ZqY/W6TyJCVV3FIY94qhiiA2uuyy80UFpGQytUBAuR5HTov3MSIWXTcubPleJ7ev2QYU6Sc2YI22fS/S7JVGj2lGGGZQKo/4mCcPeSqprJF5RuU8ozB1SMnPcDUXRh1XO4AGkRrJ9IbMk9wqYHgMJWoWhINoVuz2ZXyF81279A==</ds:SignatureValue><ds:KeyInfo Id=\"KI-F6DDC585AC5A582DD2142573691238412626\"><wsse:SecurityTokenReference xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"STR-F6DDC585AC5A582DD2142573691238412627\"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Santiago,L=Santiago,O=DemoTbk,OU=DemoTbk,CN=10</ds:X509IssuerName><ds:X509SerialNumber>12876303082739064166</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"id-8417\"><ns2:authorizeResponse xmlns:ns2=\"http://webservices.webpayserver.transbank.com/\"><return><creditCardType>Visa</creditCardType><last4CardDigits>6623</last4CardDigits><responseCode>-97</responseCode><transactionId>71686</transactionId></return></ns2:authorizeResponse></soap:Body></soap:Envelope>" }
|
299
306
|
let(:content) { mock_content(body, '200') }
|
300
307
|
let(:response) { Response.new content, :authorize}
|
301
308
|
|
@@ -318,7 +325,7 @@ module Transbank
|
|
318
325
|
end
|
319
326
|
|
320
327
|
describe 'with maximum number of payments per day exceeded' do
|
321
|
-
let(:body) {
|
328
|
+
let(:body) { "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" soap:mustUnderstand=\"1\"><ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"SIG-8418\"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"soap\"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"></ds:SignatureMethod><ds:Reference URI=\"#id-8417\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"\"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"></ds:DigestMethod><ds:DigestValue>bE4QpMQ/0dJ1DioM4fdw7Aq8EpM=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>N9QRIXEsWkEcUyQ8CHLOn3JpZeW/BhJXgayxhU14Zgo3Dqlcf1PDjga0Bx4XqAi5SNYhpXBXszzj+MZ2gWLvvOWdbTIjNkzwZaFlUr+e92TtK6wAyT4iAKswMNQ3AkKpe0jw0An/RqFZ9iMG2obxwXqiDbFqF5yUTgqvOK1MXdpXRk7j97coqe9bzo9UusJiWJT7GIyxQ+PCl6yybrjpnklakDjZ4oRQ4Xe0HuwEQx7MXYtCqkkEWVXbapQHnO3NoRirAkhgzjzifpPFFj4tOYIjbrhVfAtlKjyukno3UFniQqY1WUEu4Sv0LlinR9X5yGBrIPmRuDtuvXOTETzckw==</ds:SignatureValue><ds:KeyInfo Id=\"KI-F6DDC585AC5A582DD2142573691238412626\"><wsse:SecurityTokenReference xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"STR-F6DDC585AC5A582DD2142573691238412627\"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Santiago,L=Santiago,O=DemoTbk,OU=DemoTbk,CN=10</ds:X509IssuerName><ds:X509SerialNumber>12876303082739064166</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"id-8417\"><ns2:authorizeResponse xmlns:ns2=\"http://webservices.webpayserver.transbank.com/\"><return><creditCardType>Visa</creditCardType><last4CardDigits>6623</last4CardDigits><responseCode>-99</responseCode><transactionId>71686</transactionId></return></ns2:authorizeResponse></soap:Body></soap:Envelope>" }
|
322
329
|
let(:content) { mock_content(body, '200') }
|
323
330
|
let(:response) { Response.new content, :authorize}
|
324
331
|
|
@@ -343,7 +350,7 @@ module Transbank
|
|
343
350
|
|
344
351
|
describe 'Reverse' do
|
345
352
|
describe 'with response ok' do
|
346
|
-
let(:body) {
|
353
|
+
let(:body) { "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" soap:mustUnderstand=\"1\"><ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"SIG-8432\"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"soap\"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"></ds:SignatureMethod><ds:Reference URI=\"#id-8431\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"\"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"></ds:DigestMethod><ds:DigestValue>d5eiiC8lU9K+RwEa1fYFuCK2uOI=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>N4H295UU8whbP2g+gWETWIWDnceRqC0dhsjiIAu7C7Ia8SV0XNwJ4SYfF2EW/HWR9wZPy2R3vO0MnEBVywrr8QFTmXYrtzO1aZpWRr7pHYLDBZ94HVTGX9S9E6Q+AcGGv/x06K4cLkeFpcYCqge6vJnUa2qJRAql3gcnO4hcIueMat6hs++lEu+uMGC3yFi5t3JjFLKPe7qh151kekPmMZpfpCKxWtTH+VyfV45SLnP4rh2Mh3mKLXRv+yvydsFnsmLPlDJgqupqNc5HGyKh6hJZ8VUhLxpOOvW8GtE/jZ9GnzlF1/5nLk2kcRaQdQVsRHlTM3s+dU5TkqiU0J7IKQ==</ds:SignatureValue><ds:KeyInfo Id=\"KI-F6DDC585AC5A582DD2142573852294212647\"><wsse:SecurityTokenReference xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"STR-F6DDC585AC5A582DD2142573852294212648\"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Santiago,L=Santiago,O=DemoTbk,OU=DemoTbk,CN=10</ds:X509IssuerName><ds:X509SerialNumber>12876303082739064166</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"id-8431\"><ns2:codeReverseOneClickResponse xmlns:ns2=\"http://webservices.webpayserver.transbank.com/\"><return><reverseCode>3619160862457231902</reverseCode><reversed>true</reversed></return></ns2:codeReverseOneClickResponse></soap:Body></soap:Envelope>" }
|
347
354
|
let(:content) { mock_content(body, '200') }
|
348
355
|
let(:response) { Response.new content, :codeReverseOneClick}
|
349
356
|
|
@@ -383,7 +390,7 @@ module Transbank
|
|
383
390
|
end
|
384
391
|
|
385
392
|
describe 'with buyorder blank' do
|
386
|
-
let(:body) {
|
393
|
+
let(:body) { "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" soap:mustUnderstand=\"1\"><ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"SIG-8434\"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"soap\"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"></ds:SignatureMethod><ds:Reference URI=\"#id-8433\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"\"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"></ds:DigestMethod><ds:DigestValue>/j2dFcNHzkq8gRjQkeA3DznM0h4=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>Llcih4vOhH1o8zf5Fei0oFK5y3MhFUnKuKw5oTP95pQhe+xvqXLB8J0I8L08+zgIgd68ekgEaLAMb7MzBz6PpADVfEkezFjedkmrATbZrBL0P+uxGi7bV/KNkEjGaaLfS0oZlQn77ieG3UGYYT894hlKMzdgoPZgzyUP31Sr91bxvmx6O9utRg9UED8JGiL2+bCytyzAdbA9ATg6TZudTD/jdLOfK8cMD7cz442SLNTvZXobUHGSKudVjKKfswc2Nu4nwcAna91f7TvW5f5VwjQXVjUuUo9/r4gQVX++S0Em4gdI3bOq3X2FnzlhmZDe5y9A+qjAhnnUeeTUfT5Xpw==</ds:SignatureValue><ds:KeyInfo Id=\"KI-F6DDC585AC5A582DD2142573918866412650\"><wsse:SecurityTokenReference xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"STR-F6DDC585AC5A582DD2142573918866412651\"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Santiago,L=Santiago,O=DemoTbk,OU=DemoTbk,CN=10</ds:X509IssuerName><ds:X509SerialNumber>12876303082739064166</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"id-8433\"><ns2:codeReverseOneClickResponse xmlns:ns2=\"http://webservices.webpayserver.transbank.com/\"><return><reversed>false</reversed></return></ns2:codeReverseOneClickResponse></soap:Body></soap:Envelope>" }
|
387
394
|
let(:content) { mock_content(body, '500') }
|
388
395
|
let(:response) { Response.new content, :codeReverseOneClick}
|
389
396
|
|
@@ -405,7 +412,7 @@ module Transbank
|
|
405
412
|
|
406
413
|
describe 'Remove user' do
|
407
414
|
describe 'with ok response' do
|
408
|
-
let(:body) {
|
415
|
+
let(:body) { "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" soap:mustUnderstand=\"1\"><ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"SIG-8436\"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"soap\"></ec:InclusiveNamespaces></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"></ds:SignatureMethod><ds:Reference URI=\"#id-8435\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"\"></ec:InclusiveNamespaces></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"></ds:DigestMethod><ds:DigestValue>BtK1c6IQQt90kV7NJUMfdDFWdjU=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>RWBjf4xwgA2m0z2mcHxDRILaNF+T4UsFzMbqpDOUbUMRiyG5/2fvuqqOk3hX8IzAYYW7sNGDTCVfXs4Z0/iv83oFlS1da4uxs3RwG7W3C9pMS4g+2Ekry7nmQyD39BGVz/J7wLRf0e8rPgZmg2hxkBrGE5Ir1C4IWjq02lcErnoGPy1Lhd3vY/ZvIRXGy6Y893JO+bG3AQfEDA3Gn6pjdwL6OrYKU0EWd/vLQYT7f4xRSySg8XjgX3L0paT8c7ADgMTNaeeFEIeV0SSXy9GC32/zkNmNSCLoMBtGDi2oHFDIumf4GlV9C0lg1xKNBzePplL3gwIVoa9k9M8G8K3vxg==</ds:SignatureValue><ds:KeyInfo Id=\"KI-F6DDC585AC5A582DD2142573978894412653\"><wsse:SecurityTokenReference xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"STR-F6DDC585AC5A582DD2142573978894412654\"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>C=CL,ST=Santiago,L=Santiago,O=DemoTbk,OU=DemoTbk,CN=10</ds:X509IssuerName><ds:X509SerialNumber>12876303082739064166</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"id-8435\"><ns2:removeUserResponse xmlns:ns2=\"http://webservices.webpayserver.transbank.com/\"><return>true</return></ns2:removeUserResponse></soap:Body></soap:Envelope>" }
|
409
416
|
let(:content) { mock_content(body, '200') }
|
410
417
|
let(:response) { Response.new content, :removeUser}
|
411
418
|
|
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transbank-oneclick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramón Soto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '4.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '4.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: mocha
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.1.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.1.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webmock
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '1.20'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.20'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: nokogiri
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 1.4.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.4.0
|
97
97
|
description:
|
@@ -101,8 +101,9 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
-
-
|
104
|
+
- .gitignore
|
105
105
|
- Gemfile
|
106
|
+
- Guardfile
|
106
107
|
- LICENSE.txt
|
107
108
|
- README.md
|
108
109
|
- Rakefile
|
@@ -115,12 +116,16 @@ files:
|
|
115
116
|
- lib/transbank/oneclick/configuration.rb
|
116
117
|
- lib/transbank/oneclick/document.rb
|
117
118
|
- lib/transbank/oneclick/exception_response.rb
|
119
|
+
- lib/transbank/oneclick/exceptions.rb
|
118
120
|
- lib/transbank/oneclick/request.rb
|
119
121
|
- lib/transbank/oneclick/response.rb
|
120
122
|
- lib/transbank/oneclick/version.rb
|
121
123
|
- spec/generators/transbank_oneclick_generator_spec.rb
|
122
124
|
- spec/keys/597029124456.crt
|
123
125
|
- spec/keys/597029124456.key
|
126
|
+
- spec/keys/server/server_tbk.crt
|
127
|
+
- spec/keys/server/server_tbk.csr
|
128
|
+
- spec/keys/server/server_tbk.key
|
124
129
|
- spec/spec_helper.rb
|
125
130
|
- spec/transbank/oneclick/api_spec.rb
|
126
131
|
- spec/transbank/oneclick/client_spec.rb
|
@@ -139,17 +144,17 @@ require_paths:
|
|
139
144
|
- lib
|
140
145
|
required_ruby_version: !ruby/object:Gem::Requirement
|
141
146
|
requirements:
|
142
|
-
- -
|
147
|
+
- - '>='
|
143
148
|
- !ruby/object:Gem::Version
|
144
149
|
version: '1.9'
|
145
150
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
151
|
requirements:
|
147
|
-
- -
|
152
|
+
- - '>='
|
148
153
|
- !ruby/object:Gem::Version
|
149
154
|
version: '0'
|
150
155
|
requirements: []
|
151
156
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.4.
|
157
|
+
rubygems_version: 2.4.8
|
153
158
|
signing_key:
|
154
159
|
specification_version: 4
|
155
160
|
summary: transbank oneclick.
|
@@ -157,6 +162,9 @@ test_files:
|
|
157
162
|
- spec/generators/transbank_oneclick_generator_spec.rb
|
158
163
|
- spec/keys/597029124456.crt
|
159
164
|
- spec/keys/597029124456.key
|
165
|
+
- spec/keys/server/server_tbk.crt
|
166
|
+
- spec/keys/server/server_tbk.csr
|
167
|
+
- spec/keys/server/server_tbk.key
|
160
168
|
- spec/spec_helper.rb
|
161
169
|
- spec/transbank/oneclick/api_spec.rb
|
162
170
|
- spec/transbank/oneclick/client_spec.rb
|