#raam-prices
1 messages · Page 1 of 1 (latest)
How do you integrate with Stripe currently?
Are you using Payment Intent or Checkout Session?
payment intent
Payment Intent doesn't support price and product. Could you share how your flow is like?
Or are you using subscription or invoices?
You can retrieve all prices and expand product field using Prices List Retrieval API:
- Prices List Retrieval API: https://stripe.com/docs/api/prices/list
- Expand
productfield: https://stripe.com/docs/api/expanding_objects
Then display the prices and products according to the response returned
raam-prices
i want to show all subscription plans and also in react app,so i want to use those two api calls,and also want to create payment intent while choosing a plan for subscription.
Yup, above suggestion should work. It will list all the prices and their corresponding product details. You can then use the response to display in your frontend for your customer to choose
but i want to get the subscription id too in the frontend @rotund kayak
Subscription ID is only created after the customer chooses the price. Why do you want to display the subscription ID?
yeah,eaxctly that you said,i want to get the subscription id while choosing the price @rotund kayak
After the subscription is created, it'll return subscription ID: https://stripe.com/docs/api/subscriptions/create
So the flow will be like:
- Display prices and the product details from the response of List Prices API
- Customer chooses the price
- Create the subscription based on Step 3 and subscription ID will be returned
- Display subscription ID from Step 3
ok @rotund kayak i will work on it ,thanks for your help @rotund kayak
Stepping in for river. Let me know if you need further help!
some products are getting the default_price field as null?is there any reason for this @orchid path
Simply because it doesn't have a Price? or have but no Price is marked as default
Sure
while creating a payment intent fro subscription in a page where we can enter all the card details and while clicking the subscribe button,what will happen,is there any sample project with react and node js for my scenario
i need what will happen when the subscribe button was clicked
Are you the one implementing that page? Or are you referring to a specific page?
I think the error is quite clear that you need to call useStripe() in an Elements provider
Which Doc are you following?
It's important that on the example here, CheckoutForm which is using useStripe() , is nested under Elements
This part
return (
<div className="App">
{clientSecret && (
<Elements options={options} stripe={stripePromise}>
<CheckoutForm />
</Elements>
)}
</div>
);
so thank full @orchid path