stripe-samples / checkout-single-subscription

Learn how to combine Checkout and Billing for fast subscription pages

Home Page:https://checkout.stripe.dev/?mode=subscription

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Subscription management

mytototo opened this issue · comments

Hi there,

Thanks for the demo. Do you have any demo with subscription management (and authentication ?) using the hosted checkout page?

@mytototo By subscription management do you mean updating a customer's card using Checkout? (like https://stripe.com/docs/payments/checkout/subscriptions/updating). And what do you mean by authentication?

@adreyfus-stripe Yes this is what I mean, but also being able to update a subscription. About the authentication : is it possible to create and update subscriptions without server-side authentication? For example with a simple token given to the customer.

Okay, we will add a task to our backlog on creating a sample of updating a subscription with Checkout.

You can create a subscription with Checkout without any server side code (if that's what you mean by server-side authentication) but you need to have a server + your server-side API key to update the existing subscription so you don't risk unauthorized manipulation of existing subscriptions on the client. Does that answer your question?

Thank you very much for your answer @adreyfus-stripe, this is exactly what I am looking for. Looking forward for the new sample.

@adreyfus-stripe Any update as to where this is at in your backlog?

Since this method automatically takes care of creating the customer, payment method and subscription, how can I get the customer and subscription IDs so that I can save them in my own database?

Also, as an aside, I noticed I never received an invoice when using this method. Is that because I'm using my testing api or is there something I need to do to make sure the customer will receive an invoice when using this method? Sorry if this is a newbie question, I just started using Stripe today.

Disregard my question. It appears that I cannot use Checkout because it doesn't support metered billing or coupons so I'll have to make a my own page.

@corey-mitchell Thanks for following up on your question! You're right, Checkout does not support metered billing or coupons at the time. We plan to roll out more samples as Checkout adds more features so stay tuned.

(also re: your question for not receiving an invoice, we do not automatically send emails for invoices in testmode but you can manually trigger one in testmode through the dashboard if you want)

@adreyfus-stripe thanks for the demo. I'm also wondering how it will be possible to manage the subscription.

I did read the documentation extensively but the part I'm getting stuck is the authentication part, which Stripe does not go into detail for the client side (stripe hosted) solution.

In addition, would it be possible to apply coupon code the to the checkout?

@bornResponsive Sorry for the delay, I was offline for a week. I would recommend going to our IRC channel for the fastest answers to your questions as they relate to your integration. https://webchat.freenode.net/ is a good web client for that, and you can access our channel at #stripe to chat with Stripe engineers 24/7.

I'm not sure exactly what you mean by "authentication part" if you're referring to card authentication (e.g. OTP or 3DS) then the stripe hosted Checkout page handles all that for you automatically! If you mean authenticating requests with your API keys, as shown in the code snippets here https://stripe.com/docs/payments/checkout/client

@adreyfus-stripe thanks for the response back.

No, I meant by how you can manage subscription. Reading along the self-serve documentation it states the following:

The self-serve portal is a secure, Stripe-hosted page that lets your customers manage their subscriptions and billing details.

However the integration reguires the following:

Next, add an endpoint that creates a portal session and redirects your customers. Make sure to authenticate customers on your site before creating sessions for them. To create a session, you need the customer’s ID and a return_url, which is required if a default return url isn’t set in the Dashboard configuration.

Therefore I was wondering if there is self-serve there solution for full hosted checkout solution as opposed to the current mix of client/server solution.

Ah I see. No, the billing subscription management page is only available as a client & server solution.

@adreyfus-stripe Are there any plans to bring the hosted-page portal to just client-side?

In case helpful, we've added some samples that show you how to use the customer portal with some authentication solutions: https://stripe.com/docs/billing/subscriptions/customer-portal#start-with-sample

I hope this is helpful. I'm going to close out this issue. Please reach out to our technical support chat on IRC for follow-up questions: https://webchat.freenode.net/#stripe :)