ige_isb_api 1.0.0 → 1.1.0
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/games.rb +2 -2
- data/lib/ige_isb_api/request.rb +12 -0
- data/lib/ige_isb_api/user_api.rb +57 -4
- data/lib/ige_isb_api/version.rb +1 -1
- metadata +2 -3
- data/lib/ige_isb_api/api.rb +0 -251
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c47438d88348126a9e50ed3e6c849b56d734ee7f
|
4
|
+
data.tar.gz: f06f53b1ac22d56ddb88912b9ac787b0d219f1c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f938f22dacadba7364913ba269ae4b419a8d3a0607dff51e6a7bf4d14a61fc71258253a67b3108cc010dd81fdae100774f14101a2ad97eb85b6ba4257aeadd2b
|
7
|
+
data.tar.gz: 23eef01e9c294551b7ea5c521f1251d60e1c1849f297e627acec9d2bb01bed7935081f2bf6925af82d999137c4b95fd0c00c69d3bc36f14bfea48f73cfff764c
|
data/Gemfile.lock
CHANGED
data/lib/ige_isb_api/games.rb
CHANGED
@@ -201,6 +201,8 @@ module IGE_ISB_API
|
|
201
201
|
warnings << {game: self, message: "Missing ':html' image in #{images.inspect}"} if images[:html].nil? || images[:html].empty?
|
202
202
|
# => almost all games are missing the :v2 image completely so only warn if empty, not nil.
|
203
203
|
warnings << {game: self, message: "Missing :v2 image in #{images.inspect}"} if !images[:v2].nil? && images[:v2].empty?
|
204
|
+
warnings << {game: self, message: "Unable to determine main image"} if self.main_image.empty?
|
205
|
+
warnings << {game: self, message: "Unable to determine thumbnail image"} if self.thumb_image.empty?
|
204
206
|
return warnings
|
205
207
|
end
|
206
208
|
|
@@ -374,8 +376,6 @@ module IGE_ISB_API
|
|
374
376
|
errors << {game: self, message: "Missing type"} if self.game_type.nil? || self.game_type.empty?
|
375
377
|
errors << {game: self, message: "Invalid game type"} unless IGE_ISB_API::Constants::ALLOWED_GAME_TYPES.include?(self.game_type)
|
376
378
|
errors << {game: self, message: "Missing coin_min: coin_values are #{self.coin_values.inspect} coin: #{self.coin} max: #{self.coin_max}"} if self.coin_min.nil? || self.coin_min <= 0.0
|
377
|
-
errors << {game: self, message: "Unable to determine main image"} if self.main_image.empty?
|
378
|
-
errors << {game: self, message: "Unable to determine thumbnail image"} if self.thumb_image.empty?
|
379
379
|
errors << {game: self, message: "Invalid wmode"} unless IGE_ISB_API::Constants::ALLOWED_MODES.include?(self.wmode)
|
380
380
|
errors << {game: self, message: "Neither fun, nor real"} if !(self.fun? || self.real?)
|
381
381
|
errors << {game: self, message: "Missing fun game info"} if (self.fun? && !self.has_info?(:fun))
|
data/lib/ige_isb_api/request.rb
CHANGED
@@ -57,6 +57,18 @@ module IGE_ISB_API
|
|
57
57
|
'cur' => {:required => true, :type => 'currency_code', :length => 3},
|
58
58
|
'wallet' => {:required => true, :type => 'string', :length => 32}
|
59
59
|
},
|
60
|
+
'cancel_withdrawal' => {
|
61
|
+
'withdrawalid' => {:required => true, :type => 'int'}
|
62
|
+
},
|
63
|
+
'get_history' => {
|
64
|
+
# nothing special
|
65
|
+
},
|
66
|
+
'send_email' => {
|
67
|
+
'email' => {:required => true, :type => 'string', :length => 32},
|
68
|
+
'carte' => {:required => true, :type => 'string', :length => 32},
|
69
|
+
'emailtemplate' => {:required => true, :type => 'string', :length => 32},
|
70
|
+
'emailparameters' => {:required => true, :type => 'string', :length => 32}
|
71
|
+
},
|
60
72
|
'limits' => {
|
61
73
|
'limitationtype' => {:required => true, :type => 'limit'},
|
62
74
|
'amount' => {:required => true, :type => 'int'},
|
data/lib/ige_isb_api/user_api.rb
CHANGED
@@ -93,8 +93,8 @@ module IGE_ISB_API
|
|
93
93
|
password: @options[:password],
|
94
94
|
cur: @options[:cur],
|
95
95
|
txid: txid}.merge(opts).merge({ command: 'deposit' })
|
96
|
-
reference = "#{@params[:wallet]}:#{@params[:reference]}#{@params[:cur]}"
|
97
|
-
@params
|
96
|
+
# reference = "#{@params[:wallet]}:#{@params[:reference]}#{@params[:cur]}"
|
97
|
+
# @params[:reference] = reference
|
98
98
|
request = IGE_ISB_API.request(@params)
|
99
99
|
resp = request.send
|
100
100
|
response = JSON.parse(resp.body)
|
@@ -118,8 +118,60 @@ module IGE_ISB_API
|
|
118
118
|
password: @options[:password],
|
119
119
|
cur: @options[:cur],
|
120
120
|
txid: txid}.merge(opts).merge({ command: 'withdrawal' })
|
121
|
-
reference = "#{@params[:reference]}#{@params[:cur]}"
|
122
|
-
@params
|
121
|
+
@params[:reference] = "#{@params[:reference]}#{@params[:cur]}" unless @params[:reference][-3,3] == @params[:cur]
|
122
|
+
request = IGE_ISB_API.request(@params)
|
123
|
+
resp = request.send
|
124
|
+
response = JSON.parse(resp.body)
|
125
|
+
return response
|
126
|
+
end
|
127
|
+
|
128
|
+
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
129
|
+
# Additionally each transaction must include a unique transaction ID.
|
130
|
+
# the following options *must* be passed in.
|
131
|
+
# withdrawalid: the txid of the withdrawal to be cancelled,
|
132
|
+
def cancel_withdrawal(label = '', txid = 0, opts = {})
|
133
|
+
validate_params!(label, txid)
|
134
|
+
raise ArgumentError, "Missing options." if opts.empty?
|
135
|
+
@params = { idrequest: label,
|
136
|
+
username: @options[:username],
|
137
|
+
password: @options[:password],
|
138
|
+
txid: txid}.merge(opts).merge({ command: 'cancel_withdrawal' })
|
139
|
+
request = IGE_ISB_API.request(@params)
|
140
|
+
resp = request.send
|
141
|
+
response = JSON.parse(resp.body)
|
142
|
+
return response
|
143
|
+
end
|
144
|
+
|
145
|
+
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
146
|
+
# Additionally each transaction must include a unique transaction ID.
|
147
|
+
def get_history(label = '', txid = 0, opts = {})
|
148
|
+
validate_params!(label, txid)
|
149
|
+
@params = { idrequest: label,
|
150
|
+
username: @options[:username],
|
151
|
+
password: @options[:password],
|
152
|
+
txid: txid}.merge(opts).merge({ command: 'get_history' })
|
153
|
+
request = IGE_ISB_API.request(@params)
|
154
|
+
resp = request.send
|
155
|
+
response = JSON.parse(resp.body)
|
156
|
+
return response
|
157
|
+
end
|
158
|
+
alias_method :history, :get_history
|
159
|
+
|
160
|
+
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
161
|
+
# Additionally each transaction must include a unique transaction ID.
|
162
|
+
# the following options *must* be passed in.
|
163
|
+
# emailtemplate: the name of a template (configured within ISB's back-office),
|
164
|
+
# emailparameters: a collection of email parameters.
|
165
|
+
# the following may be passed in to override defaults
|
166
|
+
# carte: the casino carte for the user,
|
167
|
+
def send_email(label = '', txid = 0, opts = {})
|
168
|
+
validate_params!(label, txid)
|
169
|
+
raise ArgumentError, "Missing options." if opts.empty?
|
170
|
+
@params = { idrequest: label,
|
171
|
+
username: @options[:username],
|
172
|
+
password: @options[:password],
|
173
|
+
carte: @options[:carte],
|
174
|
+
txid: txid}.merge(opts).merge({ command: 'send_email' })
|
123
175
|
request = IGE_ISB_API.request(@params)
|
124
176
|
resp = request.send
|
125
177
|
response = JSON.parse(resp.body)
|
@@ -221,6 +273,7 @@ module IGE_ISB_API
|
|
221
273
|
response = JSON.parse(resp.body)
|
222
274
|
return response
|
223
275
|
end
|
276
|
+
alias_method :vip_points, :get_vip_points
|
224
277
|
|
225
278
|
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
226
279
|
# Additionally each transaction must include a unique transaction ID.
|
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.
|
4
|
+
version: 1.1.0
|
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-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -93,7 +93,6 @@ files:
|
|
93
93
|
- README.md
|
94
94
|
- ige_isb_api.gemspec
|
95
95
|
- lib/ige_isb_api.rb
|
96
|
-
- lib/ige_isb_api/api.rb
|
97
96
|
- lib/ige_isb_api/bonus.rb
|
98
97
|
- lib/ige_isb_api/bonus_api.rb
|
99
98
|
- lib/ige_isb_api/callback.rb
|
data/lib/ige_isb_api/api.rb
DELETED
@@ -1,251 +0,0 @@
|
|
1
|
-
#!/user/bin/env ruby
|
2
|
-
#coding: utf-8
|
3
|
-
|
4
|
-
module IGE_ISB_API
|
5
|
-
class API
|
6
|
-
|
7
|
-
# the following options *must* be passed in.
|
8
|
-
# username: "some_username specific to iSoftBet",
|
9
|
-
# password: "should be specific to iSoftBet",
|
10
|
-
# The following options may be passed in and are presented here with their defaults.
|
11
|
-
# cur: IGE_ISB_API::Constants::DEFAULT_CURRENCY_CODE,
|
12
|
-
# carte: IGE_ISB_API::Constants::CASINO,
|
13
|
-
# lang: IGE_ISB_API::Constants::DEFAULT_LANGUAGE,
|
14
|
-
def initialize(player_status = IGE_ISB_API::Constants::TEST, opts = {})
|
15
|
-
raise ArgumentError, "Missing options." if opts.empty?
|
16
|
-
@options = {
|
17
|
-
cur: IGE_ISB_API::Constants::DEFAULT_CURRENCY_CODE,
|
18
|
-
carte: IGE_ISB_API::Constants::CASINO,
|
19
|
-
lang: IGE_ISB_API::Constants::DEFAULT_LANGUAGE,
|
20
|
-
status: player_status
|
21
|
-
}.merge(opts)
|
22
|
-
end
|
23
|
-
|
24
|
-
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
25
|
-
# Additionally each transaction must include a unique transaction ID.
|
26
|
-
# the following options *must* be passed in.
|
27
|
-
# email: "the user's email address",
|
28
|
-
# name: "the user's surname",
|
29
|
-
# firstname: "the user's first name",,
|
30
|
-
# zip: "the user's postcode",
|
31
|
-
# city: "the user's city",
|
32
|
-
# phone: "the user's phone number",
|
33
|
-
# dob: "in 2011-11-21 format",
|
34
|
-
# country: "the ISO country code for the user",
|
35
|
-
# ip: request.ip
|
36
|
-
#
|
37
|
-
# The following may be passed in and are presented here with their defaults.
|
38
|
-
# cur: IGE_ISB_API::Constants::DEFAULT_CURRENCY_CODE,
|
39
|
-
# status: IGE_ISB_API::Constants::TEST,
|
40
|
-
# carte: IGE_ISB_API::Constants::CASINO,
|
41
|
-
# lang: 'en',
|
42
|
-
# gender: IGE_ISB_API::Constants::MALE,
|
43
|
-
def register(label = '', txid = 0, opts = {})
|
44
|
-
validate_params!(label, txid)
|
45
|
-
raise ArgumentError, "Missing options." if opts.empty?
|
46
|
-
@params = { idrequest: label,
|
47
|
-
username: @options[:username],
|
48
|
-
password: @options[:password],
|
49
|
-
status: @options[:status],
|
50
|
-
cur: @options[:cur],
|
51
|
-
lang: @options[:lang],
|
52
|
-
carte: @options[:carte],
|
53
|
-
gender: IGE_ISB_API::Constants::MALE,
|
54
|
-
txid: txid}.merge(opts).merge({ command: 'registration', idaffiliation: IGE_ISB_API::Constants::LICENSEE_ID })
|
55
|
-
request = IGE_ISB_API.request(@params)
|
56
|
-
resp = request.send
|
57
|
-
response = JSON.parse(resp.body)
|
58
|
-
return response
|
59
|
-
end
|
60
|
-
|
61
|
-
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
62
|
-
# Additionally each transaction must include a unique transaction ID.
|
63
|
-
# The following may be passed in and is presented here with its default.
|
64
|
-
# carte: defaults to IGE_ISB_API::Constants::CASINO can can be overridden if user is logging in from
|
65
|
-
# a different casino under the control of the same licensee.
|
66
|
-
def login(label = '', txid = 0, opts = {})
|
67
|
-
validate_params!(label, txid)
|
68
|
-
@params = { idrequest: label,
|
69
|
-
username: @options[:username],
|
70
|
-
password: @options[:password],
|
71
|
-
carte: @options[:carte],
|
72
|
-
txid: txid}.merge(opts).merge({ command: 'login' })
|
73
|
-
request = IGE_ISB_API.request(@params)
|
74
|
-
resp = request.send
|
75
|
-
response = JSON.parse(resp.body)
|
76
|
-
return response
|
77
|
-
end
|
78
|
-
|
79
|
-
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
80
|
-
# Additionally each transaction must include a unique transaction ID.
|
81
|
-
# the following options *must* be passed in.
|
82
|
-
# wallet: "the name of the payment processor being used",
|
83
|
-
# amount: a positive floating point number,
|
84
|
-
# reference: "for logging purposes",
|
85
|
-
#
|
86
|
-
# The following may be passed in and are presented here with their defaults.
|
87
|
-
# cur: defaults to IGE_ISB_API::Constants::DEFAULT_CURRENCY_CODE
|
88
|
-
def deposit(label = '', txid = 0, opts = {})
|
89
|
-
validate_params!(label, txid)
|
90
|
-
raise ArgumentError, "Missing options." if opts.empty?
|
91
|
-
@params = { idrequest: label,
|
92
|
-
username: @options[:username],
|
93
|
-
password: @options[:password],
|
94
|
-
cur: @options[:cur],
|
95
|
-
txid: txid}.merge(opts).merge({ command: 'deposit' })
|
96
|
-
reference = "#{@params[:wallet]}:#{@params[:reference]}#{@params[:cur]}"
|
97
|
-
@params.merge!(reference: reference)
|
98
|
-
request = IGE_ISB_API.request(@params)
|
99
|
-
resp = request.send
|
100
|
-
response = JSON.parse(resp.body)
|
101
|
-
return response
|
102
|
-
end
|
103
|
-
|
104
|
-
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
105
|
-
# Additionally each transaction must include a unique transaction ID.
|
106
|
-
# the following options *must* be passed in.
|
107
|
-
# wallet: "the name of the payment processor being used",
|
108
|
-
# amount: a positive floating point number,
|
109
|
-
# reference: "for logging purposes",
|
110
|
-
#
|
111
|
-
# The following may be passed in and are presented here with their defaults.
|
112
|
-
# cur: defaults to IGE_ISB_API::Constants::DEFAULT_CURRENCY_CODE
|
113
|
-
def withdrawal(label = '', txid = 0, opts = {})
|
114
|
-
validate_params!(label, txid)
|
115
|
-
raise ArgumentError, "Missing options." if opts.empty?
|
116
|
-
@params = { idrequest: label,
|
117
|
-
username: @options[:username],
|
118
|
-
password: @options[:password],
|
119
|
-
cur: @options[:cur],
|
120
|
-
txid: txid}.merge(opts).merge({ command: 'withdrawal' })
|
121
|
-
reference = "#{@params[:reference]}#{@params[:cur]}"
|
122
|
-
@params.merge!(reference: reference)
|
123
|
-
request = IGE_ISB_API.request(@params)
|
124
|
-
resp = request.send
|
125
|
-
response = JSON.parse(resp.body)
|
126
|
-
return response
|
127
|
-
end
|
128
|
-
|
129
|
-
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
130
|
-
# Additionally each transaction must include a unique transaction ID.
|
131
|
-
# the following options *must* be passed in.
|
132
|
-
# limitationtype: 'DEPOSIT', 'DEPOSIT_EXTRA', 'BET', 'LOSS', 'TIME', 'EXCLUSION'
|
133
|
-
# amount: a positive floating point number,
|
134
|
-
# frequency: "WEEKLY", DAILY, MONTHLY, 1..n days - for exclusion
|
135
|
-
# until: "YYYY-MM-DD" or -1 for unlimited.
|
136
|
-
#
|
137
|
-
# The following may be passed in and are presented here with their defaults.
|
138
|
-
# cur: defaults to IGE_ISB_API::Constants::DEFAULT_CURRENCY_CODE
|
139
|
-
def limits(label = '', txid = 0, opts = {})
|
140
|
-
validate_params!(label, txid)
|
141
|
-
raise ArgumentError, "Missing options." if opts.empty?
|
142
|
-
@params = { idrequest: label,
|
143
|
-
username: @options[:username],
|
144
|
-
password: @options[:password],
|
145
|
-
txid: txid}.merge(opts).merge({ command: 'limits' })
|
146
|
-
request = IGE_ISB_API.request(@params)
|
147
|
-
resp = request.send
|
148
|
-
response = JSON.parse(resp.body)
|
149
|
-
return response
|
150
|
-
end
|
151
|
-
|
152
|
-
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
153
|
-
# Additionally each transaction must include a unique transaction ID.
|
154
|
-
def deactivate(label = '', txid = 0)
|
155
|
-
validate_params!(label, txid)
|
156
|
-
@params = { idrequest: label,
|
157
|
-
username: @options[:username],
|
158
|
-
password: @options[:password],
|
159
|
-
txid: txid}.merge({ command: 'userstatus', flag: IGE_ISB_API::Constants::USER_INACTIVE })
|
160
|
-
request = IGE_ISB_API.request(@params)
|
161
|
-
resp = request.send
|
162
|
-
response = JSON.parse(resp.body)
|
163
|
-
return response
|
164
|
-
end
|
165
|
-
|
166
|
-
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
167
|
-
# Additionally each transaction must include a unique transaction ID.
|
168
|
-
def activate(label = '', txid = 0)
|
169
|
-
validate_params!(label, txid)
|
170
|
-
@params = { idrequest: label,
|
171
|
-
username: @options[:username],
|
172
|
-
password: @options[:password],
|
173
|
-
txid: txid}.merge({ command: 'userstatus', flag: IGE_ISB_API::Constants::USER_ACTIVE })
|
174
|
-
request = IGE_ISB_API.request(@params)
|
175
|
-
resp = request.send
|
176
|
-
response = JSON.parse(resp.body)
|
177
|
-
return response
|
178
|
-
end
|
179
|
-
|
180
|
-
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
181
|
-
# Additionally each transaction must include a unique transaction ID.
|
182
|
-
def ban(label = '', txid = 0)
|
183
|
-
validate_params!(label, txid)
|
184
|
-
@params = { idrequest: label,
|
185
|
-
username: @options[:username],
|
186
|
-
password: @options[:password],
|
187
|
-
txid: txid}.merge({ command: 'userstatus', flag: IGE_ISB_API::Constants::USER_BANNED })
|
188
|
-
request = IGE_ISB_API.request(@params)
|
189
|
-
resp = request.send
|
190
|
-
response = JSON.parse(resp.body)
|
191
|
-
return response
|
192
|
-
end
|
193
|
-
|
194
|
-
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
195
|
-
# Additionally each transaction must include a unique transaction ID.
|
196
|
-
# the following option *must* be passed in.
|
197
|
-
# newpassword: 'some new password',
|
198
|
-
def change_password(label = '', txid = 0, opts = {})
|
199
|
-
validate_params!(label, txid)
|
200
|
-
raise ArgumentError, "Missing options." if opts.empty?
|
201
|
-
@params = { idrequest: label,
|
202
|
-
username: @options[:username],
|
203
|
-
password: @options[:password],
|
204
|
-
txid: txid}.merge(opts).merge({ command: 'pass'})
|
205
|
-
request = IGE_ISB_API.request(@params)
|
206
|
-
resp = request.send
|
207
|
-
response = JSON.parse(resp.body)
|
208
|
-
return response
|
209
|
-
end
|
210
|
-
|
211
|
-
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
212
|
-
# Additionally each transaction must include a unique transaction ID.
|
213
|
-
def get_vip_points(label = '', txid = 0)
|
214
|
-
validate_params!(label, txid)
|
215
|
-
@params = { idrequest: label,
|
216
|
-
username: @options[:username],
|
217
|
-
password: @options[:password],
|
218
|
-
txid: txid}.merge({ command: 'get_vip_points' })
|
219
|
-
request = IGE_ISB_API.request(@params)
|
220
|
-
resp = request.send
|
221
|
-
response = JSON.parse(resp.body)
|
222
|
-
return response
|
223
|
-
end
|
224
|
-
|
225
|
-
# Each command has a label which is used by the casino to tag a group of interactions with ISB
|
226
|
-
# Additionally each transaction must include a unique transaction ID.
|
227
|
-
# the following options *must* be passed in.
|
228
|
-
# invitedname: 'some new password',
|
229
|
-
# invitedemail: 'some new password',
|
230
|
-
def save_friend_email(label = '', txid = 0, opts = {})
|
231
|
-
validate_params!(label, txid)
|
232
|
-
raise ArgumentError, "Missing options." if opts.empty?
|
233
|
-
@params = { idrequest: label,
|
234
|
-
username: @options[:username],
|
235
|
-
password: @options[:password],
|
236
|
-
txid: txid}.merge(opts).merge({ command: 'save_friend_email'})
|
237
|
-
request = IGE_ISB_API.request(@params)
|
238
|
-
resp = request.send
|
239
|
-
response = JSON.parse(resp.body)
|
240
|
-
return response
|
241
|
-
end
|
242
|
-
|
243
|
-
private
|
244
|
-
|
245
|
-
def validate_params!(label, txid)
|
246
|
-
raise ArgumentError, "Missing a valid label." if label.empty?
|
247
|
-
raise ArgumentError, "Missing a valid transaction ID." if txid <= 0
|
248
|
-
end
|
249
|
-
|
250
|
-
end
|
251
|
-
end
|