> On my shopping cart app, I've gotten through the payment > processing part and now I'm entering the data into two > tables. I'm using Nate's example from WACK. Does anyone have > any suggestions on improving this code? It works but I want > to improve it, and I've never used cftransaction before. > In this example, ListFirst(cfhttp.filecontent)is the value > returned from authorize.net. 1 - approved, 2- declined, 3- error > > <!--- Enter order into tblorders ---> > > <cftransaction action="begin"> > ... > <cfif ListFirst(cfhttp.filecontent) EQ 1> > <cftransaction action="commit" /> > <cfelse> > <cftransaction action="rollback" /> > </cfif>
Since the CFHTTP tag isn't shown here, I presume you're executing it before the CFTRANSACTION even starts. In that case, why not just skip the transaction if you get a "declined" or "error" response? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207705 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54