From a24a60fb779c577711f8528f84b423448914a705 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Sat, 23 Jul 2016 12:09:44 +1000 Subject: [PATCH] temp testing to workaround stripe bug --- booking.stripe.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/booking.stripe.inc b/booking.stripe.inc index d654600..26b09df 100644 --- a/booking.stripe.inc +++ b/booking.stripe.inc @@ -176,13 +176,15 @@ function booking_stripe_validate_form_payment($form, &$form_state) { $card_country = (isset($form_state['input']['card_country']) ? $form_state['input']['card_country'] : ''); //if card issuer is american express then the transaction fee charged should be the international rate - if ($card_brand == 'American Express') { + if ($card_brand === 'American Express') { $person = node_load($nid); $amount = (isset($form_state['input']['foreign_gross_amount']) ? $form_state['input']['foreign_gross_amount'] : $amount); watchdog('booking_debug', "Detected Amex card use, setting amount to !amount", array('!amount' => $amount)); } //if card is issued from a different country then apply the international rate also - elseif (variable_get('booking_default_country', 'Australia') == 'Australia' && $card_country != 'AU') { + //@todo figure out a better way of matching country name to country code + // probably via https://api.drupal.org/api/drupal/includes%21locale.inc/function/country_get_list/7.x + elseif (variable_get('booking_default_country', 'Australia') === 'Australia' && $card_country !== 'US') { $person = node_load($nid); $amount = (isset($form_state['input']['foreign_gross_amount']) ? $form_state['input']['foreign_gross_amount'] : $amount); watchdog('booking_debug', "Detected foreign card use (country !country), setting amount to !amount",