the existing wizard is a bit of mess. The main goal was to construct a
multistep form without using sessions. There wizard controller class is what
defines the sequence of steps, and to enable validation at each step, we
basically walk through steps already passed and get them to validate the
request data and hand back some data objects, such that all request data
that might be used is validated at each step. individual steps can be
overridden by registering an alternative view with the same name, or
alternatively by replacing the controller.

The conditions getting invoked a few times is partly just a consequence of
how formlib work, on rendering of the form, where we render the available
next actions, and also when processing the request to determine if an action
handler has been called. The wizard process also invokes the update method
(which in turn will invoke conditions) when it retrieves and sets the
current step. i've been away from the codebase long enough its not clear why
exactly its being invoked as many times (5) as in your demonstration.

hth,
kapil

On Thu, Dec 11, 2008 at 8:44 AM, Jim Nelson <[EMAIL PROTECTED]>wrote:

>
> Daniel Holth wrote:
> > makePayment is called when the "Make Payment" button is pressed after
> > entering credit card information. I noticed the condition function is
> > called 3 times, but when I subclass it /my/ make-payment condition is
> > called 5 times! Does anyone know why it doesn't just check once?
> >
>
> The checkout mechanism is kind of a mess.  When I got getpaid.paypal to
> work, I
> ended up overriding the whole checkout wizard and replacing it with my own
> - I
> could find no clean way to override the various parts of the existing
> wizard.
>
> > My problem is that the frm instance doesn't have all the data filled
> > in the first time condition is called, but it does have that
> > information on successive calls. If I can't give the right answer on
> > the first call, the user sees the credit card entry form again instead
> > of progressing to the "Order submitted" page.
> >
>
> I think it does that on purpose.  It looks like the code is designed to
> work
> with XML- or JSON-based credit card processing systems only, and fails
> miserably
> at any other attempt.
>
> > Thanks,
> >
> > Daniel Holth
> >
> > def haveInputWidgetsAndPrint(frm, action):
> >     print "form.haveInputWidgets"
> >     return form.haveInputWidgets(frm, action)
> >
> > class CheckoutReviewAndPay(BaseCheckoutForm):
> >
> >     ...
> >
> >     @form.action(_(u"Make Payment"), name="make-payment",
> > condition=haveInputWidgetsAndPrint )
> >     def makePayment( self, action, data ):
> >         """ create an order, and submit to the processor
> >         """
> >         manage_options = IGetPaidManagementOptions( self.context )
> >         processor_name = manage_options.payment_processor
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"getpaid-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/getpaid-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to