tidy up some code locations
This commit is contained in:
@@ -31,6 +31,29 @@ function _booking_get_stripe_private_key() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to calculate stripe transaction fees
|
||||
*/
|
||||
function _booking_add_stripe_fees($amount, $country) {
|
||||
//add the 30 cent fixed cost
|
||||
$result = '0.00';
|
||||
$result = (float) ($amount + (float) variable_get('booking_stripe_transaction_fee_fixedcost', '0.3'));
|
||||
|
||||
//and the 2.6 percent transaction fee for australian transaction with no currency conversion
|
||||
if ($country == variable_get('booking_default_country', 'Australia')) {
|
||||
$percentage = (float) variable_get('booking_stripe_transaction_fee_percentage', '1.75');
|
||||
} else {
|
||||
$percentage = (float) variable_get('booking_stripe_transaction_fee_percentage_intl', '2.9');
|
||||
}
|
||||
|
||||
//apply the percentage
|
||||
$percentage = (float) $percentage / 100;
|
||||
$result = $result / (1 - $percentage);
|
||||
|
||||
//return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to generate paypal form for payments
|
||||
*/
|
||||
|
Reference in New Issue
Block a user