#vineetha_62348

1 messages · Page 1 of 1 (latest)

granite sparrowBOT
glossy sequoia
#

You'd need to manually handle that yourself, perhaps increasing the application_fee_amount to account for our fee if you want to connected account to cover that

thorn prawn
#

Could you please explain ?

glossy sequoia
#

Seems like you have some logic to calculate the application_fee_amount based on the payment amount ($cslFee). You should increase the value of $cslFee so that it also covers the processing fees your platform will pay

thorn prawn
#

Team cost : 100(customer pays the amount)
CSL(platform account) : 25
Stripe: 10(assumption)
Tournament director(connected account): 65
Business model is that CSL ( Product Owner) must get $25 . Tournament director(connected account) must get the remaining amount – stripe charge.

#

This is the requirement

glossy sequoia
#

Then that should be pretty straight forward for you to calculate the required amount to pass to application_fee_amount

#

In your example where Stripe fee is 10 you'd add that to the CSL and it'd become 35

#

The platform still gets 25 after the 10 fee is deducated, and tournament director (conncted account) will get 65 still

#

Should be easy enough for you to test out

thorn prawn
#

Ok.Thanks.So before that i need to get the stripe fee amount. $paymentIntent = \Stripe\PaymentIntent::create([
'amount' => $fees,
'currency' => 'USD',
// 'automatic_payment_methods' => ['enabled' => true],
'application_fee_amount' => $cslFee,//csl fee
'description' => $description,
'receipt_email'=> $email,
'transfer_data' => [
'destination' => $CONNECTED_ACCOUNT_ID,//remaining amount to be transferred to the connected account
]
]);

glossy sequoia
thorn prawn
#

Is any API for this?

glossy sequoia
#

There is not

thorn prawn
#

So how to get strip fee in code?

glossy sequoia
#

I sent you a link which explains the formula you can use to calculate it

#

But it's something you need to calculate yourself. What most people do is just add an arbitary 'service charge' amount which will cover the fee

thorn prawn
#

service charge amount ?

glossy sequoia
#

Just an additional fee to cover the Stripe processing fee

thorn prawn
#

Is any method to Retrieve the calculated Stripe fee from the PaymentIntent?

glossy sequoia
#

I think I already answered that – no. You can't get the fee for a payment before a payment from the API, you need to calculate it manually

thorn prawn
#

$paymentIntent = \Stripe\PaymentIntent::create([
'amount' => $fee,
'currency' => 'USD',
'application_fee_amount' => $cslFee, // CSL fee (platform fee)
// Other parameters as needed
]);

// Retrieve the calculated Stripe fee from the PaymentIntent
$stripeFee = $paymentIntent->charges->data[0]->balance_transaction; I found like this code.Is it correct?

glossy sequoia
#

Well that will work after the payment has been processed yes, but not before. There's no Balance Transaction until the payment has succeeded

#

So it's not really much help in your use case

thorn prawn
#

After the payment processed how to split up the fee for platform and connected account?

dusk whale
#

hi! I'm taking over this thread.

#

it's the application_fee_amount parameter that defines how much money goes to the platform account (and the rest goes to the connected account)

thorn prawn
#

Team cost : 100(customer pays the amount)
CSL(platform account) : 25
Stripe: 10(assumption)
Tournament director(connected account): 65
Business model is that CSL ( Product Owner) must get $25 . Tournament director(connected account) must get the remaining amount – stripe charge.
This is the requirement

dusk whale
#

then set application_fee_amount: 2500

#

and amount: 100000

thorn prawn
#

but my current application stripe fee deducted from platform

dusk whale
#

if you are using Destination Charges, then yes the Stripe fee will be taken from the platform account. if you want the Stripe fee to be taken from the connected account, you may want to use Direct Charges instead.
you can learn more about this here: https://stripe.com/docs/connect/charges

thorn prawn
#

Already express account type implemented for the connected account.Payment intent created as follows $paymentIntent = \Stripe\PaymentIntent::create([
'amount' => $fees,
'currency' => 'USD',
// 'automatic_payment_methods' => ['enabled' => true],
'application_fee_amount' => $cslFee,//csl fee
'description' => $description,
'receipt_email'=> $email,
'transfer_data' => [
'destination' => $CONNECTED_ACCOUNT_ID,//remaining amount to be transferred to the connected account
]
]);

#

Can i change to the existing code?

dusk whale
#

if you are using Express accounts, then yes Destination Charges make sense. So it's the platform who will pay the Stripe fees, you can't change this.

#

you could increate the application_fee to compensate for this if needed.

thorn prawn
#

Can i change the connected account from express to standard via dashbaord

dusk whale
#

you can't change an account type. but you can create a new standard accounts if needed. however not sure if you can do this from the dashboard.

thorn prawn
#

Hi,Can you provide an example for creating charge in PHP

dusk whale
#

which type of charge?

thorn prawn
#

on connected account

#

Its express account type

dusk whale
#

so a Destination Charge?

thorn prawn
#

// Team cost
$fee = 100;

// CSL fee (Product Owner)
$cslFee = 25;

// Step 1: Create a PaymentIntent to calculate the Stripe fee
$paymentIntent = \Stripe\PaymentIntent::create([
'amount' => $fee,
'currency' => 'USD',
'application_fee_amount' => $cslFee, // CSL fee (platform fee)
// Other parameters as needed
]);

// Retrieve the calculated Stripe fee from the PaymentIntent
$stripeFee = $paymentIntent->charges->data[0]->balance_transaction;

// Calculate the remaining amount after deducting the Stripe fee
$remainingAmount = $fee - $stripeFee;

// Create a Charge to deduct the CSL fee from the customer's payment
$charge = \Stripe\Charge::create([
'amount' => $fee, // Total amount including CSL fee and Stripe fee
'currency' => 'USD',
'source' => 'SOURCE_ID', // Replace with the actual source ID (e.g., card token)
'application_fee_amount' => $cslFee, // CSL fee (platform fee)
// Other parameters as needed
], ['stripe_account' => $CONNECTED_ACCOUNT_ID]); // Specify connected account

// Now you can use $charge as needed
$chargeId = $charge->id;

If I do like this my account will work as per my requirement?

dusk whale
#

make sure to select "PHP":