From a2103e8036dfb753c7006ad5b4c5688e32ecc4a3 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 30 Sep 2010 16:27:28 -0700 Subject: [PATCH] Update Cash for Moose. --- lib/WebGUI/Shop/PayDriver/Cash.pm | 47 ++++++++----------------------- 1 file changed, 12 insertions(+), 35 deletions(-) diff --git a/lib/WebGUI/Shop/PayDriver/Cash.pm b/lib/WebGUI/Shop/PayDriver/Cash.pm index b66539316..75df2a234 100644 --- a/lib/WebGUI/Shop/PayDriver/Cash.pm +++ b/lib/WebGUI/Shop/PayDriver/Cash.pm @@ -20,7 +20,18 @@ use WebGUI::Shop::PayDriver; use WebGUI::Exception; use Tie::IxHash; -use base qw/WebGUI::Shop::PayDriver/; +use Moose; +use WebGUI::Definition::Shop; +extends 'WebGUI::Shop::PayDriver'; + +define pluginName => [qw/label PayDriver_Cash/]; +property summaryTemplateId => ( + fieldType => 'template', + label => ['summary template', 'PayDriver_Cash'], + hoverHelp => ['summary template help', 'PayDriver_Cash'], + namespace => 'Shop/Credentials', + default => '30h5rHxzE_Q0CyI3Gg7EJw', + ); #------------------------------------------------------------------- @@ -42,40 +53,6 @@ sub canCheckoutCart { #------------------------------------------------------------------- -=head2 definition ( session, definition ) - -See WebGUI::Shop::PayDriver->definition. - -=cut - -sub definition { - my $class = shift; - my $session = shift; - my $definition = shift; - - my $i18n = WebGUI::International->new($session, 'PayDriver_Cash'); - - tie my %fields, 'Tie::IxHash'; - %fields = ( - summaryTemplateId => { - fieldType => 'template', - label => $i18n->get('summary template'), - hoverHelp => $i18n->get('summary template help'), - namespace => 'Shop/Credentials', - defaultValue => '30h5rHxzE_Q0CyI3Gg7EJw', - }, - ); - - push @{ $definition }, { - name => $i18n->get('label'), - properties => \%fields, - }; - - return $class->SUPER::definition($session, $definition); -} - -#------------------------------------------------------------------- - =head2 getButton ( ) Return a form with button to finalize checkout from the Shop.