Skip to content

Commit

Permalink
remove platformFee stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
znarf committed Mar 4, 2024
1 parent dca6642 commit bd751aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions server/lib/payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1056,10 +1056,12 @@ export const getApplicationFee = async (order: OrderModelInterface): Promise<num
applicationFee += hostFeeShareAmount;
}

/*
const platformFeeAmount = await getPlatformFee(order);
if (platformFeeAmount) {
applicationFee += platformFeeAmount;
}
*/

return applicationFee;
};
Expand All @@ -1075,6 +1077,7 @@ export const getPlatformTip = (order: OrderModelInterface): number => {
return 0;
};

/*
export const getPlatformFeePercent = async (
order: OrderModelInterface,
{ loaders = null }: { loaders?: loaders } = {},
Expand All @@ -1101,6 +1104,7 @@ export const getPlatformFeePercent = async (
return 0;
};
*/

export const getHostFee = async (order: OrderModelInterface): Promise<number> => {
const totalAmount = order.totalAmount || 0;
Expand Down Expand Up @@ -1317,10 +1321,10 @@ export const getHostFeeSharePercent = async (
// order.platformTipEligible = await isPlatformTipEligible(order);
// }

const platformFee = await getPlatformFee(order);
// const platformFee = await getPlatformFee(order);

// Platform Tip Eligible or Platform Fee? No Host Fee Share, that's it
if (order.platformTipEligible === true || platformFee !== 0) {
if (order.platformTipEligible === true) {
return 0;
}

Expand Down
12 changes: 6 additions & 6 deletions server/paymentProviders/stripe/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
createRefundTransaction,
getHostFee,
getHostFeeSharePercent,
getPlatformFee,
// getPlatformFee,
getPlatformTip,
isPlatformTipEligible,
} from '../../lib/payments';
Expand Down Expand Up @@ -159,17 +159,17 @@ export const createChargeTransactions = async (
const platformTipEligible = await isPlatformTipEligible(order);
const platformTip = getPlatformTip(order);

const platformFee = await getPlatformFee(order);
// const platformFee = await getPlatformFee(order);

let platformTipInHostCurrency, platformFeeInHostCurrency;
if (platformTip) {
platformTipInHostCurrency = isSharedRevenue
? Math.round(platformTip * hostCurrencyFxRate) || 0
: fees.applicationFee;
} else if (platformFee) {
platformFeeInHostCurrency = isSharedRevenue
? Math.round(platformFee * hostCurrencyFxRate) || 0
: fees.applicationFee;
// } else if (platformFee) {
// platformFeeInHostCurrency = isSharedRevenue
// ? Math.round(platformFee * hostCurrencyFxRate) || 0
// : fees.applicationFee;
} else if (config.env === 'test' || config.env === 'ci') {
// Retro Compatibility with some tests expecting Platform Fees, not for production anymore
// TODO: we need to stop supporting this
Expand Down

0 comments on commit bd751aa

Please sign in to comment.