Re: ColdFusion / authorize.net question
I don't have much time, but post up a gist of your code or something and I'll take a look. Seems like you're just missing a minor detail or are having a conceptual issue. On 8/17/14, 9:36 PM, Eric Bourland wrote: Has anyone here tried out the ColdFusion SIM* sample code from authorize.net? I've downloaded and tested the sample code and have been reading a lot of stuff in the API. I have a question that seems basic and simple: when using the ColdFusion SIM, is it possible to use form fields with variable data -- like Last Name, First Name, Address, Fee Amount, and so on? The values in the SIM Sample Code are set using the cfset tag. Examples: cfset loginID=xxx cfset transactionKey=yyy cfset amount=19.99 cfset description=Conference Registration Form cfset label=Submit Payment !--- This is the label on the 'submit' button --- cfset testMode=false When I try to set up (for example) a form field for Last Name: cfset LastName=#form.LastName# cfoutputINPUT type=hidden name=x_last_name value=#LastName# //cfoutput ... the output to authorize.net is ... empty. No data. Has anyone here been able to develop an authorize.net SIM form to include variables like First Name, Last Name, Registration Fees, and so on? If so, can you show me an example? My client is hoping I can show her a working authorize.net payment form early this week. But I have been stuck on this problem. Thank you very much for any ideas or examples or other help. best from Eric * Server Integration Method *** Eric Bourland Internet Project Development Washington DC kind | creative | reliable ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359124 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: ColdFusion / authorize.net question
Dear .jonah, Good morning. Thank you so much. The code is below. The page is set up here: http://nnvawi.org/sample.cfm You can try it out and see that there is a blank value for field Last Name in the authorize form. I have tried to follow the sample code given by authorize.net. Thank you very much for any advice you can give me, and for your time. best from Eric Code: cfsetting enablecfoutputonly=true cfoutput !-- 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 below (and including) this comment 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 .cfm -- !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 Coldfusion -- /cfoutput !--- set default values for user-editable fields --- cfparam name=form.LastName default= !--- the parameters for the payment can be configured here --- !--- the API Login ID and Transaction Key must be replaced with valid values --- cfset loginID=x cfset transactionKey=yy cfset amount=19.99 cfset description=Sample Transaction cfset label=Submit Payment !--- The is the label on the 'submit' button --- cfset testMode=false cfset LastName=#form.LastName# !--- adding a cfset for LastName; value for LastName will come from the FORM scope --- !--- 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 --- cfset posturl=https://secure.authorize.net/gateway/transact.dll; !--- If an amount or description were posted to this page, the defaults are overidden --- cfif IsDefined(FORM.amount) cfset amount=FORM.amount /cfif cfif IsDefined(FORM.description) cfset description=FORM.description /cfif cfif IsDefined(FORM.LastName) cfset LastName=FORM.LastName /cfif !--- also check to see if the amount or description were sent using the GET method --- cfif IsDefined(URL.amount) cfset amount=URL.amount /cfif cfif IsDefined(URL.description) cfset description=URL.description /cfif cfif IsDefined(URL.LastName) cfset LastName=URL.LastName /cfif !--- an invoice is generated using the date and time --- cfset invoice=DateFormat(Now(),mmdd) TimeFormat(Now(),HHmmss) !--- a sequence number is randomly generated --- cfset sequence=RandRange(1, 1000) !--- a timestamp is generated --- cfset timestamp=DateDiff(s, January 1 1970 00:00, DateConvert('local2UTC', Now())) !--- The following lines generate the SIM fingerprint --- cf_hmac data=#loginID#^#sequence#^#timestamp#^#amount#^ key=#transactionKey# cfset fingerprint=#digest# cfoutput !--- Print the Amount and Description to the screen.--- pAmount: #amount# br / Description: #description# br / Enter Last Name: input type=text name=LastName value= tabindex=1 size=20 //p !--- gist of problem is just above -- I cannot set up a field in which a user can enter a value like LastName --- !--- Create the HTML form containing necessary SIM post values --- FORM method='post' action='#posturl#' !--- Additional fields can be added here as outlined in the SIM integration guide at http://developer.authorize.net --- INPUT type='hidden' name='x_login' value='#loginID#' / INPUT type='hidden' name='x_amount' value='#amount#' / INPUT type='hidden' name='x_description' value='#description#' / INPUT type='hidden' name='x_invoice_num' value='#invoice#' / 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_test_request' value='#testMode#' / INPUT type='hidden' name='x_show_form' value='PAYMENT_FORM' / input type='submit' value='#label#' / cfoutputINPUT type='hidden' name='x_last_name' value='#LastName#' //cfoutput !--- add hidden field to convert #LastName# to x_last_name for authorize --- /FORM !-- This is the end of the code generating the submit payment button.-- /BODY /HTML !-- The last line is a necessary part of the coldfusion script -- /cfoutput To: cf-talk@houseoffusion.com Subject: Re: ColdFusion / authorize.net question Date: Sun, 17 Aug 2014 22:59:41 -0700 From: jonah@creori.com I don't have much time, but post up a gist of your code or something and I'll take a look. Seems like you're just missing a minor detail or are having a conceptual issue
Re: ColdFusion / authorize.net question
!--- add hidden field to convert #LastName# to x_last_name for authorize --- /FORM !-- This is the end of the code generating the submit payment button. -- /BODY /HTML !-- The last line is a necessary part of the coldfusion script -- /cfoutput To: cf-talk@houseoffusion.com Subject: Re: ColdFusion / authorize.net question Date: Sun, 17 Aug 2014 22:59:41 -0700 From: jonah@creori.com I don't have much time, but post up a gist of your code or something and I'll take a look. Seems like you're just missing a minor detail or are having a conceptual issue. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359126 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: ColdFusion / authorize.net question
On 8/18/2014 12:36 AM, Eric Bourland wrote: Has anyone here tried out the ColdFusion SIM* sample code from authorize.net? I A version of the below has been working great for me. I use it as a include on my form processing page that also records the appropriate data to the customers record in the database (NOT the credit card info! NEVER do this!) !--- Get our Merchant Account User ID, Transaction Key and Amount --- cfset x_login = xx cfset x_tran_key=xx cfset x_amount=#FORM.x_amount# !--- Open a connection to Authorize.Net using CFHTTP --- cfhttp url=https://secure.authorize.net/gateway/transact.dll; method=post !--- Set the Merchant Information --- cfhttpparam type=formField name=x_login value=#x_login# cfhttpparam type=formField name=x_tran_key value=#x_tran_key# cfhttpparam type=formfield name=x_test_request value=false cfhttpparam type=formField name=x_version value=3.1 cfhttpparam type=formField name=x_delim_data value=TRUE cfhttpparam type=formField name=x_delim_char value=| cfhttpparam type=formField name=x_relay_response value=FALSE !--- Set the CUSTOMER INFORMATION --- cfhttpparam type=formfield name=x_cust_id value=- cfhttpparam type=formfield name=x_FirstName value=#form.x_FirstName# cfhttpparam type=formfield name=x_LastName value=#form.x_LastName# cfhttpparam type=formfield name=x_Company value=#form.x_Company# cfhttpparam type=formfield name=x_Address value=#form.x_Address# cfhttpparam type=formfield name=x_City value=#form.x_City# cfhttpparam type=formfield name=x_State value=#form.x_State# cfhttpparam type=formfield name=x_Zip value=#form.x_Zip# cfhttpparam type=formfield name=x_Country value=#form.X_Country# cfhttpparam type=formfield name=x_PhoneNumber value=#form.x_PhoneNumber# !--- TRANSACTION INFORMATION FOR Credit Card --- !--- I needed to send some extra data along, so it's all in the x_description field and I can parse it back out when/if needed --- cfhttpparam type=formField name=x_invoice_num value=#form.invoiceNUMBER# cfhttpparam type=formField name=x_description value=#form.policyNUMBER# - Invoice:#form.invoiceNUMBER# - #form.policyTYPE# - #form.x_Company# cfhttpparam type=formField name=x_amount value=#x_amount# cfhttpparam type=formField name=x_type value=AUTH_CAPTURE cfhttpparam type=formfield name=x_ship_to_company value=Premium: #form.initial_amount# Handling: #form.handler# cfhttpparam type=formField name=x_card_num value=#form.x_cardNumber# cfhttpparam type=formField name=x_exp_date value=#form.x_exp_date# cfhttpparam type=formField name=x_card_code value=#form.x_card_code# / /cfhttp !--- Get the Authorize.net response --- cfset AuthList = #cfhttp.FileContent# !--- JUST FOR TESTING if needed cfdump var=#cfhttp.FileContent# expand=yes --- cfset request.responseCODE = #trim(listGetAt(AuthList, 1, |))# cfset request.response = #trim(listGetAt(AuthList, 4, |))# cfset request.transactionID = #trim(listGetAt(AuthList, 7, |))# cfset request.invoiceNUM = #trim(listGetAt(AuthList, 8, |))# cfset request.DESC = #trim(listGetAt(AuthList, 9, |))# !---BLOCK BELOW WILL OUTPUT THE AUTHONET RESPONSE pstrongResponse:/strong #request.response#br / strongTransaction Id:/strong #request.transactionID#br / strongInvoice Number:/strong #request.invoiceNUM#br / strongDescription:/strong #request.DESC#/p END RESPONSE CODE--- ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359127 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: ColdFusion / authorize.net question
Les, your implementation is using the Direct Post Method (DPM), not the Server Integration Method (SIM) that Eric is trying to implement. On Mon, Aug 18, 2014 at 2:52 PM, Les Mizzell lesm...@bellsouth.net wrote: On 8/18/2014 12:36 AM, Eric Bourland wrote: Has anyone here tried out the ColdFusion SIM* sample code from authorize.net? I A version of the below has been working great for me. I use it as a include on my form processing page that also records the appropriate data to the customers record in the database (NOT the credit card info! NEVER do this!) -- --- Dean M. Lawrence INTERNET DATA TECHNOLOGY p // 888.438.4381 ext. 701 w // www.idatatech.com f // www.facebook.com/idatatech t // www.twitter.com/idatatech Social Marketing | SEO | Design | Internet Development ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359128 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: ColdFusion / authorize.net question
Dean and Les, Thank you for these helpful remarks. Dean, I think I did implement, in another draft of this form, the idea that you suggested -- but I will check that and confirm. I've been working on this task stubbornly for three days and have many versions of this code. I will check my work; try your suggestion; and report back here. Thanks so much. Eric To: cf-talk@houseoffusion.com Subject: Re: ColdFusion / authorize.net question Date: Mon, 18 Aug 2014 15:02:44 -0400 From: dean...@gmail.com Les, your implementation is using the Direct Post Method (DPM), not the Server Integration Method (SIM) that Eric is trying to implement. On Mon, Aug 18, 2014 at 2:52 PM, Les Mizzell lesm...@bellsouth.net wrote: On 8/18/2014 12:36 AM, Eric Bourland wrote: Has anyone here tried out the ColdFusion SIM* sample code from authorize.net? I A version of the below has been working great for me. I use it as a include on my form processing page that also records the appropriate data to the customers record in the database (NOT the credit card info! NEVER do this!) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359147 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: ColdFusion / authorize.net question
http://nnvawi.org/sample2.cfm When I use the code, below, then the Last Name field in the authorize.net page gets populated with: cfoutput/cfoutput So it looks like something is ... erasing the value of #form.lastname#: cfset lastname=cfoutput#form.lastname#/cfoutput !--- set value of lastname from #form.lastname#--- An easier option would be to just rename your LastName field to x_last_name and not have to deal with the javascript at all. This makes a tremendous amount of sense ... and I did try it -- I am pretty sure I did ... around 3 this morning. I was pretty tired then, so I will try it again and let you know how it goes. But, it seems like this code should work, yes? Thank you again for your help. Eric [code] cfsetting enablecfoutputonly=true cfoutput !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 Coldfusion -- /cfoutput !--- set default values for other user-editable fields --- cfparam name=form.lastname default= cfset lastname=cfoutput#form.lastname#/cfoutput !--- set value of lastname from #form.lastname#--- !--- the parameters for the payment can be configured here --- !--- the API Login ID and Transaction Key must be replaced with valid values --- cfset loginID=86G3UkHsuB cfset transactionKey=4feP455vF62EzS87 cfset amount=19.99 cfset description=Sample Transaction cfset label=Submit Payment !--- This the label on the 'submit' button --- cfset 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 --- cfset posturl=https://secure.authorize.net/gateway/transact.dll; !--- an invoice is generated using the date and time --- cfset invoice=DateFormat(Now(),mmdd) TimeFormat(Now(),HHmmss) !--- a sequence number is randomly generated --- cfset sequence=RandRange(1, 1000) !--- a timestamp is generated --- cfset timestamp=DateDiff(s, January 1 1970 00:00, DateConvert('local2UTC', Now())) !--- The following lines generate the SIM fingerprint --- cf_hmac data=#loginID#^#sequence#^#timestamp#^#amount#^ key=#transactionKey# cfset fingerprint=#digest# cfoutput !--- begin CFOUTPUT --- !--- Print the Amount and Description to the screen.--- pAmount: #amount# br / Description: #description#/p !--- Create the HTML form containing necessary SIM post values --- FORM method='post' action='#posturl#' !--- Additional fields can be added here as outlined in the SIM integration guide at http://developer.authorize.net --- pEnter Last Name: INPUT type=text NAME=lastname value= //p INPUT type='hidden' name='x_login' value='#loginID#' / INPUT type='hidden' name='x_amount' value='#amount#' / INPUT type='hidden' name='x_description' value='#description#' / INPUT type='hidden' name='x_invoice_num' value='#invoice#' / 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_test_request' value='#testMode#' / INPUT type='hidden' name='x_show_form' value='PAYMENT_FORM' / input type='submit' value='#label#' / INPUT type='hidden' name='x_last_name' value='#lastname#' /!--- populate field 'x_last_name' with value #lastname#--- /FORM !-- This is the end of the code generating the submit payment button.-- /BODY /HTML !-- The last line is a necessary part of the coldfusion script -- /cfoutput !--- close CFOUTPUT --- [/code] *** Eric Bourland Internet Project Development Washington DC kind | creative | reliable ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359148 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: ColdFusion / authorize.net question
I might try cfset lastname=form.lastname instead of cfset lastname=cfoutput#form.lastname#/cfoutput Eric Bourland ebwebw...@outlook.com wrote: http://nnvawi.org/sample2.cfm When I use the code, below, then the Last Name field in the authorize.net page gets populated with: cfoutput/cfoutput So it looks like something is ... erasing the value of #form.lastname#: cfset lastname=cfoutput#form.lastname#/cfoutput !--- set value of lastname from #form.lastname#--- An easier option would be to just rename your LastName field to x_last_name and not have to deal with the javascript at all. This makes a tremendous amount of sense ... and I did try it -- I am pretty sure I did ... around 3 this morning. I was pretty tired then, so I will try it again and let you know how it goes. But, it seems like this code should work, yes? Thank you again for your help. Eric [code] cfsetting enablecfoutputonly=true cfoutput !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 Coldfusion -- /cfoutput !--- set default values for other user-editable fields --- cfparam name=form.lastname default= cfset lastname=cfoutput#form.lastname#/cfoutput !--- set value of lastname from #form.lastname#--- !--- the parameters for the payment can be configured here --- !--- the API Login ID and Transaction Key must be replaced with valid values --- cfset loginID=86G3UkHsuB cfset transactionKey=4feP455vF62EzS87 cfset amount=19.99 cfset description=Sample Transaction cfset label=Submit Payment !--- This the label on the 'submit' button --- cfset 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 --- cfset posturl=https://secure.authorize.net/gateway/transact.dll; !--- an invoice is generated using the date and time --- cfset invoice=DateFormat(Now(),mmdd) TimeFormat(Now(),HHmmss) !--- a sequence number is randomly generated --- cfset sequence=RandRange(1, 1000) !--- a timestamp is generated --- cfset timestamp=DateDiff(s, January 1 1970 00:00, DateConvert('local2UTC', Now())) !--- The following lines generate the SIM fingerprint --- cf_hmac data=#loginID#^#sequence#^#timestamp#^#amount#^ key=#transactionKey# cfset fingerprint=#digest# cfoutput !--- begin CFOUTPUT --- !--- Print the Amount and Description to the screen.--- pAmount: #amount# br / Description: #description#/p !--- Create the HTML form containing necessary SIM post values --- FORM method='post' action='#posturl#' !--- Additional fields can be added here as outlined in the SIM integration guide at http://developer.authorize.net --- pEnter Last Name: INPUT type=text NAME=lastname value= //p INPUT type='hidden' name='x_login' value='#loginID#' / INPUT type='hidden' name='x_amount' value='#amount#' / INPUT type='hidden' name='x_description' value='#description#' / INPUT type='hidden' name='x_invoice_num' value='#invoice#' / 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_test_request' value='#testMode#' / INPUT type='hidden' name='x_show_form' value='PAYMENT_FORM' / input type='submit' value='#label#' / INPUT type='hidden' name='x_last_name' value='#lastname#' /!--- populate field 'x_last_name' with value #lastname#--- /FORM !-- This is the end of the code generating the submit payment button. -- /BODY /HTML !-- The last line is a necessary part of the coldfusion script -- /cfoutput !--- close CFOUTPUT --- [/code] *** Eric Bourland Internet Project Development Washington DC kind | creative | reliable ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359149 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: ColdFusion / authorize.net question
Dear Roger, Thanks for that. However, cfset lastname=form.lastname !--- set value of lastname from #form.lastname#--- inserts value form.lastname in the Last Name field in the authorize.net form. I think I need the outputs. I am also wondering why any value that occurs between the outputs gets .. stolen. Gone. I'll try this next: An easier option would be to just rename your LastName field to x_last_name and not have to deal with the javascript at all. *** Eric Bourland Internet Project Development Washington DC kind | creative | reliable To: cf-talk@houseoffusion.com Subject: RE: ColdFusion / authorize.net question Date: Mon, 18 Aug 2014 22:47:08 + From: raust...@nc.rr.com I might try cfset lastname=form.lastname instead of cfset lastname=cfoutput#form.lastname#/cfoutput Eric Bourland ebwebw...@outlook.com wrote: http://nnvawi.org/sample2.cfm When I use the code, below, then the Last Name field in the authorize.net page gets populated with: cfoutput/cfoutput So it looks like something is ... erasing the value of #form.lastname#: cfset lastname=cfoutput#form.lastname#/cfoutput !--- set value of lastname from #form.lastname#--- An easier option would be to just rename your LastName field to x_last_name and not have to deal with the javascript at all. This makes a tremendous amount of sense ... and I did try it -- I am pretty sure I did ... around 3 this morning. I was pretty tired then, so I will try it again and let you know how it goes. But, it seems like this code should work, yes? Thank you again for your help. Eric [code] cfsetting enablecfoutputonly=true cfoutput !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 Coldfusion -- /cfoutput !--- set default values for other user-editable fields --- cfparam name=form.lastname default= cfset lastname=cfoutput#form.lastname#/cfoutput !--- set value of lastname from #form.lastname#--- !--- the parameters for the payment can be configured here --- !--- the API Login ID and Transaction Key must be replaced with valid values --- cfset loginID=86G3UkHsuB cfset transactionKey=4feP455vF62EzS87 cfset amount=19.99 cfset description=Sample Transaction cfset label=Submit Payment !--- This the label on the 'submit' button --- cfset 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 --- cfset posturl=https://secure.authorize.net/gateway/transact.dll; !--- an invoice is generated using the date and time --- cfset invoice=DateFormat(Now(),mmdd) TimeFormat(Now(),HHmmss) !--- a sequence number is randomly generated --- cfset sequence=RandRange(1, 1000) !--- a timestamp is generated --- cfset timestamp=DateDiff(s, January 1 1970 00:00, DateConvert('local2UTC', Now())) !--- The following lines generate the SIM fingerprint --- cf_hmac data=#loginID#^#sequence#^#timestamp#^#amount#^ key=#transactionKey# cfset fingerprint=#digest# cfoutput !--- begin CFOUTPUT --- !--- Print the Amount and Description to the screen.--- pAmount: #amount# br / Description: #description#/p !--- Create the HTML form containing necessary SIM post values --- FORM method='post' action='#posturl#' !--- Additional fields can be added here as outlined in the SIM integration guide at http://developer.authorize.net --- pEnter Last Name: INPUT type=text NAME=lastname value= //p INPUT type='hidden' name='x_login' value='#loginID#' / INPUT type='hidden' name='x_amount' value='#amount#' / INPUT type='hidden' name='x_description' value='#description#' / INPUT type='hidden' name='x_invoice_num' value='#invoice#' / 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_test_request' value='#testMode#' / INPUT type='hidden' name='x_show_form' value='PAYMENT_FORM' / input type='submit' value='#label#' / INPUT type='hidden' name='x_last_name' value='#lastname#' /!--- populate field 'x_last_name' with value #lastname#--- /FORM !-- This is the end of the code generating the submit payment button. -- /BODY /HTML !-- The last line is a necessary part of the coldfusion script -- /cfoutput !--- close CFOUTPUT --- [/code] *** Eric Bourland
Re: ColdFusion / authorize.net question
cfoutput cfset lastname=#form.last_name# /cfoutput but in order for this to work, you need to have a form field with name=lastname and you don't appear to have that in the code you posted. And I agree with Roger that renaming the field names to the variable name you need to send is the simpler solution. On Mon, Aug 18, 2014 at 7:00 PM, Eric Bourland ebwebw...@outlook.com wrote: Dear Roger, Thanks for that. However, cfset lastname=form.lastname !--- set value of lastname from #form.lastname#--- inserts value form.lastname in the Last Name field in the authorize.net form. I think I need the outputs. I am also wondering why any value that occurs between the outputs gets .. stolen. Gone. I'll try this next: An easier option would be to just rename your LastName field to x_last_name and not have to deal with the javascript at all. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359151 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: ColdFusion / authorize.net question
...nd obviously I am going to generate a new transaction key since I just posted mine. sigh. *** Eric Bourland Internet Project Development Washington DC kind | creative | reliable To: cf-talk@houseoffusion.com Subject: RE: ColdFusion / authorize.net question Date: Mon, 18 Aug 2014 23:00:07 + From: ebwebw...@outlook.com Dear Roger, Thanks for that. However, cfset lastname=form.lastname !--- set value of lastname from #form.lastname#--- inserts value form.lastname in the Last Name field in the authorize.net form. I think I need the outputs. I am also wondering why any value that occurs between the outputs gets .. stolen. Gone. I'll try this next: An easier option would be to just rename your LastName field to x_last_name and not have to deal with the javascript at all. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359152 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: ColdFusion / authorize.net question
An easier option would be to just rename your LastName field to x_last_name and not have to deal with the javascript at all. Dean, Maureen: I agree that simple is best. So, I dispensed with cfset, and used this: !--- Create the HTML form containing necessary SIM post values --- FORM method='post' action='#posturl#' pEnter Last Name: INPUT type=text NAME=x_last_name value= //p INPUT type='hidden' name='x_login' value='#loginID#' / INPUT type='hidden' name='x_amount' value='#amount#' / INPUT type='hidden' name='x_description' value='#description#' / INPUT type='hidden' name='x_invoice_num' value='#invoice#' / 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_test_request' value='#testMode#' / INPUT type='hidden' name='x_show_form' value='PAYMENT_FORM' / input type='submit' value='#label#' / INPUT type='hidden' name='x_last_name' value='#x_last_name#' / !--- populate field 'x_last_name' with value #x_last_name#--- /FORM ...but ColdFusion objects to the syntax of this line: INPUT type='hidden' name='x_last_name' value='#x_last_name#' / !--- populate field 'x_last_name' with value #x_last_name#--- Am I on the right track? I feel like I have been missing something quite obvious. Thank you again for your help. Eric *** Eric Bourland Internet Project Development Washington DC kind | creative | reliable ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359153 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: ColdFusion / authorize.net question
You don'tneed the double quotes around form.lastname in a cfset statement. Eric Bourland ebwebw...@outlook.com wrote: Dear Roger, Thanks for that. However, cfset lastname=form.lastname !--- set value of lastname from #form.lastname#--- inserts value form.lastname in the Last Name field in the authorize.net form. I think I need the outputs. I am also wondering why any value that occurs between the outputs gets .. stolen. Gone. I'll try this next: An easier option would be to just rename your LastName field to x_last_name and not have to deal with the javascript at all. -- LinkedIn: http://www.linkedin.com/pub/roger-austin/8/a4/60 Twitter: http://twitter.com/RogerTheGeek Blog: http://RogerTheGeek.wordpress.com/ ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359154 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: ColdFusion / authorize.net question
You now have two form fields with the same name. You can lose the hidden field for x_last_name since you now are getting it from the input. On Mon, Aug 18, 2014 at 7:21 PM, Eric Bourland ebwebw...@outlook.com wrote: An easier option would be to just rename your LastName field to x_last_name and not have to deal with the javascript at all. Dean, Maureen: I agree that simple is best. So, I dispensed with cfset, and used this: !--- Create the HTML form containing necessary SIM post values --- FORM method='post' action='#posturl#' pEnter Last Name: INPUT type=text NAME=x_last_name value= //p ...but ColdFusion objects to the syntax of this line: INPUT type='hidden' name='x_last_name' value='#x_last_name#' / !--- populate field 'x_last_name' with value #x_last_name#--- Am I on the right track? I feel like I have been missing something quite obvious. Thank you again for your help. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359155 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: ColdFusion / authorize.net question
Maureen, you're my hero. That worked. Dean, Roger, Les -- thank you all very much. So -- I need to rename some form fields now. I think I can take it from here. On the phone with authorize.net right now to change API Login Key and Transaction ID after posting them here with my code in a moment of extreme boneheadedness. Thanks very much. =) Eric *** Eric Bourland Internet Project Development Washington DC kind | creative | reliable To: cf-talk@houseoffusion.com Subject: Re: ColdFusion / authorize.net question Date: Mon, 18 Aug 2014 19:36:40 -0400 From: mamamaur...@gmail.com You now have two form fields with the same name. You can lose the hidden field for x_last_name since you now are getting it from the input. On Mon, Aug 18, 2014 at 7:21 PM, Eric Bourland ebwebw...@outlook.com wrote: An easier option would be to just rename your LastName field to x_last_name and not have to deal with the javascript at all. Dean, Maureen: I agree that simple is best. So, I dispensed with cfset, and used this: !--- Create the HTML form containing necessary SIM post values --- FORM method='post' action='#posturl#' pEnter Last Name: INPUT type=text NAME=x_last_name value= //p ...but ColdFusion objects to the syntax of this line: INPUT type='hidden' name='x_last_name' value='#x_last_name#' / !--- populate field 'x_last_name' with value #x_last_name#--- Am I on the right track? I feel like I have been missing something quite obvious. Thank you again for your help. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359156 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: ColdFusion / authorize.net question
Glad to be of help, and don't worry about the boneheadedness. I spent hours last week trying to debug a similar issue with a form only to discover I had a minus sign where I needed an equal sign. Stuff happens. On Mon, Aug 18, 2014 at 8:05 PM, Eric Bourland ebwebw...@outlook.com wrote: Maureen, you're my hero. That worked. Dean, Roger, Les -- thank you all very much. So -- I need to rename some form fields now. I think I can take it from here. On the phone with authorize.net right now to change API Login Key and Transaction ID after posting them here with my code in a moment of extreme boneheadedness. Thanks very much. =) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359158 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm