fix for international stripe fee token

This commit is contained in:
Nathan Coad
2016-07-22 16:02:23 +10:00
parent 07078de79b
commit 2cbfda6cf7
2 changed files with 12 additions and 6 deletions

View File

@@ -1045,10 +1045,11 @@ function _booking_total_due($person)
*
* @param $person - the object relating to the registration node
* @param $amount_paid - if we have previously calculated the amount paid, this can be passed as a value
* @param $include_fees - boolean to indicate whether we want the net amount or the amount owing including paypal fees
* @param $include_fees - boolean to indicate whether we want the net amount or the amount owing including paypal or stripe fees
* @param $include_fees - boolean to indicate whether we want the fees for an international transaction
* @return amount owing as a decimal value
*/
function _booking_amount_owing($person, $amount_paid = 0, $include_fees = TRUE) {
function _booking_amount_owing($person, $amount_paid = 0, $include_fees = TRUE, $international_fees = FALSE) {
global $event;
//quick sanity check
if (! $person->nid) {
@@ -1077,7 +1078,12 @@ function _booking_amount_owing($person, $amount_paid = 0, $include_fees = TRUE)
$amount_owing = _booking_add_paypal_fees($total_due - $amount_paid, $person->booking_country);
}
elseif ($payment_processor_type == 1) {
$amount_owing = _booking_add_stripe_fees($total_due - $amount_paid, $person->booking_country);
if ($international_fees == FALSE) {
$amount_owing = _booking_add_stripe_fees($total_due - $amount_paid, $person->booking_country);
}
else {
$amount_owing = _booking_add_stripe_fees($total_due - $amount_paid, 'FakeCountry');
}
}
}
//otherwise we're using manual payment processing so don't add any fees