static function reconcileAllPaymentUids() { $txn = new paypal_transaction(); $extraWhere = "bp_biobounce_uid ='0'"; while ($txn->loadNext($extraWhere)) { $found = false; $email = $txn->get_variable('bp_paypal_email'); $paypalid = $txn->get_variable('bp_paypal_payer_id'); $txnFind = new paypal_transaction(); $extraWhere2 = "bp_biobounce_uid<>'0' AND bp_paypal_payer_id='" . $paypalid . "'"; if ($txnFind->load($extraWhere2)) { $bioId = $txnFind->get_variable('bp_biobounce_uid'); $found = true; //echo "\n\nFOUND THE USER ID BASED ON PREVIOUSLY BEING SET:PAYPALID=" . $paypalid; } else { $usr = new user(); $usr->set_variable('users_email', $email); if ($usr->load()) { $bioId = $usr->get_variable('users_id'); $found = true; //echo "\nFOUND THE USER ID BASED ON SAME EMAIL ADDRESS:ADDRESS=" . $email; } } if ($found) { $txnId = $txn->get_variable('bp_id'); //echo "\nUPDATING TRANSACTION NUMBER=" . $txnId . " to use UID=" . $bioId; $txn->set_variable('bp_biobounce_uid', $bioId); $txn->update(); } } }
public static function getPaypalEmail($uid) { $paypalFind = new paypal_transaction(); $paypalFind->set_variable('bp_biobounce_uid', $uid); if (!$paypalFind->load()) { return ""; } return $paypalFind->get_variable("bp_paypal_email"); }
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close')); if (!($res = curl_exec($ch))) { curl_close($ch); exit; } curl_close($ch); $debugString = "\nRECEIVED: " . print_r($raw_post_array, true); // if (strcmp ($res, "VERIFIED") == 0) { // Assign payment notification values to local variables $paypalTxn = new paypal_transaction(); $recordTxn = false; // check to make sure we didn't already record this transaction if (!empty($_POST['txn_id'])) { $paypalTxn->set_variable('bp_paypal_txn_id', $_POST['txn_id']); if ($paypalTxn->load()) { $recordTxn = false; $debugString .= "\nTransaction already recorded\n"; } else { $recordTxn = true; } } if ($recordTxn) { $paypalTxn->set_variable('bp_biobounce_uid', $_POST['custom']); $paypalTxn->set_variable('bp_paypal_payer_id', $_POST['payer_id']); $paypalTxn->set_variable('bp_paypal_txn_id', $_POST['txn_id']); $paypalTxn->set_variable('bp_paypal_txn_type', $_POST['txn_type']); $paypalTxn->set_variable('bp_paypal_username', $_POST['username']); $paypalTxn->set_variable('bp_paypal_mc_gross ', $_POST['mc_gross']); $paypalTxn->set_variable('bp_paypal_option_name', $_POST['option_name1']); $paypalTxn->set_variable('bp_paypal_option_selection', $_POST['option_selection1']);