laceyrod
(@laceyrod)
Automattic Happiness Engineer
Howdy,
This would require more complex development. I’ll go ahead and leave this thread open for a while in case anyone else wants to chime in, but in the meantime, I can also recommend the following resources for more development-oriented questions:
– WooCommerce Slack Community: https://woocommerce.com/community-slack/
– Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/
laceyrod
(@laceyrod)
Automattic Happiness Engineer
This thread has been inactive for a bit, so I’m going to mark it as Resolved now. Please feel free to visit the links I’ve referenced above and open a new thread if you have any further questions.
Cheers!
wish to know are you Stripe Connect API
refer, https://stripe.com/docs/connect/direct-charges#collecting-fees
add_filter( 'woocommerce_stripe_request_body', 'add_application_fee', 20, 2 );
function add_application_fee( $request, $api ) {
// Try to retrieve the order ID from the metadata
$orderID = $request['metadata']['order_id'];
$order = wc_get_order( $orderID );
// This filter is hit multiple times, so the order ID might not be available. If not, just return the request.
if ( !$order ) {
return $request;
}
// This is a custom filter that returns a fee based on the order total.
$applicationFee = 125; //Change value with your fees, will charge $1.25 as application fee.
if ( $applicationFee > 0 ) {
$request['application_fee_amount'] = $applicationFee;
}
return $request;
}