Modern PerlCommerce Past and Future API Development & Deployment Modern PerlCommerce Stefan Hornburg (Racke) racke@linuxia.de Pittsburgh Perl Workshop, 8th October 2011 racke Modern PerlCommerce
Modern PerlCommerce Perl Buzzwords Past and Future Modern Perl API PerlCommerce Choices Development & Deployment Nitesi racke Modern PerlCommerce
Modern PerlCommerce Perl Buzzwords Past and Future Modern Perl API PerlCommerce Choices Development & Deployment Perl Buzzwords ◮ Marketing Perl ◮ Modern Perl ◮ Postmodern Perl racke Modern PerlCommerce
Modern PerlCommerce Perl Buzzwords Past and Future Modern Perl API PerlCommerce Choices Development & Deployment Modern Perl ◮ CPAN ◮ Best Practices ◮ Tests ◮ Separation (Modules, Plugins, Hooks, Templates) ◮ PSGI/Plack racke Modern PerlCommerce
Modern PerlCommerce Perl Buzzwords Past and Future Modern Perl API PerlCommerce Choices Development & Deployment PerlCommerce Choices ◮ Interchange ◮ Handel ◮ Agora ◮ Business::Cart::Generic racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment Past ◮ 1995 CGI ◮ 1995 MiniVend ◮ 1998 http://www.materialboerse.de/ ◮ 2001 Interchange racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment Interchange Development ◮ Lot of things ◮ Small community ◮ Same codebase racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment Status quo racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment References ◮ Backcountry http://www.backcountry.com/ ◮ FragnanceNet http://www.fragrancenet.com/ racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment Future racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment Principles ◮ KISS ◮ Components ◮ Agnostic ◮ Expressive racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment Agnostic Cart ◮ Session ◮ DBI ◮ Webservice * racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment Agnostic Account Manager ◮ DBI ◮ LDAP * ◮ OpenID * racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment Agnostic Templating Engine ◮ Template::Toolkit ◮ Template::Flute racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment Agnostic Web framework ◮ Catalyst ◮ Mojo ◮ Dancer racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment Preferences ◮ Dancer ◮ Template::Flute ◮ DBI racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment Framework ◮ Dispatching requests ◮ Parameter parsing ◮ Session handling ◮ Template engine ◮ I18N racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment Extensions ◮ Bundles ◮ Plugins ◮ Hooks racke Modern PerlCommerce
Modern PerlCommerce Past and Future Past API Future Development & Deployment Features ◮ Navigation ◮ Cart ◮ Checkout ◮ Accounts racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Cart ◮ SKU, Name, Quantity, Price ◮ Price > 0 ◮ Combines automatically ◮ Multiple carts ◮ Storage everywhere ◮ Price caching racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Nitesi::Cart Methods use Dancer : : Plugin : : N i t e s i ; cart − >add ( sku => ’POM253 ’ , name => ’ Pomelo ’ , price => 3.00 , quantity => 10); cart − >remove ( sku => ’POM253 ’ ) ; cart − >count ( ) ; cart − >clear ( ) ; cart − >t o t a l ( ) ; cart − >subtotal ( ) ; racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Everything is a Cart ◮ Saved Carts ◮ Wishlists ◮ Collections racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Multiple Carts cart ( ’ w i s h l i s t ’) − >add ( sku => ’ORA322 ’ , name => ’ Orange ’ , price => 2.00 , quantity => 5 ) ; racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Cart Backends ◮ Session ◮ DBI racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Inventory Check MinQuantityField min_quantity MaxQuantityField inventory : quantity racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Inventory Check Hook hook ’ before_cart_add ’ => sub { my ( $cart , $item ) = @_; my ( $inventory ) ; $inventory = query − >s e l e c t _ f i e l d ( table => ’ products ’ , f i e l d => ’ inventory ’ , where => { sku => $item − >{sku } } ) ; i f ( $item − >{quantity } > $inventory ) { $item − >{ error } = ’ Out of stock ’ ; } } ; racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Cart Hooks ◮ before_cart_add ◮ after_cart_add racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Cart Hooks ◮ before_cart_remove ◮ after_cart_remove racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Checkout ◮ Taxes ◮ Shipping ◮ Payment ◮ Invoice racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Payment ◮ Business::OnlinePayment racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Tax Modules on CPAN ◮ Business::Tax::Canada ◮ Business::CA::GST ◮ Business::Tax::VAT ◮ Business::Tax::VAT::Validation racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Shipping ◮ Simple Shipping ◮ Crazy Shipping ◮ Shipping API racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Costs $cart − >apply_cost ( amount => 5 ) ; $cart − >apply_cost ( amount => 0.19 , r e l a t i v e => 1 ) ; racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms PDF Invoices ◮ HTML template ◮ Template::Flute::PDF racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Accounts post ’ / login ’ => sub { i f ( account − >login ( username => params ( ’ body ’ ) − >{username } , password => params ( ’ body ’ ) − >{password } ) ) { r e d i r e c t ’ / customerservice ’ ; } else { r e d i r e c t ’ / login ’ ; } } ; racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Accounts get ’ / checkout ’ => sub { i f ( account − >acl ( check => ’ submit_orders ’ ) ) { return template ’ checkout ’ ; } r e d i r e c t ’ / access_denied ’ ; } ; racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Account manager ◮ Account Providers ◮ Login/Logout ◮ Account Information ◮ Login status ◮ Forgot password ◮ Registration racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Account Provider ◮ DBI ◮ LDAP * ◮ Htpasswd * ◮ OpenID * ◮ OAuth * racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Access Control ◮ User ◮ Roles ◮ Permissions racke Modern PerlCommerce
Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Forms ◮ Display ◮ Validation ◮ Storage racke Modern PerlCommerce
Recommend
More recommend