#calebmmmm

1 messages · Page 1 of 1 (latest)

latent trellisBOT
grim remnant
#

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).

lilac hinge
#

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

grim remnant
#

that would be perfect

#

however, I see the transaction on my platform account and do not see the application fees

lilac hinge
#

Hm, can you share the Charge ID if you have it?

grim remnant
#

card_1NXshVDKTvXQJF9V88F7QsDE

lilac hinge
#

Thanks!

#

I found the relevant charge but it looks like we didn't receive the Stripe Account header for this request.

grim remnant
#

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?

lilac hinge
#

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

grim remnant
#

thank you!

lilac hinge
#

Hm, i'm not sure if it's an issue with double/single quotes in your request

grim remnant
#

oh ... I'll try that change quick

lilac hinge
#

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?

grim remnant
#

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'

            ]);
lilac hinge
#

@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

grim remnant
#

I am modifying existing code... attempting to change the charges to associate to a connected account.

lilac hinge
#

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

grim remnant
#

thank you

odd wind
#

👋

#

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

grim remnant
#

great... I will try that.

odd wind
#

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

latent trellisBOT
grim remnant
#

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.

empty quail
#

Hello! I'm taking over and catching up...

grim remnant
#

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.

empty quail
#

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

grim remnant
#

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?

empty quail
#

Yep!

grim remnant
#

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

empty quail
#

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.

grim remnant
#

$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?

empty quail
#

Not sure I understand what you're saying.

grim remnant
#

it is not working, please help me understand why it is not working

empty quail
#

It's right there.

grim remnant
#

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.

empty quail
#

Can you give me the Charge ID?

#

Also, why are you creating a Charge instead of a Payment Intent?

grim remnant
#

card_1NXuAQDKTvXQJF9V04g6FDNo

#

as was mentioned earlier I am modifying existing code.

empty quail
#

That's not the Charge ID.

#

The Charge ID would begin with ch_.

grim remnant
#

If I change it to a Payment Intent what other changes would I need to make?

empty quail
#

Let's skip over Payment Intents for now, I didn't realize you were modifying existing code.

grim remnant
#

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".

empty quail
grim remnant
#

$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'],
]);

empty quail
#

Could it be that your older code is still running and the updates aren't?

grim remnant
#

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?

empty quail
#

You can calculate it as part of the application fee though, yeah.

grim remnant
#

where do I see the fee schedule for our account?

empty quail
#

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

grim remnant
#

It is just standard pricing.

#

2.9% + .30