Revision 535
- Date:
- 2015/11/27 12:24:47
- Files:
Legend:
- Added
- Removed
- Modified
-
utf8/plugins/payments/lib/payments/Provider/PayTure.pm
65 65 my $params = $opts{params}; 66 66 67 67 my $ua = LWP::UserAgent->new; 68 $ua->agent('Mozilla/5.0'); 69 $ua->ssl_opts( verify_hostname => 0, SSL_ca_path => '/usr/local/share/certs' ); 68 70 my $req = URI->new( $self->{api}{init} ); 69 $req->query_param( Key => $self->id ); 71 # $req->query_param( Key => $self->id ); 70 72 my @data = ( "SessionType=$session_type", "OrderId=$order_id", "Amount=$sum", "IP=$ip"); 71 73 push @data, "Url=$url" if $url; 72 74 push @data, "TemplateTag=$template" if $template; … … 77 79 push @data, "$param=$val"; 78 80 } 79 81 } 80 my $data_str = URI::Escape::uri_escape(join ';', @data); 81 $req->query_param( Data => $data_str ); 82 my $data_unescaped = join ';', @data; 83 warn Dumper "PayTure Init data: $data_unescaped\n"; 84 my $data_str = URI::Escape::uri_escape( $data_unescaped ); 85 # $req->query_param( Data => $data_str ); 82 86 warn "PayTure Init query: ".Dumper($req) if $DEBUG; 83 87 84 my $result = $ua->get( $req ); 88 my $result = $ua->post( $req, Content => { Key => $self->id, Data => $data_str } ); 85 89 if ( $result->code == 200 ) { 86 90 warn Dumper $result->content; 87 91 return 1; 88 92 } else { 93 warn Dumper $result; 89 94 warn "PayTure Init failed; ".$result->status_line."\n"; 90 95 } 91 96 return 0;