Monday, February 28, 2011

Re: A wizard did it

I modified it to be able to use AJAX but it's got a memory problem, that is, you have to be sure which step you're in if you refresh the page :)

On 1 March 2011 08:09, Renato de Freitas Freire <renatoff@gmail.com> wrote:
One thing you have to be careful, is to save the data BEFORE redirecting to another domain.
You have a serious risk to lose your data if you dont.

The solution used by Krissy appears to be the better way to do it.

The wizard component works very well, but it had some bugs.
I had a working version with cake 1.2.8, but I didnt try to use it on 1.3 yet.
I dont know if the actual version is ready to 1.3 or it is still on 1.2, but there is a lot of tutorials to help you to use it on 1.3.

And there is some limitation too. You will have to hack the code to save checkbox fields.

--
Renato de Freitas Freire
renato@morfer.org



On Mon, Feb 28, 2011 at 7:27 PM, Krissy Masters <naked.cake.baker@gmail.com> wrote:
What I did in the same regards to cancelling payment:

User fills out form -> save username / password / set up account basics  but
I have a field User.acct_locked which I mark auto as true send them to
paypal.

If they register then cancel the payment / close window / drop computer in
the tub /  sure they can still login but all they can access is a payment
option screen since acct_locked is true (my own access function).
***********************************************************
Thank you for registering Name / Welcome back / please complete your order /
please select your subscription page:

You could even pull original order if you saved what they wanted before
cancelling.........
************************************************************

After making a payment the IPN function I added in the order what they
bought, update account subscription what not and acct_locked => false. So
once they pay they now have full access.

You could easily delete all acct_locked => 1 after 1 week / day / month
flushing out all unused / never-paid registrations. You would need to come
with a way there but should be easy enough.

K



-----Original Message-----
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Ryan Schmidt
Sent: Monday, February 28, 2011 6:32 PM
To: cake-php@googlegroups.com
Subject: A wizard did it

I'm building a multi-page signup form, using the Wizard component, which
seems to be pretty cool:

https://github.com/jaredhoyt/cakephp-wizard

After entering their preferred username, password, blood type, and mother's
maiden shoe size, I'm going to be directing users over to PayPal to pay for
these services they're signing up with me for. When the PayPal transaction
is complete, PayPal will redirect the user back to a "done" page on my site.
Or, if the transaction is cancelled in PayPal land, I believe PayPal will
redirect the user to a "cancel" page on my site. On these pages I can then
tell the user useful things, like "Thanks for giving me money" or "You
didn't give me any money".

Ultimately, I will want to use the data the customer has provided to create
several database records: users, services, etc. I'm trying to determine what
I should be doing with the user's data between the time they've entered it
and the time they've succeeded in paying me.

I could keep the data in the session only, until the "done" page is reached,
at which point I actually save() it into the appropriate models. This is how
the provided Wizard example handles it. One worry I have here is: what if
the user picked a username, and I validated on page 1 of the wizard that it
was unique, but by the time they came back from PayPal, someone else created
that username. So the user paid me, but the save() into the database with
all the data about what they paid me for fails. Maybe this is a rare enough
occasion that I can get away with just logging all the data and manually
fixing this later.

I could create the e.g. User and Service records as soon as I have enough
data from the customer. What if the user cancels the PayPal transaction? In
the "cancel" page, I could delete the records again. What if the user just
closes the window when they see the PayPal screen? My "cancel" page will
never be reached and I'll have stale records lingering in the database. What
if the user later comes back and tries again? Now the username they wanted
to pick is already sitting around unused in my database and they can't have
it anymore.

To avoid stale or unfinished records in important tables like users and
services, I could have an entirely new table, orders, and fill it with
information about the order. After coming back from PayPal successfully, I
could mark the order as ready to be filled. Then I'd need to transfer the
data from the orders table into corresponding users and services records.

Does anyone here have experience doing this kind of signup form and could
share some recommendations? I'd love to hear what you did and whether it
worked well.






--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help
others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: