cancel
Showing results for 
Search instead for 
Did you mean: 

Online payment form for SIM with customer's ability to put in invoice # and payment amount

We have a page on our website where customers can pay their invoices online.  Until a few weeks ago, this page was working. We’ve had this page for over a year and have not had any problems with it.  I've tried everything from uploading my old backups to going through the code line by line. I see no reason why it stopped working...

 

The page is supposed to behave as follows:

1)       Customers go to www.xtreme-exhibits.com/sim_gateway.php

2)       They are presented with a box where they can enter their invoice number and amount they want to pay.

3)       Then they select the “Verify Payment Amount” button

4)       they are given one final screen – a summary page – where they see the amount they entered and a button to “confirm payment”

5)       Then all this information that has been collected is forwarded to our secure Authorize.net merchant account – the payment gateway -- where the credit card is entered, etc…

 

This script which has been working for over a year, has ceased to function between steps 3 and 4.  I’ve checked with multiple programmers and no one can identify why the script has stopped working.  Now, when a customer completes step 3, they are returned to the same page and the boxes are cleared.  I welcome you to try it out yourself.

 

Since its stopping between steps 3 and 4 it seems like the information is not being temporarily stored anymore. It seems like the information is being dumped and the process is restarting rather than summarizing the invoice number and the payment amount and passing the data to Authorize.net.  I've gone round and round with our hosting provider (hostgator.com) and they have no reason on their end why it would stop working.  They ran a strace for me and suggested I post the problem to this board.  Here's a link to the strace:  http://xtreme-exhibits.com/strace.txt

Any ideas as to what could have happened in the last month?

Thanks so much for your suggestions!

 

11 REPLIES 11

Well, my first reaction is that whoever coded this steaming pile needs some serious work on their PHP skills. Not your fault, obviously, but it's making my eyes bleed from the lack of BLOCK tags or embedded variables:

 

print <<<BLOCK
this is a block of HTML
inserted inside my PHP
code without using php
start and end tags
BLOCK;

print "These are {$variables} and {$_POST['variables']} inserted in a string without having to unquote and quote it a million times";

 

Here you go guys, here is how to accept a custom amount for the payment...

 

index.html

<html>
<body>
<form action="sim.php" method="post">
Amount: <input type="text" name="myamount" />
<input type="submit" />
</form>
</body>
</html>

 

sim.php

<?php 
extract($_POST);
require_once 'anet_php_sdk/AuthorizeNet.php'; // Include the SDK you downloaded in Step 2
$api_login_id = 'xxxxxxxx';
$transaction_key = 'xxxxxxxxxxxxx';
$amount = $_POST["myamount"];
$fp_timestamp = time();
$fp_sequence = "123" . time(); // Enter an invoice or other unique number.
$fingerprint = AuthorizeNetSIM_Form::getFingerprint($api_login_id,
  $transaction_key, $amount, $fp_sequence, $fp_timestamp)
?>

<form method='post' action="https://test.authorize.net/gateway/transact.dll">
<input type='hidden' name="x_login" value="<?php echo $api_login_id?>" />
<input type='hidden' name="x_fp_hash" value="<?php echo $fingerprint?>" />
<input type='hidden' name="x_amount" value="<?php echo $amount?>" />
<input type='hidden' name="x_fp_timestamp" value="<?php echo $fp_timestamp?>" />
<input type='hidden' name="x_fp_sequence" value="<?php echo $fp_sequence?>" />
<input type='hidden' name="x_version" value="3.1">
<input type='hidden' name="x_show_form" value="payment_form">
<input type='hidden' name="x_test_request" value="false" />
<input type='hidden' name="x_method" value="cc">
<input type='submit' value="Click here for the secure payment form">
</form>

 

 

RealMayo
Member