iguana007 / paypal Goto Github PK
View Code? Open in Web Editor NEWThis project forked from maly/paypal
PayPal Express Checkout implementation in PHP
License: Other
This project forked from maly/paypal
PayPal Express Checkout implementation in PHP
License: Other
How to implement PayPal Express checkout for simple (and single) payment on your web site? PayPal allows their users to implement checkout functions using their API. But implementing the full API is not a piece of cake. There are some libraries on the web, but the most of them are paid, closed or too complex. If you wanna implement simple and single-item payments (i.e. "pay for service" or "pay for source code"), you can use this library under BSD license. How to implement, step-by-step: 1. Download the library 2. Get your API Name, Password and Signature, as described here: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_NVPAPIBasics. In a short way: * Log into PayPal and click Profile. * Click API Access from the Profile menu. * Click Request API Credentials. * Check Request API signature and click Agree and Submit. * Write down your credentials (Name, Password and Signature) * Click on Done 3. Modify the class/paypal.php file: * Write your PayPal credentials in the appropriate place * Change the PP_RETURN and PP_CANCEL URLs There are demo files in the root folder. Buy script is simple and straightforward: You have to create an instantion of the PayPal class and call its doExpressCheckout method. This method has these parameters: $amount A desired amount of money $desc Item description $invoice (default: empty) Invoice internal ID. Use if you want to assign the payment to the right invoice. $currency (default: USD) Three-letter currency code (List of the currency codes is here: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_currency_codes) If everything is OK, the user is redirected to PayPal page to log in and confirm the payment, so the script execution ends. If something was wrong, method returns an array with an error information (see Response codes: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_NVPAPIOverview#id08696I00GBL__id08696I070PM). After all, the buyer come to PP_RETURN url, or to PP_CANCEL. At the "cancel" page you haven't to do anything special, just say something like "Your payment was cancelled". At the "return" page (check ppreturn.php) you have to do one simple operation - call the doPayment() method of the PayPal object. This method confirms the money transfer and executes it. The doPayment() method returns the response code you can use to decide if the payment is OK (and display serial number or unlock the access or something else). You can call the getCheckoutDetails() method to obtain the detail information about the transaction too, e.g. mail or invoice number If you want to play with this library at PayPal Sandbox, you have to generate PayPal object as new PayPal(); - to prevent unwanted side effect, such as money loose... ;) On the production server you have use new PayPal(true); which indicated you're connected to "live" PayPal, not sandbox.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.