#calebmmmm
1 messages · Page 1 of 1 (latest)
but what's next?
I created the charge in test and the charge went thru ok and I see it in my platform account, but how would I credit it to the connected account (minus fees).
Hi there! Let's take a step back. What kind of funds flow are you designing with Connect?
The above is a direct charge, which means the funds settle on the connected account and any application fees are transferred to your platform
that would be perfect
however, I see the transaction on my platform account and do not see the application fees
Hm, can you share the Charge ID if you have it?
card_1NXshVDKTvXQJF9V88F7QsDE
Thanks!
I found the relevant charge but it looks like we didn't receive the Stripe Account header for this request.
ok... how do I send that? I thought I was supposed to pass the stripe account as a second parameter to the charge method as shown above?
The customer ID used for that request was also created on the platform, not the Stripe Account
I'm thinking it's a syntax thing, give me a few mins
thank you!
Hm, i'm not sure if it's an issue with double/single quotes in your request
oh ... I'll try that change quick
Can you try creating a test mode customer with this code?
['email' => 'test@example.com'],
['stripe_account' => 'acct_123']
);
replacing acct_123 with one of your test connected accounts?
ok... I just created a new test connect account and modified the code
card_1NXtRNDKTvXQJF9VoK5GPWvB
if(!auth()->user()->stripe_customer_id){
$customer = \Stripe\Customer::create(array(
'name' => auth()->user()->first_name . ' '. auth()->user()->last_name,
'email' => auth()->user()->email,
'stripe_account' => "acct_1NXtFrRcx2QuPHQZ",
));
$stripeCustomerId = $customer->id;
$stripeDetails = \Stripe\Charge::create ([
"customer" => $stripeCustomerId,
"amount" => $registrationFee*100,
"currency" => "USD",
"source" => $cardId,
"description" => 'Purchase Registration Credits',
"application_fee_amount" => 1,
], [
"stripe_account" => 'acct_1NVM87DBqR8ZrDbk'
]);
@grim remnant taking a step back, if you're building a brand-new Stripe integration, I recommend working with the PaymentIntents API instead of Charges
I am modifying existing code... attempting to change the charges to associate to a connected account.
got it, okay
so above, you're passing two different stripe_account values. that's not the issue but just wanted to point this out
thank you
👋
The code you have looks correct, the first array is parameters, the second array are options for the request. The Stripe-Account header/option is in the second array
So when you create a Customer on your own account as a platform you do $customer = \Stripe\Customer::create(array( 'name' => 'name' 'email' => 'email@example.com', ));
If you want the request on the connected account you have to pass that extra stripe_account header option in a separate array so $customer = \Stripe\Customer::create(array( 'name' => 'name' 'email' => 'email@example.com', ), array( "stripe_account" => 'acct_1NVM87DBqR8ZrDbk' ));
I recommend hardcoding all values first to confirm it does what you want
great... I will try that.
Also, taking a quick step back: As a platform using Custom accounts you should basically never be doing this in the first place. All API requests, payments, customers, and such should always only live on the platform account. So it feels like you mixed things up early in the design
The connected accounts is confusing to me... I would prefer to just have simple sub-accounts under our platform account.
For now here is our use case:
We host a webset that helps with youth animal shows and auctions... we help with all of the transactions for the auction and donations to the kids showing their animals at the county fair.
We have two different clients now that will be using our system.
Hello! I'm taking over and catching up...
thank you
we would prefer to set up our clients in Stripe so that they don't have to do anything directly in Stripe.
for example... I have already set up the custom connected account in our live stripe platform.
Gotcha. If you want a whitelabeled experience Custom accounts are the way to go, it just takes a lot of work to set everything up. When using Custom accounts you should be creating destination charges though: https://stripe.com/docs/connect/destination-charges
now I want to be able to charge an application fee... and have the transactions automatically sweep to the connected account (minus the strip fees and the application fee.
will the destination charge also allow us to add an applicaiton fee?
Yep!
Lower down on that same page: https://stripe.com/docs/connect/destination-charges#application-fee
sweet... let me update my code and try it in TEST
$stripeDetails = \Stripe\Charge::create ([
"customer" => $stripeCustomerId,
"amount" => $registrationFee*100,
"currency" => "USD",
"source" => $cardId,
"description" => 'Purchase Registration Credits',
"application_fee_amount" => 1,
"transfer_data" => 'acct_1NXtFrRcx2QuPHQZ'
]);
I still don't see the applciaiton fee or anything for the transfer account
Not sure I understand?
You're defining the application_fee_amount in the code you shared and setting it to 1¢. The remainder of the payment will be transferred to the destination account you specify, although it doesn't look like you have your transfer_data syntax correct.
You need to specify destination inside transfer_data.
And the destination is the connected account.
$stripeDetails = \Stripe\Charge::create ([
"customer" => $stripeCustomerId,
"amount" => $registrationFee*100,
"currency" => "USD",
"source" => $cardId,
"description" => 'Purchase Registration Credits',
"application_fee_amount" => 1,
"transfer_data" => ['destination' => 'acct_1NXtFrRcx2QuPHQZ'],
]);
card_1NXuAQDKTvXQJF9V04g6FDNo
I fixed the transfer_data... I still do not see anything in the transaction that adds the application fee or transfers the charge to the connected account?
it is not working, please help me understand why it is not working
It's right there.
yeah, but when I look at the transaction in the Stripe dashboard I see nothing about the application_fee or the transfer_data and the payment does not show up in the connected account.
Can you give me the Charge ID?
Also, why are you creating a Charge instead of a Payment Intent?
card_1NXuAQDKTvXQJF9V04g6FDNo
as was mentioned earlier I am modifying existing code.
If I change it to a Payment Intent what other changes would I need to make?
Let's skip over Payment Intents for now, I didn't realize you were modifying existing code.
ch_3NXuAQDKTvXQJF9V0wh0ahGl
I just tried another one: ch_3NXuPMDKTvXQJF9V1ICeSiM2
this one I created a new test connected account and made sure it's status shows "Completed".
The application fee and transfer data aren't coming through in the creation request: https://dashboard.stripe.com/test/logs/req_o5D5gPpJVaOGBT
$stripeDetails = \Stripe\Charge::create ([
"customer" => $stripeCustomerId,
"amount" => $registrationFee*100,
"currency" => "USD",
"source" => $cardId,
"description" => 'Purchase Registration Credits',
"application_fee_amount" => 100,
"transfer_data" => ['destination' => 'acct_1NXuFyD76WidUb5m'],
]);
Could it be that your older code is still running and the updates aren't?
yeah... let me double check
nice
progress!
you're right... It was in two spots... I only updated the one
ok... now I am seeing the charge in the connected account.
and I see the transfer data now in the platform account.
do I have to tell it to pass the stripe processing fees onto the connected account?
or do I just calculate that and put the total amount I watn to collect in the application_fee_amount?
With Custom accounts and destination charges the platform is responsible for Stripe fees. More info here: https://stripe.com/docs/connect/accounts#choosing-approach
And here: https://stripe.com/docs/connect/charges#destination
You can calculate it as part of the application fee though, yeah.
where do I see the fee schedule for our account?
That I'm not sure about. If you're using sticker pricing it's the pricing on the Stripe website. If you have a custom pricing arrangement that's something you would need to ask support about: https://support.stripe.com/contact/email