From 2a2aaa1bd06ca789a9574053348d78c3df9e86de Mon Sep 17 00:00:00 2001 From: Brian Clifton Date: Wed, 7 Jun 2017 23:16:26 -0700 Subject: [PATCH] Disables funding with debit/credit card. Only affects Coinbase (ex: customers in USA) Fixes https://github.com/brave/browser-laptop/issues/9327 Auditors: @cezaraugusto, @nejczdovc Test Plan: 1. Be on an IP that is geo-located in the USA (via VPN or physically being in USA) 2. Go to Preferences > Payments 3. Click "Add funds" 4. "Fund with debit/credit" button should be disabled; appropriate messaging should be displayed (see issue) --- .../locales/en-US/preferences.properties | 3 + .../preferences/payment/bitcoinDashboard.js | 77 +++++++++++++------ 2 files changed, 56 insertions(+), 24 deletions(-) diff --git a/app/extensions/brave/locales/en-US/preferences.properties b/app/extensions/brave/locales/en-US/preferences.properties index f70b3a5be6c..545a9c5d1ff 100644 --- a/app/extensions/brave/locales/en-US/preferences.properties +++ b/app/extensions/brave/locales/en-US/preferences.properties @@ -135,6 +135,9 @@ outsideUSAPayment=Buy Bitcoin at our recommended source coinbaseNotAvailable=Sorry! Adding funds with a credit/debit card is available only for contributions of $5/month at the moment. add=Fund with debit/credit transferTime=Transfer may take up to 40 minutes +fundingDisabled1=Card funding is temporarily unavailable. +fundingDisabled2=We apologize for the inconvenience. +fundingDisabled3=Learn more... addFundsTitle=Add funds… addFunds=Three ways to add funds to your Brave Wallet copy=Copy diff --git a/app/renderer/components/preferences/payment/bitcoinDashboard.js b/app/renderer/components/preferences/payment/bitcoinDashboard.js index 3be148640d2..04df981ea28 100644 --- a/app/renderer/components/preferences/payment/bitcoinDashboard.js +++ b/app/renderer/components/preferences/payment/bitcoinDashboard.js @@ -91,39 +91,64 @@ class BitcoinDashboard extends ImmutableComponent { })} /> } - bitcoinPurchaseButton () { - if (!this.props.ledgerData.get('buyURLFrame')) { - /* TODO refactor button */ - return