#zak-tax-unittest

1 messages · Page 1 of 1 (latest)

novel radishBOT
distant shard
#

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?

jovial sleet
#

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

distant shard
#

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

jovial sleet
#

Yeah I was thinking

#

use one live response

#

and built it up using Stripe\Invoice to mock it

distant shard
#

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.

jovial sleet
#

(my CTO doesn't want CI to call 3P)

#

thanks @distant shard