BUY/SELL bitcoin
This commit is contained in:
parent
e266ded1d1
commit
1a0a7eb5ad
7 changed files with 299 additions and 47 deletions
|
|
@ -17,7 +17,7 @@
|
||||||
"ng-lodash": "~0.2.0",
|
"ng-lodash": "~0.2.0",
|
||||||
"angular-moment": "0.10.1",
|
"angular-moment": "0.10.1",
|
||||||
"moment": "2.10.3",
|
"moment": "2.10.3",
|
||||||
"angular-bitcore-wallet-client": "^0.1.2",
|
"angular-bitcore-wallet-client": "0.1.2",
|
||||||
"angular-ui-router": "~0.2.13",
|
"angular-ui-router": "~0.2.13",
|
||||||
"qrcode-decoder-js": "*",
|
"qrcode-decoder-js": "*",
|
||||||
"fastclick": "*",
|
"fastclick": "*",
|
||||||
|
|
|
||||||
|
|
@ -11,18 +11,41 @@
|
||||||
|
|
||||||
<h1>Buy Bitcoin</h1>
|
<h1>Buy Bitcoin</h1>
|
||||||
|
|
||||||
<form name="form" ng-submit="buy.getSellPrice(index.glideraToken, {'qty': qty})" novalidate>
|
<form name="form" ng-submit="buy.getBuyPrice(index.glideraToken, {'qty': qty, 'fiat': fiat})" novalidate>
|
||||||
<label>Price
|
<label>Amount BTC</label>
|
||||||
<input type="number" ng-model="qty">
|
<input type="number" ng-model="qty">
|
||||||
<input type="number" ng-model="fiat">
|
<label>Amount USD</label>
|
||||||
</label>
|
<input type="number" ng-model="fiat">
|
||||||
<input type="submit" value="Buy">
|
<input class="button" type="submit" value="Get Buy Price">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div ng-show="buyPrice">
|
<h2>Buy Price</h2>
|
||||||
{{buyPrice}} --
|
<ul>
|
||||||
|
<li>qty: {{buy.buyPrice.qty}}
|
||||||
|
<li>price: {{buy.buyPrice.price}}
|
||||||
|
<li>subtotal: {{buy.buyPrice.subtotal}}
|
||||||
|
<li>fees: {{buy.buyPrice.fees}}
|
||||||
|
<li>total: {{buy.buyPrice.total}}
|
||||||
|
<li>currency: {{buy.buyPrice.currency}}
|
||||||
|
<li>expires: {{buy.buyPrice.expires}}
|
||||||
|
<li>priceUuid: {{buy.buyPrice.priceUuid}}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="m10b">
|
||||||
|
destinationAddress: {{buy.addr[index.walletId]}}<br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h2>Send 2FA Code</h2>
|
||||||
|
<button ng-click="buy.get2faCode(index.glideraToken)">Send 2FA Code</button>
|
||||||
|
|
||||||
|
<h2>Buy</h2>
|
||||||
|
<form name="form2" ng-submit="buy.send(index.glideraToken, twoFaCode)" novalidate>
|
||||||
|
<label>2FA Code
|
||||||
|
<input type="number" ng-model="twoFaCode">
|
||||||
|
</label>
|
||||||
|
<input class="button" type="submit" value="Buy">
|
||||||
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -24,18 +24,18 @@
|
||||||
|
|
||||||
<h2>Transactions</h2>
|
<h2>Transactions</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li ng-repeat="tx in txs">
|
<li ng-repeat="tx in glidera.txs">
|
||||||
{{tx.transactionUuid}} --
|
transactionUuid: {{tx.transactionUuid}} <br>
|
||||||
{{tx.transactionDate}} --
|
transactionDate: {{tx.transactionDate}} <br>
|
||||||
{{tx.type}} --
|
type: {{tx.type}} <br>
|
||||||
{{tx.price}} --
|
price: {{tx.price}} <br>
|
||||||
{{tx.subtotal}} --
|
subtotal: {{tx.subtotal}} <br>
|
||||||
{{tx.fees}} --
|
fees: {{tx.fees}} <br>
|
||||||
{{tx.total}} --
|
total: {{tx.total}} <br>
|
||||||
{{tx.currency}} --
|
currency: {{tx.currency}} <br>
|
||||||
{{tx.estimatedDeliveryDate}} --
|
estimatedDeliveryDate: {{tx.estimatedDeliveryDate}} <br>
|
||||||
{{tx.transactionHash}} --
|
transactionHash: {{tx.transactionHash}} <br>
|
||||||
{{tx.status}}<br><br>
|
status: {{tx.status}}<br>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,24 +5,58 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="content glidera" ng-controller="sellGlideraController as sell">
|
<div class="content glidera"
|
||||||
|
ng-controller="sellGlideraController as sell">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="large-12 columns">
|
<div class="large-12 columns">
|
||||||
|
|
||||||
<h1>Sell Bitcoin</h1>
|
<h1>Sell Bitcoin</h1>
|
||||||
|
|
||||||
<form name="form" ng-submit="sell.getSellPrice(index.glideraToken, {'qty': qty, 'fiat': fiat})" novalidate>
|
<form name="form" ng-submit="sell.getSellPrice(index.glideraToken, {'qty': qty, 'fiat': fiat})" novalidate>
|
||||||
<label>Price
|
<label>Amount BTC</label>
|
||||||
<input type="number" ng-model="qty">
|
<input type="number" ng-model="qty">
|
||||||
<input type="number" ng-model="fiat">
|
<label>Amount USD</label>
|
||||||
</label>
|
<input type="number" ng-model="fiat">
|
||||||
<input type="submit" value="Sell">
|
<input class="button" type="submit" value="Get Sell Price">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div ng-show="sellPrice">
|
<h2>Sell Price</h2>
|
||||||
{{sellPrice}} --
|
<ul>
|
||||||
|
<li>qty: {{sell.sellPrice.qty}}
|
||||||
|
<li>price: {{sell.sellPrice.price}}
|
||||||
|
<li>subtotal: {{sell.sellPrice.subtotal}}
|
||||||
|
<li>fees: {{sell.sellPrice.fees}}
|
||||||
|
<li>total: {{sell.sellPrice.total}}
|
||||||
|
<li>currency: {{sell.sellPrice.currency}}
|
||||||
|
<li>expires: {{sell.sellPrice.expires}}
|
||||||
|
<li>priceUuid: {{sell.sellPrice.priceUuid}}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Create Tx</h2>
|
||||||
|
|
||||||
|
<div class="m10b">
|
||||||
|
refundAddress: {{sell.addr[index.walletId]}}<br>
|
||||||
|
sellAddress: {{sell.sellAddress}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
ng-click="raw = sell.createTx()">
|
||||||
|
Create
|
||||||
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="m10b" ng-show="sell.raw">{{sell.raw}}</div>
|
||||||
|
|
||||||
|
<h2>Send 2FA Code</h2>
|
||||||
|
<button ng-click="sell.get2faCode(index.glideraToken)">Send 2FA Code</button>
|
||||||
|
|
||||||
|
<h2>Send TX to Glider</h2>
|
||||||
|
<form name="form2" ng-submit="sell.sendTx(index.glideraToken, twoFaCode)" novalidate>
|
||||||
|
<label>2FA Code
|
||||||
|
<input type="number" ng-model="twoFaCode">
|
||||||
|
</label>
|
||||||
|
<input class="button" type="submit" value="Sell">
|
||||||
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,60 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('buyGlideraController',
|
angular.module('copayApp.controllers').controller('buyGlideraController',
|
||||||
function() {
|
function($scope, $timeout, profileService, addressService, glideraService) {
|
||||||
|
|
||||||
|
this.addr = {};
|
||||||
|
|
||||||
|
this.setDestinationAddress = function() {
|
||||||
|
var self = this;
|
||||||
|
this.addrError = null;
|
||||||
|
var fc = profileService.focusedClient;
|
||||||
|
if (!fc) return;
|
||||||
|
|
||||||
|
$timeout(function() {
|
||||||
|
addressService.getAddress(fc.credentials.walletId, null, function(err, addr) {
|
||||||
|
if (err) {
|
||||||
|
self.addrError = err;
|
||||||
|
} else {
|
||||||
|
if (addr) self.addr[fc.credentials.walletId] = addr;
|
||||||
|
}
|
||||||
|
$scope.$digest();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
this.getBuyPrice = function(token, price) {
|
this.getBuyPrice = function(token, price) {
|
||||||
var self = this;
|
var self = this;
|
||||||
glideraService.buyPrice(token, price, function(error, sellPrice) {
|
this.buyAmount = price.qty;
|
||||||
self.sellPrice = sellPrice;
|
glideraService.buyPrice(token, price, function(error, buyPrice) {
|
||||||
|
self.buyPrice = buyPrice;
|
||||||
|
self.setDestinationAddress();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.get2faCode = function(token, cb) {
|
||||||
|
var self = this;
|
||||||
|
glideraService.get2faCode(token, function(error, sent) {
|
||||||
|
self.show2faCodeInput = sent;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.send = function(token, twoFaCode) {
|
||||||
|
var fc = profileService.focusedClient;
|
||||||
|
var self = this;
|
||||||
|
var data = {
|
||||||
|
destinationAddress: self.addr[fc.credentials.walletId],
|
||||||
|
qty: self.buyPrice.qty,
|
||||||
|
priceUuid: self.buyPrice.priceUuid,
|
||||||
|
useCurrentPrice: false,
|
||||||
|
ip: null
|
||||||
|
};
|
||||||
|
console.log('[sellGlidera.js:128]',token, twoFaCode, data); //TODO
|
||||||
|
glideraService.buy(token, twoFaCode, data, function(error, data) {
|
||||||
|
console.log('[sellGlidera.js:116]',data); //TODO
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,148 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('sellGlideraController',
|
angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
function(glideraService) {
|
function($scope, $timeout, $log, gettext, configService, profileService, addressService, feeService, glideraService) {
|
||||||
|
|
||||||
|
var config = configService.getSync();
|
||||||
|
this.addr = {};
|
||||||
|
this.data = {};
|
||||||
|
this.sellAddress = null;
|
||||||
|
this.show2faCodeInput = null;
|
||||||
|
this.currentSpendUnconfirmed = config.wallet.spendUnconfirmed;
|
||||||
|
this.currentFeeLevel = config.wallet.settings.feeLevel || 'normal';
|
||||||
|
|
||||||
|
this.setRefundAddress = function() {
|
||||||
|
var self = this;
|
||||||
|
this.addrError = null;
|
||||||
|
var fc = profileService.focusedClient;
|
||||||
|
if (!fc) return;
|
||||||
|
|
||||||
|
$timeout(function() {
|
||||||
|
addressService.getAddress(fc.credentials.walletId, null, function(err, addr) {
|
||||||
|
if (err) {
|
||||||
|
self.addrError = err;
|
||||||
|
} else {
|
||||||
|
if (addr) self.addr[fc.credentials.walletId] = addr;
|
||||||
|
}
|
||||||
|
$scope.$digest();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setSellAddress = function(token) {
|
||||||
|
var self = this;
|
||||||
|
glideraService.getSellAddress(token, function(error, addr) {
|
||||||
|
self.sellAddress = addr.sellAddress;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
this.getSellPrice = function(token, price) {
|
this.getSellPrice = function(token, price) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
this.sellAmount = price.qty;
|
||||||
glideraService.sellPrice(token, price, function(error, sellPrice) {
|
glideraService.sellPrice(token, price, function(error, sellPrice) {
|
||||||
self.sellPrice = sellPrice;
|
self.sellPrice = sellPrice;
|
||||||
|
self.setSellAddress(token);
|
||||||
|
self.setRefundAddress();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.createTx = function() {
|
||||||
|
var self = this;
|
||||||
|
var fc = profileService.focusedClient;
|
||||||
|
|
||||||
|
$timeout(function() {
|
||||||
|
var address = self.sellAddress;
|
||||||
|
var amount = parseInt((self.sellAmount * 100000000).toFixed(0));
|
||||||
|
|
||||||
|
feeService.getCurrentFeeValue(self.currentFeeLevel, function(err, feePerKb) {
|
||||||
|
if (err) $log.debug(err);
|
||||||
|
fc.sendTxProposal({
|
||||||
|
toAddress: address,
|
||||||
|
amount: amount,
|
||||||
|
message: 'Glidera',
|
||||||
|
payProUrl: null,
|
||||||
|
feePerKb: feePerKb,
|
||||||
|
excludeUnconfirmedUtxos: self.currentSpendUnconfirmed ? false : true
|
||||||
|
}, function(err, txp) {
|
||||||
|
console.log('[sellGlidera.js:62]',txp); //TODO
|
||||||
|
if (err) {
|
||||||
|
profileService.lockFC();
|
||||||
|
$log.error(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fc.canSign()) {
|
||||||
|
$log.info('No signing proposal: No private key');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.signTx(txp, function(err, raw) {
|
||||||
|
profileService.lockFC();
|
||||||
|
if (err) {
|
||||||
|
self.error = err.message ? err.message : gettext('The payment was created but could not be completed. Please try again from home screen');
|
||||||
|
$timeout(function() {
|
||||||
|
$scope.$digest();
|
||||||
|
}, 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return raw;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
}, 100);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
this.signTx = function(txp, cb) {
|
||||||
|
var self = this;
|
||||||
|
var fc = profileService.focusedClient;
|
||||||
|
fc.signTxProposal(txp, function(err, signedTx) {
|
||||||
|
console.log('[sellGlidera.js:96]',signedTx); //TODO
|
||||||
|
profileService.lockFC();
|
||||||
|
if (err) {
|
||||||
|
err.message = bwsError.msg(err, gettextCatalog.getString('The payment was created but could not be signed. Please try again from home screen'));
|
||||||
|
return cb(err);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (signedTx.status == 'accepted') {
|
||||||
|
var t = profileService.getUtils().buildTx(signedTx);
|
||||||
|
var raw = t.uncheckedSerialize();
|
||||||
|
console.log('[sellGlidera.js:104]',raw); //TODO
|
||||||
|
return cb(null, raw);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
console.log('NO ACCEPTED TX');
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.get2faCode = function(token, cb) {
|
||||||
|
var self = this;
|
||||||
|
glideraService.get2faCode(token, function(error, sent) {
|
||||||
|
self.show2faCodeInput = sent;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.sendTx = function(token, twoFaCode, raw) {
|
||||||
|
var fc = profileService.focusedClient;
|
||||||
|
var self = this;
|
||||||
|
var data = {
|
||||||
|
refundAddress: self.addr[fc.credentials.walletId],
|
||||||
|
signedTransaction: raw,
|
||||||
|
priceUuid: self.sellPrice.priceUuid,
|
||||||
|
useCurrentPrice: false,
|
||||||
|
ip: null
|
||||||
|
};
|
||||||
|
console.log('[sellGlidera.js:128]',token, twoFaCode, data); //TODO
|
||||||
|
glideraService.sell(token, twoFaCode, data, function(error, data) {
|
||||||
|
console.log('[sellGlidera.js:116]',data); //TODO
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
||||||
if (!token) return cb('Invalid Token');
|
if (!token) return cb('Invalid Token');
|
||||||
$http(_get('/transaction', token)).then(function(data) {
|
$http(_get('/transaction', token)).then(function(data) {
|
||||||
$log.info('Glidera Transaction: SUCCESS');
|
$log.info('Glidera Transaction: SUCCESS');
|
||||||
return cb(null, data.data);
|
return cb(null, data.data.transactions);
|
||||||
}, function(data) {
|
}, function(data) {
|
||||||
$log.error('Glidera Transaction: ERROR ' + data.statusText);
|
$log.error('Glidera Transaction: ERROR ' + data.statusText);
|
||||||
return cb(data.statusText);
|
return cb(data.statusText);
|
||||||
|
|
@ -130,14 +130,26 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var _post = function(endpoint, token, data) {
|
root.get2faCode = function(token, cb) {
|
||||||
|
if (!token) return cb('Invalid Token');
|
||||||
|
$http(_get('/authentication/get2faCode', token)).then(function(data) {
|
||||||
|
$log.info('Glidera Sent 2FA code by SMS: SUCCESS');
|
||||||
|
return cb(null, data.status == 200 ? true : false);
|
||||||
|
}, function(data) {
|
||||||
|
$log.error('Glidera Sent 2FA code by SMS: ERROR ' + data.statusText);
|
||||||
|
return cb(data.statusText);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _post = function(endpoint, token, twoFaCode, data) {
|
||||||
return {
|
return {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: HOST + '/api/v1' + endpoint,
|
url: HOST + '/api/v1' + endpoint,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'Authorization': 'Bearer ' + token
|
'Authorization': 'Bearer ' + token,
|
||||||
|
'2FA_CODE': twoFaCode
|
||||||
},
|
},
|
||||||
data: data
|
data: data
|
||||||
};
|
};
|
||||||
|
|
@ -148,16 +160,16 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
||||||
qty: price.qty,
|
qty: price.qty,
|
||||||
fiat: price.fiat
|
fiat: price.fiat
|
||||||
};
|
};
|
||||||
$http(_post('/prices/sell', token, data)).then(function(data) {
|
$http(_post('/prices/sell', token, null, data)).then(function(data) {
|
||||||
$log.info('Glidera Sell Price: SUCCESS');
|
$log.info('Glidera Sell Price: SUCCESS');
|
||||||
return cb(null, data);
|
return cb(null, data.data);
|
||||||
}, function(data) {
|
}, function(data) {
|
||||||
$log.error('Glidera Sell Price: ERROR ' + data.statusText);
|
$log.error('Glidera Sell Price: ERROR ' + data.statusText);
|
||||||
return cb(data.statusText);
|
return cb(data.statusText);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.sell = function(token, data, cb) {
|
root.sell = function(token, twoFaCode, data, cb) {
|
||||||
var data = {
|
var data = {
|
||||||
refundAddress: data.refundAddress,
|
refundAddress: data.refundAddress,
|
||||||
signedTransaction: data.signedTransaction,
|
signedTransaction: data.signedTransaction,
|
||||||
|
|
@ -165,11 +177,13 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
||||||
useCurrentPrice: data.useCurrentPrice,
|
useCurrentPrice: data.useCurrentPrice,
|
||||||
ip: data.ip
|
ip: data.ip
|
||||||
};
|
};
|
||||||
$http(_post('/prices/buy', token, data)).then(function(data) {
|
console.log('[glideraService.js:161]',data); //TODO
|
||||||
$log.info('Glidera Buy: SUCCESS');
|
$http(_post('/sell', token, twoFaCode, data)).then(function(data) {
|
||||||
|
console.log('[glideraService.js:168]',data); //TODO
|
||||||
|
$log.info('Glidera Sell: SUCCESS');
|
||||||
return cb(null, data);
|
return cb(null, data);
|
||||||
}, function(data) {
|
}, function(data) {
|
||||||
$log.error('Glidera Buy: ERROR ' + data.statusText);
|
$log.error('Glidera Sell: ERROR ' + data.statusText);
|
||||||
return cb(data.statusText);
|
return cb(data.statusText);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -179,16 +193,16 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
||||||
qty: price.qty,
|
qty: price.qty,
|
||||||
fiat: price.fiat
|
fiat: price.fiat
|
||||||
};
|
};
|
||||||
$http(_post('/prices/buy', token, data)).then(function(data) {
|
$http(_post('/prices/buy', token, null, data)).then(function(data) {
|
||||||
$log.info('Glidera Buy Price: SUCCESS');
|
$log.info('Glidera Buy Price: SUCCESS');
|
||||||
return cb(null, data);
|
return cb(null, data.data);
|
||||||
}, function(data) {
|
}, function(data) {
|
||||||
$log.error('Glidera Buy Price: ERROR ' + data.statusText);
|
$log.error('Glidera Buy Price: ERROR ' + data.statusText);
|
||||||
return cb(data.statusText);
|
return cb(data.statusText);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.buy = function(token, data, cb) {
|
root.buy = function(token, twoFaCode, data, cb) {
|
||||||
var data = {
|
var data = {
|
||||||
destinationAddress: data.destinationAddress,
|
destinationAddress: data.destinationAddress,
|
||||||
qty: data.qty,
|
qty: data.qty,
|
||||||
|
|
@ -196,7 +210,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
||||||
useCurrentPrice: data.useCurrentPrice,
|
useCurrentPrice: data.useCurrentPrice,
|
||||||
ip: data.ip
|
ip: data.ip
|
||||||
};
|
};
|
||||||
$http(_post('/prices/buy', token, data)).then(function(data) {
|
$http(_post('/buy', token, twoFaCode, data)).then(function(data) {
|
||||||
$log.info('Glidera Buy: SUCCESS');
|
$log.info('Glidera Buy: SUCCESS');
|
||||||
return cb(null, data);
|
return cb(null, data);
|
||||||
}, function(data) {
|
}, function(data) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue