diff --git a/public/views/amazon.html b/public/views/amazon.html index 45f2af249..319826c1e 100644 --- a/public/views/amazon.html +++ b/public/views/amazon.html @@ -1,54 +1,38 @@ + + + + + + Gift cards + -
- -
- -
- -
- -
- +
+ Sandbox version. Only for testing purpose
Amazon.com Gift Card -
Only redeemable on www.amazon.com (USA website)
+
Only redeemable on www.amazon.com (USA website)
-
+
-
-
- -
-
+ -
+
Amazon.com Gift Cards never expire and can be redeemed towards millions of items at www.amazon.com
-
+
  • @@ -61,7 +45,7 @@

    Your cards

    + class="row collapse last-transactions-content size-12">
    {{id}}
    @@ -82,7 +66,6 @@
-
+ + -
-
diff --git a/public/views/buyAmazon.html b/public/views/buyAmazon.html index e0949249a..efdcba473 100644 --- a/public/views/buyAmazon.html +++ b/public/views/buyAmazon.html @@ -1,19 +1,19 @@ -
-
+ + + + + + Buy + + -
+
-
-
- -
- - {{buy.error}} - +
+ {{buy.error}}
There was an error when trying to buy gift card, but the funds were sent to BitPay Invoice. Please, contact BitPay to refund your bitcoin @@ -29,138 +29,145 @@
Amazon.com Gift Card -
+
Use your Amazon.com Gift Card* to shop from a huge selection of books, electronics, music, movies, software, apparel, toys, and more.
-
- -
- + - USD -
+
+
-
-
-

Gift card could not be created

-
- - There was an error when trying to create the Amazon.com Gift Card. Status: {{buy.giftCard.status}} - -
-
- - This is a temporary/recoverable system failure that can be - resolved retrying the request from your list of cards - - - This failure could not be recoverable. Request your refund from your list of cards - - -
-
-
-
- Thank you for participating in the BitPay offer. It is our pleasure to send - you this Amazon.com Gift Card* that can be redeemed towards millions of items at - www.amazon.com. - You may want to print this screen for easy reference later you will need the gift card claim code below. -
- -
- Amazon.com Gift Cards -
- Gift Card Amount: - - {{buy.giftCard.amount | currency : '$ ' : 2 }} +
+
+

Gift card could not be created

+
+ + There was an error when trying to create the Amazon.com Gift Card. Status: {{buy.giftCard.status}}
-
- Claim code: {{buy.giftCard.claimCode}} -
-
-
- +
+
+ Thank you for participating in the BitPay offer. It is our pleasure to send + you this Amazon.com Gift Card* that can be redeemed towards millions of items at + www.amazon.com. + You may want to print this screen for easy reference later you will need the gift card claim code below. +
+ +
+ Amazon.com Gift Cards +
+ Gift Card Amount: + + {{buy.giftCard.amount | currency : '$ ' : 2 }} + +
+
+ Claim code: {{buy.giftCard.claimCode}} +
+
+ +
+ +
+
+ To redeem your gift card, follow these steps: + +
    +
  1. 1. Visit www.amazon.com/gc +
  2. 2. Click Apply to Account and enter the Claim Code when prompted. +
  3. 3. Gift card funds will be applied automatically to eligible orders during the checkout process. +
  4. 4. You must pay for any remaining balance on your order with another payment method. +
+ +

+ Your gift card claim code may also be entered when prompted during checkout. To redeem your gift card using + the Amazon.com 1-Click® service, first add the gift card funds to Your Account. +

+ +

+ If you have questions about redeeming your gift card, please visit + www.amazon.com/gc-redeem. + If you have questions regarding the BitPay Introductory offer, please contact BitPay. +

+
-
- To redeem your gift card, follow these steps: - -
    -
  1. 1. Visit www.amazon.com/gc -
  2. 2. Click Apply to Account and enter the Claim Code when prompted. -
  3. 3. Gift card funds will be applied automatically to eligible orders during the checkout process. -
  4. 4. You must pay for any remaining balance on your order with another payment method. -
- -

- Your gift card claim code may also be entered when prompted during checkout. To redeem your gift card using - the Amazon.com 1-Click® service, first add the gift card funds to Your Account. -

- -

- If you have questions about redeeming your gift card, please visit - www.amazon.com/gc-redeem. - If you have questions regarding the BitPay Introductory offer, please contact BitPay. -

- -
-
-
- * Amazon.com is not a sponsor of this promotion. - Except as required by law, Amazon.com - Gift Cards ("GCs") cannot be transferred for value or redeemed for cash. GCs may be used only for purchases of - eligible goods at Amazon.com or certain of its - affiliated websites. For complete terms and conditions, see - www.amazon.com/gc-legal. - GCs are issued by ACI Gift Cards, Inc., a Washington corporation. All Amazon ®, ™ & © are IP - of Amazon.com, Inc. or its affiliates. - No expiration date or service fees. -
+
+ * Amazon.com is not a sponsor of this promotion. + Except as required by law, Amazon.com + Gift Cards ("GCs") cannot be transferred for value or redeemed for cash. GCs may be used only for purchases of + eligible goods at Amazon.com or certain of its + affiliated websites. For complete terms and conditions, see + www.amazon.com/gc-legal. + GCs are issued by ACI Gift Cards, Inc., a Washington corporation. All Amazon ®, ™ & © are IP + of Amazon.com, Inc. or its affiliates. + No expiration date or service fees. +
+ + + -
-
diff --git a/public/views/tab-home.html b/public/views/tab-home.html index 2cbd180b8..7034b91b2 100644 --- a/public/views/tab-home.html +++ b/public/views/tab-home.html @@ -89,7 +89,7 @@ Buy and Sell -
  • +
  • Gift Cards diff --git a/src/js/controllers/buyAmazon.js b/src/js/controllers/buyAmazon.js index a2b9aacef..7066c4ecb 100644 --- a/src/js/controllers/buyAmazon.js +++ b/src/js/controllers/buyAmazon.js @@ -16,14 +16,15 @@ angular.module('copayApp.controllers').controller('buyAmazonController', this.init = function() { var network = amazonService.getEnvironment(); - self.allWallets = profileService.getWallets(network, 1); - client = profileService.focusedClient; - - if (!client) return; + self.allWallets = profileService.getWallets({ + network: network, + n: 1, + onlyComplete: true + }); if (lodash.isEmpty(self.allWallets)) return; - if (client.credentials.network != network) return; + client = self.allWallets[0]; $timeout(function() { self.selectedWalletId = client.credentials.walletId; @@ -157,28 +158,24 @@ angular.module('copayApp.controllers').controller('buyAmazonController', }); return; } - $scope.$emit('Local/NeedsConfirmation', createdTxp, function(accept) { - if (accept) { - self.confirmTx(createdTxp, function(err, tx) { - if (err) { - ongoingProcess.set('Processing Transaction...', false); - self.error = bwcError.msg(err); - $timeout(function() { - $scope.$digest(); - }); - return; - } - var count = 0; - ongoingProcess.set('Processing Transaction...', true); - - dataSrc.accessKey = dataInvoice.accessKey; - dataSrc.invoiceId = invoice.id; - dataSrc.invoiceUrl = invoice.url; - dataSrc.invoiceTime = invoice.invoiceTime; - - self.debounceCreate(count, dataSrc); + self.confirmTx(createdTxp, function(err, tx) { + if (err) { + ongoingProcess.set('Processing Transaction...', false); + self.error = bwcError.msg(err); + $timeout(function() { + $scope.$digest(); }); + return; } + var count = 0; + ongoingProcess.set('Processing Transaction...', true); + + dataSrc.accessKey = dataInvoice.accessKey; + dataSrc.invoiceId = invoice.id; + dataSrc.invoiceUrl = invoice.url; + dataSrc.invoiceTime = invoice.invoiceTime; + + self.debounceCreate(count, dataSrc); }); }); }); diff --git a/src/js/routes.js b/src/js/routes.js index 86342e4e7..08e9454b7 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -608,13 +608,26 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr * */ - .state('amazon', { + .state('amazon', { url: '/amazon', - templateUrl: 'views/amazon.html' + abstract: true, + template: '' }) - .state('buyAmazon', { - url: '/buyamazon', - templateUrl: 'views/buyAmazon.html' + .state('amazon.main', { + url: '/main', + views: { + 'amazon': { + templateUrl: 'views/amazon.html' + } + } + }) + .state('amazon.buy', { + url: '/buy', + views: { + 'amazon': { + templateUrl: 'views/buyAmazon.html' + } + } }); }) .run(function($rootScope, $state, $location, $log, $timeout, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, gettextCatalog) { diff --git a/src/js/services/txStatus.js b/src/js/services/txStatus.js index d6fb86615..ebb696872 100644 --- a/src/js/services/txStatus.js +++ b/src/js/services/txStatus.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.services').factory('txStatus', function(lodash, profileService, $timeout, platformInfo) { +angular.module('copayApp.services').factory('txStatus', function($stateParams, lodash, profileService, $timeout, platformInfo) { var root = {}; var isCordova = platformInfo.isCordova;