#praful0512
1 messages · Page 1 of 1 (latest)
Hello praful0512, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
• praful0512, 0 days ago, 15 messages
• praful0512, 4 days ago, 15 messages
Hello, can you send me the ID of the Checkout Session tha tyou are seeing this on?
cs_test_b1lJhcU8sOfBw7lu5yYJgFMJzsjRHGvhNcKteDgUVnEzFQ44fL5uXzI1XA
hi, are you there?
Yes but the server is very busy
Typically on this server there will be a bit of a wait for responses when it is busy
okay thanks..
Unfortunately I am having trouble looking up that Checkout Session
Can you send me your code for how you create this session and how you are trying to get the client secret?
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.stripe.com//v1/checkout/sessions',
'headers': {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Bearer token'
},
form: {
'cancel_url': 'https://example.com',
'success_url': 'https://example.com',
'customer_email': 'Beduggerr+12@gmail.com',
'line_items[0][price]': 'price_1NpUa5SFSc1Kz6ix2vN9BTu3',
'line_items[0][quantity]': '1',
'line_items[1][price]': 'price_1NpUU7SFSc1Kz6ix7E8qkBis',
'line_items[1][quantity]': '1',
'mode': 'subscription'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Ah, in subscription mode checkout does not immediately create a subscription so there is no client secret immediately as far as I know
Taking a step back, can you tell me more about what you are trying to do here? Are you integrating with the embedded checkout element? Or do you need the client secret for something else?
like we are trying to create a payment platform in react native using stripe platform but in react native sdk there is no privelege for checkout session so we are trying to creating checkiut session through backend apis for that we need to create the client secret so that through webhook we can update our internal db
👋 I see you're trying to use Checkout with React Native. Are you using WebViews to render the checkout session?
Just trying to make sure I understand your usecase
Aside from that, have you looked at some of our native components on React Native like Mobile Payment Element to see if that fits your usecase?
https://stripe.com/docs/payments/accept-a-payment?platform=react-native
yeah i'm trying to use webview to render checkout session
yeah i had already explored the documentation link you just provided but it doesn't meet our usecase..can you help to resolve the client secret issue
As my colleague already mentioned, we don't generate client-secret until the subscription has been created and the invoice has been finalized.
Which happens after checkout session is completed. So there's no way for you to get this info at creation time.
Why is it important to update the DB at creation time? Can you elaborate?
Like in db we update it at time of success
Then how can we integrate the checkout session in react native sdk
If you've integrated checkout sessions on web then it's no different on React Native SDK
Like in db we update it at time of success
Okay so all you need is to listen forcheckout.sessions.completedevent in that case and update your DB when you receive that event
We explain that here
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=stripe-hosted#provision-and-monitor
So in react native we need to follow the same steps we followed in web?
Correct. Since you're using a webview, there's nothing mobile specific you're doing really
Can you share the web related doc for it.. To check the steps
We don't have any docs for this as typically we see folks use mobile payment element with React Native
no for the web side for handdling checkout session