UK Validation
-
Sorry, me again.
I’ve enabled UK validation and there’s a couple problems there.
In the alg_wc_eu_vat_validate_vat_uk function, the default method is (if configured properly…) will be “soap”, but it assumes “curl”. A case statement there should just return null. Currently it will pointlessly run twice.
In the actual curl response, the code assumes anything with a “code” value is an “api error”. That’s not accurate. The code should be checked for it’s value. There’s two values that indicate that the passed code isn’t valid (rather than it being an API error), which should return false rather than null.
So something like:// API response if ( isset($responsedecode['code']) ) { alg_wc_eu_vat_maybe_log( $country_code, $vat_number, $billing_company, $method, __( $responsedecode['message'], 'eu-vat-for-woocommerce' ) ); switch($responsedecode['code']) { case "NOT_FOUND": return false; case "INVALID_REQUEST": return false; default: return null; } }
might be reasonable…
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘UK Validation’ is closed to new replies.