Revision 369

Date:
2013/07/16 12:40:21
Author:
ahitrov
Revision Log:
Valid IP list takes it values from project config.pm

Files:

Legend:

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

     
    32 32 <%once>
    33 33
    34 34 use Digest::MD5;
    35 my @valid_ips = qw( 94.103.26.178 94.103.26.181 159.255.220.254 );
    35 my @valid_ips = @{$state->{payments}{xsolla_valid_ips}};
    36 36 my %codes = (
    37 37 '0' => 'Success',
    38 38 '10' => 'Another delivery attempt',
     
    71 71
    72 72 my $code = 0;
    73 73 my $ip = $r->header_in('X-Real-IP');
    74 warn "From IP=$ip\n";
    74 warn "From IP=$ip\n" if $DEBUG;
    75 75 my $transaction;
    76 76 if ( $md5 eq $sign && grep { $ip eq $_ } @valid_ips ) {
    77 77 my $last = $keeper->{payments}->check( $v1 );
  • utf8/plugins/payments/config.proto

     
    26 26 XSO_SECRET =
    27 27 XSO_CURRENCY_CODE = RUB
    28 28 XSO_TEST_MODE = 1 # 0 - для боевого режима
    29 XSO_VALID_IPS = # список разрешенных ip
    29 30 # Для подтверждения целостности
    30 31 XSO_SIG_CODE =
    31 32
    32 REWRITE += XSO_ID XSO_SECRET XSO_CURRENCY_CODE XSO_TEST_MODE XSO_SIG_CODE
    33
    34 REWRITE += XSO_ID XSO_SECRET XSO_CURRENCY_CODE XSO_TEST_MODE XSO_SIG_CODE XSO_VALID_IPS
    33 35 ############################################################
    34 36 # /xsolla.com
    35 37
  • utf8/plugins/payments/lib/payments/State.pm.proto

     
    48 48 $self->{moneta_test_mode} = int('@MNT_TEST_MODE@' || 0);
    49 49 $self->{moneta_sig_code} = '@MNT_SIG_CODE@';
    50 50
    51 my @valid_ips_default = qw(
    52 94.103.26.178 94.103.26.179 94.103.26.180 94.103.26.181
    53 94.103.26.182 159.255.220.247 159.255.220.248 159.255.220.249
    54 159.255.220.250 159.255.220.251 159.255.220.252 159.255.220.253
    55 159.255.220.254
    56 );
    57
    51 58 $self->{xsolla_app_id} = '@XSO_ID@';
    52 59 $self->{xsolla_app_secret} = '@XSO_SECRET@';
    53 60 $self->{xsolla_currency_code} = '@XSO_CURRENCY_CODE@';
    54 61 $self->{xsolla_test_mode} = int('@XSO_TEST_MODE@' || 0);
    62 if ( '@XSO_VALID_IPS@' ) {
    63 $self->{xsolla_valid_ips} = [qw(@XSO_VALID_IPS@)];
    64 } else {
    65 $self->{xsolla_valid_ips} = \@valid_ips_default;
    66 }
    55 67
    56 68 $self->_init_();
    57 69 $self;