By default, fees are shared between the receivers of payments when using PayPal Adaptive Payments and Parallel Payments. You may want to change this behavior, however, and this can be done with a simple code snippet to modify the arguments sent to PayPal.
Here’s an example:
<?php | |
function custom_woocommerce_paypal_ap_payment_args( $args ) { | |
$args['feesPayer'] = 'SENDER'; | |
return $args; | |
} | |
add_filter( 'woocommerce_paypal_ap_payment_args', 'custom_woocommerce_paypal_ap_payment_args' ); |
Simply replace ‘SENDER’ with the fee payout type you wish to use. The acceptable values are as follows(taken from PayPal API docs):
SENDER
– Sender pays all fees (for personal, implicit simple/parallel payments; do not use for chained or unilateral payments)PRIMARYRECEIVER
– Primary receiver pays all fees (chained payments only)EACHRECEIVER
– Each receiver pays their own fee (default, personal and unilateral payments)SECONDARYONLY
– Secondary receivers pay all fees (use only for chained payments with one secondary receiver)
Either add this code to your theme’s functions.php file or create a plugin containing the code snippet.