Revision 359

Date:
2013/06/13 17:57:59
Author:
ahitrov
Revision Log:
Xsolla tuning
Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/plugins/payments/comps/www/payment.backend/xsolla_v2_pay.xml

     
    65 65
    66 66 warn Dumper \%ARGS if $DEBUG;
    67 67
    68 my $str = $v1.$v2.$v3.$amount.$currency.$id.$state->{payments}{xsolla_app_secret};
    68 my $str = $v1.$amount.$currency.$id.$state->{payments}{xsolla_app_secret};
    69 69 my $md5 = Digest::MD5::md5_hex ( $str );
    70 70 warn "MD5 Check: $md5\n" if $DEBUG;
    71 71
  • utf8/plugins/payments/lib/payments/Provider/Xsolla.pm

     
    19 19 return unless $sum;
    20 20
    21 21 $sum = $sum =~ /\d+\.\d{2}/ ? $sum : sprintf( "%.2f", $sum );
    22 my @params = (
    22 my @static_params = (
    23 # 'action=directpayment',
    24 'pid=26',
    23 25 'marketplace=paydesk',
    24 'theme=115',
    26 'special_skip_step=0',
    27 'prime=26,16,27,6,64',
    28 'other=1',
    29 'limit=5',
    30 );
    31 my @sig_params = (
    32 'out='.($opts{out} || '100.00'),
    25 33 'project='.$state->{payments}{xsolla_app_id},
    26 'local=ru',
    27 'pid=26',
    34 'theme='.($opts{theme} || 115),
    28 35 'v1='.$id,
    29 36 );
    30 my $iframe = '<iframe id="paystation" src="https://secure.xsolla.com/paystation2/?'.join('&',@params).'" width="100%" height="100%">';
    37 push @sig_params, 'currency='.$opts{currency} if exists $opts{currency};
    38 push @sig_params, 'email='.$opts{email} if exists $opts{email};
    39 push @sig_params, 'userip='.$opts{userip} if exists $opts{userip};
    40 push @sig_params, 'v2='.$opts{v2} if exists $opts{v2};
    41 push @sig_params, 'v3='.$opts{v3} if exists $opts{v3};
    42 @sig_params = sort { $a cmp $b } @sig_params;
    43 my $str = join( '', @sig_params).$self->secret;
    44 warn "Sign str: [$str]\n";
    45 my $sign = Digest::MD5::md5_hex ( $str );
    46 my $iframe = '<iframe id="paystation" src="https://secure.xsolla.com/paystation2/?'.join('&',@sig_params, 'sign='.$sign, @static_params).'" width="100%" height="100%">';
    31 47 return $iframe;
    32 48 }
    33 49