Results 1 to 10 of 20

Hybrid View

  1. #1
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Module disabled due to zone restriction.

    I don't have a Braintree account let alone a site set up with the module.

    But, it would be helpful to know exactly how to recreate your exact situation on a new store:
    - how to create the zone configuration affecting these transactions
    - an actual billing address that would trigger the problem

    Perhaps there's a combination in there that will expose a solution. Often zone-mismatches are a result of unexpected assumptions.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  2. #2
    Join Date
    Apr 2013
    Location
    eglisau switzerland
    Posts
    568
    Plugin Contributions
    0

    Default Re: Module disabled due to zone restriction.

    Quote Originally Posted by DrByte View Post
    I don't have a Braintree account let alone a site set up with the module.

    But, it would be helpful to know exactly how to recreate your exact situation on a new store:
    - how to create the zone configuration affecting these transactions
    - an actual billing address that would trigger the problem

    Perhaps there's a combination in there that will expose a solution. Often zone-mismatches are a result of unexpected assumptions.
    "how to create the zone configuration affecting these transactions" My zones were already set up in my zen cart in Admin/Location/Taxes/ZoneDefinitions and worked OK for some years.
    In Braintree you see a drop down list of these zone definitions and simply click the one you want to use.

    I went into my database and the "billing country" is shown correctly for these cases.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Module disabled due to zone restriction.

    Quote Originally Posted by marton_1 View Post
    My zones ... worked OK for some years.
    ... or not: https://www.zen-cart.com/showthread....ne-restriction
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Apr 2013
    Location
    eglisau switzerland
    Posts
    568
    Plugin Contributions
    0

    Default Re: Module disabled due to zone restriction.

    When I compare the zone checking Paypalwpp code against the Braintree code it is almost identical except for the first line that has some extra code and the last line has an extra }.

    Zen Cart paypalwpp.ch Line 207
    Code:
    if ($this->enabled && (int)$this->zone > 0 && isset($order->billing['country']['id'])) { 
    $check_flag = false;
          $sql = "SELECT zone_id
                  FROM " . TABLE_ZONES_TO_GEO_ZONES . "
                  WHERE geo_zone_id = :zoneId
                  AND zone_country_id = :countryId
                  ORDER BY zone_id";
          $sql = $db->bindVars($sql, ':zoneId', $this->zone, 'integer');
          $sql = $db->bindVars($sql, ':countryId', $order->billing['country']['id'], 'integer');
          $check = $db->Execute($sql);
          while (!$check->EOF) {
            if ($check->fields['zone_id'] < 1) {
              $check_flag = true;
              break;
            } elseif ($check->fields['zone_id'] == $order->billing['zone_id']) {
              $check_flag = true;
              break;
            }
            $check->MoveNext();
          }
    
          if (!$check_flag) {
            $this->enabled = false;
            $this->zcLog('update_status', 'Module disabled due to zone restriction. Billing address is not within the Payment Zone selected in the module settings.');
          }
        }
    Braintree braintree_api.ch Line 121
    Code:
     if ($this->enabled && (int) $this->zone > 0) { 
    
                $check_flag = false;
    
                $sql = "SELECT zone_id
                    FROM " . TABLE_ZONES_TO_GEO_ZONES . "
                    WHERE geo_zone_id = :zoneId
                    AND zone_country_id = :countryId
                    ORDER BY zone_id";
    
                $sql = $db->bindVars($sql, ':zoneId', $this->zone, 'integer');
                $sql = $db->bindVars($sql, ':countryId', $order->billing['country']['id'], 'integer');
                $check = $db->Execute($sql);
    
                while (!$check->EOF) {
    
                    if ($check->fields['zone_id'] < 1) {
                        $check_flag = true;
                        break;
                    } else if ($check->fields['zone_id'] == $order->billing['zone_id']) {
                        $check_flag = true;
                        break;
                    }
    
                    $check->MoveNext();
                }
    
                if (!$check_flag) {
                    $this->enabled = false;
                    $this->zcLog('update_status', 'Module disabled due to zone restriction. Billing address is not within the Payment Zone selected in the module settings.');
                }

  5. #5
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Module disabled due to zone restriction.

    Have some major differences there I would say. The braintree version doesn't check for the $order related data before attempting to match to a zone and further the content that exists at and after the "missing" right squiggly parenthesis (}) is important as well. Code operates in balanced pairs... the presented code is missing a closing }.
    Advising about whether or where to put a check of the order data depends on what follows. Currently it looks like, oh yeah will turn this off for now because we don't have all the necessary/desired data, but the next line may well turn it back on based on some other condition and/or have logic to again turn it off based on some other characteristic...

    But yes, as written/presented so far, if $order->billing['country']['id'] was not set, then the query would not work properly and the zone would be disabled and the message would get recorded... should it be possible for it to get into that condition? Well, seems one program has the check to prevent it and works fine, the other doesn't have the check and an "zone error" is logged. So... it seems that something about that piece of information is important to the process flow... may just need to go around the logging of the error message or as a sub-set of the zone check operation, I don't know without at least the remainder of the code within the opening/closing of that particular code group, possibly the entire update_status function.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Apr 2013
    Location
    eglisau switzerland
    Posts
    568
    Plugin Contributions
    0

    Default Re: Module disabled due to zone restriction.

    Quote Originally Posted by mc12345678 View Post
    Have some major differences there I would say. The braintree version doesn't check for the $order related data before attempting to match to a zone and further the content that exists at and after the "missing" right squiggly parenthesis (}) is important as well. Code operates in balanced pairs... the presented code is missing a closing }.
    Advising about whether or where to put a check of the order data depends on what follows. Currently it looks like, oh yeah will turn this off for now because we don't have all the necessary/desired data, but the next line may well turn it back on based on some other condition and/or have logic to again turn it off based on some other characteristic...

    But yes, as written/presented so far, if $order->billing['country']['id'] was not set, then the query would not work properly and the zone would be disabled and the message would get recorded... should it be possible for it to get into that condition? Well, seems one program has the check to prevent it and works fine, the other doesn't have the check and an "zone error" is logged. So... it seems that something about that piece of information is important to the process flow... may just need to go around the logging of the error message or as a sub-set of the zone check operation, I don't know without at least the remainder of the code within the opening/closing of that particular code group, possibly the entire update_status function.
    Decided to abandon this Braintree gateway and return to Paypal Express, problem here is credit card customers are sometime asked to open a PayPal account and then I lose the sale

    Anyway looks like the Braintree gateway is not updated for MasterCard 2-series BIN.

    I tried payeez, I filled in the new customer form on their local web site some two months ago but they never did reply.

    Square does not offer credit card service in Switzerland.

    Anybody have good experience of a Zen Cart credit card gateway in Switzerland?

  7. #7
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,915
    Plugin Contributions
    13

    Default Re: Module disabled due to zone restriction.

    Quote Originally Posted by marton_1 View Post
    Decided to abandon this Braintree gateway and return to Paypal Express, problem here is credit card customers are sometime asked to open a PayPal account and then I lose the sale

    Anyway looks like the Braintree gateway is not updated for MasterCard 2-series BIN.
    from:
    https://www.braintreepayments.com/bl...2-series-bins/

    "Braintree is ready for the new Mastercard 2-series BINs. The good news is that, as a merchant, you will not see any change to your day-to-day processing. If you want to test the new 2-series BINs in the sandbox environment, please refer to these Mastercard test card numbers."

    i really find it hard to believe that any processor is not ready for the MC 2-series.

    odds are much greater that the problem is with the ZC code (and possibly not having the latest version...) just my opinion...
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

 

 

Similar Threads

  1. paypalwpp Module disabled due to zone restriction.
    By marton_1 in forum PayPal Express Checkout support
    Replies: 3
    Last Post: 28 Dec 2015, 02:02 PM
  2. Need Coupon Zone Restriction by Shipping Address
    By sjrily in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 17
    Last Post: 7 Oct 2011, 01:43 AM
  3. Coupon Zone Restriction - Not working
    By imfsub12 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 6
    Last Post: 2 Feb 2011, 10:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg