#Rohit89

1 messages · Page 1 of 1 (latest)

umbral boughBOT
left mango
#

Is the goal to present the customer with multiple pricing tier options and allow them to select one to upgrade?

plush parcel
#

A customer is already subscribed to one Plan A. Inside the app I want to give option to upgrade to plan B

so when they click on upgrade option I can call checkout session again ?

left mango
plush parcel
#

Ok. my second concern

#

Is it possible if I create a customer without address/IP. And subscribe to free plan.

Stripe::Subscription.create({ customer: {{customer_ID}}, items: [ {price: '{{PRICE_ID}}'}, ], automatic_tax: { enabled: true } })

And when I switch to paid plan, I want it should calculate tax.

#

I tried

Stripe::Customer.create({ name: 'Rohit Sales Tax', })

Stripe::Subscription.create({ customer: 'cus_Mu3ly03IYq9rSx', items: [ {price: 'price_1LTRBXLv5rdhLZWUPup1oGed'}, ], automatic_tax: { enabled: true } })

it gives error

Stripe::InvalidRequestError: The customer cus_Mu3ly03IYq9rSx's location isn't recognized by the tax engine. Set an address on the customer object and verify with the tax[automatic_tax] status.

left mango
#

Yes because you need to do what's in the error message: Set an address on the customer object and verify with the tax[automatic_tax] status.

plush parcel
#

Plan A is a free plan, no payment method AND Address attached to user, and the user wants to upgrade to a paid plan Plan B? Is it possible via billing portal that it can charge tax?

quasi stratus
#

👋

#

stepping in for codename_duchess as they had to step away

#

catching up

#

Hmm I believe it will

#

Let me double check

#

So yeah

#

As long as you have tax enabled for the Price and on your account then it will be applied on an update through the Customer Portal

plush parcel
#

We have states registered under tax settings, product has tax behaviour exclusive

#

and enabled in account in test mode

#

still not able to see any tax

quasi stratus
#

Do you have an example I can look at?

plush parcel
#

what example?

quasi stratus
#

An example Subscription that you updated and are not seeing tax

plush parcel
#

Here is subscription ID. User is subscribed as free PLAN sub_1MAGk6Lv5rdhLZWUCkzcRsMm

When upgrading plan from customer billing portal there is no way for tax

quasi stratus
#

That Subscription doesn't have automatic tax enabled on creation, no?

#

Ah I may have not stated that clearly above.

#

Can you try setting automatic_tax enabled when you create the Sub and then update via the Customer Portal

#

My understanding is then it should take auto tax into account when updated

plush parcel
#

Yes.

Stripe::Subscription.create({
customer: {{customer_ID}},
items: [
{price: '{{PRICE_ID}}'},
]
})

Because customer is created without address, if I pass automatic tax enabled true in above it wont create subscription and says

Stripe::InvalidRequestError: The customer xxxxxxxxxxx location isn't recognized by the tax engine. Set an address on the customer object and verify with the tax[automatic_tax] status.

quasi stratus
#

Ah I see that is what you were discussing above

#

Yeah you will need to address up front in order to handle auto tax here if you are allowing for the Customer to update the Sub via the Customer Portal.

#

There is no way for the Customer to "tick auto tax on" via the Customer Portal

plush parcel
#

For free plan customer is created without checkout session so no way to capture address.

quasi stratus
#

Yeah you would want to capture the customer address outside of the Checkout Session then.

plush parcel
#

I have enabled automatic tax for subscription

#

sub_1MAGk6Lv5rdhLZWUCkzcRsMm

#

but in billing portal to update plan gone away

#

you need portal id?

quasi stratus
#

One sec

#

So I'd assume the reason for that is laid out here: https://stripe.com/docs/customer-management/get-started#limitations

Customers can’t modify a subscription if the new modified price has a different tax behavior than the initial price. Learn more about the tax_behavior parameter and how it relates to subscriptions.

Have you checked on that for your Plans/Prices?

plush parcel
#

I have updated subscription.

All the products prices has tax behaviour exclusive behaviour

#

what should I check in prices for all prodcts?

quasi stratus
#

Hmm if tax behavior is the same then it should be fine

#

So you are no longer seeing any ability to update via the Customer Portal for that Sub once auto tax is enabled?

plush parcel
#

Update plan option goes away from free plan... it shows only cancel.

quasi stratus
#

Can you give me the Sub you are testing with?

plush parcel
#

sub_1MAGk6Lv5rdhLZWUCkzcRsMm

wet karma
#

Hello! I'm taking over and catching up...

#

Is that expected?

plush parcel
#

I have enabled

wet karma
#

It's not enabled. Look at the response to that request. It explicitly says automatic_tax is not enabled, and there's nothing in the request where you enable it.

plush parcel
#

enabled it again

#

Stripe::Subscription:0x2637c id=sub_1MAGk6Lv5rdhLZWUCkzcRsMm> JSON: {
"id": "sub_1MAGk6Lv5rdhLZWUCkzcRsMm",
"object": "subscription",
"application": null,
"application_fee_percent": null,
"automatic_tax": {"enabled":true},
"billing_cycle_anchor": 1669916414,
"billing_thresholds": null,
"cancel_at": null,
"cancel_at_period_end": false,
"canceled_at": null,
"collection_method": "charge_automatically",
"created": 1669916414,
"currency": "usd",
"current_period_end": 1672594814,
"current_period_start": 1669916414,
"customer": "cus_Mu4tPjq8y5jhmC",
"days_until_due": null,
"default_payment_method": null,
"default_source": null,
"default_tax_rates": [

#

this is response from stripe

wet karma
#

Okay, but why did you not enable it when you created the Subscription?

plush parcel
#

Because customer is created without address /card details without checkout session, if I pass automatic tax enabled true in subscription create it wont create subscription and says

Stripe::InvalidRequestError: The customer xxxxxxxxxxx location isn't recognized by the tax engine. Set an address on the customer object and verify with the tax[automatic_tax] status.

#

hence i enabled after that

#

Stripe::Subscription.update(
'sub_1MAGk6Lv5rdhLZWUCkzcRsMm',
automatic_tax: { enabled: true }
)

wet karma
#

So after enabling automatic tax does it work as expected, or no?

plush parcel
#

nah. billing portal only shows free plan with cancel option

#

no update button, it goes away

wet karma
#

When you say it goes away what do you mean? It was there before?

plush parcel
#

yes

wet karma
#

When was it there? Before you enabled automatic tax?

plush parcel
#

yes

wet karma
#

Ah, sorry, I missed your reply earlier. If you create the Subscription with automatic tax enabled at the beginning do you see the same issue?

plush parcel
#

At beginning I can't because user is created without address. Since we only know email and name during signup ...for free plan there is no checkout page

#

creating subscription from backend in using above

#

if I pass automatic_tax: { enabled: true } it will give error

Stripe::InvalidRequestError: The customer xxxxxxxxxxx location isn't recognized by the tax engine. Set an address on the customer object and verify with the tax[automatic_tax] status.

left mango
#

You'll have to collect the address up front prior to the checkout session unfortunately

plush parcel
#

ok. Is there an option to show all products to user on checkout page to select one and pay ?

upper trellis
#

No, you cannot display a "catalog" of products, that's something you'd build in your applicaiton

plush parcel
#

But can I switch from year plan to month plan on checkout page and vice versa

upper trellis
#

Yes! there is support for that kind of upsell, see here:

#

You do have the option of configuring a monthly<>annual upsell to let customer switch, see the docs for a preview

plush parcel
#

And from annual to monthly?

upper trellis
#

THey can switch back and forth