From ddfccaa3a5dfda808c07a0bec99f3da47b92b823 Mon Sep 17 00:00:00 2001 From: Mariam Heikal Date: Wed, 26 Aug 2020 13:51:52 +0200 Subject: [PATCH 1/3] UAT host added --- lib/Utils/configure.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Utils/configure.js b/lib/Utils/configure.js index 67875cc..0cd45b2 100644 --- a/lib/Utils/configure.js +++ b/lib/Utils/configure.js @@ -7,7 +7,7 @@ var userAgent = exports.userAgent = 'GameballSDK/gameball-node-SDK' + sdkVersion //default options gathering the default parameters for Gameball APIs. var default_options = exports.default_options = { 'schema': 'https', - 'host': 'api.gameball.co', + 'host': 'gb-api.azurewebsites.net', 'path':"/api/v2.0/Integrations", 'port': process.env.PORT }; From ad0d6b48b9511ff963fee6290807aaa7f158f53f Mon Sep 17 00:00:00 2001 From: Mariam Heikal Date: Wed, 26 Aug 2020 14:01:31 +0200 Subject: [PATCH 2/3] readme updates --- README.md | 71 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 77994f7..ff62805 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,12 @@ This repository contains the open source SDK for integrating Gameball's API into Please refer to the [Gameball API docs](https://docs.gameball.co). ## Installation --- -You don't need this source code unless you want to modify the SDK. If you just -want to use the SDK, just run: +You don't need this source code unless you want to modify the SDK. For using the SDK, just run: ```js npm install gameball ``` ### Dependencies -Download sha1 package using the following command. +Download sha1 package required for computing the message validation hash using the following command. ```js npm install sha1 ``` @@ -21,7 +20,7 @@ npm install sha1 --- 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) -Require 'gameball-nodejs-sdk' in your file +Require 'gameball' in your file ```js var gameball = require('gameball') ``` @@ -36,7 +35,7 @@ Gameball.setUp({ ``` You can also directly pass the apiKey and transactionKey through the Gameball constructor. ```js -var Gameball = new gameball(apiKey, transactionKey) +var Gameball = new gameball('your_api_key', 'your_transaction_key') ``` ### Commands: ```js @@ -62,19 +61,20 @@ Gameball.rewardPoints(RewardPointsRequest, callback) //rewards a player with poi #### Creating a Player ```js Gameball.initializePlayer({ - "playerUniqueId": "player123", - "playerAttributes":{ - "displayName":" Jon Snow", - "email":"jon.snow@example.com", - "dateOfBirth":"1980-09-19T00:00:00.000Z", - "custom": { - "isGraduated": false, - "location": "Egypt, Cairo" + "playerUniqueId": "player123", + "playerAttributes":{ + "displayName":" Jon Snow", + "email":"jon.snow@example.com", + "dateOfBirth":"1980-09-19T00:00:00.000Z", + "custom": { + "isGraduated": false, + "location": "Egypt, Cairo" } + } }, function (err, res){ - if(err) console.log(err) - else console.log(res) + if(err) console.log(err) + else console.log(res) }) ``` #### Getting a Player's Information @@ -89,7 +89,9 @@ Gameball.getPlayerInfo({ Gameball.getPlayerInfo({ "playerUniqueId":"1597247015986" -}, Gameball.language.German, +}, + Gameball.language.German, + function (err, res){ if(err) console.log(err) else console.log(res) @@ -316,32 +318,35 @@ Gameball.reverseHold({ #### Creating a Coupon ```js Gameball.createCoupon({ - "playerUniqueId":"1597100928071", - "code": "1", - "value":1000.0 -},function (err, res){ - if(err) console.log(err) - else console.log(res) + "playerUniqueId":"1597100928071", + "code": "1", + "value":1000.0 +}, + function (err, res){ + if(err) console.log(err) + else console.log(res) }) ``` #### Validating a Coupon ```js Gameball.validateCoupon({ - "playerUniqueId":"1597100928071", - "code":"1" -},function (err, res){ - if(err) console.log(err) - else console.log(res) + "playerUniqueId":"1597100928071", + "code":"1" +}, + function (err, res){ + if(err) console.log(err) + else console.log(res) }) ``` #### Redeeming a Coupon ```js Gameball.redeemCoupon({ - "playerUniqueId":"1597100928071", - "code":1 -},function (err, res){ - if(err) console.log(err) - else console.log(res) + "playerUniqueId":"1597100928071", + "code":1 +}, + function (err, res){ + if(err) console.log(err) + else console.log(res) }) ``` ### Handling exceptions @@ -351,4 +356,4 @@ Unsuccessful requests raise exceptions. The raised exception will reflect the so The master branch of this repository contains the latest stable release of the SDK. ## Contact --- -For usage questions\suggestions drop us an email at support[ at ]gameball.co. Please report any bugs as issues. \ No newline at end of file +For usage questions\suggestions drop us an email at support@gameball.co. Please report any bugs as issues. \ No newline at end of file From 330ab1c5ef7cd7b7bd838ac0bc6c5aa7319c6a7f Mon Sep 17 00:00:00 2001 From: Mariam Heikal Date: Wed, 26 Aug 2020 14:01:41 +0200 Subject: [PATCH 3/3] Prod host added --- lib/Utils/configure.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Utils/configure.js b/lib/Utils/configure.js index 0cd45b2..67875cc 100644 --- a/lib/Utils/configure.js +++ b/lib/Utils/configure.js @@ -7,7 +7,7 @@ var userAgent = exports.userAgent = 'GameballSDK/gameball-node-SDK' + sdkVersion //default options gathering the default parameters for Gameball APIs. var default_options = exports.default_options = { 'schema': 'https', - 'host': 'gb-api.azurewebsites.net', + 'host': 'api.gameball.co', 'path':"/api/v2.0/Integrations", 'port': process.env.PORT };