adyen-admin 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.md CHANGED
@@ -6,12 +6,11 @@
6
6
  * add CLI binaries (to compile + upload) -> read from .adyenrc file
7
7
  * make compatible with Live system
8
8
 
9
- ## v0.0.10 - 24-04-2012
9
+ ## v0.0.11 - 23-04-2012
10
10
  * renamed `compile` to `compress`
11
11
  * added `compile` which splits any given input to the inc/* file according to given pattern
12
-
13
- ## v0.0.9 - 23-04-2012
14
12
  * parse metafile
13
+ * log out on AuthError
15
14
 
16
15
  ## v0.0.7
17
16
  * fix download issue
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.10
1
+ 0.0.11
@@ -20,7 +20,10 @@ module Adyen
20
20
 
21
21
  def get(url)
22
22
  client.get(url).tap do |page|
23
- raise AuthenticationError unless page.uri.to_s.include?(url)
23
+ if !page.uri.to_s.include?(url)
24
+ @authenticated = false
25
+ raise AuthenticationError
26
+ end
24
27
  end
25
28
  end
26
29
 
@@ -29,5 +29,11 @@ describe Adyen::Admin::Client, :vcr do
29
29
  Adyen::Admin.get(Adyen::Admin::Skin::SKINS)
30
30
  end.to raise_error Adyen::Admin::AuthenticationError
31
31
  end
32
+
33
+ it 'sets authenticated to false on error' do
34
+ expect do
35
+ Adyen::Admin.get(Adyen::Admin::Skin::SKINS) rescue nil
36
+ end.to change { Adyen::Admin.authenticated? }.from(nil).to(false)
37
+ end
32
38
  end
33
39
  end
@@ -0,0 +1,271 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://ca-test.adyen.com/ca/ca/skin/skins.shtml
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ""
9
+ headers:
10
+ Accept:
11
+ - "*/*"
12
+ User-Agent:
13
+ - Mechanize/2.3 Ruby/1.9.2p290 (http://github.com/tenderlove/mechanize/)
14
+ Accept-Encoding:
15
+ - gzip,deflate,identity
16
+ Accept-Charset:
17
+ - ISO-8859-1,utf-8;q=0.7,*;q=0.7
18
+ Accept-Language:
19
+ - en-us,en;q=0.5
20
+ Host:
21
+ - ca-test.adyen.com
22
+ Connection:
23
+ - keep-alive
24
+ Keep-Alive:
25
+ - 300
26
+ response:
27
+ status:
28
+ code: 302
29
+ message: Moved Temporarily
30
+ headers:
31
+ Date:
32
+ - Mon, 23 Apr 2012 15:04:21 GMT
33
+ Server:
34
+ - Apache
35
+ Set-Cookie:
36
+ - JSESSIONID=A7CB5BA29DDDE6850BB9482B999E8EF4.test5e; Path=/ca/; Secure; HttpOnly
37
+ Location:
38
+ - https://ca-test.adyen.com/ca/ca/login.shtml;jsessionid=A7CB5BA29DDDE6850BB9482B999E8EF4.test5e
39
+ Content-Length:
40
+ - "0"
41
+ Keep-Alive:
42
+ - timeout=15, max=100
43
+ Connection:
44
+ - Keep-Alive
45
+ Content-Type:
46
+ - text/plain; charset=UTF-8
47
+ body:
48
+ encoding: US-ASCII
49
+ string: ""
50
+ http_version:
51
+ recorded_at: Mon, 23 Apr 2012 15:04:21 GMT
52
+ - request:
53
+ method: get
54
+ uri: https://ca-test.adyen.com/ca/ca/login.shtml;jsessionid=A7CB5BA29DDDE6850BB9482B999E8EF4.test5e
55
+ body:
56
+ encoding: US-ASCII
57
+ string: ""
58
+ headers:
59
+ Accept:
60
+ - "*/*"
61
+ User-Agent:
62
+ - Mechanize/2.3 Ruby/1.9.2p290 (http://github.com/tenderlove/mechanize/)
63
+ Accept-Encoding:
64
+ - gzip,deflate,identity
65
+ Accept-Charset:
66
+ - ISO-8859-1,utf-8;q=0.7,*;q=0.7
67
+ Accept-Language:
68
+ - en-us,en;q=0.5
69
+ Cookie:
70
+ - JSESSIONID=A7CB5BA29DDDE6850BB9482B999E8EF4.test5e
71
+ Host:
72
+ - ca-test.adyen.com
73
+ Connection:
74
+ - keep-alive
75
+ Keep-Alive:
76
+ - 300
77
+ response:
78
+ status:
79
+ code: 200
80
+ message: OK
81
+ headers:
82
+ Date:
83
+ - Mon, 23 Apr 2012 15:04:21 GMT
84
+ Server:
85
+ - Apache
86
+ Cache-Control:
87
+ - no-cache, no-store, must-revalidate, max-age=0, post-check=0, pre-check=0
88
+ Pragma:
89
+ - no-cache
90
+ Expires:
91
+ - "-1"
92
+ X-Frame-Options:
93
+ - SAMEORIGIN
94
+ Content-Language:
95
+ - en-GB
96
+ Keep-Alive:
97
+ - timeout=15, max=100
98
+ Connection:
99
+ - Keep-Alive
100
+ Transfer-Encoding:
101
+ - chunked
102
+ Content-Type:
103
+ - text/html;charset=UTF-8
104
+ body:
105
+ encoding: US-ASCII
106
+ string: |
107
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
108
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
109
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
110
+ <head>
111
+
112
+ <title>Adyen PSP System</title>
113
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
114
+ <meta http-equiv="content-style-type" content="text/css" />
115
+ <meta http-equiv="imagetoolbar" content="no" />
116
+ <meta content="TRUE" name="MSSmartTagsPreventParsing" />
117
+
118
+ <link rel="shortcut icon" href="/ca/img/adyen/favicon.ico" type="image/ico"/>
119
+
120
+ <script type="text/javascript" src="/ca/js/functions.js"></script>
121
+ <script src="/ca/js/prototype.js" type="text/javascript"></script>
122
+ <script src="/ca/js/scriptaculous.js" type="text/javascript"></script>
123
+
124
+ <link rel="stylesheet" type="text/css" href="/ca/css/adyen/style.css" />
125
+ <!--[if lt IE 7]>
126
+ <link rel="stylesheet" type="text/css" href="/ca/css/adyen/style_ie6.css" />
127
+ <![endif]-->
128
+
129
+
130
+ </head>
131
+ <body>
132
+
133
+ <div id="topbar"><div class="iefillerdiv"></div></div>
134
+ <div id="middlebarcontainer">
135
+ <div id="middlebar">
136
+ <a href="/ca/ca/overview/default.shtml"><img id="mainlogo" src="/ca/img/adyen.png" alt="Logo"/>
137
+ <img id="testsystemwarning" src="/ca/img/adyen_test.png" alt="test"/></a>
138
+ <img id="maintagline" src="/ca/img/adyen_tagline.png" alt="Complex Finance, Online Insight" />
139
+ </div>
140
+ </div>
141
+ <div id="bottombar"><div id="bottombar2"></div></div>
142
+
143
+ <div id="maincontent">
144
+ <div id="boxleft">
145
+ <div id="infobox">
146
+ <ul class="nav">
147
+ </ul>
148
+ <div id="infoboxcontent">
149
+ <div>
150
+ </div>
151
+
152
+ <div style="text-align: left; margin-top: 5px">
153
+ <!--a class="icon" href="/ca/ca/overview/default.shtml" title="Home"><img src="/ca/img/home.gif" alt="Home"/></a-->
154
+ <a class="icon" href="/ca/ca/overview/default.shtml"><img src="/ca/img/home.png" alt="Home"/> home</a><br/>
155
+ <a class="icon" href="/ca/logoff.shtml" title="Sign Off"><img src="/ca/img/exit.png" alt="Sign Off"/> sign off</a>
156
+ </div>
157
+ </div>
158
+ </div>
159
+
160
+
161
+ <div class="bbarlmenu">
162
+ <div class="bbarrmenu">
163
+ <div class="bbarmenu">
164
+ </div>
165
+ </div>
166
+ </div>
167
+
168
+ </div>
169
+
170
+ <div id="contentbg">
171
+ <div id="content">
172
+ <div id="contentwrapper">
173
+
174
+ <div id="subcontent">
175
+ <ul id="help">
176
+ <li class="palette7">
177
+ <h3 class="bg">Signing On</h3>
178
+ <div class="border">
179
+ All fields are case-sensitive. If you have trouble signing on, check that the "Caps Lock" isn't on. </div>
180
+ </li>
181
+ </ul>
182
+
183
+ <script type="text/javascript" language="javascript">
184
+ function createCookie(name,value,days) {
185
+ path = "/ca/";
186
+ if (path == "") path = "/";
187
+ if (days) {
188
+ var date = new Date();
189
+ date.setTime(date.getTime()+(days*24*60*60*1000));
190
+ var expires = "; expires="+date.toGMTString();
191
+ } else {
192
+ var expires = "";
193
+ }
194
+ document.cookie = name+"="+value+expires+"; path="+path+(window.location.protocol.indexOf('https:')==0?'; Secure':'');
195
+ }
196
+
197
+ function eraseCookie(name) {
198
+ createCookie(name,"",-1);
199
+ }
200
+
201
+ function handleCookie() {
202
+ if(document.getElementById("rememberMe").checked == true) {
203
+ if(document.getElementById("accountTextInput")) {
204
+ createCookie("defaultAccount", document.getElementById("accountTextInput").value,7);
205
+ } else {
206
+ createCookie("defaultAccount", document.getElementById("accountHiddenInput").value,7);
207
+ }
208
+ } else {
209
+ eraseCookie("defaultAccount")
210
+ }
211
+ }
212
+ </script>
213
+ <h1 class="pagetitle">Please Sign On</h1>
214
+
215
+ <form method="post" autocomplete="off" onsubmit="handleCookie();" action="config/j_security_check">
216
+ <table class="data">
217
+ <tr>
218
+ <th class="row"><label for="accountTextInput">Account:</label></th>
219
+ <td><input type="text" id="accountTextInput" name="j_account" /></td>
220
+ </tr>
221
+ <tr>
222
+ <th class="row"><label for="j_username">User Name:</label></th>
223
+ <td><input type="text" id="j_username" name="j_username" /></td>
224
+ </tr>
225
+
226
+ <script type="text/javascript" language="javascript">
227
+ var elToFocus = document.getElementById("accountTextInput");
228
+ if( null == elToFocus ) {
229
+ elToFocus = document.getElementById("j_username");
230
+ }
231
+ elToFocus.focus();
232
+ </script>
233
+ <tr>
234
+ <th class="row"><label for="j_password">Password:</label></th>
235
+ <td><input type="password" id="j_password" name="j_password" /></td>
236
+ </tr>
237
+
238
+ <tr>
239
+ <td colspan="2"><label for="rememberMe">Remember my account on this computer</label> <input type="checkbox"
240
+ id="rememberMe" name="rememberMe" /></td>
241
+ </tr>
242
+
243
+ <tr>
244
+ <td colspan="2"><br />
245
+ <input type="hidden" name="j_formHash" value="193BS7s/UX6dDLEXtBZv45c0Jv4ECI=" />
246
+ <input type="submit" class="button" value="Submit" /></td>
247
+ </tr>
248
+ </table>
249
+ </form>
250
+ <br/>
251
+ <a href="/ca/forgotPassword.shtml">Forgot your password?</a>
252
+ </div>
253
+
254
+ <div class="bbarl">
255
+ <div class="bbarr">
256
+ <div class="bbar">
257
+ </div>
258
+ </div>
259
+ </div>
260
+ </div>
261
+
262
+
263
+ </div>
264
+ </div>
265
+ </div>
266
+ </body>
267
+ </html>
268
+
269
+ http_version:
270
+ recorded_at: Mon, 23 Apr 2012 15:04:22 GMT
271
+ recorded_with: VCR 2.0.1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adyen-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mechanize
16
- requirement: &70183294042540 !ruby/object:Gem::Requirement
16
+ requirement: &70115439116500 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70183294042540
24
+ version_requirements: *70115439116500
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rubyzip
27
- requirement: &70183294042060 !ruby/object:Gem::Requirement
27
+ requirement: &70115439116020 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70183294042060
35
+ version_requirements: *70115439116020
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70183294041480 !ruby/object:Gem::Requirement
38
+ requirement: &70115439115440 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70183294041480
46
+ version_requirements: *70115439115440
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &70183294041020 !ruby/object:Gem::Requirement
49
+ requirement: &70115439114980 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70183294041020
57
+ version_requirements: *70115439114980
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: vcr
60
- requirement: &70183294040560 !ruby/object:Gem::Requirement
60
+ requirement: &70115439114520 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70183294040560
68
+ version_requirements: *70115439114520
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: webmock
71
- requirement: &70183294040100 !ruby/object:Gem::Requirement
71
+ requirement: &70115439114060 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70183294040100
79
+ version_requirements: *70115439114060
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: debugger
82
- requirement: &70183294039640 !ruby/object:Gem::Requirement
82
+ requirement: &70115439113600 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70183294039640
90
+ version_requirements: *70115439113600
91
91
  description: A little Gem to make your life easier when dealing with Adyen skins
92
92
  email:
93
93
  - tobi@soundcloud.com
@@ -110,6 +110,7 @@ files:
110
110
  - spec/adyen-admin/client_spec.rb
111
111
  - spec/adyen-admin/skin_spec.rb
112
112
  - spec/fixtures/cassettes/Adyen_Admin_Client/_get/raises_authenticated_error_when_not_logged_in.yml
113
+ - spec/fixtures/cassettes/Adyen_Admin_Client/_get/sets_authenticated_to_false_on_error.yml
113
114
  - spec/fixtures/cassettes/Adyen_Admin_Client/_login/passes_with_correct_username_password.yml
114
115
  - spec/fixtures/cassettes/Adyen_Admin_Skin/authenticated/_all/freezes_local_skins.yml
115
116
  - spec/fixtures/cassettes/Adyen_Admin_Skin/authenticated/_all/returns_the_skins.yml
@@ -194,6 +195,7 @@ test_files:
194
195
  - spec/adyen-admin/client_spec.rb
195
196
  - spec/adyen-admin/skin_spec.rb
196
197
  - spec/fixtures/cassettes/Adyen_Admin_Client/_get/raises_authenticated_error_when_not_logged_in.yml
198
+ - spec/fixtures/cassettes/Adyen_Admin_Client/_get/sets_authenticated_to_false_on_error.yml
197
199
  - spec/fixtures/cassettes/Adyen_Admin_Client/_login/passes_with_correct_username_password.yml
198
200
  - spec/fixtures/cassettes/Adyen_Admin_Skin/authenticated/_all/freezes_local_skins.yml
199
201
  - spec/fixtures/cassettes/Adyen_Admin_Skin/authenticated/_all/returns_the_skins.yml