[ljcom] r11362: LJSUP-10748: Free2pay
Committer: amyshkin
LJSUP-10748: Free2payU trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm
Modified: trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm 2012-01-30 06:33:06 UTC (rev 11361)
+++ trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm 2012-01-30 06:54:39 UTC (rev 11362)
@@ -5,6 +5,7 @@
use LJ::Pay::Wallet;
use LJ::Pay::Wallet::Error qw(:codes);
+use Digest::MD5 qw(md5_hex);
sub get_subpage { 'wallet' }
sub get_template_file { 'Wallet' }
@@ -110,7 +111,17 @@
# reserved
my $transac_id = 0;
+ my $sid = $LJ::FREE_TOKENS->{'freetopay'}->{'sid'};
+ my $key = $LJ::FREE_TOKENS->{'freetopay'}->{'secretA'};
+ my $url = $LJ::FREE_TOKENS->{'freetopay'}->{'url'};
+ my $uid = $remote ? $remote->id : 0;
+ my $transac_id = $transac_id;
+ my $location = $remote ? $remote->prop('city') || '' : '';
+ my $sex = $remote ? $remote->prop('gender') : '';
+ my $age = $remote ? $remote->best_guess_age : 0;
+ my $sig = md5_hex( join( ':', ($sid, $uid, $transac_id, $sex, $age, $location, $key )));
+
return {
'siteroot' => $LJ::SITEROOT,
'promo_block_for_empty_wallet' => ($balance == 0),
@@ -134,12 +145,7 @@
offerpal_url => $LJ::OFFERPAL_URL . $remote->userid,
offerpal_disabled => $LJ::DISABLED{'offerpal'},
- 'sid' => $LJ::FREE_TOKENS->{'freetopay'}->{'sid'},
- 'uid' => $remote ? $remote->id : 0,
- 'transac_id' => $transac_id,
- 'location' => $remote ? $remote->prop('city') || '' : '',
- 'sex' => $remote ? $remote->prop('gender') : '',
- 'age' => $remote ? $remote->best_guess_age : 0,
+ 'ftp_url' => $url . '?' . join( '&', "sid=$sid", "uid=$uid", "transac_id=$transac_id", "sex=$sex", "age=$age", "location=$location", "sig=$sig" ),
};
}
