Committer: nnikulochkina
LJSUP-12898: Implement payitem for PaidRepostU trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm U trunk/cgi-bin/LJ/Widget/Shop/History.pm
Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm =================================================================== --- trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm 2012-07-11 09:09:32 UTC (rev 12264) +++ trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm 2012-07-11 09:28:41 UTC (rev 12265) @@ -53,6 +53,7 @@ 'selfpromo' => 'LJ::Pay::Payment::PayItem::SelfPromo', 'domainru' => 'LJ::Pay::Payment::PayItem::DomainRU', 'notificationpromo' => 'LJ::Pay::Payment::PayItem::NotificationPromo', + 'repost' => 'LJ::Pay::Payment::PayItem::PaidRepost', ); my @FREEZABLE_CLASSES = qw/ Modified: trunk/cgi-bin/LJ/Widget/Shop/History.pm =================================================================== --- trunk/cgi-bin/LJ/Widget/Shop/History.pm 2012-07-11 09:09:32 UTC (rev 12264) +++ trunk/cgi-bin/LJ/Widget/Shop/History.pm 2012-07-11 09:28:41 UTC (rev 12265) @@ -200,7 +200,7 @@ my $cart = $logitem->cart; my %it; - my @classes = qw( Royalty Donate WalletTokens AppItem SelfPromo ); + my @classes = qw( Royalty Donate WalletTokens AppItem SelfPromo PaidRepost); foreach my $class ( @classes ) { my $class_full = 'LJ::Pay::Payment::PayItem::' . $class; $it{$class} = $cart->get_item( $class_full->item ); @@ -263,6 +263,14 @@ }); } + if ( my $it = $it{'PaidRepost'} ) { + my $entry_url = $it->entry_url; + return LJ::Lang::ml('wallet.widget.history.des.paid_repost_rcvd', { + 'from' => $buyer->ljuser_display, + 'url' => $entry_url, + }); + } + return LJ::Lang::ml('wallet.widget.history.des.rcvd', { 'from' => $buyer->ljuser_display, }); @@ -310,12 +318,23 @@ }); } + if ( my $it = $it{'PaidRepost'} ) { + my $rcptid = $it->get_rcptid; + my $rcpt = LJ::load_userid($rcptid); + + my $entry_url = $it->entry_url; + return LJ::Lang::ml('wallet.widget.history.des.paid_repost', { + 'to' => $rcpt->ljuser_display, + 'url' => $entry_url, + }); + } + + my $cart_link = $cart->cart_link; return LJ::Lang::ml('wallet.widget.history.des.order', { 'cart_link' => $cart_link, }); } - }; foreach my $logitem (@$items) {