#ivobot-checkout-metadata
1 messages · Page 1 of 1 (latest)
you can use the client_reference_id property from the checkout session object when creating the checkout
ivobot-checkout-metadata
@vague shore you'll want to use our Metadata feature: https://stripe.com/docs/api/metadata. If you set the info inside the metadata on the Checkout Session then you will get that metadata back in checkout.session.completed Event which is what you should be listening to (and not payment_intent.succeeded)
Why? What's the difference?
Because I thought that user properly bought the product when payment_intetnt.succeeded
So use checkout.session.completed instead, it will have the metadata you need, you can look at the line items, etc.
But does checkout.session.completed trigger only when the checkout went successful or there are more options (like when the card was declined or sth)?
when it completes. I do recommend carefully reading the doc I linked you to. This explains how to do fulfillment and track what's ordered
Okay
But can you tell me whether it would be sufficient ( I mean the checkout session completed ) as far as you know in this case?
yes
This means that this event will NOT be triggered when the checkout is completed with a failure (transaction declined)?
correct since it's not completed, since it failed payment
okay. just wanted to be sure with the naming
thanks then, but I probably will need one more thread
No reason to open a new thread though, just ask here
Okay, then I have two questions:
2. I want to have two types of user: service providers and clients. Clients buy products that are executed by the service providers and when they do, some amount of money is added to their account. What simple solution I can provide in order for servicer providers to easily withdraw their fund to their e.g. bank accounts when they want it?
- I have no idea what this could even mean. What is "isQuick"? What does React have to do with it? If you use Stripe Checkout, you create a Session server-side with the right Price(s)
I'm really sorry, I don't get it at all even after reading 3 times
Sorry for confusion. Let's proceed with the second then.
Sorry I don't get the second part either. I am totally lost. What is a "service provider"?
This is just a user on my web app that provides some service for the clients who are also users on the web app.
But what's the goal? Are they getting paid for this? Are you using Connect?
you never mentioned that so I'm struggling to understand the context
I am pretty new to Stripe, so I do not use Connect nor do I know what precisely it is.
The client buys service, pays for it, the money is on my Stripe account, then when said service is provided by one of the service providers, their balance in my DB is increased and whenever they want I want them to be able to withdraw their funds. So I'm looking for something similar to solution I used for payments in order to process payouts for the service providers, like this:
stripe.checkout.sessions.create();
So I need some function or something that will accept i.e. the bank account number, amount of money and then execute the transfer to service provider's (user's) bank account.
Okay so you can't just "send money wherever". They are clear and extremely strict rules around funds flows and compliance around the world
We do support what you want though, and the product is called Stripe Connect: https://stripe.com/connect
So this is all doable and can be implemented if you build it yes but you'll have to start by carefully reading the docs for our Connect product: https://stripe.com/docs/connect
Okay
There are some high level questions first like what type of account will you use (depends on your business, your risk appetite, the countries you want to support, etc.) and then you can choose the right flow of funds (like are you even allowed to hold those funds yourself legally?)
Once you answer those questions, the rest is fairly straightforward
But the service providers need to register on the Stripe Connect first, right?
For simplification let's say I want to make an Uber app (because from Stripe's point it will be pretty similar; the service is completely different tho).
Is it ok?
yes
https://stripe.com/docs/connect/collect-then-transfer-guide is the best doc to start with
So is my session.checkout code useless now or is it still relevant? (for payments, not payouts)
It's still relevant, read that guide carefully it walks you through the whole logic
Is it correct?
yes