ige_isb_api 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ige_isb_api/constants.rb +1 -1
- data/lib/ige_isb_api/request.rb +1 -1
- data/lib/ige_isb_api/user_api.rb +102 -65
- data/lib/ige_isb_api/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a0598200aa8da360e75d735127dd278f92d6c62
|
4
|
+
data.tar.gz: 4d1b31f6327eaddbd62a9433bb631641e94c4073
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e852c53bdd61b97086cf53b6a397a94f09bff002db832191a223ff4fe724096de58e1dbb975f98a9712e1488ec79fa6f45bcb23bcab86e9bbcc82a70441a175
|
7
|
+
data.tar.gz: 733667b0820942f85eb0c480c839138eec999cce842b80db8825697c5eccd1bea6d2a6fb9b464b4313b1ba7a03e55355ba392a684c5aad3dbfaab61ed56af364
|
data/Gemfile.lock
CHANGED
data/lib/ige_isb_api/request.rb
CHANGED
@@ -67,7 +67,7 @@ module IGE_ISB_API
|
|
67
67
|
'email' => {:required => true, :type => 'string', :length => 32},
|
68
68
|
'carte' => {:required => true, :type => 'string', :length => 32},
|
69
69
|
'emailtemplate' => {:required => true, :type => 'string', :length => 32},
|
70
|
-
'emailparameters' => {:required => true, :type => 'string'
|
70
|
+
'emailparameters' => {:required => true, :type => 'string'}
|
71
71
|
},
|
72
72
|
'limits' => {
|
73
73
|
'limitationtype' => {:required => true, :type => 'limit'},
|
data/lib/ige_isb_api/user_api.rb
CHANGED
@@ -21,6 +21,42 @@ module IGE_ISB_API
|
|
21
21
|
}.merge(opts)
|
22
22
|
end
|
23
23
|
|
24
|
+
# the following options *must* be passed in.
|
25
|
+
# wallet: "the name of the payment processor being used",
|
26
|
+
# reference: "the original reference",
|
27
|
+
#
|
28
|
+
# The following may be passed in and are presented here with their defaults.
|
29
|
+
# cur: defaults to IGE_ISB_API::Constants::DEFAULT_CURRENCY_CODE
|
30
|
+
def adapt_deposit_reference(opts = {})
|
31
|
+
# 'CAS'+wallet parameter +reference parameter+cur parameter
|
32
|
+
# see https://github.com/Interactive-Gaming-Entertainment/IGE-ISB-API/issues/18
|
33
|
+
raise ArgumentError, "Missing options." if opts.empty?
|
34
|
+
raise ArgumentError, "Missing wallet." if opts[:wallet].nil?
|
35
|
+
raise ArgumentError, "Missing original reference." if opts[:reference].nil?
|
36
|
+
params = {
|
37
|
+
cur: options[:cur]
|
38
|
+
}.merge(opts)
|
39
|
+
return "CAS#{params[:wallet]}#{params[:reference]}#{params[:cur]}"
|
40
|
+
end
|
41
|
+
|
42
|
+
# the following options *must* be passed in.
|
43
|
+
# wallet: "the name of the payment processor being used",
|
44
|
+
# reference: "the original reference",
|
45
|
+
#
|
46
|
+
# The following may be passed in and are presented here with their defaults.
|
47
|
+
# cur: defaults to IGE_ISB_API::Constants::DEFAULT_CURRENCY_CODE
|
48
|
+
def adapt_withdrawal_reference(opts = {})
|
49
|
+
# 'CASWire:'+withdrawal id+cur parameter+reference parameter
|
50
|
+
# see https://github.com/Interactive-Gaming-Entertainment/IGE-ISB-API/issues/18
|
51
|
+
raise ArgumentError, "Missing options." if opts.empty?
|
52
|
+
raise ArgumentError, "Missing withdrawal id." if opts[:withdrawalid].nil?
|
53
|
+
raise ArgumentError, "Missing original reference." if opts[:reference].nil?
|
54
|
+
params = {
|
55
|
+
cur: options[:cur]
|
56
|
+
}.merge(opts)
|
57
|
+
return "CASWire:#{params[:withdrawalid]}#{params[:cur]}#{params[:reference]}"
|
58
|
+
end
|
59
|
+
|
24
60
|
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
25
61
|
# Additionally each transaction must include a unique transaction ID.
|
26
62
|
# the following options *must* be passed in.
|
@@ -43,16 +79,16 @@ module IGE_ISB_API
|
|
43
79
|
def register(label = '', txid = 0, opts = {})
|
44
80
|
validate_params!(label, txid)
|
45
81
|
raise ArgumentError, "Missing options." if opts.empty?
|
46
|
-
|
47
|
-
username:
|
48
|
-
password:
|
49
|
-
status:
|
50
|
-
cur:
|
51
|
-
lang:
|
52
|
-
carte:
|
82
|
+
params = { idrequest: label,
|
83
|
+
username: options[:username],
|
84
|
+
password: options[:password],
|
85
|
+
status: options[:status],
|
86
|
+
cur: options[:cur],
|
87
|
+
lang: options[:lang],
|
88
|
+
carte: options[:carte],
|
53
89
|
gender: IGE_ISB_API::Constants::MALE,
|
54
90
|
txid: txid}.merge(opts).merge({ command: 'registration', idaffiliation: IGE_ISB_API::Constants::LICENSEE_ID })
|
55
|
-
request = IGE_ISB_API.request(
|
91
|
+
request = IGE_ISB_API.request(params)
|
56
92
|
resp = request.send
|
57
93
|
response = JSON.parse(resp.body)
|
58
94
|
return response
|
@@ -65,12 +101,12 @@ module IGE_ISB_API
|
|
65
101
|
# a different casino under the control of the same licensee.
|
66
102
|
def login(label = '', txid = 0, opts = {})
|
67
103
|
validate_params!(label, txid)
|
68
|
-
|
69
|
-
username:
|
70
|
-
password:
|
71
|
-
carte:
|
104
|
+
params = { idrequest: label,
|
105
|
+
username: options[:username],
|
106
|
+
password: options[:password],
|
107
|
+
carte: options[:carte],
|
72
108
|
txid: txid}.merge(opts).merge({ command: 'login' })
|
73
|
-
request = IGE_ISB_API.request(
|
109
|
+
request = IGE_ISB_API.request(params)
|
74
110
|
resp = request.send
|
75
111
|
response = JSON.parse(resp.body)
|
76
112
|
return response
|
@@ -88,14 +124,14 @@ module IGE_ISB_API
|
|
88
124
|
def deposit(label = '', txid = 0, opts = {})
|
89
125
|
validate_params!(label, txid)
|
90
126
|
raise ArgumentError, "Missing options." if opts.empty?
|
91
|
-
|
92
|
-
username:
|
93
|
-
password:
|
94
|
-
cur:
|
127
|
+
params = { idrequest: label,
|
128
|
+
username: options[:username],
|
129
|
+
password: options[:password],
|
130
|
+
cur: options[:cur],
|
95
131
|
txid: txid}.merge(opts).merge({ command: 'deposit' })
|
96
132
|
# reference = "#{@params[:wallet]}:#{@params[:reference]}#{@params[:cur]}"
|
97
133
|
# @params[:reference] = reference
|
98
|
-
request = IGE_ISB_API.request(
|
134
|
+
request = IGE_ISB_API.request(params)
|
99
135
|
resp = request.send
|
100
136
|
response = JSON.parse(resp.body)
|
101
137
|
return response
|
@@ -113,13 +149,12 @@ module IGE_ISB_API
|
|
113
149
|
def withdrawal(label = '', txid = 0, opts = {})
|
114
150
|
validate_params!(label, txid)
|
115
151
|
raise ArgumentError, "Missing options." if opts.empty?
|
116
|
-
|
117
|
-
username:
|
118
|
-
password:
|
119
|
-
cur:
|
152
|
+
params = { idrequest: label,
|
153
|
+
username: options[:username],
|
154
|
+
password: options[:password],
|
155
|
+
cur: options[:cur],
|
120
156
|
txid: txid}.merge(opts).merge({ command: 'withdrawal' })
|
121
|
-
|
122
|
-
request = IGE_ISB_API.request(@params)
|
157
|
+
request = IGE_ISB_API.request(params)
|
123
158
|
resp = request.send
|
124
159
|
response = JSON.parse(resp.body)
|
125
160
|
return response
|
@@ -132,11 +167,11 @@ module IGE_ISB_API
|
|
132
167
|
def cancel_withdrawal(label = '', txid = 0, opts = {})
|
133
168
|
validate_params!(label, txid)
|
134
169
|
raise ArgumentError, "Missing options." if opts.empty?
|
135
|
-
|
136
|
-
username:
|
137
|
-
password:
|
170
|
+
params = { idrequest: label,
|
171
|
+
username: options[:username],
|
172
|
+
password: options[:password],
|
138
173
|
txid: txid}.merge(opts).merge({ command: 'cancel_withdrawal' })
|
139
|
-
request = IGE_ISB_API.request(
|
174
|
+
request = IGE_ISB_API.request(params)
|
140
175
|
resp = request.send
|
141
176
|
response = JSON.parse(resp.body)
|
142
177
|
return response
|
@@ -146,11 +181,11 @@ module IGE_ISB_API
|
|
146
181
|
# Additionally each transaction must include a unique transaction ID.
|
147
182
|
def get_history(label = '', txid = 0, opts = {})
|
148
183
|
validate_params!(label, txid)
|
149
|
-
|
150
|
-
username:
|
151
|
-
password:
|
184
|
+
params = { idrequest: label,
|
185
|
+
username: options[:username],
|
186
|
+
password: options[:password],
|
152
187
|
txid: txid}.merge(opts).merge({ command: 'get_history' })
|
153
|
-
request = IGE_ISB_API.request(
|
188
|
+
request = IGE_ISB_API.request(params)
|
154
189
|
resp = request.send
|
155
190
|
response = JSON.parse(resp.body)
|
156
191
|
return response
|
@@ -167,12 +202,12 @@ module IGE_ISB_API
|
|
167
202
|
def send_email(label = '', txid = 0, opts = {})
|
168
203
|
validate_params!(label, txid)
|
169
204
|
raise ArgumentError, "Missing options." if opts.empty?
|
170
|
-
|
171
|
-
username:
|
172
|
-
password:
|
173
|
-
carte:
|
205
|
+
params = { idrequest: label,
|
206
|
+
username: options[:username],
|
207
|
+
password: options[:password],
|
208
|
+
carte: options[:carte],
|
174
209
|
txid: txid}.merge(opts).merge({ command: 'send_email' })
|
175
|
-
request = IGE_ISB_API.request(
|
210
|
+
request = IGE_ISB_API.request(params)
|
176
211
|
resp = request.send
|
177
212
|
response = JSON.parse(resp.body)
|
178
213
|
return response
|
@@ -191,11 +226,11 @@ module IGE_ISB_API
|
|
191
226
|
def limits(label = '', txid = 0, opts = {})
|
192
227
|
validate_params!(label, txid)
|
193
228
|
raise ArgumentError, "Missing options." if opts.empty?
|
194
|
-
|
195
|
-
username:
|
196
|
-
password:
|
229
|
+
params = { idrequest: label,
|
230
|
+
username: options[:username],
|
231
|
+
password: options[:password],
|
197
232
|
txid: txid}.merge(opts).merge({ command: 'limits' })
|
198
|
-
request = IGE_ISB_API.request(
|
233
|
+
request = IGE_ISB_API.request(params)
|
199
234
|
resp = request.send
|
200
235
|
response = JSON.parse(resp.body)
|
201
236
|
return response
|
@@ -205,11 +240,11 @@ module IGE_ISB_API
|
|
205
240
|
# Additionally each transaction must include a unique transaction ID.
|
206
241
|
def deactivate(label = '', txid = 0)
|
207
242
|
validate_params!(label, txid)
|
208
|
-
|
209
|
-
username:
|
210
|
-
password:
|
243
|
+
params = { idrequest: label,
|
244
|
+
username: options[:username],
|
245
|
+
password: options[:password],
|
211
246
|
txid: txid}.merge({ command: 'userstatus', flag: IGE_ISB_API::Constants::USER_INACTIVE })
|
212
|
-
request = IGE_ISB_API.request(
|
247
|
+
request = IGE_ISB_API.request(params)
|
213
248
|
resp = request.send
|
214
249
|
response = JSON.parse(resp.body)
|
215
250
|
return response
|
@@ -219,11 +254,11 @@ module IGE_ISB_API
|
|
219
254
|
# Additionally each transaction must include a unique transaction ID.
|
220
255
|
def activate(label = '', txid = 0)
|
221
256
|
validate_params!(label, txid)
|
222
|
-
|
223
|
-
username:
|
224
|
-
password:
|
257
|
+
params = { idrequest: label,
|
258
|
+
username: options[:username],
|
259
|
+
password: options[:password],
|
225
260
|
txid: txid}.merge({ command: 'userstatus', flag: IGE_ISB_API::Constants::USER_ACTIVE })
|
226
|
-
request = IGE_ISB_API.request(
|
261
|
+
request = IGE_ISB_API.request(params)
|
227
262
|
resp = request.send
|
228
263
|
response = JSON.parse(resp.body)
|
229
264
|
return response
|
@@ -233,11 +268,11 @@ module IGE_ISB_API
|
|
233
268
|
# Additionally each transaction must include a unique transaction ID.
|
234
269
|
def ban(label = '', txid = 0)
|
235
270
|
validate_params!(label, txid)
|
236
|
-
|
237
|
-
username:
|
238
|
-
password:
|
271
|
+
params = { idrequest: label,
|
272
|
+
username: options[:username],
|
273
|
+
password: options[:password],
|
239
274
|
txid: txid}.merge({ command: 'userstatus', flag: IGE_ISB_API::Constants::USER_BANNED })
|
240
|
-
request = IGE_ISB_API.request(
|
275
|
+
request = IGE_ISB_API.request(params)
|
241
276
|
resp = request.send
|
242
277
|
response = JSON.parse(resp.body)
|
243
278
|
return response
|
@@ -250,11 +285,11 @@ module IGE_ISB_API
|
|
250
285
|
def change_password(label = '', txid = 0, opts = {})
|
251
286
|
validate_params!(label, txid)
|
252
287
|
raise ArgumentError, "Missing options." if opts.empty?
|
253
|
-
|
254
|
-
username:
|
255
|
-
password:
|
288
|
+
params = { idrequest: label,
|
289
|
+
username: options[:username],
|
290
|
+
password: options[:password],
|
256
291
|
txid: txid}.merge(opts).merge({ command: 'pass'})
|
257
|
-
request = IGE_ISB_API.request(
|
292
|
+
request = IGE_ISB_API.request(params)
|
258
293
|
resp = request.send
|
259
294
|
response = JSON.parse(resp.body)
|
260
295
|
return response
|
@@ -264,11 +299,11 @@ module IGE_ISB_API
|
|
264
299
|
# Additionally each transaction must include a unique transaction ID.
|
265
300
|
def get_vip_points(label = '', txid = 0)
|
266
301
|
validate_params!(label, txid)
|
267
|
-
|
268
|
-
username:
|
269
|
-
password:
|
302
|
+
params = { idrequest: label,
|
303
|
+
username: options[:username],
|
304
|
+
password: options[:password],
|
270
305
|
txid: txid}.merge({ command: 'get_vip_points' })
|
271
|
-
request = IGE_ISB_API.request(
|
306
|
+
request = IGE_ISB_API.request(params)
|
272
307
|
resp = request.send
|
273
308
|
response = JSON.parse(resp.body)
|
274
309
|
return response
|
@@ -283,11 +318,11 @@ module IGE_ISB_API
|
|
283
318
|
def save_friend_email(label = '', txid = 0, opts = {})
|
284
319
|
validate_params!(label, txid)
|
285
320
|
raise ArgumentError, "Missing options." if opts.empty?
|
286
|
-
|
287
|
-
username:
|
288
|
-
password:
|
321
|
+
params = { idrequest: label,
|
322
|
+
username: options[:username],
|
323
|
+
password: options[:password],
|
289
324
|
txid: txid}.merge(opts).merge({ command: 'save_friend_email'})
|
290
|
-
request = IGE_ISB_API.request(
|
325
|
+
request = IGE_ISB_API.request(params)
|
291
326
|
resp = request.send
|
292
327
|
response = JSON.parse(resp.body)
|
293
328
|
return response
|
@@ -295,6 +330,8 @@ module IGE_ISB_API
|
|
295
330
|
|
296
331
|
private
|
297
332
|
|
333
|
+
attr_reader :options
|
334
|
+
|
298
335
|
def validate_params!(label, txid)
|
299
336
|
raise ArgumentError, "Missing a valid label." if label.empty?
|
300
337
|
raise ArgumentError, "Missing a valid transaction ID." if txid <= 0
|
data/lib/ige_isb_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ige_isb_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Sag
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
-
description: Implements all of the features of the ISB API version 2.
|
97
|
+
description: Implements all of the features of the ISB API version 2.2.
|
98
98
|
email:
|
99
99
|
- davesag@gmail.com
|
100
100
|
executables: []
|
@@ -139,5 +139,5 @@ rubyforge_project:
|
|
139
139
|
rubygems_version: 2.1.11
|
140
140
|
signing_key:
|
141
141
|
specification_version: 4
|
142
|
-
summary: A Ruby Wrapper for the ISB API version 2.
|
142
|
+
summary: A Ruby Wrapper for the ISB API version 2.2
|
143
143
|
test_files: []
|