Skip to content

Commit

Permalink
Process Friend of Perl on the backend
Browse files Browse the repository at this point in the history
  • Loading branch information
hoelzro committed Dec 6, 2011
1 parent 7944e05 commit 2478b8c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/Act/Handler/User/Purchase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Act::Template::HTML;
use Act::Util;

my $form = Act::Form->new(
optional => [qw(donation)],
optional => [qw(donation friend-of-perl future-friend-of-perl)],
constraints => {
donation => 'numeric',
}
Expand Down Expand Up @@ -102,6 +102,18 @@ sub handler
name => localize('Donation'),
};
}
if ($ok && $fields->{'friend-of-perl'}) {
push @items, {
amount => 250,
name => localize('Friend of Perl'),
};
}
if ($ok && $fields->{'future-friend-of-perl'}) {
push @items, {
amount => 100,
name => localize('Future Friend of Perl'),
};
}
$ok = @items > 0 if $ok;
if ($ok) {
# always a use a newly created order
Expand Down

0 comments on commit 2478b8c

Please sign in to comment.