Skip to content
Permalink
Browse files

purchaseItemWithCoins as default instead purchaseItem

  • Loading branch information...
hadikcz committed Aug 27, 2019
1 parent c62831d commit 37574a8a0f48aa68ae105a92c41cbea20421c428

Some generated files are not rendered by default. Learn more.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -392,7 +392,7 @@ export var core = (function () {
});
};

core.purchaseItem = function (options, cb) {
core.purchaseItemWithCoins = function (options, cb, oldMethod) {

if(!cache.capabilities.coins)
throw "Coins purchases not supported, you must add the capability on gamee.Init";
@@ -409,7 +409,11 @@ export var core = (function () {
console.log(options);
}

this.native.createRequest("purchaseItem", options, function (responseData) {
var method = "purchaseItemWithCoins";
if (oldMethod !== undefined && oldMethod === true) {
method = "purchaseItem";
}
this.native.createRequest(method, options, function (responseData) {
cb(null, responseData);
});
};
@@ -270,7 +270,7 @@ Gamee.prototype = (function () {
},

/*
*puchaseitem
*purchaseItem
*@member of Gamee
*@param {object} purchaseDetails
*@param {Gamee~purchaseItemDataCallback} cb
@@ -280,7 +280,7 @@ Gamee.prototype = (function () {
validateDataType(purchaseDetails,"object","purchaseDetails","gamee.purchaseItem");
validateDataType(cb,"function","cb","gamee.purchaseItem");

core.purchaseItem(purchaseDetails,cb)
core.purchaseItemWithCoins(purchaseDetails, cb, true)
},

/*
@@ -293,7 +293,7 @@ Gamee.prototype = (function () {
validateDataType(purchaseDetails,"object","purchaseDetails","gamee.purchaseItemWithCoins");
validateDataType(cb,"function","cb","gamee.purchaseItemWithCoins");

core.purchaseItem(purchaseDetails,cb)
core.purchaseItemWithCoins(purchaseDetails, cb)
},

/*

0 comments on commit 37574a8

Please sign in to comment.
You can’t perform that action at this time.