datacash 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/datacash/client.rb +1 -0
- data/lib/datacash/response/response.rb +2 -0
- data/lib/datacash/version.rb +1 -1
- data/spec/datacash/client_spec.rb +17 -4
- data/spec/datacash/request/thirdman_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff792474ed779f94f4a03035d6bc68556197e980
|
4
|
+
data.tar.gz: ce0eb169e211c1202fe73be2bf722b93e1106a91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71208f0693b882aa07348fc8e9646fbb81c8787f5b20e738ea51a737be0ac885238bd2ce7ae6865380503ea769e78ed23d97e5f1b2b9230e566b8479ce590731
|
7
|
+
data.tar.gz: 705565a076ba7ee22ca8704efac62258300ce13daf21cc69e32a21fb1b83e41856c0f1f143768c3c92a3055bf076609cdbdf1d9e126354e1bbe3e1f177902ff6
|
data/lib/datacash/client.rb
CHANGED
data/lib/datacash/version.rb
CHANGED
@@ -41,7 +41,7 @@ describe Datacash::Client, "#post" do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
context "response containing an array of elements" do
|
44
|
-
let(:
|
44
|
+
let(:response_data) do
|
45
45
|
'<?xml version="1.0" encoding="UTF-8"?>'\
|
46
46
|
'<Response>'\
|
47
47
|
'<HpsTxn>'\
|
@@ -64,7 +64,7 @@ describe Datacash::Client, "#post" do
|
|
64
64
|
|
65
65
|
before do
|
66
66
|
stub_request(:post, "https://accreditation.datacash.com/Transaction/cnp_a").
|
67
|
-
to_return(:status => 200, :body =>
|
67
|
+
to_return(:status => 200, :body => response_data)
|
68
68
|
end
|
69
69
|
|
70
70
|
it "should return all the elements" do
|
@@ -73,6 +73,10 @@ describe Datacash::Client, "#post" do
|
|
73
73
|
attempt.should be_a(Datacash::Response::Attempt)
|
74
74
|
end
|
75
75
|
end
|
76
|
+
|
77
|
+
it 'should store raw response' do
|
78
|
+
subject.post(Datacash::Request::Request.new).raw.should eq(response_data)
|
79
|
+
end
|
76
80
|
end
|
77
81
|
end
|
78
82
|
|
@@ -93,7 +97,7 @@ describe Datacash::Client, "#post" do
|
|
93
97
|
'</Request>'
|
94
98
|
end
|
95
99
|
|
96
|
-
let(:
|
100
|
+
let(:response_data) do
|
97
101
|
'<?xml version="1.0" encoding="UTF-8"?>'\
|
98
102
|
'<Response>'\
|
99
103
|
'<HpsTxn>'\
|
@@ -117,8 +121,17 @@ describe Datacash::Client, "#post" do
|
|
117
121
|
it "should send the correct request" do
|
118
122
|
stub_request(:post, "https://accreditation.datacash.com/Transaction/cnp_a").
|
119
123
|
with(body: request).
|
120
|
-
to_return(:status => 200, :body =>
|
124
|
+
to_return(:status => 200, :body => response_data)
|
125
|
+
|
121
126
|
subject.query("12345")
|
122
127
|
end
|
128
|
+
|
129
|
+
|
130
|
+
it 'should store raw response' do
|
131
|
+
stub_request(:post, "https://accreditation.datacash.com/Transaction/cnp_a").
|
132
|
+
to_return(:status => 200, :body => response_data)
|
133
|
+
|
134
|
+
subject.query("12345").raw.should eq(response_data)
|
135
|
+
end
|
123
136
|
end
|
124
137
|
end
|
@@ -5,8 +5,8 @@ describe Datacash::Request::Thirdman do
|
|
5
5
|
describe "#to_xml" do
|
6
6
|
subject { MultiXml.parse(described_class.new.to_xml) }
|
7
7
|
|
8
|
-
it "should have a root element of '
|
9
|
-
subject.should have_key('
|
8
|
+
it "should have a root element of 'The3rdMan'" do
|
9
|
+
subject.should have_key('The3rdMan')
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datacash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Williams
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: builder
|