For someone interested in this modification, please follow the instructions below to get it works:
1. Open the file components/com_osmembership/helper/helper.php
2. Find the function calculateSubscriptionFee
3. Find this code below:
Code:
if ($paymentFeeAmount > 0 || $paymentFeePercent > 0)
{
if ($trialGrossAmount > 0)
{
$fees['trial_payment_processing_fee'] = round($paymentFeeAmount + $trialGrossAmount * $paymentFeePercent / 100, 2);
}
else
{
$fees['trial_payment_processing_fee'] = 0;
}
if ($regularGrossAmount > 0)
{
$fees['regular_payment_processing_fee'] = round($paymentFeeAmount + $regularGrossAmount * $paymentFeePercent / 100, 2);
}
else
{
$fees['regular_payment_processing_fee'] = 0;
}
if ($grossAmount > 0)
{
$fees['payment_processing_fee'] = round($paymentFeeAmount + $grossAmount * $paymentFeePercent / 100, 2);
}
else
{
$fees['payment_processing_fee'] = 0;
}
$trialGrossAmount += $fees['trial_payment_processing_fee'];
$regularGrossAmount += $fees['regular_payment_processing_fee'];
$grossAmount += $fees['payment_processing_fee'];
}
else
{
$fees['trial_payment_processing_fee'] = 0;
$fees['regular_payment_processing_fee'] = 0;
$fees['payment_processing_fee'] = 0;
}
4. Change it to:
Code:
if ($paymentFeeAmount > 0 || $paymentFeePercent > 0)
{
if ($trialGrossAmount > 0)
{
$fees['trial_payment_processing_fee'] = round(($trialGrossAmount + $paymentFeeAmount) / ( 1- $paymentFeePercent / 100) - $trialGrossAmount, 2);
}
else
{
$fees['trial_payment_processing_fee'] = 0;
}
if ($regularGrossAmount > 0)
{
$fees['regular_payment_processing_fee'] = round(($regularGrossAmount + $paymentFeeAmount) / (1 - $paymentFeePercent / 100) - $regularGrossAmount, 2);
}
else
{
$fees['regular_payment_processing_fee'] = 0;
}
if ($grossAmount > 0)
{
$fees['payment_processing_fee'] = round(($grossAmount + $paymentFeeAmount) / (1 - $paymentFeePercent / 100) - $grossAmount, 2);
}
else
{
$fees['payment_processing_fee'] = 0;
}
$trialGrossAmount += $fees['trial_payment_processing_fee'];
$regularGrossAmount += $fees['regular_payment_processing_fee'];
$grossAmount += $fees['payment_processing_fee'];
}
else
{
$fees['trial_payment_processing_fee'] = 0;
$fees['regular_payment_processing_fee'] = 0;
$fees['payment_processing_fee'] = 0;
}
This is a strange requirement, so far, only you need it

.