Committer: ssafronova
LJSUP-4203: Userpic Add-on - LJSUP-4457: move bulk code to class structure - bugfixU branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm U branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/RecBillAble.pm
Modified: branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm =================================================================== --- branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm 2009-10-07 07:30:34 UTC (rev 7753) +++ branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm 2009-10-07 07:48:21 UTC (rev 7754) @@ -188,12 +188,17 @@ my $payid = $args{payid}; my $time = $args{time}; - my $timestamp = $time->[0]; - die "Time must be specified with 'epoch'" unless $time->[1] eq 'epoch'; + my $timestamp; + if ($time) { # else will apply $self->{qty} + die "Time must be specified as arrayref" unless ref($time) eq 'ARRAY'; + die "Time must be specified with 'epoch'" unless $time->[1] eq 'epoch'; + $timestamp = $time->[0]; + } + my $exp = $self->load_paidexp_row($u); return undef unless $exp; - + # activate cap if necessary my $new_size = $self->_adopt_item(exp => $exp, payid => $payid, u => $u); @@ -344,6 +349,7 @@ return undef if $dbh->err; } + return 1; } Modified: branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/RecBillAble.pm =================================================================== --- branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/RecBillAble.pm 2009-10-07 07:30:34 UTC (rev 7753) +++ branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/RecBillAble.pm 2009-10-07 07:48:21 UTC (rev 7754) @@ -72,5 +72,11 @@ die "redefine get_expire_time() in child class"; } +sub apply_item { + my $self = shift; + my %args = @_; + die "redefine apply_item() in child class as internal part of _deliver_item()"; +} + 1;