Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Mar 28, 2024 12:33 pm
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: PayPal fix
PostPosted: Sun Dec 28, 2008 4:43 pm 
Offline

Joined: Sun Dec 28, 2008 4:34 pm
Posts: 5
Location: singapore
Paypal code in A2b is obsolete, it uses plain HTTP to talk to PayPal servers. They don't accept plain http anymore.

This patch fixes it by using HTTPS with libCURL.

Atamurad Hezretkuliyev

Code:
35,46d34
< $flag_ver = 0;
<
< function read_body($ch, $string)
< {
<    global $flag_ver;
<     $length = strlen($string);
<    if( strpos($string, "VERIFIED")== false  ) {
<       $flag_ver = 1;   
<    } else $flag_ver = 0;
<     write_log(LOGFILE_EPAYMENT, "Response: $length bytes\n$string\nVerified? $flag_ver ");
<     return $length;
< }
87,97c75,99
<
<       $url = "https://".PAYPAL_VERIFY_URL."/cgi-bin/webscr";
<        //open connection 
<        $ch = curl_init(); 
<          
<        //set the url, number of POST vars, POST data 
<        curl_setopt($ch,CURLOPT_URL,$url); 
<        curl_setopt($ch,CURLOPT_POST,1); 
<        curl_setopt($ch,CURLOPT_POSTFIELDS,$req); 
<          curl_setopt($ch, CURLOPT_WRITEFUNCTION, 'read_body');
<
---
>       $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
>       $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
>       $header .= "Content-Length: " . strlen ($req) . "\r\n\r\n";
>       for ($i = 1; $i <=3; $i++)
>       {
>          write_log(LOGFILE_EPAYMENT, basename(__FILE__).' line:'.__LINE__."-OPENDING HTTP CONNECTION TO ".PAYPAL_VERIFY_URL);
>          $fp = fsockopen (PAYPAL_VERIFY_URL, 443, $errno, $errstr, 30);
>          if($fp)
>          {   
>             break;
>          }
>          else
>          {
>             write_log(LOGFILE_EPAYMENT, basename(__FILE__).' line:'.__LINE__." -Try#".$i." Failed to open HTTP Connection : ".$errstr.". Error Code: ".$errno);
>             sleep(3);
>          }
>       }      
>       if (!$fp)
>       {
>          write_log(LOGFILE_EPAYMENT, basename(__FILE__).' line:'.__LINE__."-Failed to open HTTP Connection: ".$errstr.". Error Code: ".$errno);
>          exit();
>       }      
>       else
>       {
>          fputs ($fp, $header . $req);         
99,110c101,109
<
<       write_log(LOGFILE_EPAYMENT, "Opening HTTPS connection with curl to paypal");         
<
<        //execute post 
<        $result = curl_exec($ch); 
<
<       write_log(LOGFILE_EPAYMENT, "Result : $result");
<          
<        //close connection 
<        curl_close($ch);
<
<
---
>          while (!feof($fp))
>          {
>             $res = fgets ($fp, 1024);
>             if (strcmp ($res, "VERIFIED") == 0)
>             {
>                write_log(LOGFILE_EPAYMENT, basename(__FILE__).' line:'.__LINE__."-PAYPAL Transaction Verification Status: Verified ");
>                $flag_ver = 1;
>             }            
>          }
116c115,116
<
---
>       }
>       fclose ($fp);   


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 29, 2008 4:19 am 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Good work atamurad.

Keep it up.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2008 1:21 pm 
Offline

Joined: Thu Sep 13, 2007 12:46 pm
Posts: 254
Location: Naples, Fl ( USA )
asiby wrote:
Good work atamurad.

Keep it up.


I had a sample fix. I changed in a2billing.conf PAYPAL_VERIFY_URL ="ssl://www.paypal.com" and now it works fine.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 03, 2009 9:28 pm 
Offline

Joined: Sun Mar 12, 2006 2:49 pm
Posts: 954
Location: Barcelona
I dont follow here, we have this value by default in a2billing.conf

; paypal transaction verification url
paypal_verify_url = "ssl://www.paypal.com"

why it does need to be changed?

Yours,
/Areski


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 03, 2009 9:58 pm 
Offline

Joined: Mon Oct 01, 2007 10:44 pm
Posts: 230
Location: Bovey, Devon, UK
Are the quotes needed?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 24, 2009 9:57 pm 
Offline

Joined: Fri Oct 27, 2006 6:17 pm
Posts: 161
how can use this patch?
the file is checkout_process.php ?
how patch the file?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 25, 2009 5:06 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
kissas wrote:
how can use this patch?
With 'patch', but I'm not sure that you need to. I no longer use Paypal myself, so could someone else please confirm it still works today without need of this patch.

This time last year, asiby recapped some of the pre-requisites needed to get Paypal payments functioning correctly.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 25, 2009 5:49 pm 
Offline

Joined: Thu Sep 13, 2007 12:46 pm
Posts: 254
Location: Naples, Fl ( USA )
stavros wrote:
kissas wrote:
how can use this patch?
With 'patch', but I'm not sure that you need to. I no longer use Paypal myself, so could someone else please confirm it still works today without need of this patch.

This time last year, asiby recapped some of the pre-requisites needed to get Paypal payments functioning correctly.


Paypal does work you need to use ssl://www.paypal.com on the a2billing.conf


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 25, 2009 6:04 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Thanks for your confirmation there graher01. So, kissas, the patch is not useless, but it's not essential either.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 26, 2009 2:29 pm 
Offline

Joined: Fri Oct 27, 2006 6:17 pm
Posts: 161
with ssl://www.paypal.com in a 1.3.2 a2b its not working, with www.paypal.com its working fine.


Top
 Profile  
 
 Post subject: Re: PayPal fix
PostPosted: Sun Jul 26, 2009 1:06 pm 
Offline

Joined: Sun Mar 12, 2006 2:49 pm
Posts: 954
Location: Barcelona
make sure you have this in the code of checkout_process.php
$fp = fsockopen (PAYPAL_VERIFY_URL, 443, $errno, $errstr, 30);

and not :

$fp = fsockopen (PAYPAL_VERIFY_URL, 80, $errno, $errstr, 30);


then in a2billing.cong set as follow :

paypal_payment_url = "https://secure.paypal.com/cgi-bin/webscr"

paypal_verify_url = "ssl://www.paypal.com"


Cheers,
/Areski


Top
 Profile  
 
 Post subject: Re: PayPal fix
PostPosted: Sun Jul 26, 2009 7:02 pm 
Offline

Joined: Fri Feb 15, 2008 2:43 pm
Posts: 58
I'm having the same problem. Some (very few!) customers are able to pay via paypal - the rest aren't.

PayPal definitely broke something...

Are only A2B 1.3 users experiencing this? I guess I'll have to compare it myself, but is there a significant different between how 1.3 and 1.4 send the users to the paypal website to submit payment?


Top
 Profile  
 
 Post subject: Re: PayPal fix
PostPosted: Tue Jul 28, 2009 6:39 am 
Offline

Joined: Mon Jul 09, 2007 8:28 pm
Posts: 1
Did you find a fix to the problem yet? I tryed all the sudgested solution:

make sure you have this in the code of checkout_process.php
$fp = fsockopen (PAYPAL_VERIFY_URL, 443, $errno, $errstr, 30);

and not :

$fp = fsockopen (PAYPAL_VERIFY_URL, 80, $errno, $errstr, 30);


then in a2billing.cong set as follow :

paypal_payment_url = "https://secure.paypal.com/cgi-bin/webscr"

paypal_verify_url = "ssl://www.paypal.com"




but it DID NOT WORK. Please tell me how to fix the problem. Thank you.


Top
 Profile  
 
 Post subject: Re: PayPal fix
PostPosted: Tue Jul 28, 2009 9:52 pm 
Offline

Joined: Thu Oct 26, 2006 3:47 am
Posts: 17
This is an issue introduced by PayPal (did I mention they suck big time?!). The problem started occurring a couple of weeks ago not just for A2B users but for a lot of "paypal buy-it-now button" users.

In the little time I've spent researching this issue, it appears that some people have reported that PP no longer likes IFRAMES and got around it by launching the transaction in a new window. A2B doesn't suffer from that, of course.

Just my $.02


Top
 Profile  
 
 Post subject: Re: PayPal fix
PostPosted: Wed Jul 29, 2009 10:11 pm 
Offline

Joined: Mon Apr 17, 2006 9:04 pm
Posts: 37
Location: USA
in A2Billing.conf change the following

paypal_payment_url = "https://secure.paypal.com/cgi-bin/webscr"

TO

paypal_payment_url = "https://www.paypal.com/cgi-bin/webscr"

Issue resolved


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Voice Broadcast System


All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group