#renraj-server-side-subscription
1 messages ยท Page 1 of 1 (latest)
Hi
So what I have to do from API side to make that payment, when they click on "Pay Now" button ? How I can confirm this payment from API side?
If the customer already did the payment, what you mean by confirm the payment from API side?
The recommended Subscription integration is to follow this guide:
https://stripe.com/docs/billing/subscriptions/build-subscriptions
Hi ... I mean after customer entered the CC details and click "Pay now" button, what all steps we need to make that payment to confirm. As per our design, frontend team will make an API call to confirm that payment. Is it okay to send back the SubscriptionId,clientSecret and token(based on CC details)?
frontend team will make an API call to confirm that payment
They need the Subscription client_Secret in order to confirm the payment. I think the official guide covers your use case:
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
try following it step by step.
Yes we followed the same link upto Step 5. We use backend as C#, created Susbcription and returned ClientSecret to FrontenedTeam. They customised the Stripe CC page using the client_secret. Now the next step is, once teh customer enters teh CC details, instaed of confirm the payment from Frontend, how we can do the same from c# backend ?
No you can't confirm the payment from backend following that guide. If you want to create a Subscription from the backend 100%, you need to first collect the PaymentMethod (e.g. using SetupIntents) and then create the Subscription in the backend using that PaymentMethod Id.
Is there any link to follow that?
Here we are facing issue is that, Frontend team needs client_secret, to get stripe theme related to CC entering detail page. So due to that backend team, creates a subscription(which is incomplete as there is no payment done so far) based on Product they chose and give the client_secret to get the theme. After that only user, enters CC details and click "Pay now". That "Pay now", we need to do the confirmation from c# backendside
Her is a link to collect PaymentMethod using SetupIntents:
https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements
then when you create the Subscritpion, you pass the payment method Id (previously collected) as a default payment method:
https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method
No further action is required on the frontend
not sure whether u have seen this message. I am reposting
Here we are facing issue is that, Frontend team needs client_secret, to get stripe theme related to CC entering detail page. So due to that backend team, creates a subscription(which is incomplete as there is no payment done so far) based on Product they chose and give the client_secret to get the theme. After that only user, enters CC details and click "Pay now". That "Pay now", we need to do the confirmation from c# backendside
yes saw that,
we need to do the confirmation from c# backendside
When using SetupIntent, you've already collected the PaymentMethods, so here in the backend you create the Susbcritpion with the PaymentMethods Id as default payment method
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
Hi
Is that the client_secret, we get while creating SetupIntents, can use to get Stripe themes for FrontendTeam?
I'm not sure I follow, would you mind elaborating?
This is the message
Here we are facing issue is that, Frontend team needs client_secret, to get stripe theme related to CC entering detail page. So due to that backend team, creates a subscription(which is incomplete as there is no payment done so far) based on Product they chose and give the client_secret to get the theme. After that only user, enters CC details and click "Pay now". That "Pay now", we need to do the confirmation from c# backendside
Here support staff asked me to create SetupIntent first and later Subscription. So my question will I get some client_secret after SetupIntent, so my frontend team can use that for getting theme
Here support staff asked me to create SetupIntent first and later Subscription. So my question will I get some client_secret after SetupIntent, so my frontend team can use that for getting theme
I disagree with this approach
you don't need to confirm the payment from the backend
once the details are collected from the frontend Stripe will automatically collect the payment for the Subscription's first Invoice
you don't need an extra step for that
yes we followed the link https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
upto step 5. But after that once user enters details, only frontend team can confirm the payment. Instead of that in "Pay now" button, can we do some thing from C# backend sid eto make it confirm
Instaed of doing this from frontend, Is there anyway make this design completely handle via c#backend
you haven't answered my question, why do you need it to be a backend confirmation?
As per our previous design, we havn't used any theme for the CC card page. So from that "Paynow" button, the backend team is completely handling stripe related things. Now as per new design, we need to setup the stripe theme in the CC page, so we create the subscription(as incomplete since user didn't entered the CC details) first to get client_secret" and given to frontend and later on "Pay now", we have seen client side command to confirm payment. But just asking anyothere way to make that too via c#backend.
Hi there ๐ jumping in as my teammate needed to step away. I'm working on reviewing the thread and building context, but if there is an outstanding question that I can address then please let me know.
Hi ..please go through and let me know
Alright, am I right in understanding that you want a flow which handles payment confirmation server-side, rather than client-side?
If so, this is the guide that you want to be following:
https://stripe.com/docs/payments/finalize-payments-on-the-server?platform=web&type=subscription
renraj-server-side-subscription
Hi tobby
We followed https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
upto step 5. Now frontend got client_secret and they customized the page using Stripe theme. So now only the user enters the CC details and click on "pay now" button. From the link I can see that frontend team need to follow step 6 .
Is there any option to do the Stripe related things from c#backend side once user enters CC details as we have SubscriptionId and clientSecret can pass to c#backend ?
Yes, you can confirm the associated intent server-side, to do so you will follow the guide that I provided instead of the one you're referencing that uses client-side confirmation.
But in that I couldn't see a way to get client_secret before entering CC details or confirm subscription. We need that secret to customise the theme of that page
You don't need a client secret to customize the theme of the Payment Element, that is done via the Appearance API and can be done without first creating a Subscription. The last piece of sample code in Step 3 has a placeholder for where you can pass your appearance settings.
I checked https://stripe.com/docs/elements/appearance-api
// Pass the appearance object to the Elements instance
const elements = stripe.elements({clientSecret, appearance});
what is the clientSecret here ?
how we can get that clientSecret ?
You won't use that method, you'll use the one that doesn't require a client secret.
https://stripe.com/docs/js/elements_object/create_without_intent
This is the sample code snippet I'm referring to from the linked doc:
Thank you Tobby... let me check that with my team. thank you for your understanding. Really appreciable
Any time!