Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Apr 18, 2024 5:37 pm
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Problems getting data from PayPal
PostPosted: Fri Oct 06, 2006 12:29 pm 
Offline

Joined: Fri Oct 06, 2006 11:50 am
Posts: 1
Hi all...

I'm not really sure where to begin so I'll try to provide as many infos as possible...
And also: sorry for my english... it's not as good as I wish :)

We are running a pbx using asterisk (1.2.12) and asterisk2billing (1.2.3 BrainCoral from 08.13.2006).
Now I'll try to receive payments via PayPal.

The Payments done via PayPal are booked correctly on both accounts (sender and receiver) but not recognized by asterisk2billing so neither the cc_card nor the cc_paypal tables are updated.

In the PayPal-Logfile (/tmp/a2billing_paypal.log) on every payment i get the following entry (some data replace by "xxx" :)):

--------
[Fri Oct 6 13:19:26 CEST 2006] paypay_ipn notification

Bad order (PayPal says it's invalid)HTTP/1.1 200 OK
Date: Fri, 06 Oct 2006 11:19:26 GMT
Server: Apache/1.3.33 (Unix) mod_gzip/1.3.26.1a mod_ssl/2.8.22 OpenSSL/0.9.7e
Set-Cookie: cookie_check=yes; expires=Mon, 03-Oct-2016 11:19:26 GMT; path=/; domain=.paypal.com
Set-Cookie: Apache=xxx.xxx.xxx.xxx.5181160133566480; path=/; expires=Sun, 28-Sep-36 11:19:26 GMT
Connection: close
Content-Type: text/html; charset=UTF-8

INVALID

The following data was received from PayPal:
------

That's all i receive, also via email to the sender of the payment.

I think that the configuration in the a2billing.conf is correct but I'll show it here - also with some data replaced by xxx):

---
; PAYPAL SETTINGS
[paypal]

Set the Paypal Email account.
[email protected]

; Set the from:address for the transaction notification
[email protected]

; Define the from:name for the transaction notification
from_name=xxxxx

; Set the company name to send for the transaction notification
company_name=xxxxxxxxx

; Set the email address for the notification and error report
[email protected]

; The Item name that is displayed to the customer when credit is purchased
item_name="Credit Purchase"

; Currency for the purchase, only one currency can be defined
currency_code=EUR

;IMPORTANT - Define here the URL to notify the payment back to the customer
;note that this is initiated by Paypal, and uses port 445 HTTPS, so this port must be open in the firewall.
notify_url=https://xxx.xxx.xxx/paypal/ipn_res.php

;Set the different amounts which are available - 5 amounts maximum (5:10:15)
purchase_amount=1:5:10:20:50

; paypal log file, to log the transactions & errors
paypal_logfile=/tmp/a2billing_paypal.log
----

Where "[email protected]" is the correct email address for the receiving PayPal-Account and "[email protected]" is the same address.

I was wondering about the port 445 for SSL but I think that's a typo and should be 443. However I tried both ports, on port 445 with ":445" after the domainname so it was something like "https://xxx.xxx.xxx:445/paypal/ipn_res.php".
The ipn_res.php is definitely reachable via both ways, so firewall is set correct.


Any ideas why it's not running?

Maybe of interest: for SSL I'm using a self-signed certificate at the moment and in the apache ssl-error-logfile I get something like "[warn] RSA server certificate CommonName (CN) `xxx.xxx' does NOT match server name!?" during apache startup.

Also in that logfile i get the following during a paypal transaction:
----
[Fri Oct 06 13:19:25 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/call24adm.leitfabrik.com/htdocs/Public/form_data/FG_var_card.inc on line 88
[Fri Oct 06 13:19:25 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/call24adm.leitfabrik.com/htdocs/Public/form_data/FG_var_card.inc on line 92
[Fri Oct 06 13:19:25 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/call24adm.leitfabrik.com/htdocs/Public/form_data/FG_var_card.inc on line 120
[Fri Oct 06 13:19:25 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/call24adm.leitfabrik.com/htdocs/Public/form_data/FG_var_card.inc on line 121
[Fri Oct 06 13:19:25 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/call24adm.leitfabrik.com/htdocs/Public/form_data/FG_var_card.inc on line 125
[Fri Oct 06 13:19:25 2006] [error] [client 216.113.188.202] PHP Notice: Undefined index: popup_select in /var/www/call24adm.leitfabrik.com/htdocs/Public/form_data/FG_var_card.inc on line 129
[Fri Oct 06 13:19:25 2006] [error] [client 216.113.188.202] PHP Notice: Undefined index: popup_formname in /var/www/call24adm.leitfabrik.com/htdocs/Public/form_data/FG_var_card.inc on line 129
[Fri Oct 06 13:19:25 2006] [error] [client 216.113.188.202] PHP Notice: Undefined index: popup_fieldname in /var/www/call24adm.leitfabrik.com/htdocs/Public/form_data/FG_var_card.inc on line 129
[Fri Oct 06 13:19:25 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/call24adm.leitfabrik.com/htdocs/Public/form_data/FG_var_card.inc on line 132
[Fri Oct 06 13:19:25 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/call24adm.leitfabrik.com/htdocs/Public/form_data/FG_var_card.inc on line 151
[Fri Oct 06 13:19:25 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: default_initbalance in /var/www/call24adm.leitfabrik.com/htdocs/Public/form_data/FG_var_card.inc on line 346
[Fri Oct 06 13:19:25 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: HTTP_POST_VARS in /var/www/call24adm.leitfabrik.com/htdocs/paypal/ipn_res.php on line 36
[Fri Oct 06 13:19:25 2006] [error] [client 216.113.188.202] PHP Warning: Invalid argument supplied for foreach() in /var/www/call24adm.leitfabrik.com/htdocs/paypal/ipn_res.php on line 39
[Fri Oct 06 13:19:26 2006] [error] [client 216.113.188.202] PHP Warning: Invalid argument supplied for foreach() in /var/www/call24adm.leitfabrik.com/htdocs/paypal/ipn_cls.php on line 31
---

Where 216.113.188.202 is an IP-Address from EBay.


Can't think of any more information to provide now.

Big thanks in advance for help!

Best regards


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 12, 2006 7:21 am 
Offline

Joined: Fri Apr 28, 2006 5:11 am
Posts: 426
If you moved folder paypal to another place (maybe in web-root), you must change the paths in ipn_res.php
example:
<?php
include ("../admin/lib/defines.php");
include ("../admin/lib/Form/Class.FormHandler.inc.php");
include ("../admin/Public/form_data/FG_var_card.inc");
...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 8:00 pm 
Offline

Joined: Fri Nov 03, 2006 12:44 am
Posts: 13
I am having a similar issue.

Here is the ssl error log

[Thu Nov 16 14:34:32 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/html/A2Billing_UI/Public/form_data/FG_var_card.inc on line 88
[Thu Nov 16 14:34:32 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/html/A2Billing_UI/Public/form_data/FG_var_card.inc on line 92
[Thu Nov 16 14:34:32 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/html/A2Billing_UI/Public/form_data/FG_var_card.inc on line 120
[Thu Nov 16 14:34:32 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/html/A2Billing_UI/Public/form_data/FG_var_card.inc on line 121
[Thu Nov 16 14:34:32 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/html/A2Billing_UI/Public/form_data/FG_var_card.inc on line 125
[Thu Nov 16 14:34:32 2006] [error] [client 216.113.188.202] PHP Notice: Undefined index: popup_select in /var/www/html/A2Billing_UI/Public/form_data/FG_var_card.inc on line 129
[Thu Nov 16 14:34:32 2006] [error] [client 216.113.188.202] PHP Notice: Undefined index: popup_formname in /var/www/html/A2Billing_UI/Public/form_data/FG_var_card.inc on line 129
[Thu Nov 16 14:34:32 2006] [error] [client 216.113.188.202] PHP Notice: Undefined index: popup_fieldname in /var/www/html/A2Billing_UI/Public/form_data/FG_var_card.inc on line 129
[Thu Nov 16 14:34:32 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/html/A2Billing_UI/Public/form_data/FG_var_card.inc on line 132
[Thu Nov 16 14:34:32 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: popup_select in /var/www/html/A2Billing_UI/Public/form_data/FG_var_card.inc on line 151
[Thu Nov 16 14:34:32 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: default_initbalance in /var/www/html/A2Billing_UI/Public/form_data/FG_var_card.inc on line 346
[Thu Nov 16 14:34:32 2006] [error] [client 216.113.188.202] PHP Notice: Undefined variable: HTTP_POST_VARS in /var/www/html/A2Billing_UI/paypal/ipn_res.php on line 36
[Thu Nov 16 14:34:32 2006] [error] [client 216.113.188.202] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/A2Billing_UI/paypal/ipn_res.php on line 39
[Thu Nov 16 14:34:33 2006] [error] [client 216.113.188.202] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/A2Billing_UI/paypal/ipn_cls.php on line 31


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 17, 2006 12:52 am 
Offline
User avatar

Joined: Sun Apr 02, 2006 5:29 am
Posts: 97
Do you have a ssl certificate installed on your server? if not then I think your url notify has to be notify_url=http://xxx.xxx.xxx/paypal/ipn_res.php.. instead of notify_url=https://xxx.xxx.xxx/paypal/ipn_res.php

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 17, 2006 1:15 am 
Offline

Joined: Fri Nov 03, 2006 12:44 am
Posts: 13
mohamed wrote:
Do you have a ssl certificate installed on your server? if not then I think your url notify has to be notify_url=http://xxx.xxx.xxx/paypal/ipn_res.php.. instead of notify_url=https://xxx.xxx.xxx/paypal/ipn_res.php

Thanks


Thank you for taking the time to reply.

Yes, I do have ssl certificate installed in my server. I tried both ways http and https. Same results

Any suggestions?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 17, 2006 1:47 am 
Offline
User avatar

Joined: Sun Apr 02, 2006 5:29 am
Posts: 97
what is the path for your paypal directory.. normally its in /a2billing/paypal.. if you have it in the default directory then try your notify to be this way.. notify_url=http://xxx.xxx.xxx.xxx/a2billing/paypal/ipn_res.php also the same on your paypal account....

other then this I dont see anything wrong..


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 17, 2006 4:01 am 
Offline

Joined: Mon May 29, 2006 7:07 pm
Posts: 287
Location: Denver
I agree with mohamed there should be another directory after domain name.

For donjuan:
notify_url=http://xxx.xxx.xxx/A2Billing_UI/paypal/ipn_res.php

For obi
notify_url=http://xxx.xxx.xxx/call24adm.leitfabrik.com/htdocs/paypal/ipn_res.php
Is this folder name ??? call24adm.leitfabrik.com

It should the entiry path after www/html/.....

I had it installed in several servers and never had any problems with it.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 17, 2006 12:52 pm 
Offline

Joined: Fri Nov 03, 2006 12:44 am
Posts: 13
Thanks again for your suggestions.

Those of you who have paypal transaction working correctly, Did you made any special changes to your configuration?

Here is what I got on the a2billing.conf

Path as follow:
notify_url=http://X.X.X.X/A2Billing_UI/paypal/ipn_res.php


I tried again just a few minutes ago and I get the same error email from my server. The fact that I am getting this email indicates that paypal is accessing the correct path, right?


***start of email*****



Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 18, 2006 1:49 am 
Offline
User avatar

Joined: Sun Apr 02, 2006 5:29 am
Posts: 97
why dont you first try to just replace the A2Billing_UI directory instead off re-installing everything.. Also just a note.. did you edit any of the files using a Dos or windows editor? These editors including notepad do not work well in linux...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 18, 2006 3:02 am 
Offline

Joined: Mon May 29, 2006 7:07 pm
Posts: 287
Location: Denver
I just edited ipn_res.php to remove extra charge for the customers.
What a2billing version do you have
ipn_res.php - size is 6568
ipn_cls.php size is 2444

----------------------------------------
This is from paypal page:

Why do I always receive an 'INVALID' response from PayPal?

If your script is receiving the final post from PayPal but it is always 'INVALID' or you are receiving an error message, then you are posting back to us, but there is a problem with the information we are receiving. You must post all of the form variables exactly as you received them, and maintaining the same order. If you are receiving a specific error message, please contact us with the exact error message so we may assist you.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 18, 2006 6:43 pm 
Offline

Joined: Fri Nov 03, 2006 12:44 am
Posts: 13
As suggested, I replaced the A2Billing_UI directory. And just to make sure everything was working; I created a couple of customers, login via the customer interface and performed a paypal transaction. Paypal successfully processed the payment, but I received the same error email from my server.

I am running a2billing version 1.2.3.

No, I have not used DOS editors. I have edited all files using VIM within the linux environment.

Here are the files sizes in /var/www/html/A2Billing_UI/paypal/
-rw-r--r-- 1 500 500 2444 Apr 19 2006 ipn_cls.php
-rw-r--r-- 1 500 500 6568 Jun 24 21:03 ipn_res.php


Thank you for the suggestion. At the very least double check everything. Any additional suggestions all welcome.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 
VoIP Billing solution


All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group