[Catalyst] Single-domain multi-shop, multi-gateway; linked to the one shopping-cart

Kieren Diment diment at gmail.com
Tue Dec 6 09:18:53 GMT 2011



On 06/12/2011, at 7:07 PM, Alec Taylor wrote:

> On Tue, Dec 6, 2011 at 6:15 AM, Denny <2011 at denny.me> wrote:
>> On Mon, 2011-10-31 at 02:38 +1100, Alec Taylor wrote:
>>> Good morning,
>>> 
>>> How would I go about integrating/developing a multi-levelled
>>> meta-shopping-cart using Catalyst?
>>> 
>>> [ ... ]
>>> 
>>> Thanks for all suggestions,
>> 

Disclaimer:  My total experience with web shopping is having looked into the turnkey php solutions for an abortive project some time ago.

As denny says, it's a matter of spending the time to figure out what you want in terms of planning and then spending more time writing the code.  Catalyst buys you flexibility, although the learning curve is probably steeper than other web frameworks.  However, as any emacs user will tell you, a steep learning curve is often a benefit.

Once you've spent the setup time, what you're asking for is pretty easy, given that you have the programmer resources to actually achieve your specification (that's up to you to figure out)

The bulk of the work in Catalyst apps is setting up and maintaining the business logic, and resisting the temptation to shove all of your business logic into controllers.  So what you probably want is a nice pluggable architecture to handle the payment stuff (chapter 4 of The Definitive Guide to Catalyst gives an implementation for this).

So for your use-case you can probably extend the sql schema for an existing shopping cart app to make it multi-gateway, and then get DBIx::Class to understand it via DBIx::Class::Schema::Loader (you'll probably have to do this iteratively with a dummy payment gateway model in the early stages).  That will provide you with the model for your user/order system.  You'll need to evaluate the quality of the payment gateway  models to do that.  At this point you need to start thinking about integrating existing CPAN modules  into your app, preferably using a pluggable architecture, probably  using Catayst::Model::Adaptor or it's variants (although writing your own model from scratch is pretty trivial as well).  CPAN has a lot of payment gateway stuff on it.  Have a look here for details: https://metacpan.org/search?q=business+payment

Then there's the writing templates, and Controllers to provide the front-end.   This is pretty routine work.  If you end up using one of the turnkey solutions, you'll spend lots of time bending their existing html to your will.  Writing your own templates (and stealing appropriately from elsewhere) will buy you more flexibility, and in the long run will cost you little or no extra time.  If you have no existing preferences for a templating language Template Toolkit (https://metacpan.org/module/Template) works well.  My other prefrerence is to use CSS frameworks to do the clean-design stuff for me.  At the moment my preference is for the Elastic framework.

The overriding philosophy of Catalyst is that building a web app is for life, not just for making a blog engine in 5 minutes.  To my understanding Catalyst's major advantages are that it scales better than its competition (without using unreasonable hardware requirements or having programmers hack on it's core), and it's more flexible than its competition as well.



>> 
>> On Mon, 2011-12-05 at 15:53 +1100, Alec Taylor wrote:
>>> Good afternoon,
>>> 
>>> How would I go about building a single-domain multi-shop with
>>> multiple-gateways; linked to the one shopping-cart; using Catalyst?
>>> 
>>> Thanks for all suggestions,
>> 
>> 
>> Hi Alec,
>> 
>> My suggestion is that you should probably take the following approach:
>> 1. Design the software architecture.
>> 2. Implement the system as designed.
>> 3. Test it thoroughly.
>> 
>> If you're not sure how to proceed with any of those steps, then given
>> that you seem to be talking about building a very large-scale commercial
>> application, and you haven't mentioned it being open source, I would
>> suggest that you should probably hire someone who does know how to do it
>> and pay them appropriately.
>> 
>> If you get stuck at specific technical points in step 2 or 3 then I'm
>> sure people on this list will be very happy to give you some guidance,
>> but if you've not even made a start on step 1 then I think you have some
>> work to do for yourself first - or some hiring to do.
>> 
>> Regards,
>> Denny
>> 
> 
> Thanks for the suggestion Denny.
> 
> We definitely support open-source, but haven't yet discussed which
> components we'll open-source.
> 
> Currently we are looking for a good starting base, with a lot of the
> development already done for us; then we'll build up from that
> foundation.
> 
> Research includes: Ruby on Rails (spree), DJango (satchmo) and Catalyst.
> 
> Could you recommend some libraries on CPAN (or other places) which
> will provide a strong foundation for this project?
> 
> Thanks for all suggestions,
> 
> Alec Taylor
> 
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/




More information about the Catalyst mailing list