Good afternoon.
I am populating a bean (myBean) as part of a shopping cart payment
wizard. myBean just has firstName, lastName, city, state as
properties. The wizard accepts the aforementioned columns and then
goes to a validation page which accepts CC info. CC info is sent to
the merchant gateway and a return code comes back. if the return code
is true then we save myBean to the database, if false, then we reset.
So in summary:
1. Accept name, city, state (submit)
2. Review name, city, state and add credit card info (submit)
3. Respond with success or failure.
At step 2, I temporarily store myBean in a session. myBean is
populated using the beanFactory plugIn (btw, beanFactory works
great...i just hope it will work with the IBO stuff I've been piecing
together, but I digress). Once I submit the CC info from step 2, the
bean in my session is cleared out and replaced with the values from
the CC information. Does anyone have any idea what's going on here?
Code samples below:
[code name="admin.cfc" type="handler"]
...
<!--- STEP 1 PAGE --->
<cffunction name="myAdmin" access="public" returntype="void"
output="false">
<cfargument name="Event" type="coldbox.system.beans.requestContext">
<cfscript>
Event.setValue("header", "My Person Administration");
LOCAL.myService = CreateObject("component",
"com.nba.service.myService");
LOCAL.myService.init(getDatasource("NBA").getName());
Event.setValue("myProxy", LOCAL.myService.proxy());
Event.setView("myAdmin");
</cfscript>
</cffunction>
<!--- STEP 2 PAGE --->
<cffunction name="myConfirm" access="public" returntype="void"
output="false">
<cfargument name="Event" type="coldbox.system.beans.requestContext">
<cfscript>
LOCAL.myBean = CreateObject("component",
"com.nba.bean.person").init();
getPlugin("beanFactory").populateBean(LOCAL.myBean);
Event.setValue("header", "Confirm New Information");
Event.setValue("amount", 100.00);
if(getPlugin("sessionStorage").exists("myBean"))
getPlugin("sessionStorage").deleteVar("myBean");
getPlugin("sessionStorage").setVar("myBean", LOCAL.myBean);
Event.setView("myConfirm");
</cfscript>
</cffunction>
<!--- STEP 3 PAGE --->
<cffunction name="mySave" access="public" returntype="void"
output="false">
<cfargument name="Event" type="coldbox.system.beans.requestContext">
<cfscript>
dump(getPlugin("sessionStorage").getVar("myBean")); // custom
function to convert bean to struct
abort();
</cfscript>
</cffunction>
...
[/code]
[code name="myBean.cfc" type="bean"]
...
<cfproperty name="firstName" type="any" />
<cfproperty name="lastName" type="any" />
<cfproperty name="city" type="any" />
<cfproperty name="state" type="any" />
<cffunction name="init" access="public" output="false"
returntype="any">
<cfreturn THIS/>
</cffunction>
...
[/code]
Any assistance would be greatly appreciated.
~possum jones