I misstated above. I understand that the callback function will work only with PayPal and Authorize (not with stripe). Nevertheless, I am not able to get the callback function to trigger.
It appears from your code that the callback function should also include $transaction_data as arguments. So I am adding that. I am pretty sure this is correct although none of your documentation explains this.
Regarding the $transaction_data it appears that the following is passed and can be manipulated by me:
'new_user' => $new_user,
'new_user_password' => $new_user_password['pass'],
'transaction' => array(
'payment_status' => 'Complete'
),
'billing' => array(
'customer_information_domain_name' => $domain_name['domain_name'],
'user_email' => $user_email
),
'user_data' => array(
'ID' => $user->ID,
'first_name' => !empty( $user_meta['first_name'][0] ) ? $user_meta['first_name'][0] : 'User',
'last_name' => !empty( $user_meta['last_name'][0] ) ? $user_meta['last_name'][0] : 'User',
'user_email' => $user_email,
'user_login' => $user_email
),
'items' => $items,
'other_meta' => array(
'charge_amount' => $post['mc_gross'],
'cc_number' => $post['payer_email'],
'transaction_id'=> $post['txn_id']
),
'post_data' => $post_data //all the meta keys associated with the post id
Hopefully this is the case because I will need to manipulate a few of these variables in my call back function.
So this is what I am able to discern. Am I off base? Have I misinterpreted?
I have tested my simple call back function by calling it with php on my success page. it does work: When I call the function the test email is sent. Therefore, if I am correct in all the above assumptions, and I set up the short code as explained in the first post, and the function is in functions.php as stated in my first post, then why is it not triggering with successful payment in the sandbox and with the IPN handshake completed? What is missing? Do I need to have Return URL on at PayPal? I do not think that this is necessary but is it? I have tried it but still no success? Do I need to use a special hook? I do not know why that would be the case given that I see it is set up with call_user_func(). I think a simple function with an argument would be sufficient. Am I wrong? Could this be because I am in sandbox mode. Does the callback not work in sandbox?
I need the call the back function to work for this project so please respond.