diff --git a/assets/js/controllers/sfox/sfoxSellCheckout.controller.js b/assets/js/controllers/sfox/sfoxSellCheckout.controller.js index 988d491794..5fab74c4b5 100644 --- a/assets/js/controllers/sfox/sfoxSellCheckout.controller.js +++ b/assets/js/controllers/sfox/sfoxSellCheckout.controller.js @@ -38,12 +38,15 @@ function SfoxSellCheckoutController ($scope, $timeout, $stateParams, $q, Wallet, $scope.payment.amount(amt); $scope.payment.updateFeePerKb(Exchange.sellFee || 2); $scope.payment.from(Wallet.my.wallet.hdwallet.defaultAccountIndex); + let minutesInADay = 1440; + let profile = exchange.profile; + let expectedDelivery = profile.processingTimes && profile.processingTimes.usd.sell / minutesInADay + ' Days'; $scope.payment.sideEffect((payment) => { $scope.checkout.quote = quote; $scope.checkout.type = 'sell'; $scope.checkout.goTo('confirm'); - $scope.checkout.tradeDetails = sfox.sellTradeDetails($scope.checkout.quote, payment); + $scope.checkout.tradeDetails = sfox.sellTradeDetails($scope.checkout.quote, payment, null, null, expectedDelivery); Wallet.api.incrementPartnerTrade('sfox', 'sell', $scope.checkout.quote.baseCurrency, $scope.checkout.quote.quoteCurrency); }); @@ -58,6 +61,7 @@ function SfoxSellCheckoutController ($scope, $timeout, $stateParams, $q, Wallet, let submitTx = (trade) => { $scope.checkout.trade = trade; + $scope.checkout.expectedDelivery = trade.expectedDelivery; $scope.payment.to(trade.receiveAddress); return Wallet.askForSecondPasswordIfNeeded().then((pw) => { return $scope.payment.build().sign(pw).publish().payment; diff --git a/assets/js/controllers/sfox/sfoxTradeDetails.controller.js b/assets/js/controllers/sfox/sfoxTradeDetails.controller.js index fa53314a1c..c8b436f2df 100644 --- a/assets/js/controllers/sfox/sfoxTradeDetails.controller.js +++ b/assets/js/controllers/sfox/sfoxTradeDetails.controller.js @@ -28,7 +28,7 @@ function SfoxTradeDetailsController ($scope, MyWallet, Exchange, currency, sfox, $q.resolve(sfox.buyTradeDetails(null, trade, tx, expectedDelivery)) .then(details => $scope.tradeDetails = details); } else { - $scope.tradeDetails = sfox.sellTradeDetails(null, null, trade, tx); + $scope.tradeDetails = sfox.sellTradeDetails(null, null, trade, tx, expectedDelivery); } $scope.rate = $scope.type === '.buy' diff --git a/assets/js/services/sfox.service.js b/assets/js/services/sfox.service.js index 6e072ab914..b1f5036b8b 100644 --- a/assets/js/services/sfox.service.js +++ b/assets/js/services/sfox.service.js @@ -195,7 +195,7 @@ function sfox ($q, MyWallet, MyWalletHelpers, Alerts, modals, Env, Exchange, cur return localStorageService.get('hasSeenSfoxBuyIntro'); } - function sellTradeDetails (quote, payment, trade, tx) { + function sellTradeDetails (quote, payment, trade, tx, expectedDelivery) { let { formatCurrencyForView, convertFromSatoshi } = currency; let fiat = currency.currencies.find((curr) => curr.code === 'USD'); let btc = currency.bitCurrencies.find((curr) => curr.code === 'BTC'); @@ -209,7 +209,7 @@ function sfox ($q, MyWallet, MyWalletHelpers, Alerts, modals, Env, Exchange, cur : (trade.receiveAmount).toFixed(2); let amountKey = quote || payment ? '.AMT' : '.AMT_SOLD'; - return { + let details = { txAmt: { key: amountKey, val: isNaN(amount) ? amount : formatCurrencyForView(convertFromSatoshi(amount, btc), btc, true) @@ -232,6 +232,15 @@ function sfox ($q, MyWallet, MyWalletHelpers, Alerts, modals, Env, Exchange, cur tip: () => console.log('Clicked tooltip') } }; + + if (expectedDelivery) { + details.expectedDelivery = { + key: '.EXPECTED_DELIVERY', + val: expectedDelivery + }; + } + + return details; } function buyTradeDetails (quote, trade, tx, expectedDelivery) { diff --git a/locales/en-human.json b/locales/en-human.json index a9f267783e..0ff478020e 100644 --- a/locales/en-human.json +++ b/locales/en-human.json @@ -1902,7 +1902,7 @@ "DISPLAY": "Pending Sell", "ACTION": "@:EXCHANGE.ACTIONS.VIEW_DETAILS", "HEADER": "Sell Order in Progress", - "BODY": "Your sell trade has been initiated. Your funds will be deposited into your bank account within 3-5 business days. Your order ID is: SFX-{{::tradeId}}" + "BODY": "Your sell trade has been initiated. Your funds will be deposited into your bank account by {{::expectedDelivery}}. Your order ID is: SFX-{{::tradeId}}" }, "failed": { "DISPLAY": "Failed Sell", @@ -1927,6 +1927,7 @@ "TX_FEE": "Transaction Fee", "TOTAL": "Total Outgoing Bitcoin", "INTRODUCING_HEADER": "Sell Bitcoin", + "EXPECTED_DELIVERY": "Estimated Delivery of Funds", "INTRODUCING_BODY": "Selling bitcoin is simple, seamless, and secure. Thanks to our partnership with SFOX, you can sell bitcoin directly from your Blockchain wallet.

Tips for getting started:
The minimum amount you can sell is $10. Your daily maximum can be found under the local currency field.

Currently, your Blockchain wallet supports linking only one bank account. If you would like to change your synced account, please email support@sfox.com. Please note: selling with a credit card is not supported at this time.", "TRADING_FEE": "Trading Fee", "TO_BE_RECEIVED": "USD To Be Received", @@ -1964,7 +1965,7 @@ "TRADING_FEE": "@:SFOX.sell.TRADING_FEE", "TX_FEE": "@:SFOX.sell.TX_FEE", "NOW_SUPPORTING": "This Just In!", - "EXPECTED_DELIVERY": "Estimated Delivery of Funds", + "EXPECTED_DELIVERY": "@:SFOX.sell.EXPECTED_DELIVERY", "ANNOUNCEMENT": "Buy has arrived. You can now swiftly buy bitcoin directly from within your Blockchain wallet!", "GET_STARTED": "Begin Buying", "COMING_SOON": "We are working hard to bring buy bitcoin functionality to your wallet very soon.", diff --git a/rootApp/Resources/wallet-options.json b/rootApp/Resources/wallet-options.json index b15c73b18c..a397c1df5d 100644 --- a/rootApp/Resources/wallet-options.json +++ b/rootApp/Resources/wallet-options.json @@ -44,9 +44,9 @@ "showBuyFraction": 1, "inviteFormFraction": 0.1, "buyTransactionFeeInSatoshi": false, - "apiKey": "f31614a7-5074-49f2-8c2a-bfb8e55de2bd", + "apiKey": "6fbfb80536564af8bbedb7e3be4ec439", "plaid": "0b041cd9e9fbf1e7d93a0d5a39f5b9", - "plaidEnv": "production", + "plaidEnv": "tartan", "siftScience": "3884e5fae5", "surveyLinks": ["https://blockchain.co1.qualtrics.com/jfe/form/SV_9BuZyJxdOT0Psb3", "https://blockchain.co1.qualtrics.com/jfe/form/SV_8cE4saqzhlLXngN",