#erikvm-customer_portal

1 messages · Page 1 of 1 (latest)

tough timber
#

Hi @pearl hill! I'm looking into this, please give me a few minutes.

pearl hill
#

Thanks!

tough timber
#

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 ?

pearl hill
#

Thats exactly what I tried as well

#

Not getting that button there though

civic escarp
#

The "add promotion code" button?

pearl hill
#

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?

civic escarp
#

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?

raven raven
#

[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.]

pearl hill
#

Yeah you're right

#

Does promo codes work for subscriptions?

civic escarp
#

Yes

pearl hill
#

Yes I got that checked

#

@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

civic escarp
#

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?

pearl hill
#

Hmm

#

I never get to that page though

#

But as @raven raven mentioned - are we doing two different things?

civic escarp
#

My screenshot is from the customer portal

pearl hill
#

Karlleko, it seems like I am indeed in the customer portal?

#

Not sure what Karlleko was referring to

civic escarp
#

That screenshot very much looks like Checkout. How did you get to that page from the customer portal?

pearl hill
#

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

civic escarp
#

And the screenshot you shared was the landing page from that URL?

pearl hill
#

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

civic escarp
#

It should not be. The landing page should look like this. That screenshot is definitely the checkout landing page.

pearl hill
#

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..

civic escarp
#

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?

pearl hill
#

I am super confused. This is the landing page that it gets to:

#

Yepp, DM'd you

civic escarp
#

Do you have the API request ID (req_123) from when you created that link?

pearl hill
#

I DM'd you

civic escarp
#

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?

pearl hill
#

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

civic escarp
#

So it looks like you create a Checkout Session if so and a Billing Portal if not.

pearl hill
#

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?

raven raven
#

for Checkout you enable promo codes a different way, it doesn't use that setting

pearl hill
#

See, this is the confusing part

#

What am I using? I'm using checkout?

raven raven
#

I don't disagree, it is confusing

#

you're using Checkout and the Billing Portal. They are separate things but related

pearl hill
#

Okay, what should I do next?

#

Do allow users to apply a promo code

pearl hill
#

Awesome, that was what I was looking for

#

Thanks for your help!

dire hill
#

Excellent, glad we were able to get you sorted out here! Let me know if you have any other questions 🙂