alphaSDK 0.0.3 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a6989546d20cbfdaf28a7ea73877b274c72e45a037bbad9055b898a78a91cac
4
- data.tar.gz: f9ab083d60b26b3610ee29aa2eff0b7d508af818f52cb58c0b960795ffe842f2
3
+ metadata.gz: fce1ae63c92d753f9e6259e1879e31943136eee81eee60ee7282da75a1295da8
4
+ data.tar.gz: 9225dc4c5c30c1c31a127dccb540b73db610c9d611f9369b1fb2480accd25f3f
5
5
  SHA512:
6
- metadata.gz: 578f474795b250585bb20934b0627ed579bd104fa533a81b00a0847a57bdba749dcd3d32cb4974b95d9a7cedc7b38ee3c5afcbc9ba3ea33ba1f2812cb688149f
7
- data.tar.gz: ca4109823dee36c7a55004eef82a497ed15eac7fb21229f69cd12f4c1b4d0a46a62392616e5aee2321463512cd4b2c8ce269f8d9b2ec5c6d7e7e65cdb7cd2699
6
+ metadata.gz: d70c86ed0f885b71e485fb725aa52049d42e3d729b25a52fe6c2204b0e1156caa4524e47cf9c001380149b183f31f2c2937796019c081e1fbb44b1cca9b700e8
7
+ data.tar.gz: fca1964701315edb2eb1324164819b76311ee30d27e44a72c33db6fa425a235fe6117da8494bc33aa8989b48a527dcf9e11887a43aa55e84b4748a41ab1d989d
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
@@ -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
@@ -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"
@@ -1,13 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- alphaSDK (0.0.1)
4
+ alphaSDK (0.2.5)
5
+ rake (>= 12.0)
6
+ rspec (>= 3.0)
5
7
 
6
8
  GEM
7
9
  remote: https://rubygems.org/
8
10
  specs:
9
11
  diff-lcs (1.4.4)
10
- rake (12.3.3)
12
+ rake (12.0.0)
11
13
  rspec (3.9.0)
12
14
  rspec-core (~> 3.9.0)
13
15
  rspec-expectations (~> 3.9.0)
@@ -27,8 +29,8 @@ PLATFORMS
27
29
 
28
30
  DEPENDENCIES
29
31
  alphaSDK!
30
- rake (~> 12.0)
31
- rspec (~> 3.0)
32
+ rake (>= 12.0)
33
+ rspec (>= 3.0)
32
34
 
33
35
  BUNDLED WITH
34
36
  2.1.4
@@ -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
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/gameball`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'gameball'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle install
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install gameball
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
34
-
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/gameball. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/gameball/blob/master/CODE_OF_CONDUCT.md).
36
-
37
-
38
- ## License
39
-
40
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
41
-
42
- ## Code of Conduct
43
-
44
- Everyone interacting in the Gameball project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/gameball/blob/master/CODE_OF_CONDUCT.md).
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.