changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[ljcom] r7527: LJSUP-4585.

Committer: gproschaev
LJSUP-4585.

make_coupon_email call as a method


U   branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Coupon.pm
Modified: branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Coupon.pm
===================================================================
--- branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Coupon.pm	2009-08-03 03:29:36 UTC (rev 7526)
+++ branches/shop/cgi-bin/LJ/Pay/Payment/PayItem/Coupon.pm	2009-08-03 03:43:10 UTC (rev 7527)
@@ -8,8 +8,12 @@
 @coupon = (5, 15, 20, 25);
 
 sub make_coupon_email {
-    my ($token, $amt, $type) = @_;
+    my $self = shift;
 
+    my $token = $self->{token};
+    my $amt = $self->{amt};
+    my $type = $self->{type};
+
     my $inttxt;
     if ($type eq 'int') {
         $inttxt .= "This gift certificate is only valid for intangible items such as paid accounts ";
@@ -47,7 +51,11 @@
     my $email = ref $u ? $u->email_raw : $u;
     return undef unless $email;
 
-    my ($subject, $body) = make_coupon_email($token, $amt, $type);
+    my $coupon = LJ::Pay::Payment::PayItem->new_memonly( item => 'coupon' );
+    $coupon->{token} = $token;
+    $coupon->{amt} = $amt;
+    $coupon->{type} = $type;
+    my ($subject, $body) = $coupon->make_coupon_email();
 
     LJ::send_mail({
         'to' => $email,
@@ -174,7 +182,7 @@
         # if there was an error, try again later
         return (0, undef, undef) unless $self->{'tokenid'};
 
-        ($subject, $body) = make_coupon_email($self->{'token'}, $self->{'amt'}, $1);
+        ($subject, $body) = $self->make_coupon_email();
 
     }
 

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