-
-
Save neovea/86461e07d1dd91e61027 to your computer and use it in GitHub Desktop.
Combined to WooCommerce Adaptive Payment by WooTheme, offers the possibility to create dynamic amounts for specific paypal accounts.
Put this snippet into functions.php
This file contains 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 | |
/** | |
* Custom PayPal Adaptive Payments args. | |
* | |
* @param array $args | |
* @param WC_Order $order | |
* @return array | |
*/ | |
function wc_adaptive_payment_custom_args( $args, $order ) { | |
$args['receiverList'] = array( | |
'receiver' => array( | |
array( | |
'amount' => '40.00', | |
'email' => '[email protected]' | |
// 'primary' => 'true' // use this only for Chained Payment. | |
), | |
array( | |
'amount' => '15.00', | |
'email' => '[email protected]' | |
), | |
array( | |
'amount' => '60.00', | |
'email' => '[email protected]' | |
) | |
) | |
); | |
return $args; | |
} | |
add_filter( 'woocommerce_paypal_ap_payment_args', 'custom_woocommerce_paypal_ap_payment_args', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment