#sergixel04

1 messages · Page 1 of 1 (latest)

umbral wedgeBOT
#

Hello sergixel04, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
sergixel04, 17 hours ago, 53 messages
sergixel04, 20 hours ago, 13 messages
sergixel04, 3 days ago, 23 messages
sergixel04, 6 days ago, 37 messages
sergixel04, 6 days ago, 78 messages

cyan scaffold
#

Can you share the example subscription ID (sub_xxx)?

misty adder
#

Of course!

sub_1O5kDQKYINwhn6n4FGnJq9g6

#
$createdSubscription = $stripe->subscriptions->create([
                'customer' => $user->stripe_id,
                'items' => [
                    ['price' => $priceId]
                ],
                'description' => 'Negocio extra: ' . $request->name,
            ]);

This is the code

I also have tested and tried 'automatic_tax' with enabled at true. But getting an error

{"error":"Received unknown parameter: automatic_tax[0]"}

cyan scaffold
#

automatic_tax.enabled must set to true in order to use Stripe Tax

misty adder
#

I have in my .env the txr_id

#

Can I use that?

cyan scaffold
#

Do you plan to use Tax Rate (manually create tax rate yourself) or Stripe Tax (automatically calculated by Stripe)?

#

They are two different products

misty adder
#

I think it would be Stripe Tax, when creating the prices at product, it automatically calculates the taxes correctly

#

In the first subscription I am using Stripe Checkout and that's fine.

But when I am using API for creating the subscription is charging the price without taxes

cyan scaffold
#

Without setting automatic_tax.enabled: true, there won't be automatic tax calculation

misty adder
#

Yep, that test doesn't have that set up.

But the problem is I saw that parameter

#

and added to the code, like this:

#
$createdSubscription = $stripe->subscriptions->create([
                'customer' => $user->stripe_id,
                'items' => [
                    ['price' => $priceId],
                ],
                'automatic_tax' => [
                    ['enabled' => true],
                ],
                'description' => 'Negocio extra: ' . $request->n,
            ]);
#

But it's not creating the subscription, and it's catching this error

{"error":"Received unknown parameter: automatic_tax[0]"}

cyan scaffold
#

Your code has double square bracket under automatic_tax

#

It should just be:

'automatic_tax' => ['enabled' => true],
misty adder
#

That worked, thank you so much, sorry for that mistake!