changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[ljcom] r7553: LJSUP-4585.

Committer: gproschaev
LJSUP-4585.
LJ::Pay::product_name


U   branches/shop/bin/maint/expiring.pl
U   branches/shop/bin/maint/pay.pl
U   branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon/Boolean.pm
U   branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon/Sized.pm
U   branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm
U   branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm
U   branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Permanent.pm
U   branches/shop/cgi-bin/LJ/Pay/Payment/PayItem.pm
U   branches/shop/cgi-bin/LJ/Pay/RecBill.pm
U   branches/shop/cgi-bin/paylib.pl
U   branches/shop/cgi-bin/paylib_cart.pl
U   branches/shop/htdocs/manage/account/giftcerts.bml
U   branches/shop/htdocs/manage/account/index.bml
U   branches/shop/htdocs/manage/account/modify.bml
U   branches/shop/htdocs/pay/modify.bml
U   branches/shop/htdocs/shop/view.bml
Modified: branches/shop/bin/maint/expiring.pl
===================================================================
--- branches/shop/bin/maint/expiring.pl	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/bin/maint/expiring.pl	2009-08-07 08:01:00 UTC (rev 7553)
@@ -206,10 +206,11 @@
         if ($u->{'statusvis'} eq "V") {
             my $bonus_msg;
             if (@$bonus_ref) {
+                my $item = LJ::Pay::Payment::PayItem->new_memonly(item => $_->{'item'}, amt => $_->{'size'});
                 $bonus_msg = "Additionally, the following add-ons have been deactivated " .
                              "from your account.  Any remaining time has been saved and will " .
                              "be reapplied if you later decide to renew your paid account.\n\n" .
-                             join("\n", map {  "   - " . LJ::Pay::product_name($_->{'item'}, $_->{'size'}, undef, "short") .
+                             join("\n", map {  "   - " . $item->product_name("short") .
                                                ": $_->{'daysleft'} days saved" }
                                   sort { $a->{'item'} cmp $b->{'item'} } @$bonus_ref) . "\n\n";
             }
@@ -298,7 +299,8 @@
 
         # and send them an email, if they're not self-deleted/suspended
         if ($u->{'statusvis'} eq "V") {
-            my $name = LJ::Pay::product_name($item, $size, undef, "short");
+            my $item_obj = LJ::Pay::Payment::PayItem->new_memonly(item => $item, amt => $size);
+            my $name = $item_obj->product_name("short");
             my $uri = $get_item_uri->($item);
 
             LJ::send_mail({ 'to' => $u->email_raw,
@@ -429,7 +431,8 @@
 
             print "Mailing user $u->{user} about $days days of $item...\n";
 
-            my $bonus_name = LJ::Pay::product_name($item, $size, undef, "short");
+            my $item_obj = LJ::Pay::Payment::PayItem->new_memonly(item => $item, amt => $size);
+            my $bonus_name = $item_obj->product_name("short");
             my $uri = $get_item_uri->($item, $u->{journaltype} ne 'P');
 
             my $acct_body = '';

Modified: branches/shop/bin/maint/pay.pl
===================================================================
--- branches/shop/bin/maint/pay.pl	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/bin/maint/pay.pl	2009-08-07 08:01:00 UTC (rev 7553)
@@ -707,7 +707,8 @@
         my $rec_items;
         foreach my $item ($rec->get_items) {
             next unless $item->get_recflag eq 'on';
-            $rec_items .= "* " . LJ::Pay::product_name($item->{name}, undef, undef, 'short') . "\n";
+            my $item_obj = LJ::Pay::Payment::PayItem->new_memonly(item => $item->{name});
+            $rec_items .= "* " . $item_obj->product_name('short') . "\n";
         }
 
         print "$u->{'user'}\n" if ($LJ::LJMAINT_VERBOSE == 2);

Modified: branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon/Boolean.pm
===================================================================
--- branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon/Boolean.pm	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon/Boolean.pm	2009-08-07 08:01:00 UTC (rev 7553)
@@ -103,12 +103,12 @@
 
 sub get_item_base_price {
     my $self = shift;
-    my ($qty, $size, %opts) = @_;
+    my %opts = @_;
     
     my $item = $self->item;
 
-    return undef unless LJ::Pay::is_valid_bool_bonus($item, $qty, 1);
-    return $LJ::Pay::Payment::PayItem::Addon::bonus{$item}->{items}->{$qty}->{'amount_rec'};
+    return undef unless LJ::Pay::is_valid_bool_bonus($item, $self->{qty}, 1);
+    return $LJ::Pay::Payment::PayItem::Addon::bonus{$item}->{items}->{$self->{qty}}->{'amount_rec'};
 }
 
 sub can_be_added {

Modified: branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon/Sized.pm
===================================================================
--- branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon/Sized.pm	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon/Sized.pm	2009-08-07 08:01:00 UTC (rev 7553)
@@ -218,12 +218,12 @@
 
 sub get_item_base_price {
     my $self = shift;
-    my ($qty, $size, %opts) = @_;
+    my %opts = @_;
 
     my $item = $self->item;
 
-    return undef unless LJ::Pay::is_valid_sized_bonus($item, $size, $qty);
-    return $LJ::Pay::Payment::PayItem::Addon::bonus{$item}->{'items'}->{$size}->{'qty'}->{$qty}->{'amount_rec'};
+    return undef unless LJ::Pay::is_valid_sized_bonus($item, $self->{amt}, $self->{qty});
+    return $LJ::Pay::Payment::PayItem::Addon::bonus{$item}->{'items'}->{$self->{amt}}->{'qty'}->{$self->{qty}}->{'amount_rec'};
 }
 
 sub can_be_added {

Modified: branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm
===================================================================
--- branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm	2009-08-07 08:01:00 UTC (rev 7553)
@@ -469,7 +469,7 @@
 
     # log to statushistory
     LJ::statushistory_add($it->{rcptid}, undef, 'revoke',
-                          LJ::Pay::product_name($it, "short") . "; $timeval ${units}s");
+                          $it->product_name("short") . "; $timeval ${units}s");
 
     return 1;
 }

Modified: branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm
===================================================================
--- branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm	2009-08-07 08:01:00 UTC (rev 7553)
@@ -313,10 +313,10 @@
     if (@$bonus_ref) {
         $bonus_added = "Additionally, the following previously deactivated bonus features\n" .
                        "have been reactivated so you can use the time remaining on them:\n\n" .
-                       join("\n", map { "   - " . LJ::Pay::product_name($_->{'item'}, $_->{'size'}, undef, "short") .
-                                        ": $_->{'daysleft'} days applied" }
-                            sort { $a->{'item'} cmp $b->{'item'} } @$bonus_ref) .
-                       "\n\n";
+                       join("\n", map {
+                            my $item = LJ::Pay::Payment::PayItem->new_memonly(item => $_->{'item'}, qty => $_->{'size'});
+                            "   - " . $item->product_name("short") . ": $_->{'daysleft'} days applied";
+                        } sort { $a->{'item'} cmp $b->{'item'} } @$bonus_ref) . "\n\n";
     }
 
     my $msg = "$self->{'qty'} months of paid account time have been added to your $LJ::SITENAMESHORT ";
@@ -332,12 +332,12 @@
 
 sub get_item_base_price {
     my $self = shift;
-    my ($qty, $size, %opts) = @_;
+    my %opts = @_;
 
     return undef
-        unless ref $LJ::Pay::Payment::PayItem::PaidAccount::account{$qty};
+        unless ref $LJ::Pay::Payment::PayItem::PaidAccount::account{$self->{qty}};
 
-    return LJ::Pay::paid_account_price( interval => $qty, rec => 1, %opts );
+    return LJ::Pay::paid_account_price( interval => $self->{qty}, rec => 1, %opts );
 }
 
 sub can_be_added {

Modified: branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Permanent.pm
===================================================================
--- branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Permanent.pm	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Permanent.pm	2009-08-07 08:01:00 UTC (rev 7553)
@@ -147,10 +147,10 @@
     if (@$bonus_ref) {
         $bonus_added = "Additionally, the following previously deactivated bonus features\n" .
                        "have been reactivated so you can use the time remaining on them:\n\n" .
-                       join("\n", map { "   - " . LJ::Pay::product_name($_->{'item'}, $_->{'size'}, undef, "short") .
-                                        ": $_->{'daysleft'} days applied" }
-                            sort { $a->{'item'} cmp $b->{'item'} } @$bonus_ref) .
-                       "\n\n";
+                       join("\n", map {
+                            my $item = LJ::Pay::Payment::PayItem->new_memonly(item => $_->{'item'}, qty => $_->{'size'});
+                            "   - " . $item->product_name("short") . ": $_->{'daysleft'} days applied";
+                        } sort { $a->{'item'} cmp $b->{'item'} } @$bonus_ref) . "\n\n";
     }
 
     my $msg = "Your $LJ::SITENAMESHORT account \"$rcpt_u->{'user'}\" has been upgraded to a ";

Modified: branches/shop/cgi-bin/LJ/Pay/Payment/PayItem.pm
===================================================================
--- branches/shop/cgi-bin/LJ/Pay/Payment/PayItem.pm	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/cgi-bin/LJ/Pay/Payment/PayItem.pm	2009-08-07 08:01:00 UTC (rev 7553)
@@ -450,16 +450,16 @@
     # @_: item, subitem, qty, short?
 
     my $item = $self;
-    my ($subitem, $qty, $short) = @_;
+    my ($subitem, $qty, $short) = ();
 
-    # case 1: $it, $short
     if (ref $item) { # non-blessed hash or parent class object
         $subitem = $item->{'subitem'};
         $qty     = $item->{'qty'};
         $item    = $item->{'item'};
         $short   = shift;
+    }else {
+        ($subitem, $qty, $short) = @_;
     }
-    # otherwise, case 2: $item, $subitem, $qty, $short?
 
     # now we should have all the right vars
 

Modified: branches/shop/cgi-bin/LJ/Pay/RecBill.pm
===================================================================
--- branches/shop/cgi-bin/LJ/Pay/RecBill.pm	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/cgi-bin/LJ/Pay/RecBill.pm	2009-08-07 08:01:00 UTC (rev 7553)
@@ -1126,7 +1126,8 @@
                 "Your current paid account feature(s) will expire on the " .
                 "following date$s:\n\n" .
 
-                join('', map { LJ::Pay::product_name($_->{name}, $_->{size}, undef, 'short') .
+                join('', map { my $item = LJ::Pay::Payment::PayItem->new_memonly(item => $_->{'item'}, qty => $_->{'size'});
+                            $item->product_name('short') .
                                ", expires " . substr(LJ::mysql_time($_->{exptime}), 0, 10) .
                                "\n\n" } @{$self->{items}||[]} ) .
 
@@ -2177,7 +2178,8 @@
 
         my $exp = LJ::Pay::date_format($it->get_exptime);
 
-        $body .= LJ::Pay::product_name($it->{name}, $it->{size}, undef, 'short');
+        my $item = LJ::Pay::Payment::PayItem->new_memonly(item => $it->{'item'}, qty => $it->{'size'});
+        $body .= $item->product_name('short');
         $body .= ": expires $exp\n\n";
     }
 
@@ -2242,8 +2244,8 @@
     foreach my $it ($self->get_items) {
         next if $it->get_name eq 'paidacct';
         next unless $it->get_recflag eq 'on';
-        $cur_services .= LJ::Pay::product_name
-            ($it->get_name, $it->get_size, undef, 1 );
+        my $item = LJ::Pay::Payment::PayItem->new_memonly(item => $it->get_name, qty => $it->get_size);
+        $cur_services .= $item->product_name( 1 );
         $cur_services .= ', ';
     }
     chop($cur_services) foreach 1..2;
@@ -2392,7 +2394,8 @@
     foreach my $it ( $self->get_items() ) {
         next if $it->get_name eq 'paidacct';
         next unless $it->get_recflag eq 'on';
-        $cur_services .= LJ::Pay::product_name($it->get_name, $it->get_size, undef, 'short');
+        my $item = LJ::Pay::Payment::PayItem->new_memonly(item => $it->get_name, qty => $it->get_size);
+        $cur_services .= $item->product_name('short');
         $cur_services .= ', ';
     }
     chop($cur_services) foreach 1..2;

Modified: branches/shop/cgi-bin/paylib.pl
===================================================================
--- branches/shop/cgi-bin/paylib.pl	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/cgi-bin/paylib.pl	2009-08-07 08:01:00 UTC (rev 7553)
@@ -327,7 +327,7 @@
             foreach (@fraud_rcpt) {
                 my ($it, $fu) = @$_;
                 $rcpt_txt .= "        User: $fu->{user}\n";
-                $rcpt_txt .= "        Item: " . LJ::Pay::product_name($it) . "\n\n";
+                $rcpt_txt .= "        Item: " . $it->product_name . "\n\n";
             }
         }
 
@@ -634,7 +634,8 @@
     my $ct;
     while (my $exp = $sth->fetchrow_hashref) {
 
-        $bonus .= "<li>" . LJ::Pay::product_name($exp, "short") . " - ";
+        my $item = LJ::Pay::Payment::PayItem->new_memonly ( item => $exp->{item} );
+        $bonus .= "<li>" . $item->product_name("short") . " - ";
 
         # enabled has 2 cases:
         # - item has associated cap and it's enabled on $u

Modified: branches/shop/cgi-bin/paylib_cart.pl
===================================================================
--- branches/shop/cgi-bin/paylib_cart.pl	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/cgi-bin/paylib_cart.pl	2009-08-07 08:01:00 UTC (rev 7553)
@@ -177,7 +177,8 @@
         my $avail = $dbh->selectrow_array("SELECT avail FROM inventory WHERE item=? AND subitem=?",
                                           undef, $n->{'item'}, $n->{'subitem'});
         next if $avail >= $n->{'count'};
-        push @$out_list, LJ::Pay::product_name($n->{'item'}, $n->{'subitem'});
+        my $item = LJ::Pay::Payment::PayItem->new_memonly(item => $n->{'item'}, subitem => $n->{'subitem'});
+        push @$out_list, $item->product_name();
     }
 
     # fail if items were out of stock

Modified: branches/shop/htdocs/manage/account/giftcerts.bml
===================================================================
--- branches/shop/htdocs/manage/account/giftcerts.bml	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/htdocs/manage/account/giftcerts.bml	2009-08-07 08:01:00 UTC (rev 7553)
@@ -45,7 +45,8 @@
     while (my $row = $sth->fetchrow_hashref) {
         my $str = sub { $row->{'payid'} ? "<strike>$_[0]</strike>" : $_[0] };
         $tbl .= "<tr><td>";
-        $tbl .= $str->(LJ::Pay::product_name('coupon', $row->{'type'}));
+        my $item = LJ::Pay::Payment::PayItem->new_memonly(item => 'coupon', subitem => $row->{'type'});
+        $tbl .= $str->($item->product_name());
         $tbl .= "</td><td>" . $str->($damt->($row->{'arg'})) . "</td><td>";
         $tbl .= $str->($row->{'cpid'} . "-" . $row->{'auth'});
         $tbl .= "</td></tr>";

Modified: branches/shop/htdocs/manage/account/index.bml
===================================================================
--- branches/shop/htdocs/manage/account/index.bml	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/htdocs/manage/account/index.bml	2009-08-07 08:01:00 UTC (rev 7553)
@@ -183,7 +183,8 @@
                 <tr><td>
             };
 
-            $body .= LJ::Pay::product_name( $paid->get_name(), undef, undef, 1 );
+            my $item = LJ::Pay::Payment::PayItem->new_memonly(item => $paid->get_name());
+            $body .= $item->product_name( 1 );
             $body .= "</td><td class='price'>\$";
             $total += $paid_price;
             $body .= "$paid_price</td></tr>";
@@ -192,7 +193,8 @@
                 next if $_->get_name() eq 'paidacct';
                 next unless $_->get_recflag eq 'on';
                 $body .= "<tr><td> - ";
-                $body .= LJ::Pay::product_name( $_->get_name(), $_->get_size, undef, 1 );
+                my $item = LJ::Pay::Payment::PayItem->new_memonly(item => $_->get_name(), amt => $_->get_size());
+                $body .= $item->product_name( 1 );
                 $body .= "</td><td class='price'>\$";
                 $item_price =
                     my $item = LJ::Pay::Payment::PayItem->new_memonly ( item => $_->get_name() );
@@ -206,7 +208,8 @@
                     foreach my $it (@{$pt{$ident}}) {
                         my $apply = $date_format->($it->get_applytime);
                         my $qty = int(($it->get_timeqty) / (86400*30)+.5);
-                        my $itemname = LJ::Pay::product_name($it->get_itemname, undef, undef, 'short');
+                        my $item = LJ::Pay::Payment::PayItem->new_memonly(item => $it->get_itemname());
+                        my $itemname = $item->product_name('short');
                         $body .= "<tr><td>" . BML::ml('.bonusitem', {'item' => $itemname, 'qty' => $qty});
                         $body .= "<br /><font size='1'>" . BML::ml('.startingdate', {'date' => $apply, 'aopts' => "href='$LJ::SITEROOT/support/faqbrowse.bml?faqid=240&view=full'"}) . "</font></td>";
                         $body .= "<td class='price'>\$0.00</td></tr>";
@@ -286,8 +289,9 @@
             $item = 'diskquota' if $item eq 'disk_quota';
 
             if ($item eq 'perm') { # bleh, perms have no exp
+                my $item_obj = LJ::Pay::Payment::PayItem->new_memonly(item => $item);
                 $manual{perm} = {
-                    'name' => LJ::Pay::product_name($item, undef, undef, 'short'),
+                    'name' => $item_obj->product_name('short'),
                 };
             } else {
                 my ($exp, $size);
@@ -306,8 +310,9 @@
                 }
 
                 if ($exp) {
+                    my $item_obj = LJ::Pay::Payment::PayItem->new_memonly(item => $item, amt => $size);
                     $manual{$item} = {
-                        'name' => LJ::Pay::product_name($item, $size, undef, 'short'),
+                        'name' => $item_obj->product_name('short'),
                         'exp'  => $exp,
                     };
                 }
@@ -384,7 +389,8 @@
                 foreach my $pt (@{$pt{$ident}}) {
                     my $apply = $date_format->($pt->get_applytime);
                     my $qty = int(($pt->get_timeqty) / (86400*30)+.5);
-                    my $itemname = LJ::Pay::product_name($pt->get_itemname, undef, undef, 'short');
+                    my $item = LJ::Pay::Payment::PayItem->new_memonly(item => $pt->get_itemname());
+                    my $itemname = $item->product_name('short');
                     $body .= "<tr><td align='left'>" . BML::ml('.promotionitem', {'item' => $itemname, 'qty' => $qty}) . "</td><td align='right'>$apply</td></tr>";
                 }
                 delete $pt{$ident};

Modified: branches/shop/htdocs/manage/account/modify.bml
===================================================================
--- branches/shop/htdocs/manage/account/modify.bml	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/htdocs/manage/account/modify.bml	2009-08-07 08:01:00 UTC (rev 7553)
@@ -746,7 +746,8 @@
 
         foreach (sort { $b <=> $a } keys %{ $prices{$bill_interval} }) {
             next unless /^disk_(\d+)/;
-            my $txt = LJ::Pay::product_name( 'diskquota', $1 );
+            my $item = LJ::Pay::Payment::PayItem->new_memonly(item => 'diskquota', amt => $1);
+            my $txt = $item->product_name();
             $POST{"disk_amount"} ||= "disk_$disksize";
             $body .= LJ::html_check(
                                     {
@@ -891,7 +892,8 @@
                     $body .= "<tr><td colspan='2'><strong>$ML{'.todayspay.payment'}</strong></td></tr>";
                     my $sub_total = 0;
                     foreach (@cart) {
-                        my $it_name = LJ::Pay::product_name($_->get_item, undef, undef, 'short');
+                        my $item = LJ::Pay::Payment::PayItem->new_memonly(item => $_->get_item());
+                        my $it_name = $item->product_name('short');
                         next if $it_name =~ /^coupon/i;
 
                         my $it_amt = $_->get_amt;

Modified: branches/shop/htdocs/pay/modify.bml
===================================================================
--- branches/shop/htdocs/pay/modify.bml	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/htdocs/pay/modify.bml	2009-08-07 08:01:00 UTC (rev 7553)
@@ -174,7 +174,8 @@
                     next unless $extra_remove{$it->{'piid'}} && LJ::Pay::is_bonus($it);
 
                     $body .= "<li>" . LJ::ljuser($users{$it->{'rcptid'}}) . " - ";
-                    $body .= LJ::Pay::product_name($it, "short") . "</li>";
+                    my $itemobj = LJ::Pay::Payment::PayItem->new_memonly(item => $it->{'item'});
+                    $body .= $itemobj->product_name("short") . "</li>";
                 }
                 $body .= "</ul>";
 
@@ -804,7 +805,8 @@
             # -- but we do allow buying disk quota for permanent accounts
             if (LJ::Pay::is_bonus($itemname, 'bool') &&  $is_perm) {
 
-                my $dispname = LJ::Pay::product_name($item, "short");
+                my $itemobj = LJ::Pay::Payment::PayItem->new_memonly(item => $item);
+                my $dispname = $itemobj->product_name("short");
                 return $err->(BML::ml('.error.cantbuyitemforperm', {'item' => "<b>$dispname</b>"}));
             }
 
@@ -821,7 +823,8 @@
             my $utag = LJ::ljuser($rcptuser);
 
             # no paid account at all
-            my $dispname = LJ::Pay::product_name($item, "short");
+            my $itemobj = LJ::Pay::Payment::PayItem->new_memonly(item => $item);
+            my $dispname = $itemobj->product_name("short");
             unless ($db_paid_time || $cart_paid_months) {
                 return $err->(BML::ml('.error.cantbuyextrasforfreeaccount', {'item' => "<b>$dispname</b>", 'user' => $utag}));
             }

Modified: branches/shop/htdocs/shop/view.bml
===================================================================
--- branches/shop/htdocs/shop/view.bml	2009-08-07 04:27:29 UTC (rev 7552)
+++ branches/shop/htdocs/shop/view.bml	2009-08-07 08:01:00 UTC (rev 7553)
@@ -306,7 +306,8 @@
 
             if (LJ::conf_test($LJ::PERM_SALE)) {
                 $body .= "<span style='margin-left: -6px; border: 2px solid #ffff22; padding: 4px;'><label><input type='radio' value='perm' name='item' checked=1 /> ";
-                $body .= LJ::Pay::product_name("perm") . " (\$175 USD)</label></span><br /><br />";
+                my $item = LJ::Pay::Payment::PayItem(item => "perm");
+                $body .= $item->product_name . " (\$175 USD)</label></span><br /><br />";
                 $selected = 0;
             }
 
@@ -314,7 +315,8 @@
                 next unless $mo && $LJ::Pay::account{$mo};
                 next unless $mo && $LJ::Pay::account{$mo}->{'amount'};
                 my $checked = $mo eq $selected ? "checked='checked'" : "";
-                my $name  = LJ::Pay::product_name("paidacct", undef, $mo);
+                my $item = LJ::Pay::Payment::PayItem->new_memonly(item => "paidacct", amt => $mo);
+                my $name  = $item->product_name;
                 my $price = '($' . $LJ::Pay::account{$mo}->{'amount'} . ".00 USD)";
 
                 if (LJ::is_enabled("paid_acct_sale") && $mo == 12) {
@@ -381,7 +383,8 @@
                         $items .= " $name $price</label><br />";
                     }
                     next if $items eq "";
-                    my $name = LJ::Pay::product_name("diskquota", $size);
+                    my $item = LJ::Pay::Payment::PayItem->new_memonly(item => "diskquota", subitem => $size);
+                    my $name = $item->product_name;
                     $body .= "<dt><strong>$name</strong></dt><dd>$items</dd>";
                 }
                 $body .= "</dl>";
@@ -389,7 +392,8 @@
         } elsif ($itemname eq "giftcertificate") {
             my $selected = $GET{extra} || 25;
             foreach my $amt (@LJ::Pay::coupon) {
-                my $name = LJ::Pay::product_name("coupon", "dollaroff", $amt);
+                my $item = LJ::Pay::Payment::PayItem->new_memonly(item => "coupon", subitem => "dollaroff", amt => $amt);
+                my $name = $item->product_name;
                 my $price = "(\$$amt.00 USD)";
                 $body .= "<label>" . LJ::html_check({ 'type' => "radio", 'value' => "coupon-$amt", 'name' => "item", 'selected' => $selected == $amt ? 1 : 0});
                 $body .= "$name $price</label><br />";

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