Merge pull request #5872 from matiu/bug/gift-card-err

better gift-card-err
This commit is contained in:
Javier Donadío 2017-04-10 13:48:07 -03:00 committed by GitHub
commit 62cc46e455
1 changed files with 7 additions and 1 deletions

View File

@ -145,7 +145,13 @@ angular.module('copayApp.controllers').controller('buyAmazonController', functio
amazonService.createBitPayInvoice(dataSrc, function(err, dataInvoice) {
if (err) {
ongoingProcess.set('buyingGiftCard', false, statusChangeHandler);
showError('Error creating BitPay invoice', err);
if (err && err.message && err.message.match(/suspended/i)) {
showError('Service not available', 'Amazon Gift Card Service is not available at this moment. Please try back later.');
} else {
showError('Could not access Gift Card Service', err);
};
return;
}