#Ninja man

1 messages · Page 1 of 1 (latest)

late quiverBOT
slow pumice
#

Hi there

#

That is all possible.

#

In case any of those come into play with the types of Subscriptions you are creating

#

But overall, what you are describing is totally possible with Checkout + Customer Portal

marble wyvern
#

So what my issue is:

If a customer today start to subscribe to productX, then tomorrow the customer starts to subscribe to productY.

Then in the customer portal ONLY productY will be visable as i never passed in any checkout session id etc....

slow pumice
#

Nope that's not how that works. Customer Portal will show multiple Subscriptions. You never have to pass a Checkout Session ID to the Customer Portal.

marble wyvern
#

Hmm

So how would stripe know that once the customer start to subscribe on productY, that the customer also subscribes to productX ?

hearty tendon
#

Hi 👋

I'm stepping in for @slow pumice . The Customer Portal is aware of the active subscriptions for that Customer.

#

I would recommend building a quick test integration to see how it behaves.

marble wyvern
#

I did that and it did not include the prevoius subcription.

#

So basically i create the checkout like this:

#

So once i create another checkout for productY, how would the customer portal remember productX?

hearty tendon
#

Screenshots of the code aren't really helpful at this point. Can you share a Customer Portal session ID?

marble wyvern
#

Actually check this out, i already discussed about all this already: #1020005106491609188 message

The reason i get back to this issue, is becuase i wonder if there is another solution than storing the users Customer ID

hearty tendon
#

A Customer Portal needs to be instantiated with a Customer ID. How are you creating one without it?

marble wyvern
#

Like this:

hearty tendon
#

That's a checkout session. You said earlier you were talking about the Customer Portal

marble wyvern
#

Yeah, to be able to have multiple of active subscriptions in the customer portal, don't i need to pass in the Customer ID to the checkout session if the user already have a subscription?

This is the part where i want to skip storing the Customer Id somewhere

hearty tendon
#

It explains this in our docs:

If blank for Checkout Sessions in payment or subscription mode, Checkout will create a new Customer object based on information provided during the payment flow.

So by not setting the Customer ID in Checkout, you created a new Customer that was only subscribed to Product Y

marble wyvern
hearty tendon
#

No, we would need the Customer ID, that's why we say it that way in the docs. The pricing table will create a new customer as well.

marble wyvern
#

Ah well i guess i need to do that.. So how do i pass the Customer ID using the pricing table?

hearty tendon
#

The pricing table does not support using a Customer ID currently.

marble wyvern
#

hmm so then what happens if the same customer buys 2 things? how can we manage this?

hearty tendon
#

Checkout is still the best option in that case

#

Passing the Customer ID as part of the session

marble wyvern
#

ah well alright so:

must create my own pricing tables
must create an account for the user
must store the customer ID

Damn feels like quite alof of work hehe😅

hearty tendon
#

Okay here's an example of how you could do it without "storing" much data. If you collect the Customer's email as part of the Checkout session it will be included when the Customer is created. So you have your user enter their email as part of the HTML form before they get redirected to the Checkout Session. You then use the Customer List API to retrieve any existing Customer records with that email. https://stripe.com/docs/api/customers/list

If there are any, use that Customer ID when creating the Checkout Session & Customer Portal. If not, pass the email when creating the Session https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer_email

marble wyvern
#

So like this?:

Start your subscription -> enter your email -> check if email exists in Customer List API -> start the checkout session with the existing customer Customer ID

hearty tendon
#

Well don't you use the Checkout Session to start the Subscription? Or are you talking about the flow from your user's perspective?

marble wyvern
#

Yeah from user perspective

hearty tendon
#

Okay, as long as you created the Checkout Session with the Customer email if a Customer wasn't in the Customer List results then I think that would work

#

That's the first time the Customer gets created, so then when they come back later you can match them to the existing Customer record

marble wyvern
#

Okay, using this approach, wouldn't a small risk be someone that use another ones email for the checkout? I mean this could maybe be solved by a unique link being sent to the email? BUT that would interupt the funnel a bit tho..

hearty tendon
#

The only method I can think of that would guarantee a single person per Customer record would be to set up some sort of Authentication and Identity framework. But if you don't want to even store Customer IDs then I think the email approach is your best bet.

marble wyvern
#

yeah agree. The issue here isn't the authentication it self but the security if it.. as this client needs everything to be super secure and to make authentication super secure, you need proper server administarions, database security and so on.

#

Do you know about any DB+ Auth for Next JS that handles ALL security for this?

tepid iris
#

Hi, stepping in as snufkin is away. Can you share what DB+ means?

#

I see what you mean here, I'm afraid this is not a Stripe specific question and we won't be able to further assist. Let us know if you have any Stripe specific questions.