How to integrate with Paypal API in PHP/Cake
From How2s
- Upgrade to a Business Account under Website Payments Pro then "Sign Up" at the bottom
- Fill out the form with all the company details, customer service numbers etc.
- Once you've been granted business access, your "My Account->Profile" tab in the main screen will change (that should happen instantly after the request.)
- Go to "API Access" and you should end up in https://www.paypal.com/uk/cgi-bin/webscr?cmd=_profile-api-access
You might want to work with IPNs (Instant Payment Notifications) to get notified of billings:
- Again, click on "My Account->Profile"
- On the right column, click on Instant Payment Notifications
- Set you URL there, you'll get a HTTP POST to this URL whenever you get a payment or any other notification (subscription cancellation etc.)
Setting up a Sandbox account:
- Go to http://developer.paypal.com and sign up for a new account. You can then add as many accounts as you wish.
- The accounts will always have the format "chosenbyyou_paypalID_pre/per/biz@..."
- you can also set the password, but by default it's the same as the ID
Testing with the Sandbox:
- There is a cascaded system of user logins
- You have to be logged in as the super user and then log in as sandbox demo account
- If you are using a hosted button, you need to create one, one for your live and one for your test account. They will have different IDs.
Receiving IPNs:
- When you receive an IPN, you have to verify against the paypal API. Send back all received parameters adding plus
$transaction['cmd'] = '_notify-validate';
back to PayPal and they will either return
VERIFIED
or
INVALID

