#ivobot-checkout-metadata

1 messages · Page 1 of 1 (latest)

hollow reefBOT
snow marten
#

you can use the client_reference_id property from the checkout session object when creating the checkout

sly linden
#

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)

vague shore
#

Why? What's the difference?

#

Because I thought that user properly bought the product when payment_intetnt.succeeded

sly linden
#

So use checkout.session.completed instead, it will have the metadata you need, you can look at the line items, etc.

vague shore
#

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)?

sly linden
#

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

vague shore
#

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?

sly linden
#

yes

vague shore
#

This means that this event will NOT be triggered when the checkout is completed with a failure (transaction declined)?

sly linden
#

correct since it's not completed, since it failed payment

vague shore
#

okay. just wanted to be sure with the naming

#

thanks then, but I probably will need one more thread

sly linden
#

No reason to open a new thread though, just ask here

vague shore
#

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?

sly linden
#
  1. 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

vague shore
#

Sorry for confusion. Let's proceed with the second then.

sly linden
#

Sorry I don't get the second part either. I am totally lost. What is a "service provider"?

vague shore
#

This is just a user on my web app that provides some service for the clients who are also users on the web app.

sly linden
#

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

vague shore
#

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.

sly linden
#

Okay so you can't just "send money wherever". They are clear and extremely strict rules around funds flows and compliance around the world

#

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

vague shore
#

Okay

sly linden
#

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

vague shore
#

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?

sly linden
#

yes

vague shore
#

So is my session.checkout code useless now or is it still relevant? (for payments, not payouts)

sly linden
#

It's still relevant, read that guide carefully it walks you through the whole logic

sly linden
#

yes