cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the amount in SIM Integration

Hi, im new here, and im trying to make SIM Integration with Authorize.net, first excuse my bad english!!!

 

everything is OK in my test using the sample code (php version), but when i try to change the defaul amount via Web, then i get a error, i read the forum about putting trim in the variable but still i getting the error.

 

Here i put diferent trim:

 

if ($_REQUEST["amount"])
    { $amount = trim($_REQUEST["amount"]); }

 

if( phpversion() >= '5.1.2' )
{    $fingerprint = hash_hmac("md5", $loginID . "^" . $sequence . "^" . $timeStamp . "^" . trim($amount) . "^", $transactionKey); }
else
{ $fingerprint = bin2hex(mhash(MHASH_MD5, $loginID . "^" . $sequence . "^" . $timeStamp . "^" . trim($amount) . "^", $transactionKey)); }

 

and i always get this msg: (99) This transaction cannot be accepted.

 

To enter a different amount via web i change the input field from hidden to text, like this:

 

echo "    <INPUT type='text'   name='x_amount' value='$amount' />";

bprado
Member
24 REPLIES 24

sorry for the delay, the one here worked very well, with just some modificactions for customize purpose, if you need any help just post here

Could you provide the code for asp users as well?

Authorize.Net has sample code in ASP.


-------------------------------------------------------------------------------------------------------------------------------------------
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

I am using the sample code but don't understand how to update the hidden field x_amount after the user clicks on the Submit button.

You update this:

    $amount = "19.99";

 

in the parameters area near the top of he sample code.

Hi guys,

 

I know this is an ancient topic.. when I run Dave's code I get this error:

 

Parse error: syntax error, unexpected T_VARIABLE in sim.php on line 45

 

Line 45 contains $LiveLoginId = "xxxxxxxxxxx";      where xxxxxxxxxx is my liveloginID
Line 46: $LiveTransactionKey = "xxxxxxxxxx";

 

Any idea of what may be going on?  thanks.

There is a semicolon missing at the end of this line:

 

$ReturnHomePage = "www.someurl.org"

 Just add it there and it should work

 

$ReturnHomePage = "www.someurl.org";

 


-------------------------------------------------------------------------------------------------------------------------------------------
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

Gotcha, now it's throwing an error for simlib.php.  What does this file do and where may I acquire it?

 

 

Warning: include(simlib.php) [function.include]: failed to open stream: No such file or directory in sim.php on line 81

Warning: include(simlib.php) [function.include]: failed to open stream: No such file or directory in sim.php on line 81

Warning: include() [function.include]: Failed opening 'simlib.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in sim.php on line 81

 

Thank you for your help.

simlib.php probably represents the path to the SIM library file in your Authorize.net PHP SDK (at least, I would hope so...) Try changing to that and see if it works.

Thank you for your help TJ, looks like I have it sorted out now. You guys are a lifesaver.