Note that there are some explanatory texts on larger screens.

plurals
  1. PONo response from PayPal Payflow Gateway started between 11/21/2012 and 11/24/2012 - Perl / CGI
    text
    copied!<p>I'm a Perl/CGI programmer who's been using PayPal's Payflow Pro system since before it was even owned by PayPal. I have a generic script that handles all of the transactions for a variety of websites that I work on. It's been running successfully for quite some time...and all of a sudden, sometime between 11/21/2012 and 11/24/2012, it stopped receiving a response from PayPal and I haven't made any changes to this code in close to a year.</p> <p>The last successful transaction I had was at 9:46am EST on 11/21...and the first transaction I had without a response was on 11/24/2012 at 11:22pm EST.</p> <p>I also verified with my hosting provider that their external and internal firewall are not blocking any of this. I even had them add PayPal's Payflow server IPs as safe IPs.</p> <p>Here's my code:</p> <pre><code>#!/usr/bin/perl -w use LWP; use Data::Dumper; require HTTP::Request; require HTTP::Headers; ################################################## # Usage Instructions # # if (chargecc("4111111111111111","0903","1.00","test charge","123")) { # print "Transaction good. ($status)"; # } # else { # print "Transaction bad. ($status)"; # } # ################################################## sub chargecc { my $ccnum = $_[0]; my $ccexp = $_[1]; my $ccamount = $_[2]; my $comments = $_[3]; my $cvv2 = $_[4]; my $method = 'POST'; my $trans_uri = 'https://payflowpro.paypal.com'; #my $trans_uri = 'https://pilot-payflowpro.paypal.com'; my $request_id = int(rand 9999999999) + 1; my $content = "USER=OMITTED&amp;VENDOR=OMITTED&amp;PARTNER=Verisign&amp;PWD=OMITTED&amp;TENDER=C&amp;TRXTYPE=S&amp;ACCT=$ccnum&amp;EXPDATE=$ccexp&amp;AMT=$ccamount&amp;COMMENT1=$comments&amp;CVV2=$cvv2"; my $headers = HTTP::Headers-&gt;new( 'Content-Type' =&gt; 'text/namevalue', 'X-VPS-Request-Id' =&gt; $request_id, 'X-VPS-Timeout' =&gt; '30', 'X-VPS-VIT-Client-Architecture' =&gt; 'x86', 'X-VPS-VIT-Client-Certification-ID' =&gt; 'OMITTED', 'X-VPS-VIT-Client-Type' =&gt; 'Perl', 'X-VPS-VIT-Integration-Product' =&gt; '$input{program}', 'X-VPS-VIT-OS-Name' =&gt; 'Red Hat', ); my $request = HTTP::Request-&gt;new($method, $trans_uri, $headers, $content); my $ua = LWP::UserAgent-&gt;new; my $response = $ua-&gt;request($request); my $data; foreach my $pair (split('&amp;', $response-&gt;content)) { my ($k, $v) = split('=', $pair); $data-&gt;{$k} = $v; } if ($data-&gt;{RESULT} eq "0") { ######################## # Transaction approved! return 1; } else { ####################### # Transaction declined return 0; } } </code></pre> <p>What comes back with no value is the $response->content. The main issue with that is that I have no idea if the charge went through successfully or not, nor can I retrieve a Transaction ID from PayPal.</p> <p>And, if I switch this section:</p> <pre><code> if ($data-&gt;{RESULT} eq "0") { ######################## # Transaction approved! return 1; } else { ####################### # Transaction declined return 0; } </code></pre> <p>...to say...</p> <pre><code> if ($data-&gt;{RESULT} ne "0") { ######################## # Transaction declined! return 0; } else { ####################### # Transaction approved return 1; } </code></pre> <p>...the credit card charge actually goes through...but still nothing is returned in the $response->content value.</p> <p>Not sure if anyone else has experienced the same problem or not, but I have found nothing via Google searches that has helped yet.</p> <p>Anyone who can help would be greatly appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload