Reply
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Newbie - Need help with integration

[ Edited ]

In the sample code the form is create like so

' Create the HTML form containing necessary SIM post values
Response.Write("<FORM method='post' action='" & url & "' >")
' Additional fields can be added here as outlined in the SIM integration guide
' at: http://developer.authorize.net
Response.Write("	<INPUT type='hidden' name='x_login' value='" & loginID & "' />")
Response.Write("	<INPUT type='hidden' name='x_amount' value='" & amount & "' />")
Response.Write("	<INPUT type='hidden' name='x_description' value='" & description & "' />")
Response.Write("	<INPUT type='hidden' name='x_invoice_num' value='" & invoice & "' />")
Response.Write("	<INPUT type='hidden' name='x_fp_sequence' value='" & sequence & "' />")
Response.Write("	<INPUT type='hidden' name='x_fp_timestamp' value='" & timeStamp & "' />")
Response.Write("	<INPUT type='hidden' name='x_fp_hash' value='" & fingerprint & "' />")
Response.Write("	<INPUT type='hidden' name='x_test_request' value='" & testMode & "' />")
Response.Write("	<INPUT type='hidden' name='x_show_form' value='PAYMENT_FORM' />")
Response.Write("	<input type='submit' value='" & label & "' />")
Response.Write("</FORM>")

 But your is outside the script <% %>, so all you been doing is passing the string "amount" not the value "1999.99", etc

and more important, do not send the following, with it and the loginID, other can use your account.

<INPUT TYPE= HIDDEN NAME = "x_txnkey" VALUE="0000000000000000"/>

 

 

Member
Posts: 7
Registered: ‎12-14-2011

Re: Newbie - Need help with integration

So, i fixed the </%> sign and now by "Please click here for payment form" won't open anything. I don't know if i am just mixing up all the infomation, but after clicking that button i am suppose to be taked to the form correct?

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Newbie - Need help with integration

[ Edited ]

Did you look at the browser page sources when running it, it will show you what might be causing the problem.

And post your updated code again and see if we can see the problem.

Member
Posts: 7
Registered: ‎12-14-2011

Re: Newbie - Need help with integration

Thanks.. I feel like i am making something super easy into something exteremly difficult. I am now confused as to how integration works. I have pretty nice general skills in C++ and html, but for some reason i am hitting a stump. My code is below..

 Just a refresher, once i get this "submit payment" button working, i should be taken away from my website and to a general form from authorize.net where customers can fill in information except the amount?

 

<HTML lang='en'>

<title> UNHS online bill pay</title>

<%
loginID= "my id"
transactionKey= "my transaction key"
amount= "0000.00"
description = "Sample Transaction"
label= "Submit Payment"
testMode= "false"
url= "http://secure.authorize.net/gateway/transact.dll"

 
Response.Write If Request.Form ("amount") <> ""Then amount = Request.Form ("amount")
End If
 
If Request.Form ("description") <> ""Then description = Request.Form ("description")
End If
 
If Request.QueryString ("amount") <> ""Then amount = Request.QueryString ("amount")
End If
 
If Request.QueryString ("description") <> ""Then description = Request.QueryString ("description")
End If
 
Dim invoice
invoice = Year (Date) & Month (Date)& Day (Date) & Hour (Now) & Minute (Now) & Second (Now)
 
Dim Sequence
Randomize
Sequence = Int(1000*Rnd)
 

Dim timeStamp = GetSecondsSince1970()+(25200)

Dim fingerprint
fingerprint = HMAC-Md5("transactionKey, loginID  "^" & sequence & "^" & timeStamp & "^" &amount & "^")


 
Response.Write ("Amount: "&amount&"  <br/>")
Response.Write ("Description: "&description&" <br/>")

 

<!--#INCLUDE FILE="simlib.asp"-->
 
<FORM method = post action = "https://secure.authorize.net/gateway/transact.dll">
<%ret=InsertFP(APIloginid, sequence, amount, txnkey)%>
 
<INPUT type=hidden name="x_login" value= "000000000">
<INPUT type = hidden name= "x_version" value= "3.1">
<INPUT type= hidden name="x_amount" value= "0000.00">
<INPUT type=hidden name = "x_method" value="CC">
<INPUT type=hidden name="x_type" value = "CAPTURE_ONLY">
<INPUT type= hidden name= "x_fp_sequence" value=  "sequence">
<INPUT type= hidden name= "x_fp_timeStamp" value="timeStamp">
<INPUT type= hidden name= "x_fp_hash" value=  "fingerprint">
<INPUT type= hidden name= "x_show_form" value= "PAYMENT_FORM">
<INPUT type= submit value="Please click here for secure payment.">

</%>
</Form>

 

</HTML>

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Newbie - Need help with integration

From the sample code, see if you can just download the sample code and change the loginid, transactionKey and the url.

<!--
This sample code is designed to connect to Authorize.net using the SIM method.
For API documentation or additional sample code, please visit:
http://developer.authorize.net

Most of this page can be modified using any standard html. The parts of the
page that cannot be modified are noted in the comments.  This file can be
renamed as long as the file extension remains .asp
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
  "http://www.w3.org/TR/html4/loose.dtd">
<HTML lang='en'>
<HEAD>
	<TITLE> Sample SIM Implementation </TITLE>
</HEAD>
<BODY>

<!-- This section generates the "Submit Payment" button using ASP           -->
<!--#INCLUDE FILE="simlib.asp"-->
<%
' the parameters for the payment can be configured here
' the API Login ID and Transaction Key must be replaced with valid values
Dim loginID, transactionKey, amount, description, label, testMode, url
loginID			= "API_LOGIN_ID"
transactionKey	= "TRANSACTION_KEY"
amount			= "19.99"
description		= "Sample Transaction"
' The is the label on the 'submit' button
label			= "Submit Payment"
testMode		= "false"
' By default, this sample code is designed to post to our test server for
' developer accounts: https://test.authorize.net/gateway/transact.dll
' for real accounts (even in test mode), please make sure that you are
' posting to: https://secure.authorize.net/gateway/transact.dll
url				= "https://test.authorize.net/gateway/transact.dll"

' If an amount or description were posted to this page, the defaults are overidden
If Request.Form("amount") <> "" Then
	amount = Request.Form("amount")
End If
If Request.Form("description") <> "" Then
	description = Request.Form("description")
End If

' also check to see if the amount or description were sent using the GET method
If Request.QueryString("amount") <> "" Then
	amount = Request.QueryString("amount")
End If
If Request.QueryString("description") <> "" Then
	description = Request.QueryString("description")
End If

' an invoice is generated using the date and time
Dim invoice
invoice	= Year(Date) & Month(Date) &  Day(Date) & Hour(Now) & Minute(Now) & Second(Now)
' a sequence number is randomly generated
Dim sequence
Randomize
sequence	= Int(1000 * Rnd)
' a time stamp is generated (using a function from simlib.asp)
Dim timeStamp
timeStamp = simTimeStamp()
' a fingerprint is generated using the functions from simlib.asp and md5.asp
Dim fingerprint
fingerprint = HMAC (transactionKey, loginID & "^" & sequence & "^" & timeStamp & "^" & amount & "^")

' Print the Amount and Description to the screen.
Response.Write("Amount: " & amount & " <br />")
Response.Write("Description: " & description & " <br />")

' Create the HTML form containing necessary SIM post values
Response.Write("<FORM method='post' action='" & url & "' >")
' Additional fields can be added here as outlined in the SIM integration guide
' at: http://developer.authorize.net
Response.Write("	<INPUT type='hidden' name='x_login' value='" & loginID & "' />")
Response.Write("	<INPUT type='hidden' name='x_amount' value='" & amount & "' />")
Response.Write("	<INPUT type='hidden' name='x_description' value='" & description & "' />")
Response.Write("	<INPUT type='hidden' name='x_invoice_num' value='" & invoice & "' />")
Response.Write("	<INPUT type='hidden' name='x_fp_sequence' value='" & sequence & "' />")
Response.Write("	<INPUT type='hidden' name='x_fp_timestamp' value='" & timeStamp & "' />")
Response.Write("	<INPUT type='hidden' name='x_fp_hash' value='" & fingerprint & "' />")
Response.Write("	<INPUT type='hidden' name='x_test_request' value='" & testMode & "' />")
Response.Write("	<INPUT type='hidden' name='x_show_form' value='PAYMENT_FORM' />")
Response.Write("	<input type='submit' value='" & label & "' />")
Response.Write("</FORM>")
%>
<!-- This is the end of the code generating the "submit payment" button.    -->

</BODY>
</HTML>

Also, can you post the browser page source?