A2Billing comes with PayPal integration built in so that A2Billing customers can add credit to their balance using PayPal automatically.
There are a few things to configure to get this integration working, which are listed below.
The exact setup will depend if you are running A2Billing 1.3 or A2Billing 1.4+. In version 1.3 all of the settings were in a file called /etc/asterisk/a2billing.conf. In versions 1.4 and later the settings were moved in to the database and can be changed via the web GUI. The examples here show the web GUI.
Payments work in 5 steps. These are –
- In A2Billing customer clicks to make a payment and is redirected to the PayPal website
- Customer makes a payment on the PayPal website
- Payment notification is queued by PayPal using IPN
- PayPal IPN connects to your A2Billing webserver and passes the transaction details. This could happen a little while after the payment
- Transaction is recorded in A2illing and balance updated
The first thing to do is switch on PayPal and set your PayPal payment e-mail address.
Under BILLING select Payment Methods –
Enable PayPal and enter your payment address –
Now select SYSTEM SETTINGS and Global List –
Now select epayment_method and click search –
Enable the e-payment settings –
Set the HTTP URL to blank and the HTTPS url to the url of your A2Billing server (you really should be using HTTPS). This can either be a domain name or an IP address –
Set the url on the web server for the customer interface. The customer interface on my A2Billing server is just ‘/’ –
Enable SSL (the http_domain setting is probably not needed) –
Set the purchase amounts and currency for the purchases. The purchases amounts are the options the customer will see in the customer interface –
Set the PayPal call URLs. Pay close attention to these. They changed a while back (and could be changed by PayPal again) –
Select Profile then Instant Payment Notification preferences –
Ensure that IPN is enabled and enter a Notification URL. This URL you enter is unimportant as the actual URL called will be passed to PayPal based on your A2Billing settings –
And that should be it. You should be good to go.
If you run in to problems there are a few simple things to check
- Ensure that you have port 443 open and that your webserver is listening on HTTPS on your A2Billing server as PayPal will be making calls to it
- Ensure the A2Billing settings above are correct, especially the PayPal URL settings
- Check your webserver logs to see if you can see PayPal making a call to your A2Billing server after the payment
Check your PayPal IPN History. A link to this can be found on the IPN setup page. This should tell you what URL PayPal is trying to notify about the payment –