#cornonthecob
1 messages · Page 1 of 1 (latest)
Updating a subscription is possible with Customers can switch plans: https://dashboard.stripe.com/test/settings/billing/portal
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
yes the problem is that when i toggle this on it still doesnt work
the option to upgrade plan does not appear
ive also looked at the list of limitations as specified in the documentation and I dont think it applies to me
so im wondering if you could help in some way
Can you share your account ID, so that I can take a closer look at how your customer portal configuration is set up? You can find your account ID by logging in to https://dashboard.stripe.com/settings/account. It'll be in the upper right hand corner and looks like acct_123
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
And also an example customer portal link?
hmm ive done it through code
shoudl i give you the code snippet
acct_1NUdiAGJK35igdoB
the products im using are :
- oyster black card subscription
- oyster white card subscription
i want them to be able to switch between the two of them
in stripe dashboard it looks fine so im not suer why its not showing up
Can you share the customer portal link that the update option doesn't show? The configuration looks fine to me
this is the test user
but either way it should still show it right
if (product_id == current_app.config["WHITE_CARD_SUBSCRIPTION"]):
session = stripe.checkout.Session.create(
customer=stripe_customer_id,
line_items=[{
'price': product_id,
'quantity': 1,
},
{
'price': current_app.config["WHITE_CARD_SIGN_UP_FEE"],
'quantity': 1
}],
mode='subscription',
success_url=f'{current_app.config["WEBSITE_URL"]}/user/stripe/success',
cancel_url=f'{current_app.config["WEBSITE_URL"]}/user/stripe/cancel',
consent_collection={"terms_of_service": "required"},
custom_text={
"terms_of_service_acceptance": {
"message": "I agree to the [Terms of Service](https://www.ostudy.org/termsOfService)"
},
},
allow_promotion_codes=True,
payment_method_collection="always",
)
This is the code snippet
do i need to specify any other options
What's the cus_xxx ID you're passing?
its the user that gets created when they go to the checkout session
I know that, but what's the actual ID in the example where it's not working?
oh right let me check
I suspect they have a subscription that is incompatible with the portal: https://docs.stripe.com/customer-management#customer-portal-limitations
cus_PUgajyAjTKvWZ7
this is the test user
the subscription is just a simple subscription
It's currently controlled by a schedule, and those aren't supported in portal today as per the link
That's why they can't update via portal (only cancel)
what is the schedule?
is my checkout session code to create the subscription wrong then?
i havent created any schedule at all
You created a schedule for the subscription here: https://dashboard.stripe.com/test/logs/req_cZ4Xn4jNXRciRq
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
After the subscription was created via Checkout
okay sorry can you check this live user then
i dont think there should be a schedule for them
cus_PW4lurCb7J3yyU
okay maybe there is....why is it creating a subscription schedule?
how can i change my product to not do this
Ok, there's no schedule attached to their subscription
Why is what? Your integration made that API request, not us. Only you can answer that
yes but im just following the stripe documentation which is just using this code
and i havent specified any subscription schedules anywhere
only a subscription
unless a schedule is created by default
It isn't, no
Look at the API request again. Clearly it's initiated by your secret key so something in your code is making that request
wait so for this user you said there is no subscription schedule...so shouldnt this one be working then?
Yep, likely something else preventing it. As per the docs, many limitations. Are you creating these portal sessions via the API? Or just using the no-code flow?
im using the stripe API
portal_configuration = stripe.billing_portal.Configuration.create(
features={
"customer_update": {
"allowed_updates": ["email", "phone"],
"enabled": True
},
"invoice_history": {
"enabled": True
},
"payment_method_update": {
"enabled": True
},
"subscription_cancel": {
"enabled": True,
"mode": "at_period_end"
}
},
business_profile={
"headline": "manage your oyster subscription here"
}
)
Can you share the bps_xxx ID of the session from what screenshot?
would it be the configurations i need to change?
Oh yeah, you're missing subscription_update: https://docs.stripe.com/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Looking at this example: https://dashboard.stripe.com/logs/req_Bj0uGwFos1rZrG
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
It uses bpc_1OmYMMGJK35igdoBxAWxfKF0 which is a configuration, and it doesn't have subscription_update enabled. So seems expected
ohhh silly me let me try this
It looks like you setup the portal configuration on the Dashboard to work as you need?
If that's right, then just omit the configuration parameter when you create your session and it'll use the default Dashboard configuration
oh really? Okay, ill try that since it sounds easier
The configuration parameter just allows you to override that where required
okay that seemed to work! thank you so much !
worked perfectly when i got rid of the config
Awesome!
thanks for the help:)