#Constant

1 messages · Page 1 of 1 (latest)

tawny abyssBOT
fast notch
#

Hi there!

#

What do you mean by "with only a payment intent"?

storm stump
#

Hi Soma!

I'm creating a paymentIntent in a cloud function that is associated with transfers. I then need to make the payment for that intent. I would prefer to create a checkoutSession and just return the url to the client.

fast notch
#

Checkout Session will automatically create a PaymentIntent for you. So:

  • You create a Checkout Session for whatever amount you need
  • You get a URL that you send your customer
  • If they pay, you'll end up with a PaymentIntent in a succeeded status
storm stump
#

Is it possible to create transfers within the checkout session? As I understand you can only do that with the paymentIntent

fast notch
#

What do you mean by transfer? A transfer is to send money between Stripe accounts. And this has nothing to do with Checkout Session.

storm stump
#

My use case is as follows. A Manager needs to pay his workers for today, they all have connect accounts. The transfer is for all the accounts he needs to pay. Does that make sense?

#

I'm trying to pay multiple connect accounts with one payment.

fast notch
storm stump
#

Ah okay. So the user would pay us, then we would pay the connect accounts via transfers?

fast notch
storm stump
#

Perfect! Thank you.

#

Sorry last question. Does the checkoutSession need to have the same transfer_group as the transfers?

fast notch
storm stump
#

Thank you!

#

The source_transaction, what should that be from the checkout session?

fast notch
#

The Checkout Session will have a PaymentIntent, and the PaymentIntent will have a Charge. The source_transaction is the Charge ID.

storm stump
#

Perfect. Just to double check. I create the CheckoutSession with the total that needs to be paid, then just after that I create the transfers with the Charge Id. Then I return the Checkout Session's url. The customer then pays, and once the payment is successful, the transfers automatically gets made. And I can do all this in one function?

#

Really appreciate your help!

fast notch
#

No, the order is wrong:

#
  1. You create the Checkout Session
  2. You send the URL to the user
  3. And only after they completed the payment you create the transfer
storm stump
#

Is the transfers then created via a webhook?

fast notch
#

The simplest way to do 3. is to listen to the checkout.session.completed webhook event to create the transfer.

storm stump
#

Great, and that would be on the platform account, not the connect account right?

fast notch
#

Yes