Announcement

Collapse
No announcement yet.

Sage Pay the billing country value is to long

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sage Pay the billing country value is to long

    Hi,

    I am trying to use seperate delivery country's so I can charge extra for say delivery to Northern Ireland or Scotland however when not using UK as the country code and using say UK2 it is giving me this error via sage:

    Code:
    Status Detail:	3145 : The BillingCountry value is too long.
    I realize it is because UK2 etc is not only to long but also not a valid country code, I have seen a previous thread on here about this but with no working solution in 2013, does anyone have a work around for this issue?

    Thanks,
    Simon
    www.simonstaton.co.uk

    #2
    SellerDeck 2013 SagePay script still uses 2.23 protocol listed in the knowledge base article Using SagePay with SellerDeck v10. There was a workaround here and explained here have you tried it?.
    Peblaco

    Comment


      #3
      Originally posted by peblaco View Post
      SellerDeck 2013 SagePay script still uses 2.23 protocol listed in the knowledge base article Using SagePay with SellerDeck v10. There was a workaround here and explained here have you tried it?.
      Hi thanks for the reply,

      the only issue is I am unable to find this file in 2013 "OCCPROTXScriptTemplate.pl"

      I have also tried naming them "UK2, UK3, UK4" but this also does not seem to work.
      www.simonstaton.co.uk

      Comment


        #4
        The renaming needs the change to the script because of the SagePay restriction. Find the file within your installation folder CommonOCC sub folder, this is where you installed the software and is often at: "Documents\SellerDeck 2013\Sites\Site1\CommonOCC".
        Peblaco

        Comment


          #5
          Okay awesome I found it, and it worked! thanks for the help
          www.simonstaton.co.uk

          Comment


            #6
            It looks like the topic linked to above "Delivery options V10" which had the fix has been deleted so the fix is now missing. If it was deleted for some reason such as a security issue, SellerDeck or SagePay change please can it be let known. However the archive version of topic is currently (temporarily) in the Google cache. And I had the fix noted down as I applied it to a site using version 12.0.3 last year.

            There were two posts on the original topic by itc.

            First:
            "OCCPROTXScriptTemplate.pl in the CommonOCC folder
            make a backup first.
            Find the line "# Handle state code according to country"
            you should have

            Code:
            #
            # Handle state code according to country
            #
            my $sStateCode = '';
            if ($sCountryCode eq 'UK')
            {
            $sCountryCode =~ s/^UK$/GB/;
            $sStateCode = '';
            }
            change this to:-
            Code:
            #
            # Handle state code according to country
            #
            my $sStateCode = '';
            if (substr($sCountryCode ,0, 2) eq 'UK')
            {
            $sCountryCode = 'GB';
            $sStateCode = '';
            }
            Make sure your extra UK country codes are of the format UK1,UK2,Uk3 etc....
            Seems to work for us, but use at your own risk!
            "

            Second:
            "All the script change does is to remap any UK prefixed code to GB instead of just the normal UK two digits. So by setting your other UK countries codes to UKx, where x is any character (UK1,UK2, UK3 etc are the simplest) when it comes to process for the purposes of sagepay alone they all end up with the GB country code. This works fine."

            NOTES:
            1) You have to set up your country regions in Settings menu > Locations with the country codes such as "UK2, UK3, UK4" as mentioned above then apply the .pl Perl script fix detailed above.
            2) This fix worked last year for SD2013 patch 12.0.3 but it has not been tested on the latest patch, or in SD2014, or with any recent changes SagePay may have made. Perl scripts can be changed between patch versions so the code above may not remain the same as in earlier versions of the software.
            3) If you make a change to a .pl Perl script file it will get wiped every time you run an upgrade patch or upgrade to a major new release and the changes would need re-applying and testing.
            4) As mentioned above use the fix at your own risk no liability as this is not an official fix and I am re-posting someone else's code as a helpful fix.
            Peblaco

            Comment


              #7
              I have tried the fix in 12.0.5 and it works for us.

              Thank you to peblaco for posting the solution again!

              Comment


                #8
                Regarding the recent update by SellerDeck to support SagePay v3 in the patches 11.0.6, 12.0.6 and 14.0.3. The fix originally posted by itc is to have different UK regions as separate countries to use different delivery costs and work with SagePay. Note in the new SellerDeck patches the SagePay script file name has been changed from:
                Site1\CommonOCC\OCCPROTXScriptTemplate.pl
                to:
                Site1\CommonOCC\OCCSagePay.pl
                Because of that if you upgrade from an earlier version which had an edited OCCPROTXScriptTemplate.pl file the software auto-upgrader will not report changes in the script log file as the file name was changed and the new script will need editing. Also there is a small change between the old v10 code posted above and the latest code in the new OCCSagePay.pl. Fix below is confirmed working in 12.0.6 and 14.0.3.

                Make a backup of OCCSagePay.pl first. Open OCCSagePay.pl look for the code: Handle state code according to country
                Code:
                	# Handle state code according to country
                	#
                	my $sStateCode = '';
                	if ($sCountryCode eq 'UK')
                		{
                		$sCountryCode =~ s/^UK$/GB/;
                		}
                Change it to the below - the two changed lines are commented with # edit:
                Code:
                	# Handle state code according to country
                	#
                	my $sStateCode = '';
                	if (substr($sCountryCode ,0, 2) eq 'UK') # edit
                		{
                		$sCountryCode = 'GB'; # edit
                		}
                As per the original post "Make sure your extra UK country codes are of the format UK1,UK2,Uk3 etc...."

                NOTES:
                1) You have to set up your country regions in Settings menu > Locations with the country codes such as "UK2, UK3, UK4" as mentioned above then apply the .pl Perl script fix detailed above.
                2) Fix is confirmed working in 12.0.6 and 14.0.3. Needs testing in 11.0.6 however it should also work okay.
                3) If you make a change to a .pl Perl script file it will get wiped every time you run an upgrade patch or upgrade to a major new release and the changes would need re-applying and testing. Perl scripts can be changed between patch versions so the code above may not remain the same as in earlier versions of the software.
                4) As mentioned above use the fix at your own risk no liability as this is not an official fix and I am re-posting someone else's code as a helpful fix.
                Peblaco

                Comment


                  #9


                  Is all I will say, and if I can do it on V14.03 with Sagepay V3, then anyone can

                  Comment


                    #10
                    This is great news..... We've been scratching our heads and loosing orders over this - Just moved to 2014 and ironing out the bugs. Appreciate you posting this........ Thanks again......
                    Steve Dalloway.......

                    Comment

                    Working...
                    X