Skip to content

Commit

Permalink
Merge pull request #44858 from Expensify/blimpich-hideGBP
Browse files Browse the repository at this point in the history
  • Loading branch information
blimpich authored Jul 4, 2024
2 parents b49d5b8 + db42a76 commit 3f4d619
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 35 deletions.
1 change: 0 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5084,7 +5084,6 @@ const CONST = {
PAYMENT_CARD_CURRENCY: {
USD: 'USD',
AUD: 'AUD',
GBP: 'GBP',
NZD: 'NZD',
},

Expand Down
4 changes: 0 additions & 4 deletions src/hooks/useSubscriptionPossibleCostSavings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ const POSSIBLE_COST_SAVINGS = {
[CONST.POLICY.TYPE.TEAM]: 1400,
[CONST.POLICY.TYPE.CORPORATE]: 3000,
},
[CONST.PAYMENT_CARD_CURRENCY.GBP]: {
[CONST.POLICY.TYPE.TEAM]: 800,
[CONST.POLICY.TYPE.CORPORATE]: 1400,
},
[CONST.PAYMENT_CARD_CURRENCY.NZD]: {
[CONST.POLICY.TYPE.TEAM]: 1600,
[CONST.POLICY.TYPE.CORPORATE]: 3200,
Expand Down
10 changes: 0 additions & 10 deletions src/hooks/useSubscriptionPrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ const SUBSCRIPTION_PRICES = {
[CONST.SUBSCRIPTION.TYPE.PAYPERUSE]: 1400,
},
},
[CONST.PAYMENT_CARD_CURRENCY.GBP]: {
[CONST.POLICY.TYPE.CORPORATE]: {
[CONST.SUBSCRIPTION.TYPE.ANNUAL]: 700,
[CONST.SUBSCRIPTION.TYPE.PAYPERUSE]: 1400,
},
[CONST.POLICY.TYPE.TEAM]: {
[CONST.SUBSCRIPTION.TYPE.ANNUAL]: 400,
[CONST.SUBSCRIPTION.TYPE.PAYPERUSE]: 800,
},
},
[CONST.PAYMENT_CARD_CURRENCY.NZD]: {
[CONST.POLICY.TYPE.CORPORATE]: {
[CONST.SUBSCRIPTION.TYPE.ANNUAL]: 1600,
Expand Down
27 changes: 7 additions & 20 deletions src/libs/actions/PaymentMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
TransferWalletBalanceParams,
UpdateBillingCurrencyParams,
} from '@libs/API/parameters';
import {READ_COMMANDS, SIDE_EFFECT_REQUEST_COMMANDS, WRITE_COMMANDS} from '@libs/API/types';
import {READ_COMMANDS, WRITE_COMMANDS} from '@libs/API/types';
import * as CardUtils from '@libs/CardUtils';
import Navigation from '@libs/Navigation/Navigation';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -253,25 +253,12 @@ function addSubscriptionPaymentCard(cardData: {
},
];

if (currency === CONST.PAYMENT_CARD_CURRENCY.GBP) {
// eslint-disable-next-line rulesdir/no-api-side-effects-method
API.makeRequestWithSideEffects(SIDE_EFFECT_REQUEST_COMMANDS.ADD_PAYMENT_CARD_GBR, parameters, {optimisticData, successData, failureData}).then((response) => {
if (response?.jsonCode !== CONST.JSON_CODE.SUCCESS) {
return;
}
// TODO 3ds flow will be done as a part https://github.com/Expensify/App/issues/42432
// We will use this onyx key to open Modal and preview iframe. Potentially we can save the whole object which come from side effect
Onyx.set(ONYXKEYS.VERIFY_3DS_SUBSCRIPTION, (response as {authenticationLink: string}).authenticationLink);
});
} else {
// eslint-disable-next-line rulesdir/no-multiple-api-calls
API.write(WRITE_COMMANDS.ADD_PAYMENT_CARD, parameters, {
optimisticData,
successData,
failureData,
});
Navigation.goBack();
}
API.write(WRITE_COMMANDS.ADD_PAYMENT_CARD, parameters, {
optimisticData,
successData,
failureData,
});
Navigation.goBack();
}

/**
Expand Down

0 comments on commit 3f4d619

Please sign in to comment.