fixed bitpay payment bug as according to bitpay
This commit is contained in:
parent
4f1a780cda
commit
bd382a847a
5 changed files with 14 additions and 10 deletions
|
|
@ -223,7 +223,8 @@ angular.module('copayApp.controllers').controller('buyAmazonController', functio
|
||||||
var dataSrc = {
|
var dataSrc = {
|
||||||
amount: parsedAmount.amount,
|
amount: parsedAmount.amount,
|
||||||
currency: parsedAmount.currency,
|
currency: parsedAmount.currency,
|
||||||
uuid: wallet.id
|
uuid: wallet.id,
|
||||||
|
buyerSelectedTransactionCurrency: coin.toUpperCase()
|
||||||
};
|
};
|
||||||
ongoingProcess.set('loadingTxInfo', true);
|
ongoingProcess.set('loadingTxInfo', true);
|
||||||
createInvoice(dataSrc, function(err, invoice, accessKey) {
|
createInvoice(dataSrc, function(err, invoice, accessKey) {
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,8 @@ angular.module('copayApp.controllers').controller('buyMercadoLibreController', f
|
||||||
var dataSrc = {
|
var dataSrc = {
|
||||||
amount: parsedAmount.amount,
|
amount: parsedAmount.amount,
|
||||||
currency: parsedAmount.currency,
|
currency: parsedAmount.currency,
|
||||||
uuid: wallet.id
|
uuid: wallet.id,
|
||||||
|
buyerSelectedTransactionCurrency: coin.toUpperCase()
|
||||||
};
|
};
|
||||||
ongoingProcess.set('loadingTxInfo', true);
|
ongoingProcess.set('loadingTxInfo', true);
|
||||||
createInvoice(dataSrc, function(err, invoice, accessKey) {
|
createInvoice(dataSrc, function(err, invoice, accessKey) {
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,8 @@ angular.module('copayApp.controllers').controller('topUpController', function($s
|
||||||
$scope.amountUnitStr = parsedAmount.amountUnitStr;
|
$scope.amountUnitStr = parsedAmount.amountUnitStr;
|
||||||
var dataSrc = {
|
var dataSrc = {
|
||||||
amount: parsedAmount.amount,
|
amount: parsedAmount.amount,
|
||||||
currency: parsedAmount.currency
|
currency: parsedAmount.currency,
|
||||||
|
buyerSelectedTransactionCurrency: coin.toUpperCase()
|
||||||
};
|
};
|
||||||
ongoingProcess.set('loadingTxInfo', true);
|
ongoingProcess.set('loadingTxInfo', true);
|
||||||
createInvoice(dataSrc, function(err, invoice) {
|
createInvoice(dataSrc, function(err, invoice) {
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
||||||
if ((/^bitcoin(cash)?:\?r=[\w+]/).exec(data)) {
|
if ((/^bitcoin(cash)?:\?r=[\w+]/).exec(data)) {
|
||||||
var c = data.indexOf('bitcoincash') >= 0 ? 'bch' : 'btc';
|
var c = data.indexOf('bitcoincash') >= 0 ? 'bch' : 'btc';
|
||||||
data = decodeURIComponent(data.replace(/bitcoin(cash)?:\?r=/, ''));
|
data = decodeURIComponent(data.replace(/bitcoin(cash)?:\?r=/, ''));
|
||||||
payproService.getPayProDetails(data, function(err, details) {
|
payproService.getPayProDetails(data, coin, function(err, details) {
|
||||||
if (err) {
|
if (err) {
|
||||||
popupService.showAlert(gettextCatalog.getString('Error'), err);
|
popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||||
} else handlePayPro(details, coin);
|
} else handlePayPro(details, coin);
|
||||||
|
|
@ -132,7 +132,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
||||||
var amount = parsed.amount ? parsed.amount : '';
|
var amount = parsed.amount ? parsed.amount : '';
|
||||||
|
|
||||||
if (parsed.r) {
|
if (parsed.r) {
|
||||||
payproService.getPayProDetails(parsed.r, function(err, details) {
|
payproService.getPayProDetails(parsed.r, coin, function(err, details) {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (addr && amount) goSend(addr, amount, message, coin, shapeshiftData);
|
if (addr && amount) goSend(addr, amount, message, coin, shapeshiftData);
|
||||||
else popupService.showAlert(gettextCatalog.getString('Error'), err);
|
else popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||||
|
|
@ -154,7 +154,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
||||||
|
|
||||||
// paypro not yet supported on cash
|
// paypro not yet supported on cash
|
||||||
if (parsed.r) {
|
if (parsed.r) {
|
||||||
payproService.getPayProDetails(parsed.r, function(err, details) {
|
payproService.getPayProDetails(parsed.r, coin, function(err, details) {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (addr && amount)
|
if (addr && amount)
|
||||||
goSend(addr, amount, message, coin, shapeshiftData);
|
goSend(addr, amount, message, coin, shapeshiftData);
|
||||||
|
|
@ -197,7 +197,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
||||||
|
|
||||||
// paypro not yet supported on cash
|
// paypro not yet supported on cash
|
||||||
if (parsed.r) {
|
if (parsed.r) {
|
||||||
payproService.getPayProDetails(parsed.r, function(err, details) {
|
payproService.getPayProDetails(parsed.r, coin, function(err, details) {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (addr && amount)
|
if (addr && amount)
|
||||||
goSend(addr, amount, message, coin, shapeshiftData);
|
goSend(addr, amount, message, coin, shapeshiftData);
|
||||||
|
|
@ -215,7 +215,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
||||||
// Plain URL
|
// Plain URL
|
||||||
} else if (/^https?:\/\//.test(data)) {
|
} else if (/^https?:\/\//.test(data)) {
|
||||||
|
|
||||||
payproService.getPayProDetails(data, function(err, details) {
|
payproService.getPayProDetails(data, coin, function(err, details) {
|
||||||
if (err) {
|
if (err) {
|
||||||
root.showMenu({
|
root.showMenu({
|
||||||
data: data,
|
data: data,
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,12 @@ angular.module('copayApp.services').factory('payproService',
|
||||||
|
|
||||||
var ret = {};
|
var ret = {};
|
||||||
|
|
||||||
ret.getPayProDetails = function(uri, cb, disableLoader) {
|
ret.getPayProDetails = function(uri, coin, cb, disableLoader) {
|
||||||
if (!cb) cb = function() {};
|
if (!cb) cb = function() {};
|
||||||
|
|
||||||
var wallet = profileService.getWallets({
|
var wallet = profileService.getWallets({
|
||||||
onlyComplete: true
|
onlyComplete: true,
|
||||||
|
coin: coin
|
||||||
})[0];
|
})[0];
|
||||||
|
|
||||||
if (!wallet) return cb();
|
if (!wallet) return cb();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue