#zak-tax-unittest
1 messages · Page 1 of 1 (latest)
Good question. I think Tax does need to be enabled on the account overall. I'm not 100% familiar with the setup here, do I understand it about right that you are currently getting an error that Tax isn't set up, but setting tax up would require setting actual business details on your account that you don't want to be on your live account?
not exactly
I've built an endpoint that creates a tax summary leveraging upcoming invoice API
to essentially replicate Stripe Checkout behavior (aka display Sales Tax) on our implementation
the thing is that the upcoming invoice endpoint won't calculate taxes if the account doesn't have tax enabled
our unit tests are using stripe-mock and I don't think there is way to "enable" that
like 'automatic_tax' => [ 'enabled' => true, ]
is ignored because - I'm assuming - stripe-mock doesn't support tax
Yeah, I think Stripe mock just gives back static responses and largely doesn't take params in to account. You might want to make this call once from a real account, save that response, and use that to mock out that endpoint going forward
So in this case it sounds like you will need a unit test account
Yeah I was thinking
use one live response
and built it up using Stripe\Invoice to mock it
Yeah I think that is the best way forward here. From what I can see, stripe-mock's logic is still too naive to properly handle the tax parameters here.