Ref: amazon integration

This commit is contained in:
Gustavo Maximiliano Cortez 2017-07-11 00:41:10 -03:00
commit 59d668f292
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
4 changed files with 251 additions and 145 deletions

View file

@ -51,8 +51,8 @@ angular.module('copayApp.controllers').controller('amazonCardsController',
remove: true
}, function(err) {
updateGiftCards();
return;
});
return;
}
amazonService.savePendingGiftCard(newData, null, function(err) {
@ -85,11 +85,11 @@ angular.module('copayApp.controllers').controller('amazonCardsController',
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.cardClaimCode = data.stateParams.cardClaimCode;
$scope.invoiceId = data.stateParams.invoiceId;
updateGiftCards(function() {
if ($scope.cardClaimCode) {
if ($scope.invoiceId) {
var card = lodash.find($scope.giftCards, {
claimCode: $scope.cardClaimCode
invoiceId: $scope.invoiceId
});
if (lodash.isEmpty(card)) {
popupService.showAlert(null, 'Card not found');