Committer: ssafronova
LJSUP-7404: We should put transaction info to token history.U trunk/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm
Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm =================================================================== --- trunk/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm 2010-11-22 08:57:19 UTC (rev 9740) +++ trunk/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm 2010-11-22 09:03:11 UTC (rev 9741) @@ -667,9 +667,20 @@ # promo action 'Give more 2010' (LJSUP-7267) my $now = time; - if ($self->{'qty'} == 12 and $rcpt_u->userid != $buyer_u->userid and + if ($self->{'qty'} == 12 and $rcpt_u->userid != $buyer_u->userid and + LJ::Pay::Wallet->is_user_eligible($rcpt_u) and $now >= $LJ::PAID_ACCOUNT_PROMO_TOKENS_START and $now < $LJ::PAID_ACCOUNT_PROMO_TOKENS_END) { + LJ::Pay::Wallet->try_add($rcpt_u, $LJ::PAID_ACCOUNT_PROMO_TOKENS_AMOUNT); + LJ::Pay::Wallet::Log->log( + userid => $rcpt_u->userid, + action => LJ::Pay::Wallet::Log::ACTION_ADD, + qty => $LJ::PAID_ACCOUNT_PROMO_TOKENS_AMOUNT, + payid => $self->get_payid, + piid => $self->get_piid, + status => LJ::Pay::Wallet::Log::STATUS_FINISHED, + time_end => time, + ); } # note that this user's bill changed