For the first time, I had a fluke race condition happen in my store app. Two
people placed separate orders at the exact same time. Somehow, the order totals
got crossed up which caused one of the orders to use the other order's total
when transmitting the sale thru authorize.net
I didnt think I HAD to use a lock, but I'm guessing maybe I do because of this.
And to be honest, I never really use locks much because I didn't think I needed
them in the later versions of CF.
Here's the code that transmits to auth.net. I'm guessing I'd wrap it in a
<cflock>?
<!--- Initialize authorize.cfc --->
<cfset SESSION.authorizenet =
createObject("component","cfcs.AuthorizeNet").init(AuthNetLogin,
AuthNetPassword)>
<cfinvoke component="#SESSION.authorizenet#" method="transmitpayment"
returnvariable="response">
<cfinvokeargument name="AuthNetURL" value="#AuthNetURL#">
<cfinvokeargument name="storeinfo" value="#storeinfo#">
<cfinvokeargument name="shopperbillshipinfo"
value="#VARIABLES.shopperbillshipinfo#">
<cfinvokeargument name="shoppercreditinfo"
value="#VARIABLES.shoppercreditinfo#">
<cfinvokeargument name="carttotals" value="#VARIABLES.carttotals#">
<cfinvokeargument name="finalcarttotal" value="#VARIABLES.finalCartTotal#">
<cfinvokeargument name="IPaddress" value="#CGI.remote_addr#">
<cfinvokeargument name="shopperbillstatename" value="#shopperbillstatename#">
<cfinvokeargument name="shoppershipstatename" value="#shoppershipstatename#">
</cfinvoke>
Thanks,
Will
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:293675
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4