taxjar / vat_check

Validate EU VAT numbers the easy way with VIES!
23 stars 16 forks source link

Account for VIES URL and subsequent call changing to https #4

Closed ryanflach closed 4 years ago

ryanflach commented 4 years ago

Due to VIES updating to https, current calls to establish the client respond with:

<HTML><HEAD>
<TITLE>Redirect</TITLE>
</HEAD>
<BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Redirect (policy_request_redirect)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
Click <a href="https:&#x2F;&#x2F;ec.europa.eu&#x2F;taxation_customs&#x2F;vies&#x2F;checkVatService.wsdl">here</a> if you are not automatically redirected.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">

</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica" SIZE=2>
<BR>
For assistance, contact your network support team.
</FONT>
</TD></TR>
</TABLE>
</blockquote>
</FONT>
</BODY></HTML>

I was able to spend a small amount of time looking at this, and it seemed like adding follow_redirects: true to https://github.com/taxjar/vat_check/blob/1898e5a3b64724165f809feb707a3a096fb57473/lib/vat_check/requests.rb#L6 got things working as expected through vat_check.rb, but I was unable to get the specs back to a passing state with this change.

prdanelli commented 4 years ago

@fastdivision @aleccarper Is there any chance of getting this one patched? Seems like its breaking a clients production site as its 500'ing on submission of the VAT Codes.

Thank you for the time you spend putting this gem together, its really appreciated.

fastdivision commented 4 years ago

Fixed in v1.0

prdanelli commented 4 years ago

@fastdivision Thank you for taking the time to fix this. The Gem is really appreciated.