#Kyle U
1 messages ยท Page 1 of 1 (latest)
Hi, can you share the request if where you're seeing this? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_Lh4IdnP63jChFA
How we operate: Charities add their bank accounts, and donors send them money. We don't need to hold the funds as a platform and operate in the same way as GoFundMe.
There can be different charities at checkout which is why we also need to transfer accordingly
Use Case:
A donor chooses to send $15 to Charity A & $10 to Charity B for a checkout total of $25. When the payment is processed, we need to send $15 to Charity A and $10 to Charity B.
The issue -> only Charities within Canada are receiving transfers because on_behalf_of isn't configured correctly
It looks like your Platform account is a CA account. Cross border payouts are only able for US accounts: https://stripe.com/docs/connect/cross-border-payouts
const charge = await stripe.paymentIntents.create({
amount: amt,
currency: currency,
on_behalf_of: val.stripeAccountId,
receipt_email: email,
transfer_group: "{ORDER10}",
});
So "on_behalf_of" won't work for our account?
We don't want to keep the funds at all. For example GB Donors will be sending money to GB Charities directly to their banks they hooked up using Express. We don't need the money sent to us in Canada at all
The request id that you've shared with me is a transfers API call.
I need help implementing on_behalf_of to allow our foreign charities to receive payments directly from our donors
on_behalf_of, should work here, https://stripe.com/docs/connect/charges#on_behalf_of.
I tried to implement it by doing this:
const charge = await stripe.paymentIntents.create({
amount: amt,
currency: currency,
on_behalf_of: val.stripeAccountId,
receipt_email: email,
transfer_group: "{ORDER10}",
});
And then:
await stripe.transfers.create({
amount: finalValue,
currency: defaultCurrency,
destination: val.stripeAccountId,
transfer_group: "{ORDER10}",
});
๐ Taking over this thread, catching up now
As mentioned by pgskc, cross border payout, i.e. platform process the payment for connected accounts from different countries is only supported by US platform account. With your platform in Canada, you can't transfer the funds to other countries other than Canada even with on_behalf_of on the payments
I don't want any of the funds to come to my account at all. I want the funds to be sent directly to the charity's bank account in that country. It will only ever be domestic transfers, for example a US donor will only send funds to US charities, and our platform doesn't need to hold the money at all
So I don't need cross border payouts
Users aren't sending money to other countries, we just operate in other countries and all payouts will be domestic in that country. GB to GB, US to US, AU to AU, etc
And since the users don't send us the funds to send to the other countries, we should be able to make it work as nothing would be cross border.
Since they are sending directly to the charity, within their own country and not to us
Thanks for sharing! Let me double check and get back to you
Thanks. I think our configuration is using transfers but I'm not sure that's what we're trying to accomplish. We don't want the funds to come through Canada at all
With Separate Charges and Transfer (the one that you're now), it's not possible to do cross border payout even with on_behalf_of.
Since your platform account isn't in US, there will be two possible ways.
- Direct Charges on Standard account which the payment is made directly on the connected account, not on the platform account.
- Standard account: https://stripe.com/docs/connect/standard-accounts
- Direct Charges: https://stripe.com/docs/connect/direct-charges
- Destination Charges with
on_behalf_ofon Express or Custom accounts.
- Destination Charges with
on_behalf_of: https://stripe.com/docs/connect/destination-charges#settlement-merchant
This is what I'm asking for help with, #2
I integrated it but still received the error
Could you share the request ID that threw the error? The above request ID you shared used Separate Charges and Transfer, not Destination Charges
The request for Destination Charges with on_behalf_of should look like this and no separate Transfers request required since Destination Charges includes payment and transfer in one single request:
const paymentIntent = await stripe.paymentIntents.create({
amount: 1000,
currency: 'gbp',
transfer_data: {
destination: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
},
on_behalf_of: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
});
Ok so I don't need transfers.create?
Yup! Please ensure you include transfer_data.destination and on_behalf_of in Payment Intent request for Destination Charges
So that chunk of code you provided handles the entire request? And the transfers will happen
I'm just wondering since there may be multiple charities under one transaction where the funds will need to be sent to different accounts
Yes! You may refer to the doc here for the details: https://stripe.com/docs/connect/destination-charges#settlement-merchant
Destination Charges only allows one payment to one connected account
Only Separate Charges and Transfers allows multiple connected account transfer. However, cross-border payout to multiple connected accounts is not supported in non-US platform
So could we configure using separate charges? Is this the same as direct charge?
I guess more importantly, how do we distribute the funds to multiple accounts from the transaction
Your CA platform can't payout to non-CA connected accounts with Separate Charges and Transfers. Transfers request doesn't support transferring funds to non-CA countries even with on_behalf_of.
In your case (CA platform), it's only possible to transfer funds to non-CA connected accounts with either Destination Charges on Express/Custom accounts or Direct Charges on Standard account. Both Destination Charges and Direct Charges is one payment to one connected account.
If you wish to transfer funds to multiple accounts that are in different countries from your platform account's, it can only be done with platform account in US
If you wish to still use CA platform, then you can only do one payment to one connected account with Destination Charges
So if a GB donor sends $30 to 3 seperate GB Charities, we can't split the funds up and send $10 to each charity, we can only have all $30 go to 1 GB charity
Yup! Or you can make 3 different payment requests with Destination Charges to each charity ($10, $10, $10)
Hmm, I like this option. Is there example code of a scenario like this? We wouldn't know how many destination charges we would have until checkout. The donor could choose as many charities to split as they prefer
We don't have the example code for this. One way I can think of is:
- Collect and save doner's payment method: https://stripe.com/docs/payments/save-and-reuse
- Doner set the split amount in your system
- Charges to doner using Destination Charges with
on_behalf_ofin each split using the saved payment method in Step 1: https://stripe.com/docs/connect/destination-charges#settlement-merchant
You can set following parameters additional in Payment Intent request:
payment_methodfor saved payment method in Step 1: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_methodconfirmto true to confirm the payment immediately on the saved payment method: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm
Here is the use case: Charities post items they need, donors send the funds to purchase the items. So a donor might add a Ball, Hat, and Blanket to their cart, then checkout. These items could belong to 3 different charities, or 2, or 1, there's no way to predict for each transaction. So when the transaction is complete, send the funds to each charity accordingly. Transaction total is $45, $10 Bats (Charity A), $15 Hats (Charity B), $20 Blankets (Charity C). We need to distribute the funds accordingly. Is it possible using seperate destination charges? Or is there any other possible way to accomplish this with linked express accounts for the charities in foreign countries?
Yup! This can be done with the steps I shared earlier by collecting and saving doner's payment method upfront without charging to the doner. When the doner checkout, your system would already know the amount and connected account. You can then charge the doner with the saved payment method using Destination Charges for each connected connect
Why do we need to collect and save the doner's payment method?
The doc is shared in the above steps, more specifically this one:
- Collect and save doner's payment method: https://stripe.com/docs/payments/save-and-reuse
Here is a mockup of what a transaction would look like
Lets say the Donor and the Charities are all in GB
How do I configure Stripe so that $17.54 is sent to Charity A & $86.93 is sent to Charity B from the transaction total of $104.77 paid by the GB Donor
You can use above doc to save payment method using the same UI. After doner enters the card information and saves to Stripe system, you can then charge separately at your server
So instead of processing the transaction and transferring when the user pressed "Pay Now", we tell them the payment was successful and because we have their card details we can process on the back end
When to show successful payment is up to your business logic. You can also display successful message after all the backend charges are successful
Is there any starter code for the backend charges where we charge separately?
Nope! You'd have to manage in your system with Payment Intent requests on each connected account
Ok, thanks. What is required to open a US account?
I'm not familiar with opening a US account. I'd recommend reaching out to Stripe Support for account related questions: https://support.stripe.com/contact
thanks
No problem ๐