alphaSDK 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +11 -11
- data/.rspec +3 -3
- data/.travis.yml +6 -6
- data/CODE_OF_CONDUCT.md +74 -74
- data/Gemfile +7 -7
- data/Gemfile.lock +34 -34
- data/LICENSE.txt +21 -21
- data/README.md +202 -44
- data/Rakefile +6 -6
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/examples.rb +139 -0
- data/gameball.gemspec +29 -29
- data/lib/gameball.rb +8 -0
- data/lib/gameball/models/action.rb +17 -0
- data/lib/gameball/models/coupon.rb +14 -0
- data/lib/gameball/models/player.rb +4 -0
- data/lib/gameball/models/transaction.rb +25 -0
- data/lib/gameball/utils/helper.rb +4 -0
- data/lib/gameball/version.rb +1 -1
- data/lib/testFile.rb +101 -0
- data/sdk.gemspec +13 -0
- data/unitTests.rb +398 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f91e52e2564ee95c3278bd6b3532e74439dddd5ee3c5cb6776cd498b2bd007fc
|
4
|
+
data.tar.gz: de1960fd811351064e6d8e4b07602b40d8e4a2a5f08ee1d43fc2d83e9d5333d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 659b269ed66b7689954a76c87e7c296d98a7c3a1a74ef50710eadd6777e099e71ebafed257ba531026bdefe890e49ed31e5acb5076ef403fc17d6824e564d6dc
|
7
|
+
data.tar.gz: dd5f356094ccb89f1f68aef1565d3e874005207a8c5c1a2c1cedf2bd24bdde20d6b85c18a34631bbadd25be5170dd4ab60baff3b489c979a7ccbe32e962c2be9
|
data/.gitignore
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
/.bundle/
|
2
|
-
/.yardoc
|
3
|
-
/_yardoc/
|
4
|
-
/coverage/
|
5
|
-
/doc/
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/tmp/
|
9
|
-
|
10
|
-
# rspec failure tracking
|
11
|
-
.rspec_status
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
9
|
+
|
10
|
+
# rspec failure tracking
|
11
|
+
.rspec_status
|
data/.rspec
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
--format documentation
|
2
|
-
--color
|
3
|
-
--require spec_helper
|
1
|
+
--format documentation
|
2
|
+
--color
|
3
|
+
--require spec_helper
|
data/.travis.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
---
|
2
|
-
language: ruby
|
3
|
-
cache: bundler
|
4
|
-
rvm:
|
5
|
-
- 2.6.6
|
6
|
-
before_install: gem install bundler -v 2.1.4
|
1
|
+
---
|
2
|
+
language: ruby
|
3
|
+
cache: bundler
|
4
|
+
rvm:
|
5
|
+
- 2.6.6
|
6
|
+
before_install: gem install bundler -v 2.1.4
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,74 +1,74 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
-
orientation.
|
11
|
-
|
12
|
-
## Our Standards
|
13
|
-
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
15
|
-
include:
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
22
|
-
|
23
|
-
Examples of unacceptable behavior by participants include:
|
24
|
-
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
-
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
30
|
-
address, without explicit permission
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
-
professional setting
|
33
|
-
|
34
|
-
## Our Responsibilities
|
35
|
-
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
39
|
-
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
45
|
-
|
46
|
-
## Scope
|
47
|
-
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
54
|
-
|
55
|
-
## Enforcement
|
56
|
-
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at alsouidan@gmail.com. All
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
63
|
-
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
66
|
-
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at [https://contributor-covenant.org/version/1/4][version]
|
72
|
-
|
73
|
-
[homepage]: https://contributor-covenant.org
|
74
|
-
[version]: https://contributor-covenant.org/version/1/4/
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at alsouidan@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [https://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: https://contributor-covenant.org
|
74
|
+
[version]: https://contributor-covenant.org/version/1/4/
|
data/Gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in gameball.gemspec
|
4
|
-
gemspec
|
5
|
-
|
6
|
-
gem "rake", "~> 12.0"
|
7
|
-
gem "rspec", "~> 3.0"
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in gameball.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
gem "rake", "~> 12.0"
|
7
|
+
gem "rspec", "~> 3.0"
|
data/Gemfile.lock
CHANGED
@@ -1,34 +1,34 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
alphaSDK (0.0.1)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
diff-lcs (1.4.4)
|
10
|
-
rake (12.3.3)
|
11
|
-
rspec (3.9.0)
|
12
|
-
rspec-core (~> 3.9.0)
|
13
|
-
rspec-expectations (~> 3.9.0)
|
14
|
-
rspec-mocks (~> 3.9.0)
|
15
|
-
rspec-core (3.9.2)
|
16
|
-
rspec-support (~> 3.9.3)
|
17
|
-
rspec-expectations (3.9.2)
|
18
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
-
rspec-support (~> 3.9.0)
|
20
|
-
rspec-mocks (3.9.1)
|
21
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
-
rspec-support (~> 3.9.0)
|
23
|
-
rspec-support (3.9.3)
|
24
|
-
|
25
|
-
PLATFORMS
|
26
|
-
x64-mingw32
|
27
|
-
|
28
|
-
DEPENDENCIES
|
29
|
-
alphaSDK!
|
30
|
-
rake (~> 12.0)
|
31
|
-
rspec (~> 3.0)
|
32
|
-
|
33
|
-
BUNDLED WITH
|
34
|
-
2.1.4
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
alphaSDK (0.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.4.4)
|
10
|
+
rake (12.3.3)
|
11
|
+
rspec (3.9.0)
|
12
|
+
rspec-core (~> 3.9.0)
|
13
|
+
rspec-expectations (~> 3.9.0)
|
14
|
+
rspec-mocks (~> 3.9.0)
|
15
|
+
rspec-core (3.9.2)
|
16
|
+
rspec-support (~> 3.9.3)
|
17
|
+
rspec-expectations (3.9.2)
|
18
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
+
rspec-support (~> 3.9.0)
|
20
|
+
rspec-mocks (3.9.1)
|
21
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
+
rspec-support (~> 3.9.0)
|
23
|
+
rspec-support (3.9.3)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
x64-mingw32
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
alphaSDK!
|
30
|
+
rake (~> 12.0)
|
31
|
+
rspec (~> 3.0)
|
32
|
+
|
33
|
+
BUNDLED WITH
|
34
|
+
2.1.4
|
data/LICENSE.txt
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2020 Alsouidan
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Alsouidan
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,44 +1,202 @@
|
|
1
|
-
# Gameball
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
```
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
1
|
+
# Gameball Ruby SDK
|
2
|
+
The Gameball Ruby SDK provides convenient access to the Gameball API from applications written in the Ruby language.
|
3
|
+
|
4
|
+
## Documentation
|
5
|
+
|
6
|
+
Please refer to the [Gameball API docs](https://docs.gameball.co).
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
You don't need this source code unless you want to modify the SDK. If you just
|
11
|
+
want to use the SDK, just run:
|
12
|
+
|
13
|
+
```sh
|
14
|
+
gem install gameballSDK
|
15
|
+
```
|
16
|
+
|
17
|
+
### Requirements
|
18
|
+
|
19
|
+
- Ruby 2.6+ and Gem 3.0+
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
The SDK needs to be configured with your account's API & Transaction keys available in your [Gameball Dashboard](https://help.gameball.co/en/articles/3467114-get-your-account-integration-details-api-key-and-transaction-key)
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
require 'gameball'
|
27
|
+
|
28
|
+
Gameball.api_key="api_key"
|
29
|
+
Gameball.api_version="v2.0" # Or latest
|
30
|
+
Gameball.transaction_key="transaction_key"
|
31
|
+
```
|
32
|
+
|
33
|
+
### Example
|
34
|
+
|
35
|
+
#### Sending an Event
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
# Example 1
|
39
|
+
Gameball::Event.send_event({
|
40
|
+
events:{
|
41
|
+
place_order:{
|
42
|
+
total_amount:"100",
|
43
|
+
category:[
|
44
|
+
"electronics",
|
45
|
+
"cosmetics"
|
46
|
+
]
|
47
|
+
},
|
48
|
+
review:{}
|
49
|
+
},
|
50
|
+
playerUniqueId:"player123"
|
51
|
+
})
|
52
|
+
# Example 2
|
53
|
+
Gameball::Event.send_event({
|
54
|
+
events:{
|
55
|
+
reserve:{
|
56
|
+
rooms:2
|
57
|
+
}
|
58
|
+
},
|
59
|
+
playerUniqueId:" player123",
|
60
|
+
playerAttributes:{
|
61
|
+
displayName:" Jon Snow",
|
62
|
+
email:"jon.snow@example.com",
|
63
|
+
dateOfBirth:"1980-09-19T00:00:00.000Z",
|
64
|
+
joinDate:"2019-09-19T21:06:29.158Z"
|
65
|
+
}
|
66
|
+
})
|
67
|
+
# Example 3
|
68
|
+
Gameball::Event.send_event({
|
69
|
+
events:{
|
70
|
+
reserve:{
|
71
|
+
rooms:2
|
72
|
+
}
|
73
|
+
},
|
74
|
+
playerUniqueId:" player123",
|
75
|
+
playerAttributes:{
|
76
|
+
displayName:" Jon Snow",
|
77
|
+
email:"jon.snow@example.com",
|
78
|
+
dateOfBirth:"1980-09-19T00:00:00.000Z",
|
79
|
+
joinDate:"2019-09-19T21:06:29.158Z",
|
80
|
+
custom:{
|
81
|
+
location:"Miami",
|
82
|
+
graduationDate:"2018-07-04T21:06:29.158Z",
|
83
|
+
isMarried:false
|
84
|
+
}
|
85
|
+
}
|
86
|
+
})
|
87
|
+
|
88
|
+
|
89
|
+
```
|
90
|
+
#### Create a new Referral
|
91
|
+
```ruby
|
92
|
+
Gameball::Referral.create_referral({
|
93
|
+
playerCode:"CODE11",
|
94
|
+
playerUniqueId:"player456"
|
95
|
+
}
|
96
|
+
)
|
97
|
+
# Example 2
|
98
|
+
Gameball::Referral.create_referral({
|
99
|
+
playerCode:"CODE11",
|
100
|
+
playerUniqueId:"player456",
|
101
|
+
playerAttributes:{
|
102
|
+
displayName:" Tyrion Lannister",
|
103
|
+
firstName:"Tyrion",
|
104
|
+
lastName:"Lannister",
|
105
|
+
email:"tyrion@example.com",
|
106
|
+
gender:"M",
|
107
|
+
dateOfBirth:"1978-01-11T00:00:00.000Z",
|
108
|
+
joinDate:"2019-09-19T21:06:29.158Z",
|
109
|
+
custom:{
|
110
|
+
location:"Miami",
|
111
|
+
graduationDate:"2018-07-04T21:06:29.158Z",
|
112
|
+
isMarried:false
|
113
|
+
}
|
114
|
+
}
|
115
|
+
}
|
116
|
+
)
|
117
|
+
```
|
118
|
+
|
119
|
+
#### Reward Examples
|
120
|
+
```ruby
|
121
|
+
# Example 1
|
122
|
+
Gameball::Transaction.reward_points({
|
123
|
+
playerUniqueId:"player123",
|
124
|
+
amount:99.98,
|
125
|
+
transactionId:"tra_123456789",
|
126
|
+
transactionTime:"2019-09-19T16:14:09.895Z"
|
127
|
+
})
|
128
|
+
# Example 2
|
129
|
+
Gameball::Transaction.reward_points({
|
130
|
+
playerUniqueId:"player456",
|
131
|
+
amount:2500,
|
132
|
+
transactionId:"tra_123456789",
|
133
|
+
playerAttributes:{
|
134
|
+
displayName:" Tyrion Lannister",
|
135
|
+
firstName:"Tyrion",
|
136
|
+
lastName:"Lannister",
|
137
|
+
email:"tyrion@example.com",
|
138
|
+
gender:"M",
|
139
|
+
dateOfBirth:"1978-01-11T00:00:00.000Z",
|
140
|
+
joinDate:"2019-09-19T21:06:29.158Z",
|
141
|
+
custom:{
|
142
|
+
location:"Miami",
|
143
|
+
graduationDate:"2018-07-04T21:06:29.158Z",
|
144
|
+
isMarried:false
|
145
|
+
}
|
146
|
+
},
|
147
|
+
transactionTime:"2019-09-19T16:14:09.895Z"
|
148
|
+
}
|
149
|
+
)
|
150
|
+
```
|
151
|
+
#### Get Player Balance Example
|
152
|
+
```ruby
|
153
|
+
Gameball::Transaction.get_player_balance("player456")
|
154
|
+
```
|
155
|
+
#### Hold Points Example
|
156
|
+
```ruby
|
157
|
+
Gameball::Transaction.hold_points({
|
158
|
+
playerUniqueId:"player456",
|
159
|
+
amount:98.89,
|
160
|
+
transactionTime:"2019-09-21T16:53:28.190Z"
|
161
|
+
}
|
162
|
+
)
|
163
|
+
```
|
164
|
+
#### Redeem Example
|
165
|
+
```ruby
|
166
|
+
Gameball::Transaction.redeem_points({
|
167
|
+
playerUniqueId:"player456",
|
168
|
+
amount:10,
|
169
|
+
transactionId:"tra_123456789",
|
170
|
+
holdReference:"2342452352435234",
|
171
|
+
transactionTime:"2019-09-19T16:14:09.895Z"
|
172
|
+
})
|
173
|
+
```
|
174
|
+
#### Reverse Transaction Example
|
175
|
+
```ruby
|
176
|
+
Gameball::Transaction.reverse_transaction({
|
177
|
+
playerUniqueId:"player456",
|
178
|
+
transactionId:"1234567890",
|
179
|
+
reversedTransactionId:"234567891",
|
180
|
+
transactionTime:"2019-09-19T11:14:09.895Z"
|
181
|
+
}
|
182
|
+
)
|
183
|
+
```
|
184
|
+
#### Reverse Hold Example
|
185
|
+
```ruby
|
186
|
+
Gameball::Transaction.reverse_hold({
|
187
|
+
playerUniqueId:" player456",
|
188
|
+
holdReference:"9245fe4a-d402-451c-b9ed-9c1a04247482",
|
189
|
+
transactionTime:"2019-09-21T16:53:28.190Z"
|
190
|
+
}
|
191
|
+
)
|
192
|
+
```
|
193
|
+
|
194
|
+
### Handling exceptions
|
195
|
+
|
196
|
+
Unsuccessful requests raise exceptions. The raised exception will reflect the sort of error that occurred with appropriate message and error code . Please refer to the [Gameball API docs](https://docs.gameball.co).
|
197
|
+
|
198
|
+
## Contribution
|
199
|
+
The master branch of this repository contains the latest stable release of the SDK.
|
200
|
+
|
201
|
+
## Contact
|
202
|
+
For usage questions\suggestions drop us an email at support[ at ]gameball.co. Please report any bugs as issues.
|