nvz_user_register not fired
-
Hi,
I’m extending UM with automated user activation after successful payment. The user is being added to a new role which is setup to be approved by an admin. This will prevent that a user is immediately activated. After the registration it should redirect the user to a payment url (from Stripe). After successful payment he returns to a page where the payment status is checked and the user gets activated.
add_action( 'um_user_register', 'nvz_user_register', 10, 2 ); function nvz_user_register( $user_id, $args ) { $wp_user = new WP_User( $user_id ); if ( ! empty( $wp_user->roles ) && is_array( $wp_user->roles )){ $contributie = 0; if(in_array('Lid', $wp_user->roles)) $contributie = intval(get_field('contributie_lid', 'option')); if(in_array('Student', $wp_user->roles)) $contributie = intval(get_field('contributie_student', 'option')); if($contributie > 0){ $stripe = new Stripe(); $input = ["user_id" => $user_id, "amount" => $contributie, "description" => "Lidmaatschap", "return_url" => 'https://'.$_SERVER['HTTP_HOST'].'/lidmaatschap-betaald/']; $stripe->Betalen($input); } } }
Problem:
I’m extending ‘um_user_register’ with a function that should redirect the user to the payment. But the function never gets fired.Probably this is the wrong place for after a user registered to a role with admin approvement?
The page I need help with: [log in to see the link]
- The topic ‘nvz_user_register not fired’ is closed to new replies.