Thread Starter
cr42yd
(@cr42yd)
ok i think i found the problem. We need an paypal buisness account for it. Is there a fix to use normal papyal acc?
@cr42yd – The snippet should still work fine and you shouldn’t have to have a PayPal business account for it to work. You should simply have two separate PayPal Standard accounts.
Can you share the snippet you have in place so I can test and see if it works on my end?
Thread Starter
cr42yd
(@cr42yd)
Hello,
thats the snippet i got from github:
<?php
/**
* Multiple PayPal Standard Accounts
*
* Modify the paypal business email on a per form basis.
* This allows you to create separate donation forms per paypal “business” aka nonprofit cause.
*
* @param $paypal_args
* @param $payment_data
*
* @return array $paypal_args
*/
function my_custom_multiple_paypal_accounts( $paypal_args, $payment_data ) {
$form_id = isset( $payment_data[‘post_data’][‘give-form-id’] ) ? $payment_data[‘post_data’][‘give-form-id’] : ”;
// If this form is ID ‘144’ then we customize the email for it.
if(‘144’ === $form_id ) {
// Customize the email address for this form’s email
$paypal_args[‘business’] = ‘mypaypal@email.com’;
}
// Always return the paypal args.
return $paypal_args;
}
add_filter( ‘give_paypal_redirect_args’, ‘my_custom_multiple_paypal_accounts’, 10, 2 );
I changed the 144 from “if(‘144’ === $form_id )” to my form id 2595.
Also changed ‘mypaypal@email.com’ to ‘myemail@myemail.com’
But still got the paypal adress from plugin backend if i press the paypal donate button from form “2595”.
Thx for help
Hey @cr42yd – I just tested and on my end again and the snippet it worked as I expect it to. Try removing the if statement entirely to see if that works for all forms. If not, perhaps the “My Custom Functions” plugin doesn’t have that snippet activated?