ssafronova (ssafronova) wrote in changelog,
ssafronova
ssafronova
changelog

[ljcom] r7754: LJSUP-4203: Userpic Add-on - LJSUP-4457:...

Committer: ssafronova
LJSUP-4203: Userpic Add-on - LJSUP-4457: move bulk code to class structure - bugfix

U   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;

Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments