[Handel] credit card processing questions

charlie Bowman cbowmanschool at yahoo.com
Thu Dec 8 01:14:33 CET 2005

1. What field is the credit card info stored?

temporary fields are as follows:

ccn = credit card number
cctype = credit card type (visa,mastercard...)
ccm = month
ccy = year
ccvn = credit card verification number
ccname = credit card name

cool that clears things up quite a bit!  I've looked
over the database after an order was completed and was
beginning to get confused.

2. How do I unencrypt this number for later refunds or

You make a good point about accountability of credit
card numbers, but personally I like the idea of being
able to look up a transaction based upon a credit card
number.  Most customers never keep a receipt,
especially not a digital one.  I think I'll try my
hand at subclassing this portion.

3. Where do I add in the actual credit card

Now I'm beginnin to understand your idea of a plugable
system....and I like it!  I do have one question.  Do
I have to make the plugin/sub function 
CHECKOUT_PHASE_AUTHORIZE or is that an arbitrary name
that you chose.  I have the same question about the
return value.  If there is an error in the authorising
of the credit card, how do I pass errors back to the
main script. CHECKOUT_PHASE_AUTHORIZE makes complete
sense as a name, I'm just wondering how open ended
your plugin system is.

4. I can't seem to get the updated field in the orders
table to update.  Any ideas?
I am using the scaffolding that works so well with
catalyst.  I'm also using MySql as my backend.  I
thought that field was an auto update.  I set mysql up
to do that but I guess I set it up incorrectly.  I
guess I'll just modify some of the code to update that

thanks again for the tool.  This is my 5th commerce
site and I have been dreading making the shopping cart
for a while! Here's a little christmas wish list for
Handel.  Maybe these are there and I just missed them.

1. Downloadable Mysql file to set up the database.
(perl.com has a link the sql-lite version but this
causes errors when loading the .sql into MySql)
2. A Tutorial on the web that goes furthur than the
perl.com version.  It does a good job of setting up
handel but doesn't explain actually whats happening. 
When i finish this project I'm going to write up a
small tutorial using Catalyst and Handel that starts
where the perl.com version left off...as long as I
figure it out by then.

Thanks again for the help and the tool!

--- "Christopher H. Laco" <claco at chrislaco.com> wrote:

> charlie Bowman wrote:
> > I'm going through my first site using Handel and
> > Catalyst and I've got a few questions.  Please
> bear
> > with me through this process.
> I still get silly every time someone actually uses
> my code. :-)
> > 
> > 1. What field is the credit card info stored?
> Good question. I guess I forgot to put those fields
> in the pod. :-)
> The following temporary fields are declared for
> Handel::Order:
> 	ccn cctype ccm ccy ccvn ccname
> Temporary is the key word here. They act like
> fields, but they are never
> stored in the database [by design]. The values in
> these fields live only
> as long as the order instance they are used within.
> Typically, one would load an order, set the credit
> card info, then call
> the $checkout->process() to do order processing.
> Once that processing is
> over and $order is out of scope, those fields are
> lost.
> If you would like something more permanent, you can
> subclass
> Handel::Order and create your own:
> > 2. How do I unencrypt this number for later
> refunds or
> > charges.
> Don't. :-) If you are dealing with refunds, this
> needs to be offline in
> a business system IMHO, or in permanent records; not
> in an online ecom
> site. If you really need to, subclass Handel::Order,
> make a custom field
> and a sub that does the encryption/decryption.
> > 3. Where do I add in my actuall credit card
> > processing.  Do I just add it to the
> Checkout/payment
> > function?
> You would need to write a new plugin for the phases
> CHECKOUT_PHASE_AUTHORIZE, if someone else hasn't
> already.
> See:
> This would roughly be:
>   package MyPackage::FaxOrder;
>   use Handel::Constants qw(:checkout);
>   use base 'Handel::Checkout::Plugin';
>   use Business::OnlinePayment::SomePaymentProcessor
>   sub register {
>     my ($self, $ctx) = @_;
>     $ctx->add_handler(CHECKOUT_PHASE_AUTHORIZE,
> \&process_credit_card);
>   };
>   sub process_credit_card {
>     my ($self, $ctx) = @_;
>     ...online payment code here...
>   };
> See the Business::OnlinePayment::* modules on CPAN
> for starters...
> > 4. I can't seem to get the updated field in the
> orders
> > table to update.  Any ideas?
> Manually, or after you place an order in the generic
> scaffold created
> for Catalyst?
> The updated field doesn't set itself everytime
> something is updated.
> It's a manual field like all the others.
> If you're using MySQL, I think the AssignOrderNumber
> plugin makes some
> silly assumptions, like:
>     $ctx->order->updated(scalar localtime);
> I may just remove that from that plugin, because it
> doesn't have
> anyhting to do with assigning an order number. :-)
> > 
> > Even though I'm spending alot of time learning
> these
> > two tools.  I've already saved myself several days
> of
> > work!  Thanks in advance for the help.
> > 
> > Charlie
> -=Chris
> > _______________________________________________
> Handel mailing list
> Handel at lists.rawmode.org

Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 

More information about the Handel mailing list