#erikvm-customer_portal
1 messages · Page 1 of 1 (latest)
Thanks!
I did some tests on my end, and I can see the "add promotion code" on the customer portal when trying to update one of my subscription plan.
Where exactly are you expecting to add the promo code ?
The "add promotion code" button?
Yeah, I get nothing..
Doesn't work for an active subscription either
Is promo codes only applicable when you change the subscription plan or something?
Can you send me the snippet of code where you create your checkout Session?
Are you setting allow_promotion_codes to true when creating the Session?
[note that your screenshot is Checkout, which is not the Customer Portal(that was Soma's screenshot), they are different products and you configure promo codes for them in different ways.]
And on that note, have you set the "Allow Customers to provide promotional codes" setting from your dashboard? https://dashboard.stripe.com/settings/billing/portal
Yes
Yes I got that checked
And:
@civic escarp - the session snippet looks as following (django)
@csrf_exempt
def manage_billing(request):
session = stripe.billing_portal.Session.create(customer=customer, return_url=domain_url)
return JsonResponse(session["url"], safe=False)
And then I pass that to the frontend
Thanks, looking in to how why that might not be working
I am seeing it with that same config
Have you been going all the way to the "Confirm your new plan" page?
Hmm
I never get to that page though
But as @raven raven mentioned - are we doing two different things?
My screenshot is from the customer portal
Karlleko, it seems like I am indeed in the customer portal?
Not sure what Karlleko was referring to
That screenshot very much looks like Checkout. How did you get to that page from the customer portal?
Through my webapp, with
session = stripe.billing_portal.Session.create(customer=customer, return_url=domain_url)
I also tried hitting the "Preview" button in the stripe dashboard, and still nothing
And the screenshot you shared was the landing page from that URL?
Correct
But what's strange is that your landing page looks different than mine
It looks like you're doing a "change"?
Not a new subscription
It should not be. The landing page should look like this. That screenshot is definitely the checkout landing page.
What does your "pay with card" page look like
When you subscribe to a total new product
I don't see a field where you fill in all the billing details..
It looks like soma's. But also new subscriptions cannot be created from the customer portal so I'm a but confused
Are you sure that snippet of code that you sent is being hit here?
Can you DM me a link that that generates?
Interesting, that is a Checkout link. Customer portal should start with billing.stripe.com
Do you have the API request ID (req_123) from when you created that link?
Looks like it was this https://dashboard.stripe.com/test/logs/req_Pf2iJzb3wKPkBb
I DM'd you
Once a subscription is live - youre correct - there is a billing.stripe.com URL
That second link is a customer portal link. It looks like the calls or URLs may be getting mixed up somewhere
Ah, so you are saying your code does a check for whether they have a subscription or not?
Well, nevermind that, I think it might be irrelevant
What's weird is that I don't see the promo code even though I have that checkbox checked
So it looks like you create a Checkout Session if so and a Billing Portal if not.
Yes basically
First a checkout session -> customer fills in their details -> subscription is activated -> now they can access their customer portal to cancel their plan
So the last URL I sent you, Pompey, thats the correct url, right?
that checkbox is only for the Billing Portal, which you're not using for the 'new subscription' flow, you use Checkout for that
for Checkout you enable promo codes a different way, it doesn't use that setting
I don't disagree, it is confusing
you're using Checkout and the Billing Portal. They are separate things but related
that ^^
i.e in the call to stripe.checkout.session.create in your "new subscription" flow ; https://stripe.com/docs/api/checkout/sessions/create?lang=python#create_checkout_session-allow_promotion_codes
Excellent, glad we were able to get you sorted out here! Let me know if you have any other questions 🙂