2012-11-05, 05:37 PM
I'm using the Pay Register plugin to require users to pay a fee to register.
The payment goes through, but the user is not added to our database. Does anyone have any experience with this plugin or have an idea what might be going on?
Thanks for reading
More info:
So I've narrowed it down to this code
The reason I think it's that code is because I just happened to look in the mailerrors table for another reason and saw that the my_mail function is failing, with the subject 'Live-VERIFIED IPN' as found in the condition above. So for some reason one of those is failing and I'm not sure which one. (FWIW - the mailerror 'fromaddress' field all hold "" <> which is probably why that's failing. Does it have something to do with my registration errors? )
I double checked to see that the amount we expect through paypal is what is being sent so I think that condition passes.
I don't see anywhere in the file where $payment_status gets set, but it must from somewhere. Also, a few lines before it sets a $payer_status but I don't see it using it..could that be just a typo?
This plugin has a number of downloads so my assumtion is that it must be working for people.
Can any other eyes help me spot what's going on?
Thanks for reading
More Info:
I've managed to verify the passing of all those conditions except the first two ($payment_status and $mc_gross)
As I said above, I don't see where $payment_status gets set, and looking at the contents of the message that are supposed to have all the POST vars appended I don't see mc_gross as a key, but it's used to make $mc_gross
Anyway...that's where I'm stuck.
Actually, looking through ALL the email errors there are some that contain them and some that doen't so now I'm back to why is it failing.
Also, I get anywhere from 1 to 3 mailerrors.
I wrote in a else condition to send me an email with the data when it fails and I get anywhere from 1 to 3 there too.
The condition from above is definitely failing.
The payment goes through, but the user is not added to our database. Does anyone have any experience with this plugin or have an idea what might be going on?
Thanks for reading
More info:
So I've narrowed it down to this code
$mc_gross = $db->escape_string($_POST['mc_gross']);
$payer_status = $db->escape_string($_POST['payer_status']);
$receiver_email = $db->escape_string($_POST['receiver_email']);
$mc_currency = $db->escape_string($_POST['mc_currency']);
if ($payment_status == "Completed" && $mc_gross == $setting['payregister_price']['price'] && $receiver_email == $setting['payregister_email']['value'] && $mc_currency == $setting['payregister_currency']['value'])
{
$lang->load("member");
require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler("insert");
$userinfo = $cache->read("payregister");
$user = stripslashes($userinfo['user']);
$user = urldecode($user);
$user = unserialize($user);
$user['payregistered'] = 1;
$userhandler->set_data($user);
$userhandler->validate_user();
$user_info = $userhandler->insert_user();
$db->delete_query("datacache", "title='payregister'");
my_setcookie("mybbuser", $user_info['uid']."_".$user_info['loginkey'], null, true);
$lang->redirect_registered = $lang->sprintf($lang->redirect_registered, $mybb->settings['bbname'], $user_info['username']);
redirect("index.php", $lang->redirect_registered);
}
my_mail($email, "Live-VERIFIED IPN", $emailtext . "\n\n" . $req);
The reason I think it's that code is because I just happened to look in the mailerrors table for another reason and saw that the my_mail function is failing, with the subject 'Live-VERIFIED IPN' as found in the condition above. So for some reason one of those is failing and I'm not sure which one. (FWIW - the mailerror 'fromaddress' field all hold "" <> which is probably why that's failing. Does it have something to do with my registration errors? )
I double checked to see that the amount we expect through paypal is what is being sent so I think that condition passes.
I don't see anywhere in the file where $payment_status gets set, but it must from somewhere. Also, a few lines before it sets a $payer_status but I don't see it using it..could that be just a typo?
This plugin has a number of downloads so my assumtion is that it must be working for people.
Can any other eyes help me spot what's going on?
Thanks for reading
More Info:
I've managed to verify the passing of all those conditions except the first two ($payment_status and $mc_gross)
As I said above, I don't see where $payment_status gets set, and looking at the contents of the message that are supposed to have all the POST vars appended I don't see mc_gross as a key, but it's used to make $mc_gross
Anyway...that's where I'm stuck.
Actually, looking through ALL the email errors there are some that contain them and some that doen't so now I'm back to why is it failing.
Also, I get anywhere from 1 to 3 mailerrors.
I wrote in a else condition to send me an email with the data when it fails and I get anywhere from 1 to 3 there too.
The condition from above is definitely failing.