diff --git a/app/components/UI/FiatOrders/PaymentMethodApplePay/index.js b/app/components/UI/FiatOrders/PaymentMethodApplePay/index.js index 96eaa15752a..ea6099e71c3 100644 --- a/app/components/UI/FiatOrders/PaymentMethodApplePay/index.js +++ b/app/components/UI/FiatOrders/PaymentMethodApplePay/index.js @@ -173,7 +173,7 @@ QuickAmount.propTypes = { //* Constants */ const quickAmounts = ['50', '100', '250']; -const minAmount = 5; +const minAmount = 50; const maxAmount = 250; const hasTwoDecimals = /^\d+\.\d{2}$/; @@ -265,7 +265,7 @@ function PaymentMethodApplePay({ const handleWyreTerms = useWyreTerms(navigation); const rates = useWyreRates(network, 'USDETH'); - const [pay, ABORTED, percentFee, flatFee, , fee] = useWyreApplePay(roundAmount, selectedAddress, network); + const [pay, ABORTED, , , , fee] = useWyreApplePay(roundAmount, selectedAddress, network); const handlePressApplePay = useCallback(async () => { const prevLockTime = lockTime; @@ -431,9 +431,7 @@ function PaymentMethodApplePay({ <> {disabledButton ? ( - - {strings('fiat_on_ramp.Fee')} ~{percentFee}% + ${flatFee} - + ) : ( diff --git a/app/components/UI/FiatOrders/PaymentMethodSelector/wyreApplePay.js b/app/components/UI/FiatOrders/PaymentMethodSelector/wyreApplePay.js index 5b8159d3cad..e503d84a7cc 100644 --- a/app/components/UI/FiatOrders/PaymentMethodSelector/wyreApplePay.js +++ b/app/components/UI/FiatOrders/PaymentMethodSelector/wyreApplePay.js @@ -3,14 +3,7 @@ import PropTypes from 'prop-types'; import { StyleSheet, Image, TouchableOpacity } from 'react-native'; import { NavigationContext } from 'react-navigation'; import { strings } from '../../../../../locales/i18n'; -import { - useWyreTerms, - WYRE_IS_PROMOTION, - WYRE_FEE_PERCENT, - WYRE_FEE_FLAT, - WYRE_REGULAR_FEE_PERCENT, - WYRE_REGULAR_FEE_FLAT -} from '../orderProcessor/wyreApplePay'; +import { useWyreTerms } from '../orderProcessor/wyreApplePay'; import PaymentMethod from '../components/PaymentMethod'; @@ -45,25 +38,6 @@ const WyreApplePayPaymentMethod = ({ onPress }) => { {strings('fiat_on_ramp.apple_pay')} {strings('fiat_on_ramp.via')}{' '} - - {WYRE_IS_PROMOTION ? ( - <> - - ${WYRE_REGULAR_FEE_PERCENT.toFixed(2)} + ${WYRE_REGULAR_FEE_FLAT.toFixed(2)} - {' '} - - {WYRE_FEE_PERCENT}% {strings('fiat_on_ramp.fee')} - - {'\n'} - {strings('fiat_on_ramp.limited_time')} - - ) : ( - - {strings('fiat_on_ramp.Fee')} ~{WYRE_FEE_PERCENT.toFixed(2)}% + $ - {WYRE_FEE_FLAT.toFixed(2)} - - )} - {strings('fiat_on_ramp.wyre_minutes')} {strings('fiat_on_ramp.wyre_max')} {strings('fiat_on_ramp.wyre_requires_debit_card')} diff --git a/app/components/UI/FiatOrders/orderProcessor/wyreApplePay.js b/app/components/UI/FiatOrders/orderProcessor/wyreApplePay.js index fc47aee5359..9d8bd056395 100644 --- a/app/components/UI/FiatOrders/orderProcessor/wyreApplePay.js +++ b/app/components/UI/FiatOrders/orderProcessor/wyreApplePay.js @@ -112,6 +112,7 @@ const { WYRE_MERCHANT_ID, WYRE_MERCHANT_ID_TEST, WYRE_API_ENDPOINT, WYRE_API_END export const WYRE_IS_PROMOTION = false; export const WYRE_REGULAR_FEE_PERCENT = 2.9; export const WYRE_REGULAR_FEE_FLAT = 0.3; +export const WYRE_MIN_FEE = 5; export const WYRE_FEE_PERCENT = WYRE_IS_PROMOTION ? 0 : WYRE_REGULAR_FEE_PERCENT; export const WYRE_FEE_FLAT = WYRE_IS_PROMOTION ? 0 : WYRE_REGULAR_FEE_FLAT; @@ -392,7 +393,11 @@ export function useWyreApplePay(amount, address, network) { amount, percentFee ]); - const fee = useMemo(() => (Number(percentFeeAmount) + Number(flatFee)).toFixed(2), [flatFee, percentFeeAmount]); + const fee = useMemo(() => { + const totalFee = Number(percentFeeAmount) + Number(flatFee); + + return totalFee < WYRE_MIN_FEE ? WYRE_MIN_FEE : totalFee.toFixed(2); + }, [flatFee, percentFeeAmount]); const total = useMemo(() => Number(amount) + Number(fee), [amount, fee]); const methodData = useMemo(() => getMethodData(network), [network]); const paymentDetails = useMemo(() => getPaymentDetails(ETH_CURRENCY_CODE, amount, fee, total), [