From dbb8eb4b1728875c57841d786ab361229a836034 Mon Sep 17 00:00:00 2001 From: Prasanna Annamalai Date: Tue, 19 Mar 2013 16:12:14 +0530 Subject: [PATCH] Modified README.md and add travis config --- .travis.yml | 10 ++++++++++ README.md | 18 +++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6ce4fee --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: php +jdk: + - 5.4 + - 5.3 +before_script: + - composer install +notifications: + recipients: + - prannamalai.x.com@gmail.com + on_success: always \ No newline at end of file diff --git a/README.md b/README.md index cbb0ff8..38f67ad 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -REST API SDK for PHP (V0.5.0) +REST API SDK for PHP (V0.5.0) [![Build Status](https://travis-ci.org/prannamalai/rest-api-sdk-php.png?branch=master)](https://travis-ci.org/prannamalai/rest-api-sdk-php) ============================== PayPal's PHP SDK for the RESTful APIs @@ -30,23 +30,27 @@ To write an app that uses the SDK dependencies * Copy the sample configuration file sdk_config.ini to a location of your choice and let the SDK know your config path using the following define directive - define('PP_SDK_CONFIG_PATH', /path/to/your/sdk_config.ini); + ```php + define('PP_SDK_CONFIG_PATH', /path/to/your/sdk_config.ini); + ``` * Obtain your clientId and client secret from the developer portal and add them to your config file * Now you are all set to make your first API call. Create a resource object as per your need and call the relevant operation or invoke one of the static methods on your resource class. + ```php $payment = new Payment(); $payment->setIntent("Sale"); ... - + $payment->create(); - + *OR* - - $payment = Payment::get('payment_id'); - + + $payment = Payment::get('payment_id'); + ``` + These examples pick the client id / secret automatically from your config file. You can also set API credentials dynamically. See the sample code for how you can do this.