diff --git a/sample/README.md b/sample/README.md index ce1e81a..4b1ae03 100644 --- a/sample/README.md +++ b/sample/README.md @@ -1,57 +1,71 @@ -Rest API Samples -=================== +# Rest API Samples -This sample project is a simple web app that you can explore to understand what the payment APIs can do for you. +![Home Image](https://raw.githubusercontent.com/wiki/paypal/PayPal-PHP-SDK/images/homepage.jpg) -To try out the sample, run `composer update --no-dev` from the PayPal-PHP-SDK folder and you are all set. +These examples are created to experiment with the PayPal-PHP-SDK capabilities. Each examples are designed to demonstrate the default use-cases in each segment. -#### Running Samples +This sample project is a simple web app that you can explore to understand what each PayPal APIs can do for you. Irrespective of how you [installed your SDK](https://github.com/paypal/PayPal-PHP-SDK/wiki/Installation), you should be able to get the samples running by following the instructions below: -##### PHP 5.4 or higher -* If you are running PHP 5.4 or greater, PHP provides a built-in support for hosting PHP sites. -* The fastest way to get it running is -```bash -php -f sample/index.php -``` -* This would get the [built-in web server](http://php.net/manual/en/features.commandline.webserver.php) started, and hosted on `http://localhost:5000' +## Viewing Sample Code +You can [view sample source codes here](http://paypal.github.io/PayPal-PHP-SDK/sample/). However, we recommend you run samples locally to get a better idea. -```bash -LM-AUN-00876403:PayPal-PHP-SDK japatel$ php -f sample/index.php -PHP 5.5.14 Development Server started at Wed Nov 19 21:07:52 2014 -Listening on http://localhost:5000 -Document root is /Users/japatel/Documents/workspace/Server-SDK/PayPal-PHP-SDK/sample -Press Ctrl-C to quit. -[Wed Nov 19 21:07:56 2014] ::1:60826 [200]: /index.php -... -``` +## Instructions -##### PHP 5.3 or less +If you are running PHP 5.4 or greater, PHP provides a [ built-in support ]( http://php.net/manual/en/features.commandline.webserver.php) for hosting PHP sites. -* You could host the entire project in your local web server, by using tools like [MAMP](http://www.mamp.info/en/) or [XAMPP](https://www.apachefriends.org/index.html). -* Once done, you could easily open the samples by opening the matching URL. For e.g.: -`http://localhost/PayPal-PHP-SDK/sample/index.html` +Note: The root directory for composer based download would be `vendor` and for direct download it would be `PayPal-PHP-SDK`. Please update the commands accordingly. -You should see a sample dashboard page as shown below: -![Web Output!](/sample/images/sample_web.png) +1. Run `php -f PayPal-PHP-SDK/paypal/rest-api-sdk-php/sample/index.php` from your project root directory. +2. This would host a PHP server at `localhost:5000`. The output should look something like this: + + ``` +