temp testing to workaround stripe bug

This commit is contained in:
Nathan Coad
2016-07-23 12:09:44 +10:00
parent 3cbb0334c3
commit a24a60fb77

View File

@@ -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",