#storm-lao_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1264981950905454644
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
So you want to transfer some funds related to an individual payment as a sort of comission?
This is a common issue with the Connect funds flow called Separate Charges & Transfers. We have a way to fix this by linking the transfer to the Charge object using the source_transaction ID. This makes sure that the transfer only occurs once the funds from that Charge are available.
You can read about how this works here: https://docs.stripe.com/connect/separate-charges-and-transfers?platform=android#transfer-availability
I saw that this code works but it is a subscription system so how to resolve this problem subscription_data: {
application_fee_percent: 70, // 10% des frais d'application
transfer_data: {
destination: "acct_1PFgR3QPAYFw2Cln"
}
}
That is an entirely different funds flow. I provided you the document that shows you how to solve this problem using the funds flow you specified.
Please test that approach first. I think it will solve your exact issue
so for each transaction the amount will be transferred but I have to put it in the wehbook?
Sorry but what are you talking about? None of that was in the doc I provided
Do you mean for asynchronous payment methods? Like SEPA DD?
Can you clarify the specifics of what you are trying to achieve?
I just want that when a person uses a promo code 20% of the transaction goes to a connected stripe account
using what payment methods? How are you generating payments?
I use a subscription via a stripe and a firebase server-side code to create it
Okay. And you want the connect account to receive 20% for each payment associated with the subscription?
Or just the first one?
for each payment
In that case, I recommend you use Destination charges and specify the transfer_data.amount_percent instead of using the application_fee_percent. I think it's easier to understand what you are doing.
https://docs.stripe.com/api/subscriptions/create#create_subscription-transfer_data-amount_percent
So you would specify the Account ID in transfer_data.destination and then how much of each payment they would get in transfer_data.amount_percent
ok but I only want this to be done when we use a promo code called "TEST103
How are you applying the promo code? Is it when a customer enters it in a Checkout page?
when the customer enters the promo code on the payment stripe page
Okay so a checkout page. In that case you won't know until after the first payment (unless you are using a free trial period).
how I modify this code to influence multiple connected stripe accounts: subscription_data: {
transfer_data: {
destination: "acct_1PFgR3QPAYFw2Cln",
amount_percent: 30 // 10% of the invoice total will be transferred to the connected account
}
Hello
transfer_data,destination can only include one account ID
You should rather use Separate Charges and transfers flow where you create explicit transfers to different connected accounts after subscription amount settles in the platform
the problem is that the transfer does not work because it tells me that the test account is negative while I keep adding funds