英文:
Why am I getting status:undefined from Chargebee API method validateVat?
问题
我正在尝试使用他们的脚本来进行增值税验证,但即使在运行他们的示例时,我也得到了相同的响应:
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
})
});
我始终得到{status: undefined}
作为结果。但是API有响应,因为如果我不发送例如var_number
,我会得到来自缺少参数的预期错误。
有没有人知道发生了什么,或者我漏掉了什么?谢谢!
包含所述案例的播放环境:https://jsfiddle.net/r27panuv/
英文:
I'm trying to user their VAT validation method with their script, but even when running their example I'm getting the same response:
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. But the API is responding because If if don't send for example var_number
I get the expected error from missing params.
Anyone with an idea what's happening or I'm missing something? Thanks!
Playground with mentioned case: https://jsfiddle.net/r27panuv/
答案1
得分: 0
已解决!需要在管理员面板中启用增值税(VAT)验证。文档中缺少此信息。
英文:
Solved! VAT validation needed to be enabled in the admin panel. The documentation is missing that.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论