#batz_api

1 messages ยท Page 1 of 1 (latest)

sharp spireBOT
#

๐Ÿ‘‹ 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/1435267933738897529

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

granite widget
#

Please see the successful charge api response from payment_intent.suceeded with the on_behalf_of parameter and application fee set correctly

oblique sleet
#

Hey there

#

You've created this using a direct charge pattern on the connected account, so that account is already the settlement merchant and the funds are already in their account. Only the application fee is transferred back to your platform.

oblique sleet
#

What is happening here differently than you expect? Can you explain what you're trying to do to help me understand? It's possible you might need to contact the platform for guidance if you don't control the internal implementation of how these payments are created.

granite widget
#

So if you use the transfer_data => ['destination' : Connect Account ID] it will land in the account automatically but when i do this it complains about the Stripe Request contains a Stripe-Account header which i cannot remove due to a limitation of the plugin. But online i found others said you can use this on_behalf_of parameter which should payout the money - the stripe fees and application fee automatically while settling the charge and the application fee on your main stripe account. But when i have done this in a test mode enviroment in stripe the connect account never shows the balance ?

#

transfer data parameter settles it on the merchant account immediately not the main stripe account but i cannot use those parameters

#

I know this only because I am working on another custom nextjs project and it works this way.

oblique sleet
#

Wait this on_behalf_of value is a different sandbox account that looks like it might also belong to you. What are you trying to accomplish here?

#

But online i found others said you can use this on_behalf_of parameter which should payout the money
I don't understand what this means or what you're trying to do

#

The direct charge from the platform is already settling in your connected account, you don't need to transfer it anywhere, it would be paid out according to your payout schedule.

sharp spireBOT
granite widget
#

This is a function from my wordpress site that intercepts the request body of the payment intent and adds the on_behalf_of and application fee parameters.

the stripe connect account id below matches the one on the connect account see screenshot above.

I want the funds to transfer into the connect account i cannot use the transfer_data parameter as the plugin forces a header of Stripe-Account and when i do this the payment intent shows up incomplete and says you cannot use the Stripe-Account header when using transfer data and asks me to remove it. I looked up the documentation for stripe and it explained you can use the on_behalf_of parameter and the trasaction will settle on the main account and payout the accounts daily afterward. Where as a direct charge shows directly on the connect account.

define('STRIPE_CONNECT_ACCOUNT_ID', 'acct_1SNDjgPJuTutPjzn');
define('STRIPE_APPLICATION_FEE_RATE', 0.025); // 2.5%

function add_stripe_connect_application_fee($request, $api) {
// Only process payment intents
if ($api !== 'payment_intents' || empty($request['metadata']['order_id'])) {
return $request;
}

// Configuration
$connect_account_id = STRIPE_CONNECT_ACCOUNT_ID;
$application_fee_rate = STRIPE_APPLICATION_FEE_RATE;

// Calculate fees for destination charge
$total_amount = $request['amount'];
$platform_fee = round($total_amount * $application_fee_rate);

// Remove conflicting parameters but keep customer-related ones
$request['application_fee_amount'] = $platform_fee; // Can't use with transfer_data
$request['on_behalf_of'] = STRIPE_CONNECT_ACCOUNT_ID; // Important for destination charges


return $request;

}
add_filter('wc_stripe_request_body', 'add_stripe_connect_application_fee', 20, 2);

#

My issue is that I dont see any funds in the balance of the connect account i am using ? even though it says it was transferred and settled with that connect account.

#

the webspace.ie email you see in the settlement and transferred to is coming from that connect account not the main account apologies as i can see this looks confusing.

soft lion
#

hi there, taking over for my colleague here as they had to step away. give me a few moments to catch up

granite widget
#

No worries dention thank you apologies this is definetly a confusing one and im limited by the plugin i am using from wordpress as it was really designed for one purpose and not this but i found a bit of a hack to try get to my solution without editing the plugin directly.

soft lion
#

so taking a step back here. which account do you want the charge to be on? your platform, or the connected account?

granite widget
#

So having it go directly to the connected account would be great.

#

But if we need to have it on the main account and then it transfers the funds afterwards its not an issue.

soft lion
#

so if you're fine having it exist directly on the connected account, then you could use Direct charges, which would be compatible with the Stripe-Account header usage. you'd then use application_fee_amount to transfer any fees back to your platform

Create charges directly on the connected account and collect fees.

granite widget
#

so i would just need to add a header with that connect account id ?

#

and it will go there ?

soft lion
#

yes. by doing that, you're essentially acting as the connected account to create the charge

granite widget
#

I think my main issue is though the plugin will overwrite this header when its sent

#

thats why i was using on_behalf_of

soft lion
#

what is the plugin overwriting the header with?

#

like, what account ID is it putting there?

granite widget
#

Stripe Woocommerce Payment Gateway

#

let me double check for you

#

Stripe-Account
acct_1CDWVwA7kW3XX0IW

#

its the main account

#

so if i can update this header with the connect account i want to transfer it to it should work ?

soft lion
#

yes it should, although we're not really familiar with third-party plugins on this channel. if you have trouble doing so I think you'll need to reach out to the plugin developer to see if your goal can be accomplished with this

granite widget
#

Final question though what is the actual point of on_behalf_of then ? It said in the docs it settles the payment on the parent account and then transfers the funds daily to that connect account

soft lion
#

if you're referring to this doc, the "settlement merchant" in this case is referring to the settlement country / currency and how the charge will appear on the customer's credit card statement.

#

basically on_behalf_of only makes sense when used with Destination charges (i.e. a charge not made with the Stripe-Account header)

granite widget
#

oh understood.

soft lion
#

it doesn't actually create the charge on the connected account

granite widget
#

Okay thank you denton mabye i just had it in my head that it worked that way as i have been driven mad by this !

#

okay ill try intercept that header and update it then and see how it goes.

soft lion
#

you're welcome! happy to help!