alf (red_alf) wrote in changelog,
alf
red_alf
changelog

[ljcom] r10660: LJSUP-9016: LJ-like - add donate button

Committer: afedorov
LJSUP-9016: LJ-like - add donate button

U   trunk/bin/maint/pay.pl
Modified: trunk/bin/maint/pay.pl
===================================================================
--- trunk/bin/maint/pay.pl	2011-06-17 09:32:29 UTC (rev 10659)
+++ trunk/bin/maint/pay.pl	2011-06-17 10:27:37 UTC (rev 10660)
@@ -51,26 +51,35 @@
         }
 
         if ($p->{'forwhat'} eq "cart") {
-            my $cart = "$p->{'payid'}-$p->{'anum'}";
-            my $amt_show = $p->{'method'} eq 'wallet' ?
-                sprintf( '%d tokens',
-                         $p->{'amount'} * LJ::Pay::Wallet::EXCHANGE_RATE ) :
-                sprintf( '$%.2f', $p->{'amount'} );
 
-            LJ::send_mail({
-                'to' => $pu->email_raw,
-                'from' => $LJ::ACCOUNTS_EMAIL,
-                'fromname' => $LJ::SITENAMESHORT,
-                'wrap' => 1,
-                'charset' => 'utf-8',
-                'subject' => "Thanks, We've Received Your Payment",
-                'body' => ("Your payment of $amt_show for order $cart was received and the order is now being processed.\n\n".
-                           "For your reference, you can view the order here:\n\n".
-                           "   $LJ::SITEROOT/pay/?c=$cart\n\n".
-                           $note_msg->() .
-                           "Thank you for supporting the site!\n\n".
-                           "--\n$LJ::SITENAMESHORT Team\n$LJ::SITEROOT"
-                           )});
+            my $pmt = LJ::Pay::Payment->load( payid   => $p->{'payid'},
+                                              forwhat => $p->{'forwhat'} );
+                                              
+            unless ($pmt->payvar_get('do_not_notify_sender')) {
+
+                my $cart = "$p->{'payid'}-$p->{'anum'}";
+                my $amt_show = $p->{'method'} eq 'wallet' ?
+                    sprintf( '%d tokens',
+                             $p->{'amount'} * LJ::Pay::Wallet::EXCHANGE_RATE ) :
+                    sprintf( '$%.2f', $p->{'amount'} );
+
+                LJ::send_mail({
+                    'to' => $pu->email_raw,
+                    'from' => $LJ::ACCOUNTS_EMAIL,
+                    'fromname' => $LJ::SITENAMESHORT,
+                    'wrap' => 1,
+                    'charset' => 'utf-8',
+                    'subject' => "Thanks, We've Received Your Payment",
+                    'body' => ("Your payment of $amt_show for order $cart was received and the order is now being processed.\n\n".
+                               "For your reference, you can view the order here:\n\n".
+                               "   $LJ::SITEROOT/pay/?c=$cart\n\n".
+                               $note_msg->() .
+                               "Thank you for supporting the site!\n\n".
+                               "--\n$LJ::SITENAMESHORT Team\n$LJ::SITEROOT"
+                               )});
+
+            }
+            
             $dbh->do("UPDATE payments SET mailed='Y' WHERE payid=$p->{'payid'}");
             next;
         }

Tags: ljcom, pl, red_alf
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