Last active
July 18, 2025 11:50
-
-
Save vladutilie/b050f7e49ce10f2912b8c25eefd00cdf to your computer and use it in GitHub Desktop.
Netopia split payments for WooCommerce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( | |
'netopia_payment_request_params', | |
function ( \Netopia_Payment_Request_Abstract $mobilpay_instance, int $order_id ) { | |
require_once get_stylesheet_directory() . '/inc/classes/class-netopia-payment-split.php'; | |
$netopia_instance->split = new Inc\Classes\Netopia_Payment_Split(); | |
$order = wc_get_order( $order_id ); | |
$amount = 123; // Amount based on some products from the $order. | |
/** | |
* The destination seller account (SAC) ID and the amount that will be transferred to that seller account. | |
* The currency will always be that of the originating request. | |
* | |
* The rest of the amount will go in the Netopia main account. | |
*/ | |
$netopia_instance->split->destinations = array( | |
array( | |
'id' => 'netopia-sac-id', | |
'amount' => $amount / 100, | |
), | |
); | |
error_log( print_r( array( 'amount_1' => $amount_1 ), true ) ); | |
return $netopia_instance; | |
}, | |
10, | |
2 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment