Reply
Highlighted
Member
Posts: 6
Registered: ‎06-12-2011
Accepted Solution

Help needed asking a 3rd time I've checked the forums cann't find anything

I need help with making so i have more text fields on the first part and have them post to my payment form i just cann't get the first and last name to do it i would also like to figure out have to put the sumit to them all on one page this is my first time ever playing with code so any help would be great.

 

<head>
<title>Sample SIM Implementation</title>
</head>
<body><?php
if (isset($_POST) && is_array($_POST) && count($_POST))
{
$loginID = "xxxxxxxxxxxxxxxxxx";
$transactionKey = "xxxxxxxxxxxxxxx";
$description = "Please put Defendants name Here";
$testMode = "false";
$amount = (float) trim($_REQUEST["x_amount"]);
$FirstName = (float) trim($_REQUEST["x_firstname"]);
$LastName = (float) trim($_REQUEST["x_lastname"]);
$Address = (float) trim($_REQUEST["x_address"]);
$city = (float) trim($_REQUEST["x_city"]);
$state = (float) trim($_REQUEST["x_state"]);
$zip = (float) trim($_REQUEST["x_zip"]);
$invoice = date(YmdHis);
$sequence = rand(1, 1000);
$timeStamp = time();
// The following lines generate the SIM fingerprint. PHP versions 5.1.2 and
// newer have the necessary hmac function built in. For older versions, it
// will try to use the mhash library.
if( phpversion() >
= '5.1.2' )
{
$fingerprint = hash_hmac("md5", $loginID . "^" . $sequence . "^" . $timeStamp . "^" . $amount . "^", $transactionKey);
}
else
{
$fingerprint = bin2hex(mhash(MHASH_MD5, $loginID . "^" . $sequence . "^" . $timeStamp . "^" . $amount . "^", $transactionKey));
}
?>
<form method="post" action="https://test.authorize.net/gateway/transact.dll"><input value="<?php echo $loginID; ?>" type="hidden" name="x_login" /> <input value="<?php echo $amount; ?>" type="hidden" name="x_amount" /> <input value="<?php echo $FirstName; ?>" type="hidden" name="x_firstname" /> <input value="<?php echo $LastName; ?>" type="hidden" name="x_lastname" /> <input value="<?php echo $Address; ?>" type="hidden" name="x_address" /> <input value="<?php echo $city; ?>" type="hidden" name="x_city" /> <input value="<?php echo $state; ?>" type="hidden" name="x_state" /> <input value="<?php echo $zip; ?>" type="hidden" name="x_zip" /> <input value="<?php echo $description; ?>" type="hidden" name="x_description" /> <input value="<?php echo $invoice; ?>" type="hidden" name="x_invoice_num" /> <input value="<?php echo $sequence; ?>" type="hidden" name="x_fp_sequence" /> <input value="<?php echo $timeStamp; ?>" type="hidden" name="x_fp_timestamp" /> <input value="<?php echo $fingerprint; ?>" type="hidden" name="x_fp_hash" /> <input value="<?php echo $testMode; ?>" type="hidden" name="x_test_request" /> <input value="PAYMENT_FORM" type="hidden" name="x_show_form" /> <input value="Submit Payment" type="submit" /> </form><?php
}
else
{
?>

<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">Amount: <input type="text" name="x_amount" /> First Name: <input value="<?php echo $FirstName; ?>" type="text" name="x_FirstName" /> Last Name: <input value="<?php echo $LastName; ?>" type="text" name="x_LastName" /> Address: <input value="<?php echo $address; ?>" type="text" name="x_address" /> city: <input value="<?php echo $city; ?>" type="text" name="x_city" /> state: <input value="<?php echo $state; ?>" type="text" name="x_state" /> zip: <input value="<?php echo $zip; ?>" type="text" name="x_zip" /> <input value="AMOUNT" type="submit" /> </form><?php
}
?>

</body>
</html>


Accepted Solutions
Highlighted
Solution
Accepted by topic author gotta21226
‎08-21-2015 01:58 AM
Member
Posts: 6
Registered: ‎06-12-2011

Re: Help needed asking a 3rd time I've checked the forums cann't find anything

I got it working thanks  i didn't have the names in the echo fingerprint   

View solution in original post


All Replies
Highlighted
Posts: 1,476
Topics: 33
Kudos: 34
Solutions: 126
Registered: ‎09-14-2009

Re: Help needed asking a 3rd time I've checked the forums cann't find anything

Get rid of all of the (float). They're what's causing your problems.

-------------------------------------------------------------------------------------------------------------------------------------------
John Conde :: Certified Authorize.Net Developer (Brainyminds) :: Official Authorize.Net Blogger

NEW! Handling Authorize.Net's Webhooks with PHP

Integrate Every Authorize.Net JSON API with One PHP Class (Sample code included)

Tutorials for integrating Authorize.Net with PHP: AIM, ARB, CIM, Silent Post
All About Authorize.Net's Silent Post
Highlighted
Member
Posts: 6
Registered: ‎06-12-2011

Re: Help needed asking a 3rd time I've checked the forums cann't find anything

Thanks i tried that still not getten the first last name in the and how do i make it so the text areas are under each other

Highlighted
Solution
Accepted by topic author gotta21226
‎08-21-2015 01:58 AM
Member
Posts: 6
Registered: ‎06-12-2011

Re: Help needed asking a 3rd time I've checked the forums cann't find anything

I got it working thanks  i didn't have the names in the echo fingerprint   

Highlighted
Member
Posts: 6
Registered: ‎06-12-2011

Re: Help needed asking a 3rd time I've checked the forums cann't find anything

Here it is if someone is looking for something like this added more fields to echo to payment gateway 

<?php
if (isset($_POST) && is_array($_POST) && count($_POST))
{
$loginID = "xxxxxxxxxxxxx";
$transactionKey = "xxxxxxxxxxxxxxxxx";
$description = "xxxxxxxxxxxxxxx";
$testMode = "false";
$amount = ($_REQUEST["x_amount"]);
$first_name = ($_POST["x_first_name"]);
$last_name = ($_POST["x_last_name"]);
$Address = ($_REQUEST["x_address"]);
$city = ($_REQUEST["x_city"]);
$state = ($_REQUEST["x_state"]);
$zip = ($_REQUEST["x_zip"]);
$email = ($_REQUEST["x_email"]);
$phone = ($_REQUEST["x_phone"]);
$invoice = date(YmdHis);
$sequence = rand(1, 1000);
$timeStamp = time();
// The following lines generate the SIM fingerprint. PHP versions 5.1.2 and
// newer have the necessary hmac function built in. For older versions, it
// will try to use the mhash library.
if( phpversion() >= '5.1.2' )
{
$fingerprint = hash_hmac("md5", $loginID . "^" . $sequence . "^" . $timeStamp . "^" . $amount ."^", $transactionKey);
}
else
{
$fingerprint = bin2hex(mhash(MHASH_MD5, $loginID . "^" . $sequence . "^" . $timeStamp . "^" . $amount . "^", $transactionKey));
}
?>
<form method="post" action="https://test.authorize.net/gateway/transact.dll"><input value="<?php echo $loginID; ?>" type="hidden" name="x_login" /> <input value="<?php echo $amount; ?>" type="hidden" name="x_amount" /> <input value="<?php echo $first_name; ?>" type="hidden" name="x_first_name" /> <input value="<?php echo $last_name; ?>" type="hidden" name="x_last_name" /> <input value="<?php echo $Address; ?>" type="hidden" name="x_address" /> <input value="<?php echo $city; ?>" type="hidden" name="x_city" /> <input value="<?php echo $state; ?>" type="hidden" name="x_state" /> <input value="<?php echo $zip; ?>" type="hidden" name="x_zip" /> <input value="<?php echo $description; ?>" type="hidden" name="x_description" /><input value="<?php echo $email; ?>" type="hidden" name="x_email" /><input value="<?php echo $phone; ?>" type="hidden" name="x_phone" /> <input value="<?php echo $invoice; ?>" type="hidden" name="x_invoice_num" /> <input value="<?php echo $sequence; ?>" type="hidden" name="x_fp_sequence" /> <input value="<?php echo $timeStamp; ?>" type="hidden" name="x_fp_timestamp" /> <input value="<?php echo $fingerprint; ?>" type="hidden" name="x_fp_hash" /> <input value="<?php echo $testMode; ?>" type="hidden" name="x_test_request" /> <input value="PAYMENT_FORM" type="hidden" name="x_show_form" /> <input value="Continue to Our Secure Server" type="submit" /> </form><?php
}
else
{
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<p>Amount:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<input type="text" name="x_amount" /> </p>
<div>First Name:&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<input value="<?php echo $first_name; ?>" type="text" name="x_first_name" /> </div>
<div>Last Name:&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<input value="<?php echo $last_name; ?>" type="text" name="x_last_name" /> </div>
<div>Address:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<input value="<?php echo $address; ?>" type="text" name="x_address" /> </div>
<div>city:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; <input value="<?php echo $city; ?>" type="text" name="x_city" /></div>
<div>state:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;<input value="<?php echo $state; ?>" type="text" name="x_state" /></div>
<div>&nbsp;zip:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<input value="<?php echo $zip; ?>" type="text" name="x_zip" />
<div>Email:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<input value="<?php echo $email; ?>" type="text" name="x_email" /> </div>
<div>Phone Number: <input value="<?php echo $phone; ?>" type="text" name="x_phone" /> <input value="NexT Page" type="submit" /> </div></form><?php

}
?> </div>