Skip to content

Commit 2478b8c

Browse files
committed
Process Friend of Perl on the backend
Fixes hoelzro#20
1 parent 7944e05 commit 2478b8c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/Act/Handler/User/Purchase.pm

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use Act::Template::HTML;
1313
use Act::Util;
1414

1515
my $form = Act::Form->new(
16-
optional => [qw(donation)],
16+
optional => [qw(donation friend-of-perl future-friend-of-perl)],
1717
constraints => {
1818
donation => 'numeric',
1919
}
@@ -102,6 +102,18 @@ sub handler
102102
name => localize('Donation'),
103103
};
104104
}
105+
if ($ok && $fields->{'friend-of-perl'}) {
106+
push @items, {
107+
amount => 250,
108+
name => localize('Friend of Perl'),
109+
};
110+
}
111+
if ($ok && $fields->{'future-friend-of-perl'}) {
112+
push @items, {
113+
amount => 100,
114+
name => localize('Future Friend of Perl'),
115+
};
116+
}
105117
$ok = @items > 0 if $ok;
106118
if ($ok) {
107119
# always a use a newly created order

0 commit comments

Comments
 (0)