alphaSDK 0.2.5 → 0.2.6
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 +2 -2
- data/Gemfile.lock +36 -34
- data/alphaSDK-0.2.5.gem +0 -0
- data/gameball.gemspec +2 -2
- data/lib/gameball.rb +2 -8
- data/lib/gameball/models/action.rb +5 -8
- data/lib/gameball/models/coupon.rb +2 -15
- data/lib/gameball/models/event.rb +0 -4
- data/lib/gameball/models/player.rb +0 -4
- data/lib/gameball/models/transaction.rb +0 -25
- data/lib/gameball/utils/helper.rb +1 -10
- data/lib/gameball/version.rb +1 -1
- data/unitTests.rb +5 -77
- metadata +6 -6
- data/sdk.gemspec +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fce1ae63c92d753f9e6259e1879e31943136eee81eee60ee7282da75a1295da8
|
4
|
+
data.tar.gz: 9225dc4c5c30c1c31a127dccb540b73db610c9d611f9369b1fb2480accd25f3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d70c86ed0f885b71e485fb725aa52049d42e3d729b25a52fe6c2204b0e1156caa4524e47cf9c001380149b183f31f2c2937796019c081e1fbb44b1cca9b700e8
|
7
|
+
data.tar.gz: fca1964701315edb2eb1324164819b76311ee30d27e44a72c33db6fa425a235fe6117da8494bc33aa8989b48a527dcf9e11887a43aa55e84b4748a41ab1d989d
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,34 +1,36 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
alphaSDK (0.
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
rspec-
|
15
|
-
|
16
|
-
rspec-
|
17
|
-
rspec-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
alphaSDK (0.2.5)
|
5
|
+
rake (>= 12.0)
|
6
|
+
rspec (>= 3.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
diff-lcs (1.4.4)
|
12
|
+
rake (12.0.0)
|
13
|
+
rspec (3.9.0)
|
14
|
+
rspec-core (~> 3.9.0)
|
15
|
+
rspec-expectations (~> 3.9.0)
|
16
|
+
rspec-mocks (~> 3.9.0)
|
17
|
+
rspec-core (3.9.2)
|
18
|
+
rspec-support (~> 3.9.3)
|
19
|
+
rspec-expectations (3.9.2)
|
20
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
+
rspec-support (~> 3.9.0)
|
22
|
+
rspec-mocks (3.9.1)
|
23
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
+
rspec-support (~> 3.9.0)
|
25
|
+
rspec-support (3.9.3)
|
26
|
+
|
27
|
+
PLATFORMS
|
28
|
+
x64-mingw32
|
29
|
+
|
30
|
+
DEPENDENCIES
|
31
|
+
alphaSDK!
|
32
|
+
rake (>= 12.0)
|
33
|
+
rspec (>= 3.0)
|
34
|
+
|
35
|
+
BUNDLED WITH
|
36
|
+
2.1.4
|
data/alphaSDK-0.2.5.gem
ADDED
Binary file
|
data/gameball.gemspec
CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.homepage = "http://mygemserver.com"
|
11
11
|
spec.license = "MIT"
|
12
12
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
13
|
-
spec.add_dependency 'rake','
|
14
|
-
spec.add_dependency 'rspec','
|
13
|
+
spec.add_dependency 'rake','>= 12.0'
|
14
|
+
spec.add_dependency 'rspec','>= 3.0'
|
15
15
|
# spec.metadata["allowed_push_host"] = "https://github.com/Alsouidan/alphasdk"
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
data/lib/gameball.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# Requiring all dependencies needed
|
1
2
|
require "net/http"
|
2
3
|
require "net/http"
|
3
4
|
require "openssl"
|
@@ -5,10 +6,7 @@ require "uri"
|
|
5
6
|
require "Time"
|
6
7
|
require "digest/sha1"
|
7
8
|
require "json"
|
8
|
-
|
9
|
-
require "async"
|
10
|
-
=======
|
11
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
9
|
+
# Requiring all the other files to help us require this fiel only
|
12
10
|
require_relative "./gameball/utils/request"
|
13
11
|
require_relative "./gameball/utils/helper"
|
14
12
|
require_relative "./gameball/utils/validation"
|
@@ -25,11 +23,7 @@ module Gameball
|
|
25
23
|
@max_retries = 1
|
26
24
|
@read_timeout = 60
|
27
25
|
@keep_alive_timeout = 30
|
28
|
-
<<<<<<< HEAD
|
29
|
-
@api_version = "v1.0"
|
30
|
-
=======
|
31
26
|
@api_version = "v2.0"
|
32
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
33
27
|
class << self
|
34
28
|
attr_accessor :api_key
|
35
29
|
attr_accessor :api_version
|
@@ -1,12 +1,10 @@
|
|
1
1
|
module Gameball
|
2
2
|
class Action
|
3
|
-
<<<<<<< HEAD
|
4
|
-
def send_action(body)
|
5
|
-
Gameball::Utils.validate(body, ["playerUniqueId"], ["playerAttributes", "events", "pointsTransaction"])
|
6
|
-
=======
|
7
3
|
def self.send_action(body)
|
4
|
+
# Validating keys in incoming body
|
8
5
|
Gameball::Utils.validate(body, ["playerUniqueId"], ["playerAttributes", "events", "pointsTransaction"])
|
9
6
|
if body.has_key? (:pointsTransaction)
|
7
|
+
# Validating pointsTransaction object in body
|
10
8
|
Gameball::Utils.validate(body[:pointsTransaction], ['transactionId'],['rewardAmount','holdReference'])
|
11
9
|
body[:pointsTransaction][:transactionTime]=Time.now.utc
|
12
10
|
amount=''
|
@@ -14,17 +12,16 @@ module Gameball
|
|
14
12
|
amount=body[:pointsTransaction][:rewardAmount]
|
15
13
|
end
|
16
14
|
body[:pointsTransaction]['hash']=Gameball::Utils.hashBody(playerUniqueId:body[:playerUniqueId],transactionTime:body[:pointsTransaction][:transactionTime],amount:amount)
|
15
|
+
body[:pointsTransaction][:transactionTime]=Time.now.utc.iso8601
|
17
16
|
end
|
18
|
-
body[:pointsTransaction][:transactionTime]=Time.now.utc.iso8601
|
19
17
|
|
20
|
-
p body.to_json
|
21
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
22
18
|
res = Gameball::Utils::request("post", "/Integrations/Action", body)
|
19
|
+
# Check for HTTP Success and throws error if not success
|
23
20
|
unless res.kind_of? Net::HTTPSuccess
|
24
21
|
if res.kind_of? Net::HTTPInternalServerError
|
25
22
|
raise Gameball::GameballError.new("An Internal Server Error has occurred")
|
26
23
|
else
|
27
|
-
raise Gameball::GameballError.new(res.body)
|
24
|
+
raise Gameball::GameballError.new(res.body)
|
28
25
|
end
|
29
26
|
else
|
30
27
|
return res
|
@@ -1,17 +1,12 @@
|
|
1
1
|
module Gameball
|
2
2
|
class Coupon
|
3
|
-
def self.create_discount_coupon(body)
|
4
|
-
|
5
|
-
Gameball::Utils.validate(body, ["playerUniqueId", "transactionTime"], ["startAt", "endsAt", "entitledCollectionIds", "entitledProductIds",
|
6
|
-
"oncePerCustomer", "prerequisiteQuantityRange", "prerequisiteShippingPriceRange", "prerequisiteSubtotalRange",
|
7
|
-
"prerequisiteCollectionIds", "prerequisiteProductIds", "code", "usageLimit", "value", "valueType", "cap"])
|
8
|
-
=======
|
3
|
+
def self.create_discount_coupon(body)
|
4
|
+
# Validating keys in incoming body
|
9
5
|
Gameball::Utils.validate(body, ["playerUniqueId"], ["startAt", "endsAt", "entitledCollectionIds", "entitledProductIds",
|
10
6
|
"oncePerCustomer", "prerequisiteQuantityRange", "prerequisiteShippingPriceRange", "prerequisiteSubtotalRange",
|
11
7
|
"prerequisiteCollectionIds", "prerequisiteProductIds", "code", "usageLimit", "value", "valueType", "cap"])
|
12
8
|
|
13
9
|
body[:transactionTime] = Time.now.utc
|
14
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
15
10
|
body["hash"] = Gameball::Utils::hashBody(playerUniqueId: body[:playerUniqueId])
|
16
11
|
res = Gameball::Utils::request("post", "/Integrations/Coupon", body)
|
17
12
|
unless res.kind_of? Net::HTTPSuccess
|
@@ -25,13 +20,9 @@ module Gameball
|
|
25
20
|
end
|
26
21
|
end
|
27
22
|
def self.validate_discount_coupon(body)
|
28
|
-
<<<<<<< HEAD
|
29
|
-
Gameball::Utils.validate(body, ["playerUniqueId", "code", "transactionTime"])
|
30
|
-
=======
|
31
23
|
Gameball::Utils.validate(body, ["playerUniqueId", "code"])
|
32
24
|
body[:transactionTime] = Time.now.utc
|
33
25
|
|
34
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
35
26
|
body["hash"] = Gameball::Utils::hashBody(playerUniqueId: body[:playerUniqueId])
|
36
27
|
res = Gameball::Utils::request("post", "/Integrations/Coupon/Validate", body)
|
37
28
|
unless res.kind_of? Net::HTTPSuccess
|
@@ -45,12 +36,8 @@ module Gameball
|
|
45
36
|
end
|
46
37
|
end
|
47
38
|
def self.redeem_discount_coupon(body)
|
48
|
-
<<<<<<< HEAD
|
49
|
-
Gameball::Utils.validate(body, ["playerUniqueId", "code", "transactionTime"])
|
50
|
-
=======
|
51
39
|
Gameball::Utils.validate(body, ["playerUniqueId", "code"])
|
52
40
|
body[:transactionTime] = Time.now.utc
|
53
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
54
41
|
body["hash"] = Gameball::Utils::hashBody(playerUniqueId: body[:playerUniqueId])
|
55
42
|
res = Gameball::Utils::request("post", "/Integrations/Coupon/Redeem", body)
|
56
43
|
unless res.kind_of? Net::HTTPSuccess
|
@@ -1,11 +1,7 @@
|
|
1
1
|
module Gameball
|
2
2
|
class Event
|
3
|
-
# include Gameball::Request
|
4
3
|
def self.sendEvent(eventBody)
|
5
4
|
Gameball::Utils.validate(eventBody, ["events", "playerUniqueId"], ["playerAttributes"])
|
6
|
-
if eventBody.has_key?(:playerAttributes)
|
7
|
-
# Gameball::Utils.validate(eventBody[:playerAttributes],['displayName','firstName','lastName','email','gender','mobileNumber','dateOfBirth','joinDate'],['custom'])
|
8
|
-
end
|
9
5
|
res = Gameball::Utils::request("post", "/integrations/event", eventBody)
|
10
6
|
unless res.kind_of? Net::HTTPSuccess
|
11
7
|
if res.kind_of? Net::HTTPInternalServerError
|
@@ -24,11 +24,7 @@ module Gameball
|
|
24
24
|
end
|
25
25
|
def self.get_player_info(playerUniqueId)
|
26
26
|
body = { playerUniqueId: playerUniqueId }
|
27
|
-
<<<<<<< HEAD
|
28
|
-
body["bodyHashed"] = Gameball::Utils::hashBody(playerUniqueId: playerUniqueId)
|
29
|
-
=======
|
30
27
|
body["hash"] = Gameball::Utils::hashBody(playerUniqueId: playerUniqueId)
|
31
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
32
28
|
res = Gameball::Utils::request("post", "/integrations/Player/Info", body)
|
33
29
|
unless res.kind_of? Net::HTTPSuccess
|
34
30
|
if res.kind_of? Net::HTTPInternalServerError
|
@@ -4,11 +4,7 @@ module Gameball
|
|
4
4
|
def self.get_player_balance(playerId)
|
5
5
|
hashedBody = Gameball::Utils::hashBody(playerUniqueId: playerId)
|
6
6
|
body = { playerUniqueId: playerId,
|
7
|
-
<<<<<<< HEAD
|
8
|
-
bodyHashed: hashedBody }
|
9
|
-
=======
|
10
7
|
hash: hashedBody }
|
11
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
12
8
|
res = Gameball::Utils::request("post", "/integrations/transaction/balance", body)
|
13
9
|
unless res.kind_of? Net::HTTPSuccess
|
14
10
|
raise Gameball::GameballError.new(res.body) # use custom message
|
@@ -19,14 +15,9 @@ module Gameball
|
|
19
15
|
def self.hold_points(body)
|
20
16
|
# puts body
|
21
17
|
# check if attributes are available
|
22
|
-
<<<<<<< HEAD
|
23
|
-
Gameball::Utils.validate(body, ["playerUniqueId", "amount", "transactionTime"], ["otp"])
|
24
|
-
|
25
|
-
=======
|
26
18
|
|
27
19
|
Gameball::Utils.validate(body, ["playerUniqueId", "amount"], ["otp"])
|
28
20
|
body[:transactionTime] = Time.now.utc
|
29
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
30
21
|
body = Gameball::Utils::extractAttributesToHash(body)
|
31
22
|
res = Gameball::Utils::request("post", "/integrations/transaction/hold", body)
|
32
23
|
unless res.kind_of? Net::HTTPSuccess
|
@@ -41,12 +32,8 @@ module Gameball
|
|
41
32
|
end
|
42
33
|
def self.redeem_points(body)
|
43
34
|
# check if attributes are available
|
44
|
-
<<<<<<< HEAD
|
45
|
-
Gameball::Utils.validate(body, ["holdReference", "playerUniqueId", "amount", "transactionOnClientSystemId", "transactionTime"], [])
|
46
|
-
=======
|
47
35
|
Gameball::Utils.validate(body, ["holdReference", "playerUniqueId", "transactionId"], [])
|
48
36
|
body[:transactionTime] = Time.now.utc
|
49
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
50
37
|
body = Gameball::Utils::extractAttributesToHash(body)
|
51
38
|
res = Gameball::Utils::request("post", "/integrations/transaction/redeem", body)
|
52
39
|
unless res.kind_of? Net::HTTPSuccess
|
@@ -60,13 +47,9 @@ module Gameball
|
|
60
47
|
end
|
61
48
|
end
|
62
49
|
def self.reverse_transaction(body)
|
63
|
-
<<<<<<< HEAD
|
64
|
-
Gameball::Utils.validate(body, ["reversedTransactionOnClientSystemId", "playerUniqueId", "transactionOnClientSystemId", "transactionTime"], [])
|
65
|
-
=======
|
66
50
|
Gameball::Utils.validate(body, ["reversedTransactionId", "playerUniqueId", "transactionId"], [])
|
67
51
|
body[:transactionTime] = Time.now.utc
|
68
52
|
|
69
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
70
53
|
body = Gameball::Utils::extractAttributesToHash(body)
|
71
54
|
res = Gameball::Utils::request("post", "/integrations/transaction/cancel", body)
|
72
55
|
unless res.kind_of? Net::HTTPSuccess
|
@@ -80,13 +63,9 @@ module Gameball
|
|
80
63
|
end
|
81
64
|
end
|
82
65
|
def self.reward_points(body)
|
83
|
-
<<<<<<< HEAD
|
84
|
-
Gameball::Utils.validate(body, ["playerUniqueId", "amount", "transactionOnClientSystemId", "transactionTime"], ["playerAttributes"])
|
85
|
-
=======
|
86
66
|
Gameball::Utils.validate(body, ["playerUniqueId", "amount", "transactionId"], ["playerAttributes"])
|
87
67
|
body[:transactionTime] = Time.now.utc
|
88
68
|
|
89
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
90
69
|
body = Gameball::Utils::extractAttributesToHash(body)
|
91
70
|
res = Gameball::Utils::request("post", "/integrations/transaction/reward", body)
|
92
71
|
unless res.kind_of? Net::HTTPSuccess
|
@@ -101,12 +80,8 @@ module Gameball
|
|
101
80
|
end
|
102
81
|
def self.reverse_hold(body)
|
103
82
|
# check if holdReference is in body else throw error
|
104
|
-
<<<<<<< HEAD
|
105
|
-
Gameball::Utils.validate(body, ["holdReference", "playerUniqueId", "transactionTime"], [])
|
106
|
-
=======
|
107
83
|
Gameball::Utils.validate(body, ["holdReference", "playerUniqueId"], [])
|
108
84
|
body[:transactionTime] = Time.now.utc
|
109
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
110
85
|
|
111
86
|
body = Gameball::Utils::extractAttributesToHash(body)
|
112
87
|
res = Gameball::Utils::request("post", "/integrations/transaction/hold", body)
|
@@ -3,22 +3,17 @@ module Gameball
|
|
3
3
|
extend self
|
4
4
|
|
5
5
|
def hashBody(playerUniqueId:, transactionTime: "", amount: "")
|
6
|
-
# Check if transaction Key is provided else raise
|
6
|
+
# Check if transaction Key is provided else raise Error
|
7
7
|
if !Gameball.transaction_key
|
8
8
|
raise Gameball::GameballError.new("Please provide transaction_key, try Gameball::transaction_key='your_key'") # Raise exception
|
9
9
|
else
|
10
10
|
if transactionTime == ""
|
11
11
|
formatted_time = ""
|
12
12
|
else
|
13
|
-
# begin
|
14
13
|
formatted_time = transactionTime.strftime("%y%m%d%H%M%S")
|
15
|
-
# rescue => exception
|
16
|
-
|
17
|
-
# end
|
18
14
|
end
|
19
15
|
end
|
20
16
|
str = playerUniqueId + ":" + formatted_time + ":" + amount.to_s + ":" + Gameball.transaction_key
|
21
|
-
# puts str
|
22
17
|
return Digest::SHA1.hexdigest (str)
|
23
18
|
end
|
24
19
|
|
@@ -31,11 +26,7 @@ module Gameball
|
|
31
26
|
rescue NoMethodError => exception
|
32
27
|
raise Gameball::GameballError.new("Invalid Date Formate, Please use Date and Time objects")
|
33
28
|
end
|
34
|
-
<<<<<<< HEAD
|
35
|
-
body["bodyHashed"] = Gameball::Utils::hashBody(playerUniqueId: playerUniqueId, amount: (amount || ""), transactionTime: (transactionTime || ""))
|
36
|
-
=======
|
37
29
|
body["hash"] = Gameball::Utils::hashBody(playerUniqueId: playerUniqueId, amount: (amount || ""), transactionTime: (transactionTime || ""))
|
38
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
39
30
|
body
|
40
31
|
end
|
41
32
|
end
|
data/lib/gameball/version.rb
CHANGED
data/unitTests.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "rspec/autorun"
|
2
2
|
require "./lib/gameball"
|
3
3
|
|
4
|
-
describe Gameball::Player do
|
4
|
+
RSpec.describe Gameball::Player do
|
5
5
|
before (:each) {
|
6
6
|
Gameball::api_key = nil
|
7
7
|
Gameball::api_version = nil
|
@@ -68,7 +68,7 @@ describe Gameball::Player do
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
71
|
-
describe Gameball::Event do
|
71
|
+
RSpec.describe Gameball::Event do
|
72
72
|
it "create new event" do
|
73
73
|
Gameball::api_key = "7c7636658209418c9a82306a421f76a5"
|
74
74
|
Gameball::api_version = "v2.0"
|
@@ -159,7 +159,7 @@ describe Gameball::Event do
|
|
159
159
|
# })
|
160
160
|
# expect(res).to eq(true)
|
161
161
|
# end
|
162
|
-
describe Gameball::Referral do
|
162
|
+
RSpec.describe Gameball::Referral do
|
163
163
|
it "Creates new player then new referral" do
|
164
164
|
Gameball::api_key = "7c7636658209418c9a82306a421f76a5"
|
165
165
|
Gameball::api_version = "v2.0"
|
@@ -196,26 +196,17 @@ describe Gameball::Event do
|
|
196
196
|
expect(res).to eq(true)
|
197
197
|
end
|
198
198
|
end
|
199
|
-
describe Gameball::Transaction do
|
199
|
+
RSpec.describe Gameball::Transaction do
|
200
200
|
it "Makes a simple reward" do
|
201
201
|
Gameball::api_key = "7c7636658209418c9a82306a421f76a5"
|
202
202
|
Gameball::transaction_key = "26e1967d89114388bdd1772587c336c8"
|
203
203
|
Gameball::api_version = "v2.0"
|
204
|
-
<<<<<<< HEAD
|
205
|
-
transactionOnClientSystemId = rand 50000..10000000
|
206
|
-
res = Gameball::Transaction.reward_points({
|
207
|
-
playerUniqueId: "player123",
|
208
|
-
amount: 100,
|
209
|
-
transactionTime: Time.now.utc,
|
210
|
-
transactionOnClientSystemId: transactionOnClientSystemId,
|
211
|
-
=======
|
212
204
|
transactionId = rand 50000..10000000
|
213
205
|
res = Gameball::Transaction.reward_points({
|
214
206
|
playerUniqueId: "player123",
|
215
207
|
amount: 100,
|
216
208
|
|
217
209
|
transactionId: transactionId,
|
218
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
219
210
|
|
220
211
|
})
|
221
212
|
expect(res).to eq(true)
|
@@ -224,21 +215,12 @@ describe Gameball::Event do
|
|
224
215
|
Gameball::api_key = "7c7636658209418c9a82306a421f76a5"
|
225
216
|
Gameball::transaction_key = "26e1967d89114388bdd1772587c336c8"
|
226
217
|
Gameball::api_version = "v2.0"
|
227
|
-
<<<<<<< HEAD
|
228
|
-
transactionOnClientSystemId = rand 50000..10000000
|
229
|
-
res = Gameball::Transaction.reward_points({
|
230
|
-
playerUniqueId: "player123",
|
231
|
-
amount: 100,
|
232
|
-
transactionTime: Time.now.utc,
|
233
|
-
transactionOnClientSystemId: transactionOnClientSystemId,
|
234
|
-
=======
|
235
218
|
transactionId = rand 50000..10000000
|
236
219
|
res = Gameball::Transaction.reward_points({
|
237
220
|
playerUniqueId: "player123",
|
238
221
|
amount: 100,
|
239
222
|
|
240
223
|
transactionId: transactionId,
|
241
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
242
224
|
playerAttributes: {
|
243
225
|
displayName: " Jon Snow",
|
244
226
|
email: "jon.snow@example.com",
|
@@ -260,12 +242,7 @@ describe Gameball::Event do
|
|
260
242
|
Gameball::api_version = "v2.0"
|
261
243
|
res = Gameball::Transaction.hold_points({
|
262
244
|
playerUniqueId: "player123",
|
263
|
-
<<<<<<< HEAD
|
264
|
-
amount: 2,
|
265
|
-
transactionTime: Time.now.utc,
|
266
|
-
=======
|
267
245
|
amount: 2
|
268
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
269
246
|
})
|
270
247
|
expect(res.code).to eq("200")
|
271
248
|
end
|
@@ -275,20 +252,6 @@ describe Gameball::Event do
|
|
275
252
|
Gameball::api_version = "v2.0"
|
276
253
|
res = Gameball::Transaction.hold_points({
|
277
254
|
playerUniqueId: "player123",
|
278
|
-
<<<<<<< HEAD
|
279
|
-
amount: 2,
|
280
|
-
transactionTime: Time.now.utc,
|
281
|
-
})
|
282
|
-
|
283
|
-
holdReference = JSON.parse(res.body)["holdReference"]
|
284
|
-
transactionOnClientSystemId = rand 50000..10000000
|
285
|
-
res = Gameball::Transaction.redeem_points({
|
286
|
-
holdReference: holdReference,
|
287
|
-
playerUniqueId: "player123",
|
288
|
-
amount: 2,
|
289
|
-
transactionOnClientSystemId: transactionOnClientSystemId,
|
290
|
-
transactionTime: Time.now.utc,
|
291
|
-
=======
|
292
255
|
amount: 2
|
293
256
|
})
|
294
257
|
|
@@ -298,7 +261,6 @@ describe Gameball::Event do
|
|
298
261
|
holdReference: holdReference,
|
299
262
|
playerUniqueId: "player123",
|
300
263
|
transactionId: transactionId
|
301
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
302
264
|
})
|
303
265
|
expect(res.code).to eq("200")
|
304
266
|
end
|
@@ -308,39 +270,20 @@ describe Gameball::Event do
|
|
308
270
|
Gameball::api_version = "v2.0"
|
309
271
|
res = Gameball::Transaction.hold_points({
|
310
272
|
playerUniqueId: "player123",
|
311
|
-
<<<<<<< HEAD
|
312
|
-
amount: 2,
|
313
|
-
transactionTime: Time.now.utc,
|
314
|
-
})
|
315
|
-
transactionOnClientSystemId = rand 50000..10000000
|
316
|
-
=======
|
317
273
|
amount: 2
|
318
274
|
})
|
319
275
|
transactionId = rand 50000..10000000
|
320
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
321
276
|
|
322
277
|
holdReference = JSON.parse(res.body)["holdReference"]
|
323
278
|
res = Gameball::Transaction.redeem_points({
|
324
279
|
holdReference: holdReference,
|
325
280
|
playerUniqueId: "player123",
|
326
|
-
<<<<<<< HEAD
|
327
|
-
amount: 2,
|
328
|
-
transactionOnClientSystemId: transactionOnClientSystemId,
|
329
|
-
transactionTime: Time.now.utc,
|
330
|
-
})
|
331
|
-
res = Gameball::Transaction.reverse_transaction({
|
332
|
-
playerUniqueId: "player123",
|
333
|
-
transactionOnClientSystemId: transactionOnClientSystemId,
|
334
|
-
reversedTransactionOnClientSystemId: transactionOnClientSystemId,
|
335
|
-
transactionTime: Time.now.utc,
|
336
|
-
=======
|
337
281
|
transactionId: transactionId
|
338
282
|
})
|
339
283
|
res = Gameball::Transaction.reverse_transaction({
|
340
284
|
playerUniqueId: "player123",
|
341
285
|
transactionId: transactionId,
|
342
286
|
reversedTransactionId: transactionId
|
343
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
344
287
|
})
|
345
288
|
expect(res.code).to eq("200")
|
346
289
|
end
|
@@ -350,24 +293,12 @@ describe Gameball::Event do
|
|
350
293
|
Gameball::api_version = "v2.0"
|
351
294
|
res = Gameball::Transaction.hold_points({
|
352
295
|
playerUniqueId: "player123",
|
353
|
-
<<<<<<< HEAD
|
354
|
-
amount: 2,
|
355
|
-
transactionTime: Time.now.utc,
|
356
|
-
})
|
357
|
-
=======
|
358
296
|
amount: 2 })
|
359
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
360
297
|
|
361
298
|
holdReference = JSON.parse(res.body)["holdReference"]
|
362
299
|
res = Gameball::Transaction.reverse_hold({
|
363
300
|
playerUniqueId: "player123",
|
364
|
-
<<<<<<< HEAD
|
365
|
-
holdReference: holdReference,
|
366
|
-
transactionTime: Time.now.utc,
|
367
|
-
})
|
368
|
-
=======
|
369
301
|
holdReference: holdReference })
|
370
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
371
302
|
expect(res.code).to eq("200")
|
372
303
|
end
|
373
304
|
it "Gets a Player's balance" do
|
@@ -378,9 +309,7 @@ describe Gameball::Event do
|
|
378
309
|
expect(res.code).to eq("200")
|
379
310
|
end
|
380
311
|
end
|
381
|
-
|
382
|
-
=======
|
383
|
-
describe Gameball::Action do
|
312
|
+
RSpec.describe Gameball::Action do
|
384
313
|
it "Sends an action with only an event" do
|
385
314
|
res= Gameball::Action.send_action({
|
386
315
|
playerUniqueId: "uniquekeys120",
|
@@ -394,5 +323,4 @@ describe Gameball::Event do
|
|
394
323
|
end
|
395
324
|
end
|
396
325
|
|
397
|
-
>>>>>>> aece124df52cb5113b88b74b8e8eb5c68bec89ef
|
398
326
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alphaSDK
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alsouidan
|
@@ -14,28 +14,28 @@ dependencies:
|
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '12.0'
|
20
20
|
type: :runtime
|
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: '12.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '3.0'
|
34
34
|
type: :runtime
|
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: '3.0'
|
41
41
|
description:
|
@@ -54,6 +54,7 @@ files:
|
|
54
54
|
- LICENSE.txt
|
55
55
|
- README.md
|
56
56
|
- Rakefile
|
57
|
+
- alphaSDK-0.2.5.gem
|
57
58
|
- bin/console
|
58
59
|
- bin/setup
|
59
60
|
- examples.rb
|
@@ -71,7 +72,6 @@ files:
|
|
71
72
|
- lib/gameball/utils/validation.rb
|
72
73
|
- lib/gameball/version.rb
|
73
74
|
- lib/testFile.rb
|
74
|
-
- sdk.gemspec
|
75
75
|
- unitTests.rb
|
76
76
|
homepage: http://mygemserver.com
|
77
77
|
licenses:
|
data/sdk.gemspec
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = "alphaSDK"
|
3
|
-
s.version = "0.2.0"
|
4
|
-
s.date = "2020-07-28"
|
5
|
-
s.summary = "Test"
|
6
|
-
s.description = "SDK"
|
7
|
-
s.authors = ["Souidan"]
|
8
|
-
s.email = "alsouidan@gmail.com"
|
9
|
-
s.files = Dir["lib/**/*.rb"]
|
10
|
-
s.homepage =
|
11
|
-
"https://rubygems.org/gems/hola"
|
12
|
-
s.license = "MIT"
|
13
|
-
end
|