save giftcards data when reedem failed
This commit is contained in:
parent
23417fe1b3
commit
7334d06c89
3 changed files with 9 additions and 4 deletions
|
|
@ -194,14 +194,16 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
|||
amazonService.createGiftCard(dataSrc, function(err, giftCard) {
|
||||
$log.debug("creating gift card " + count);
|
||||
if (err) {
|
||||
giftCard = {};
|
||||
giftCard.status = 'FAILURE';
|
||||
ongoingProcess.set('Processing Transaction...', false);
|
||||
self.error = bwcError.msg(err);
|
||||
self.errorInfo = dataSrc;
|
||||
$timeout(function() {
|
||||
$scope.$digest();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (giftCard.status == 'PENDING' && count < 3) {
|
||||
$log.debug("pending gift card not available yet");
|
||||
self.debounceCreate(count + 1, dataSrc, dataSrc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue