chargebee / chargebee-js-types

2 stars 4 forks source link

validateVat always returning status:undefined #9

Closed julianCast closed 1 year ago

julianCast commented 1 year ago

When running this example: https://www.chargebee.com/checkout-portal-docs/eu-vat-validation-function.html#integration

 let cbInstance = Chargebee.getInstance();
  charegbeeInstance.load('functions').then(() => {
    const payload = {
          country: "DE",
          vat_number: "811569869",
        }
    cbInstance.vat.validateVat(payload).then(data => {
      // Your code here
    }).catch(err => {
      // Your code here
    })
  });

I'm always getting {status: undefined} as result.

Playground as example https://jsfiddle.net/r27panuv/

julianCast commented 1 year ago

Solved! VAT validation needed to be enabled in the admin panel. The documentation is missing that. Thanks!

cb-dinesh commented 1 year ago

cc: @cb-nimithajalal