wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r9490: LJSUP-6582

Committer: gprochaev
LJSUP-6582

U   trunk/cgi-bin/LJ/Widget/IPPU/UserHeadSmsPay.pm
Modified: trunk/cgi-bin/LJ/Widget/IPPU/UserHeadSmsPay.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/IPPU/UserHeadSmsPay.pm	2010-09-10 10:14:41 UTC (rev 9489)
+++ trunk/cgi-bin/LJ/Widget/IPPU/UserHeadSmsPay.pm	2010-09-10 10:35:55 UTC (rev 9490)
@@ -24,7 +24,9 @@
     my $remote = $class->get_effective_remote;
     my $now = time();
 
-    my $uh = LJ::UserHead->get_userhead($post->{id});
+    my ($id) = $post->{uh} =~ m#uh-(\d+)#;
+
+    my $uh = LJ::UserHead->get_userhead($id);
     die BML::ml('.error.invalidproduct') unless $uh;
 
     die BML::ml('widget.vgiftsmspay.notauthorized') 
@@ -33,7 +35,7 @@
     my $cartobj = LJ::Pay::Payment::new_cart($remote);
 
     # Check recipient
-    my $recipient = $post->{to} || $remote->{user};
+    my $recipient = $post->{formyself} ? $remote->{user} : $post->{to} || $remote->{user};
     die BML::ml('.error.nousernamegiven') if $recipient eq "";
 
     my $ou = LJ::load_user($recipient);
@@ -44,8 +46,8 @@
     die BML::ml('.error.cantbuyduetoaccountstatus')
         unless $ou->is_visible || $ou->is_memorial;
 
-    my $item = LJ::Pay::Payment::PayItem->new_memonly(item => 'userhead', subitem => 'uh-'.$post->{id}, qty => 12, amt => $uh->get_price,
-                                                      anon => ($post->{anongift} eq 'true') ? 1 : 0, rcptid => $ou->{'userid'});
+    my $item = LJ::Pay::Payment::PayItem->new_memonly(item => 'userhead', subitem => 'uh-'.$id, qty => 12, amt => $uh->get_price,
+                                                      anon => ($post->{gift_anon} eq '1') ? 1 : 0, rcptid => $ou->{'userid'});
     my @errs;
     my $can_be_added = $item->can_belong_to($cartobj, \@errs, undef, 'additem');
     die LJ::bad_input(@errs) unless $can_be_added;

Tags: ljcom, pm, wisest-owl
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