Ok, so I am still a newbie when it comes to php but find your website very helpful. I have a question or two for you and I will "check out your sponsors here and there" if you can please assist me : )
1. I have a donation form already made (donate.php) then it goes to (donate_confirm.php) which shows the customer what they entered. And now I created your (config.php), (class.error.php), (class.credit.php) and the (class.authnet.php)......I have all that figured out.
2. What I can't figure out is where to put the code in the second to last box and the code in the last box? Do I need to create another class or something? Do I need to include those on the page with the form? Im not sure but I attached the php snippets I am not sure where to put.
Thank you so much!
//Ok not sure where to put this code //Do I need to make a new PHP file for it //Or do I include it on the page of my form
<?php
require_once"config.php"; require_once"class.error.php"; //My Simple Error Class $e = new error; require_once"class.authnet.php"; $auth = new authnet;
//You get all of the following information from your checkout forms on your site.
//set new transaction $auth->setTransaction($cc_number, $date, $total, $cvv);
//Get response and do something with it if($auth->isApproved()){ $e->setError("Transaction Completed! Please print the following for your records"); $e->showErrors(); //show completed checkout info and write new information to your database }elseif($auth->isDeclined()){ $e->setError($auth->getResponseText()); $e->showErrors(); }else{ $e->setError("Transaction Error! Please try again"); $e->setError($auth->getResponseText()); $e->showErrors(); }
?>
//End of the first snippet I dont know what to do with
//Ok not sure where to put this code either //Do I need to make a new PHP file for it //Or do I include it on the page of my form
<?php $auth->toString(); ?>
//End of the second snippet I dont know what to do with
Required information for transaction processing omitted. setParameter() arg 2 must be a string, integer, or boolean value: NULL given. setParameter() arg 2 must be a string, integer, or boolean value: NULL given. setParameter() arg 2 must be a string, integer, or boolean value: NULL given. setParameter() arg 2 must be a string, integer, or boolean value: NULL given. setParameter() arg 2 must be a string, integer, or boolean value: NULL given. setParameter() arg 2 must be a string, integer, or boolean value: NULL given. Transaction Error! Please try agai
Please help me I do not know where to put this part of the code. It has been attached below:
// Where does this go
<?php
$auth->toString();
?>
//Oh and I am getting this error when I try to submit the form
setParameter() arg 2 must be a string, integer, or boolean value: NULL given. setParameter() arg 2 must be a string, integer, or boolean value: NULL given. Required information for transaction processing omitted. setParameter() arg 2 must be a string, integer, or boolean value: NULL given. setParameter() arg 2 must be a string, integer, or boolean value: NULL given. setParameter() arg 2 must be a string, integer, or boolean value: NULL given. setParameter() arg 2 must be a string, integer, or boolean value: NULL given. setParameter() arg 2 must be a string, integer, or boolean value: NULL given. setParameter() arg 2 must be a string, integer, or boolean value: NULL given. Transaction Error! Please try again
//Please help me I would really appreciate it and will make sure to //metion your website to friends
1. I have a donation form already made (donate.php) then it goes to (donate_confirm.php) which shows the customer what they entered. And now I created your (config.php), (class.error.php), (class.credit.php) and the (class.authnet.php)......I have all that figured out.
2. What I can't figure out is where to put the code in the second to last box and the code in the last box? Do I need to create another class or something? Do I need to include those on the page with the form? Im not sure but I attached the php snippets I am not sure where to put.
Thank you so much!
//Ok not sure where to put this code
//Do I need to make a new PHP file for it
//Or do I include it on the page of my form
<?php
require_once "config.php";
require_once "class.error.php"; //My Simple Error Class
$e = new error;
require_once "class.authnet.php";
$auth = new authnet;
//You get all of the following information from your checkout forms on your site.
//set new transaction
$auth->setTransaction($cc_number, $date, $total, $cvv);
//Billing information
$auth->setParameter("x_email", $b_email);
$auth->setParameter("x_first_name", $b_fname);
$auth->setParameter("x_last_name", $b_lname);
$auth->setParameter("x_address", $b_address);
$auth->setParameter("x_city", $b_city);
$auth->setParameter("x_state", $b_state);
$auth->setParameter("x_zip", $b_zip);
$auth->setParameter("x_country", $b_country);
$auth->setParameter("x_description", $description); //Purchase description (Order #: 199 from yoursite.com)
//Shipping information
$auth->setParameter("x_ship_to_first_name", $s_fname);
$auth->setParameter("x_ship_to_last_name", $s_lname);
$auth->setParameter("x_ship_to_address", $s_address);
$auth->setParameter("x_ship_to_city", $s_city);
$auth->setParameter("x_ship_to_state", $s_state);
$auth->setParameter("x_ship_to_zip.", $s_zip);
$auth->setParameter("x_ship_to_country", $s_country);
//Process checkout information
$auth->process();
//Get response and do something with it
if ($auth->isApproved()) {
$e->setError("Transaction Completed! Please print the following for your records");
$e->showErrors();
//show completed checkout info and write new information to your database
}elseif($auth->isDeclined()){
$e->setError($auth->getResponseText());
$e->showErrors();
}else{
$e->setError("Transaction Error! Please try again");
$e->setError($auth->getResponseText());
$e->showErrors();
}
?>
//End of the first snippet I dont know what to do with
//Ok not sure where to put this code either
//Do I need to make a new PHP file for it
//Or do I include it on the page of my form
<?php
$auth->toString();
?>
//End of the second snippet I dont know what to do with
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
Transaction Error! Please try agai
// Where does this go
<?php
$auth->toString();
?>
//Oh and I am getting this error when I try to submit the form
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
Required information for transaction processing omitted.
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
setParameter() arg 2 must be a string, integer, or boolean value: NULL given.
Transaction Error! Please try again
//Please help me I would really appreciate it and will make sure to //metion your website to friends