Notary Public Central


"$api_key", "x_tran_key" => "$api_trans_key", "x_version" => "3.1", "x_delim_data" => "TRUE", "x_delim_char" => "|", "x_relay_response" => "FALSE", "x_type" => "AUTH_CAPTURE", "x_method" => "CC", "x_card_num" => "$studentccnum", //demo cc num is 4111111111111111 "x_exp_date" => "$studentccexp", //demo exp is 0115 "x_amount" => "$the_price_is", "x_description" => "Notary Public Central Online Class Signup", "x_first_name" => "$studentfname", "x_last_name" => "$studentlname", "x_address" => "$studentaddress", "x_state" => "$studentstate", "x_zip" => "$studentzip" // Additional fields can be added here as outlined in the AIM integration // guide at: http://developer.authorize.net ); // This section takes the input fields and converts them to the proper format // for an http post. For example: "x_login=username&x_tran_key=a1B2c3D4" $post_string = ""; foreach( $post_values as $key => $value ) { $post_string .= "$key=" . urlencode( $value ) . "&"; } $post_string = rtrim( $post_string, "& " ); // The following section provides an example of how to add line item details to // the post string. Because line items may consist of multiple values with the // same key/name, they cannot be simply added into the above array. // // This section is commented out by default. /* $line_items = array( "item1<|>golf balls<|><|>2<|>18.95<|>Y", "item2<|>golf bag<|>Wilson golf carry bag, red<|>1<|>39.99<|>Y", "item3<|>book<|>Golf for Dummies<|>1<|>21.99<|>Y"); foreach( $line_items as $value ) { $post_string .= "&x_line_item=" . urlencode( $value ); } */ // This sample code uses the CURL library for php to establish a connection, // submit the post, and record the response. // If you receive an error, you may want to ensure that you have the curl // library enabled in your php configuration $request = curl_init($post_url); // initiate curl object curl_setopt($request, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1) curl_setopt($request, CURLOPT_POSTFIELDS, $post_string); // use HTTP POST to send form data curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response. $post_response = curl_exec($request); // execute curl post and store results in $post_response // additional options may be required depending upon your server configuration // you can find documentation on curl options at http://www.php.net/curl_setopt curl_close ($request); // close curl object // This line takes the response and breaks it into an array using the specified delimiting character $response_array = explode($post_values["x_delim_char"],$post_response); //lets setup student in database //first lets see if the student is already in the database $checksql = mysqli_query($dbc, "SELECT uid, uemail FROM user_profiles WHERE uemail='$studentemailaddr' LIMIT 1"); $numrows = mysqli_num_rows($checksql); if($numrows == 0) { $sq = mysqli_query($dbc, "INSERT into user_profiles(uemail, upass, f_name, l_name, u_level, signedup_on, acct_status, cardholdername, address, city, state, zip, uphone, cellphone, ufax) VALUES('$studentemailaddr','$encrypted_users_password','$studentfname','$studentlname', '30','$rightnowid','pending','$cardholdername','$studentaddress','$studentcity','$studentstate','$studentzip','$studentworkphone', '$studenthomephone','$studentfax')"); $newstudentuid = mysqli_insert_id($dbc); } else { $usersrow = mysqli_fetch_array($checksql); extract($usersrow); $newstudentuid = "$uid"; $studentemailaddr = "$uemail"; } // The results from the payment processor $responsenum = $response_array[0]; $response_text = $response_array[3]; $transaction_id = $response_array[6]; $lastfour_num = $response_array[50]; $cardtype = $response_array[51]; if($responsenum != 1 && $trasncation_id =='') { //transaction failed echo "

$response_text

"; //lets record this transaction mysqli_query($dbc, "INSERT into transactions_log(trans_datetime, trans_amount, trans_id, trans_responsecode, trans_userid, trans_cclastfour, trans_cctype, for_class, for_classlocation_id, forclass_id) VALUE('$rightnowid','$the_price_is','$transaction_id','$response_text', '$newstudentuid','$lastfour_num','$cardtype','$fordatabase','Online Class','$onlinecourseid')"); } else { //transaction passed mysqli_query($dbc, "UPDATE user_profiles set upass='$encrypted_users_password', acct_status='active' WHERE uid='$newstudentuid'"); mysqli_query($dbc, "INSERT into user_onlinecontent_access(uid, onlinecourseid, date_added) VALUES('$newstudentuid','$onlinecourseid','$rightnowid')"); //lets record this transaction mysqli_query($dbc, "INSERT into transactions_log(trans_datetime, trans_amount, trans_id, trans_responsecode, trans_userid, trans_cclastfour, trans_cctype, for_class, for_classlocation_id, forclass_id) VALUE('$rightnowid','$the_price_is','$trasncation_id','$response_text', '$newstudentuid','$lastfour_num','$cardtype','$fordatabase','Online Class','$onlinecourseid')"); //lets send email from template include("inc/onlineclass_welcome_email.php"); echo "You have been registered for the Online class titled $online_course_name. You will recieve an email with further information regarding accessing the content shortly.

Transaction Details

Transaction ID: $trasncation_id
Transaction Amount: $$the_price_is
Card Type: $cardtype
Card #: $lastfour_num"; // individual elements of the array could be accessed to read certain response // fields. For example, response_array[0] would return the Response Code, // response_array[2] would return the Response Reason Code. // for a list of response fields, please review the AIM Implementation Guide //end process creditcard with Authorize.net } } else { echo "Click Here To Login Otherwise fill out the form below to regiser for this class.

Class Name: $online_course_name

$online_course_desc Price $$the_price_is

Location: Online access
"; if($regpage_img !='') { echo ""; } echo "

"; ?>

Contact Information

Note: * indicated field is required








$




Payment Information





Terms and Conditions
$orderform_terms"; ?>