#Satya
1 messages · Page 1 of 1 (latest)
Hi there!
Is the code above working? And you want to convert that in Node.js?
the API is working but i want to send it through the java script
is it possibel
I have created a stripe check out page
i want to use to that API from the javascript
If you want to create a subscription with Stripe, it has to be done from your backend code (and not the frontend code). So you can't create a subscription with plain JavaScript, but you can in Node.js. You can see an example of this here: https://stripe.com/docs/api/subscriptions/create?lang=node
But from javascript i can able to do the subscription
but this is static price
I want to do dynamic means customer entered price
by checkout page i did this code
Oh, you are using Checkout client-only integration? Note that this is an old integration that we don't recommend using.
But yes it's possible to create subscriptions with this, as mentioned here https://stripe.com/docs/payments/checkout/client-subscription
But I don't thing this integration supports setting the price dynamically directly from the frontend.
As you can see here you need to pass a price ID (and not an amount): https://stripe.com/docs/js/deprecated/redirect_to_checkout#stripe_checkout_redirect_to_checkout-options-lineItems-price
And it makes sense, otherwise your visitors would have been able to directly change the price of the subscription.