Announcement

Collapse
No announcement yet.

toolkit callurl no longer working for our state tax API

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

    toolkit callurl no longer working for our state tax API

    Hello forum:
    the toolkit callurl has stopped working on 3 of our sites after being in use for 2+ years, Has this function been changes/disabled?
    This is the code that used to work:

    <mvt:assign name="g.sales_tax_rate" value="'0'" />
    <mvt:if expr="g.basket:ship_state EQ 'WA' AND ISNULL g.taxexempt">
    <mvt:assign name="g.addr" value = "g.basket:ship_addr1" />
    <mvt:assign name="g.city" value = "g.basket:ship_city" />
    <mvt:assign name="g.zip" value = "g.basket:ship_zip" />
    <mvt:assign name="g.output" value = "'TEXT'" />
    <mvt:item name="toolkit" param="callurl|taxRate|http://dor.wa.gov/addressrates.aspx|...r,g.city,g.zip " />
    <mvt:assign name="g.taxCodeResult" value="gettoken(g.taxRate, '=', '4') " />
    <mvt:assign name="g.taxCodeResult" value="trim(g.taxCodeResult)" />
    <mvt:if expr="g.taxCodeResult EQ '0' OR g.taxCodeResult EQ '1' OR g.taxCodeResult EQ '2'">
    <mvt:assign name="g.taxCodedistrict" value="gettoken(g.taxRate, '=', '2') " />
    <mvt:assign name="g.taxCodedistrict" value="gettoken(g.taxCodedistrict, ' ', '1') " />
    <mvt:assign name="g.taxCoderate" value="gettoken(g.taxRate, '=', '3') " />
    <mvt:assign name="g.taxCoderate" value="gettoken(g.taxCoderate, ' ', '1') " />
    <mvt:assign name="g.taxinfo" value="g.taxCoderate $ '^' $ g.taxCodedistrict" />
    <mvt:item name="customfields" param="Write_Basket('salestax', g.taxinfo)" />
    <mvt:assign name="g.sales_tax_rate" value="(g.taxCoderate * 100)" />
    <mvt:else>
    <mvt:item name="toolkit" param="sassign|to_email|[email protected] m" />
    <mvt:item name="toolkit" param="sassign|from_email|[email protected] " />
    <mvt:item name="toolkit" param="sassign|cc_email|[email protected]" />
    <mvt:item name="toolkit" param="sassign|subject|Unable to get Washington sales tax rate" />
    <mvt:assign name="g.message" value="'Error code=' $g.taxCoderesult $'. Customer: ' $g.basket:ship_comp $' Ship To name: ' $g.basket:ship_lname $', ' $g.basket:ship_fname $' Ship To address: ' $g.basket:ship_addr1 $' ' $g.basket:ship_city $' ' $g.basket:ship_state $' ' $g.basket:ship_zip" />
    <mvt:do file="g.module_library_utilities" name="g.email_sent" value="SendEmail(g.to_email,g.from_email,g.cc_emai l,g.subject,'',g.message)" />
    </mvt:if>
    </mvt:if>

    No value is returned in the taxRate global variable.

    We now get nothing back from the call however the following conditional above is executed as true as we do not send/receive the error email.:
    <mvt:if expr="g.taxCodeResult EQ '0' OR g.taxCodeResult EQ '1' OR g.taxCodeResult EQ '2'">

    I've opened a ticket
    Larry
    Last edited by wajake41; 09-14-17, 03:07 PM.
    Larry
    Luce Kanun Web Design
    www.facebook.com/wajake41
    www.plus.google.com/116415026668025242914/posts?hl=en



    #2
    Hi Larry,

    I don't see any code on my screen; maybe something went wrong when you pasted it in? At any rate, it seems unlikely that a Toolkit function would simply stop working. If all three stores are using Toolkit to call the same server, maybe something changed on the server side; you might need to contact them about it. Also, now that the Store Morph language includes the mvt:call element, you can probably rewrite your code to use that instead of Toolkit. You can drop me a line if you need some help fixing this.
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    Comment


      #3
      May need to update your URL, not sure how many redirects it will follow but it appears to force you to https first, then a second redirect to https://webgis.dor.wa.gov/webapi/addressrates.aspx but depending on how often you call it, could be some type of rate limiting going on too.
      David Hubbard
      CIO
      Miva
      [email protected]
      http://www.miva.com

      Comment


        #4
        This has been working for 2 years, No changes made for at least a year. Has something changed in Miva regarding callurl?
        Also cannot get a replacement mvt:call to compile with this url. See below
        <mvt:assign name="g.addr" value = "g.basket:ship_addr1" />
        <mvt:assign name="g.city" value = "g.basket:ship_city" />
        <mvt:assign name="g.zip" value = "g.basket:ship_zip" />
        <mvt:assign name="g.output" value = "'TEXT'" />
        <mvt:comment> <mvt:item name="toolkit" param="callurl|taxRate|http://dor.wa.gov/AddressRates.aspx|GET|g.output,g.addr,g.city,g.zip " /> </mvt:comment>
        <mvt:call ACTION="http://dor.wa.gov/AddressRates.aspx" METHOD="'GET'" TIMEOUT="'15'" FIELDS="'g.output,g.addr,g.city,g.zip'">
        <mvt:assign name="g.taxRate" value="s.callvalue" />
        </mvt:call>
        Larry
        Luce Kanun Web Design
        www.facebook.com/wajake41
        www.plus.google.com/116415026668025242914/posts?hl=en


        Comment


          #5
          Still not able to compile the mvt:call
          Last edited by wajake41; 09-14-17, 08:48 PM.
          Larry
          Luce Kanun Web Design
          www.facebook.com/wajake41
          www.plus.google.com/116415026668025242914/posts?hl=en


          Comment


            #6
            If it has been working for two years and then suddenly stopped, then I suspect something has changed with the URL you're calling, or its hosting. Something definitely has changed at some point given the URL you're using redirects to something else at the current time, and who knows if ToolKit follows redirects.
            David Hubbard
            CIO
            Miva
            [email protected]
            http://www.miva.com

            Comment


              #7
              David, any idea why the mvt:call cannot compile?
              Larry
              Luce Kanun Web Design
              www.facebook.com/wajake41
              www.plus.google.com/116415026668025242914/posts?hl=en


              Comment


                #8
                David, you got it. State API URL address has been changed.

                Thanks, Larry
                Larry
                Luce Kanun Web Design
                www.facebook.com/wajake41
                www.plus.google.com/116415026668025242914/posts?hl=en


                Comment


                  #9
                  Originally posted by wajake41 View Post
                  This has been working for 2 years, No changes made for at least a year. Has something changed in Miva regarding callurl?
                  Also cannot get a replacement mvt:call to compile with this url. See below
                  <mvt:assign name="g.addr" value = "g.basket:ship_addr1" />
                  <mvt:assign name="g.city" value = "g.basket:ship_city" />
                  <mvt:assign name="g.zip" value = "g.basket:ship_zip" />
                  <mvt:assign name="g.output" value = "'TEXT'" />
                  <mvt:comment> <mvt:item name="toolkit" param="callurl|taxRate|http://dor.wa.gov/AddressRates.aspx|GET|g.output,g.addr,g.city,g.zip " /> </mvt:comment>
                  <mvt:call ACTION="http://dor.wa.gov/AddressRates.aspx" METHOD="'GET'" TIMEOUT="'15'" FIELDS="'g.output,g.addr,g.city,g.zip'">
                  <mvt:assign name="g.taxRate" value="s.callvalue" />
                  </mvt:call>
                  FYI: the compile most likely fails because your ACTION is empty. Without the ' ' single quotes, mvt:call is looking for a variable called: http://dor.wa.gov/AddressRates.aspx
                  Bruce Golub
                  Phosphor Media - "Your Success is our Business"

                  Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                  phosphormedia.com

                  Comment


                    #10
                    That was it Bruce, Thanks!
                    Larry
                    Luce Kanun Web Design
                    www.facebook.com/wajake41
                    www.plus.google.com/116415026668025242914/posts?hl=en


                    Comment

                    Working...
                    X