We have to follow the following steps:
- Define API Information
- Redirect to Paypal [with some POST value for payment information]
- Redirect Back to Our Application with an IPN[Instance Payment Notification]
- Process and handle the payment on our app [validate , store and update the payment information]
Here is an Example Form:
<form id="paypal-form" action="https://www.sandbox.paypal.com/cgi-bin/webscr" accept-charset="UTF-8" method="post" >"></form>
Reference : https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/formbasics/
To simulate on Local Environment we need to use certificate authorities on php.ini:
curl.cainfo=<path-to>cacert.pem , Here is the file : https://curl.haxx.se/ca/cacert.pem
We Need to use Sandbox accounts for Simulation and we can create sanbox accounts from paypal developer website.
https://developer.paypal.com/developer/accounts/