#sejo
1 messages · Page 1 of 1 (latest)
Hello! What's your question?
Hello, I want to know if I should only implement the code on the front side or also on the back side
It depends on what you're integration - which of stripe's products are you using? Checkout? Payment Links? Payment Element?
Or could you send me a documentation? explain it to me well I have searched but I have not understood it at all
So you haven't decided which of Stripe's products you're using yet
erm I'm using a recurring product that is a subscription
Yes, but that can be done with any of the things I mentioned - but it sounds like you haven't decided which of those to use yet so let me back up
I already have the subscription payment code implemented, but I must have a button to cancel the subscription
ahhh ok
Ah for making subscription cancellation button, then you have two options:
- you build this yourself (you'd need to write both front end and backend code for this)
- or you use the customer portal (https://stripe.com/docs/no-code/customer-portal) to redirect your customers to a stripe-hosted site where they can cancel the subscription from there
Alright! I understand but that address that you gave me does not lead me to the code that I must implement both on the front and on the back side
Which of the two options are you doing? Your own button, or the stripe hosted one?
I chose to do the code on both the front and back sides
Gotcha - then we don't have a guide for doing this. Generally, the flow would be that you have a button on your site (that'd be the frontend code) and when that button is clicked it hits your server which makes the request to stripe tocancel the subscription
ahh well I opt for the option you are telling me
but what would be the steps to follow to implement this button
I just told you the general flow for what you'd do if you wanted to implement your own button for cancellation - can you clarify what about that didn't make sense?
If I understand the button, I would create it, but what does it point to? I mean, where am I sending the information, I don't know how it works if I didn't see any code of how the flow would be
Clicking the button would make a request to your own server and your server would make a request to stripe to cancel the subscription (https://stripe.com/docs/api/subscriptions/cancel)
is this code correct?
just to know if I would already implement it, it is what I was looking for
Yes, that doc links to the same API I already sent you https://stripe.com/docs/api/subscriptions/cancel
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.