#skthon_api

1 messages ¡ Page 1 of 1 (latest)

frosty sailBOT
#

👋 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/1460998569279619196

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

ashen drum
#

Can you share a code snippet and/or example request attempt that is not doing what you expect?

#

Not sure if this was a typo, but transfer_data.application_fee_amount is not a valid param, application_fee_amount exists at the top level of the api if you mean to set the fee amount

#

Within transfer there is transfer.amount which is kind of the inverse, when you want to set how much to send to the account (and you keep the rest).

#

When i use the clientSecret value for transfer_data.destination, its working. I am able to see the charge getting collected
that is definitely not the correct value for that parameter, destination has to be a connected account id (eg acct_123)

#

A concrete example we can look at together would be most helpful

dense ivy
#

For one time payment:
If ($applicationFeeAmount > 0) {
$create_intent_params['application_fee_amount'] = $applicationFeeAmount;
}

$intent = \Stripe\PaymentIntent::create($create_intent_params, [
'stripe_account' => $incoming['stripe_account_key'],
'idempotency_key' => $idemKey,
]);

For subscriptions:
if (!empty($connectedAccountId) && $hasTransfersEnabled) {
$subscription_params['application_fee_percent'] = '2';
}

$charge_response = \Stripe\Subscription::create(
$subscription_params,
array('stripe_account' => $stripe_account_key,)
);

#

Not sure if this was a typo, but transfer_data.application_fee_amount is not a valid param, application_fee_amount exists at the top level of the api if you mean to set the fee amount

ah that must be it.

#

anyway i omitted the transfer_data altogether which fixed the issue

ashen drum
#

You're using different patterns for one time payment, direct charges vs destination charges

#

Because of this:

$intent = \Stripe\PaymentIntent::create($create_intent_params, [
    'stripe_account' => $incoming['stripe_account_key'],
    'idempotency_key' => $idemKey,
]);
#

setting the stripe_account there makes this a direct charge, and incompatible with transfer_data

#

You cna set an application fee to be collected back for your platform, so that is why that works mechanically

#

but you should carefully review which kind of payments you mean to create

#

Do you want the payment to exist on your platform, and transfer some amount to the connected account? Or do you want the payment to exist directly on the connected account and collect a fee from that?

#

These are fundamentally different, with implications around merchant of record and liability for disputes etc