#nakasho

1 messages · Page 1 of 1 (latest)

serene lagoonBOT
iron otter
#

Hello again 👋

#

If you want to perform separate charges and transfers, you'd omit the transfer/destination details you shared yesterday and instead create the transfers after the payment succeeded

sly brook
#

Long time no see.
I made the payment settlement.
I also made a program for remittance.
How else can I tell the remittance to send money?

#

Once the payment is completed, the transfer should be made automatically.

iron otter
#

OK, and what are you stuck on now after the guidance yesterday? Did you resolve the issue with your connected accounts have missing required information?

#

You likely will want to remove the transfer_data you configure during the session creation and use two transfers instead

sly brook
#

The program of submissions is under application.
I asked another Deb support and it turns out that my program is wrong.
I am working on that issue now until the application is complete.

I see, so you don't need Transfer_data.
I want to use another Transfer. Is that possible?

iron otter
#

Yes, you asked about separate charges and transfers - that's what you'd use here

#

So can you please be precise about what calls or API requests are not doing what you expect?

sly brook
#

Yes, we are challenging that documentation.
However, I was told that it must be combined with a payment.

#

I understand that I can't put Transfer in payment_intent_data: {} in Session.
Can I run a function in the Session function that executes two Transfers that I created separately once the payment is completed?
Or is there an argument in the Stripe API that allows me to execute my own function once the payment is complete?

#

The API call is successful.
Now I just need to call the Trasfers I created according to the documentation.
Once the payment is made, we want to transfer the money. Automatic.

iron otter
#

Can I run a function in the Session function that executes two Transfers that I created separately once the payment is completed?
Nothing will do this automatically, you'd need to write the code to make the transfers

#

Or is there an argument in the Stripe API that allows me to execute my own function once the payment is complete?
Yes, you'd use webhooks to listen for checkout.session.completed events then initiate your transfers following that signal

#

Once the payment is made, we want to transfer the money. Automatic.
You can only do that if it's for a single destination account as you've configure with the transfer data. FOr multiple destination accounts to share the payment you need to build that.

#

What part of your code is not working?

sly brook
#

What does it mean that if I want to share a payment with multiple payee accounts, I need to build it?
I mean how to create Trasfers as shown in the second screenshot, right?

#

Using destination, the money was successfully transferred to the instructor's stripe bank account.
What didn't work with the code is that I need to transfer the money to multiple bank accounts.

If that is the case, is it common practice to use that webhooks you are talking about?

#

In addition to using "checkout.session.completed", I heard that there is another way using "Transfers_group".
Which is the correct one to use?

Also, can "Transfers_group" be used in conjunction with Session as shown in my first screenshot?

iron otter
#

Yes, those are not mutually exclusive. The webhook is how you'd know to create the transfers.

#

You can create a second transfer after the destination payment, but you'll need available funds for that

#

You won't be able to do that with a manual transfer after a destination charge -- you must create both transfers yourself

#

But if you have available funds to use, then that's fine

frigid wigeon
#

I'll mention the "Transfer_Group" is essentially just a label for a particular collection of funds (paid by payment_intent) so that multiple Transfers (each created separately) can draw from that amount.

In particular, the issue mentioned above about "available balance" can be reduced by using the "Transfer_Group" - the transfer will become somewhat similar to the initial payment, waiting to occur when the actual payment has settled and become available.

In this way, you can collect the initial payment and almost immediately create the (multiple) transfers - they would proceed unless there is some issue with the initial charge and/or transfer(s) (such as not have the Transfer capabilities enabled on a particular Connected Account).

Note that Stripe does not know (and does not care) if a Connected account is a seller, referrer, or whatever else you treat them as - that's your code. Stripe just executes the payment collection and transfers as directed.

sly brook
#

I see. I see that I can implement this by using both "Transfers_group" and "charge.succeeded webhook".

I have a different question: it is a system specification of the StripeAPI that the destination cannot have a second transfer, right?

iron otter
#

Correct - you can specific only a single destination

frigid wigeon
#

"Transfer_Group" can also be used to gather multiple payments into a single group, and make several transfer from that group. For example, an event ticketing system can take all payments for an event into a single "Transfer_Group", and make multiple, separate transfers from that group - again for example, to a vnue and to the promotor of the event.

#

So in the ticket scenario:
=> Collect the payment for the ticket from the customer into "Transfer_Group" named EVENT
=> Create a transfer from Platform to Venue Connected Account from "Transfer_Group" EVENT
=> Create another transfer from Platform to Promoter Connected Account also from "Transfer_Group" EVENT

sly brook
#

So "Transfer_Group" means the bank accounts pooled in my stripe account.
So you are creating a dedicated transfer group from my pooled money.
I can name the transfer_group anything I want, right? Because it is what I use to create a new money transfer.

iron otter
#

That's just a label for the transfers, essentially

#

You still haven't shared today any specific calls/requests that are failing, so it's hard to guide you on what to do next

sly brook
#

ok. can you tell me where to use checkout.session.completed in the object at the end?

iron otter
#

This is a webhook event -- do you have a webhook endpoint set up?

#

You'd listen for that then create transfers to the appropriate accounts based on your own criteria

sly brook
#

Yes, as you can see in the screenshot, we have already created the functions and endpoints that make the payments.
How can I catch the stripe event?

iron otter
sly brook
#

Perhaps I need to create something in the Stripe site dashboard to use the webhook checkout.session.completed?

iron otter
#

Yes that is part of the process

sly brook
#

Seriously, I just want to execute the function after the process.
Thank you very much. I will try what you taught me.