Skip to content

Commit

Permalink
Merge pull request #29395 from Expensify/cole_platinum_wallets
Browse files Browse the repository at this point in the history
Allow platinum wallets to transact
  • Loading branch information
MariaHCD authored Oct 17, 2023
2 parents 75a2cc9 + f7f785c commit cf16dac
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,10 @@ const CONST = {
ACTIVATE: 'ActivateStep',
},
TIER_NAME: {
PLATINUM: 'PLATINUM',
GOLD: 'GOLD',
SILVER: 'SILVER',
BRONZE: 'BRONZE',
},
WEB_MESSAGE_TYPE: {
STATEMENT: 'STATEMENT_NAVIGATE',
Expand Down
7 changes: 4 additions & 3 deletions src/components/KYCWall/BaseKYCWall.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'underscore';
import React from 'react';
import {withOnyx} from 'react-native-onyx';
import {Dimensions} from 'react-native';
Expand Down Expand Up @@ -123,9 +124,9 @@ class KYCWall extends React.Component {
}
if (!isExpenseReport) {
// Ask the user to upgrade to a gold wallet as this means they have not yet gone through our Know Your Customer (KYC) checks
const hasGoldWallet = this.props.userWallet.tierName && this.props.userWallet.tierName === CONST.WALLET.TIER_NAME.GOLD;
if (!hasGoldWallet) {
Log.info('[KYC Wallet] User does not have gold wallet');
const hasActivatedWallet = this.props.userWallet.tierName && _.contains([CONST.WALLET.TIER_NAME.GOLD, CONST.WALLET.TIER_NAME.PLATINUM], this.props.userWallet.tierName);
if (!hasActivatedWallet) {
Log.info('[KYC Wallet] User does not have active wallet');
Navigation.navigate(this.props.enablePaymentsRoute);
return;
}
Expand Down
11 changes: 6 additions & 5 deletions src/pages/EnablePayments/ActivateStep.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'underscore';
import React from 'react';
import {withOnyx} from 'react-native-onyx';
import * as LottieAnimations from '../../components/LottieAnimations';
Expand Down Expand Up @@ -29,18 +30,18 @@ const defaultProps = {
};

function ActivateStep(props) {
const isGoldWallet = props.userWallet.tierName === CONST.WALLET.TIER_NAME.GOLD;
const animation = isGoldWallet ? LottieAnimations.Fireworks : LottieAnimations.ReviewingBankInfo;
const isActivatedWallet = _.contains([CONST.WALLET.TIER_NAME.GOLD, CONST.WALLET.TIER_NAME.PLATINUM], props.userWallet.tierName);
const animation = isActivatedWallet ? LottieAnimations.Fireworks : LottieAnimations.ReviewingBankInfo;
const continueButtonText = props.walletTerms.chatReportID ? props.translate('activateStep.continueToPayment') : props.translate('activateStep.continueToTransfer');

return (
<>
<HeaderWithBackButton title={props.translate('activateStep.headerTitle')} />
<ConfirmationPage
animation={animation}
heading={props.translate(`activateStep.${isGoldWallet ? 'activated' : 'checkBackLater'}Title`)}
description={props.translate(`activateStep.${isGoldWallet ? 'activated' : 'checkBackLater'}Message`)}
shouldShowButton={isGoldWallet}
heading={props.translate(`activateStep.${isActivatedWallet ? 'activated' : 'checkBackLater'}Title`)}
description={props.translate(`activateStep.${isActivatedWallet ? 'activated' : 'checkBackLater'}Message`)}
shouldShowButton={isActivatedWallet}
buttonText={continueButtonText}
onButtonPress={PaymentMethods.continueSetup}
/>
Expand Down
4 changes: 3 additions & 1 deletion src/pages/settings/Wallet/TransferBalancePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ function TransferBalancePage(props) {
const isButtonDisabled = !isTransferable || !selectedAccount;
const errorMessage = !_.isEmpty(props.walletTransfer.errors) ? _.chain(props.walletTransfer.errors).values().first().value() : '';

const shouldShowTransferView = PaymentUtils.hasExpensifyPaymentMethod(paymentCardList, props.bankAccountList) && props.userWallet.tierName === CONST.WALLET.TIER_NAME.GOLD;
const shouldShowTransferView =
PaymentUtils.hasExpensifyPaymentMethod(paymentCardList, props.bankAccountList) &&
_.contains([CONST.WALLET.TIER_NAME.GOLD, CONST.WALLET.TIER_NAME.PLATINUM], props.userWallet.tierName);

return (
<ScreenWrapper testID={TransferBalancePage.displayName}>
Expand Down

0 comments on commit cf16dac

Please sign in to comment.