[ic] custom payment module

Dan Bergan dan at berganconsulting.com
Fri Sep 16 23:17:50 UTC 2011


snip
> >
> > Values that were set before the payment module and Scratch values that
> > were set inside the payment module are available at every step, so I
> > think the session is being maintained.
> >
> > I did some digging into the code, and I found that in route_order in
> > Order.pm, and I see near the beginning:
> > my $value_save = { %{$::Values} };
> >
> > And then near the end of the function:
> > $Vend::Interpolate::Values = $::Values = $value_save;
> >
> > So, am I right in thinking that saving data to the values space in an
> > order route won't work for me?  I assume that I will have to put my
> > payment processing outside of the order route:
> > [charge route="mypaymentroute"]
> > and then submit the order after that.
> >
> > Dan
>
> The values hash should be available if it's retrieved at the point that you
> want to use it - I'm not totally clear on the precise process happening here
> but perhaps you have an extra step before using the retrieved values? Losing
> the session is really the only way you're going to lose any values in the
> session in this procedure, so perhaps you could double check that with
> explicit debugging points?
>

Sorry, maybe I wasn't clear enough in my explanation -- the Values
hash is available, the problem was that in the payment processing
during the order route, I was adding new values to the hash -- those
values are not available in subsequent order routes ("main",
"copy_user").  But, I know the session is maintained because if I add
a scratch value, that is available during all steps.

So, I moved my payment route to separate step -- I call [charge
route="mypaymentroute"] then I bounce to a url to do the final submit
of the order.  That seems to be working just fine.

Dan



More information about the interchange-users mailing list