-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7aa8041
Showing
101 changed files
with
6,229 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
build | ||
.DS_Store | ||
*.log | ||
|
||
# IDE | ||
.project | ||
.settings | ||
.buildpath | ||
*.bak | ||
|
||
# Composer | ||
vendor | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CHANGELOG | ||
========= | ||
|
||
V0.5.0 (March 07, 2013) | ||
----------------------- | ||
|
||
* Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
PAYPAL, INC. | ||
|
||
SDK LICENSE | ||
|
||
NOTICE TO USER: PayPal, Inc. is providing the Software and Documentation for use under the terms of this Agreement. Any use, reproduction, modification or distribution of the Software or Documentation, or any derivatives or portions hereof, constitutes your acceptance of this Agreement. | ||
|
||
As used in this Agreement, "PayPal" means PayPal, Inc. "Software" means the software code accompanying this agreement. "Documentation" means the documents, specifications and all other items accompanying this Agreement other than the Software. | ||
|
||
1. LICENSE GRANT Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, worldwide, royalty free license to use, reproduce, prepare derivative works from, publicly display, publicly perform, distribute and sublicense the Software for any purpose, provided the copyright notice below appears in a conspicuous location within the source code of the distributed Software and this license is distributed in the supporting documentation of the Software you distribute. Furthermore, you must comply with all third party licenses in order to use the third party software contained in the Software. | ||
|
||
Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, worldwide, royalty free license to use, reproduce, publicly display, publicly perform, distribute and sublicense the Documentation for any purpose. You may not modify the Documentation. | ||
|
||
No title to the intellectual property in the Software or Documentation is transferred to you under the terms of this Agreement. You do not acquire any rights to the Software or the Documentation except as expressly set forth in this Agreement. | ||
|
||
If you choose to distribute the Software in a commercial product, you do so with the understanding that you agree to defend, indemnify and hold harmless PayPal and its suppliers against any losses, damages and costs arising from the claims, lawsuits or other legal actions arising out of such distribution. You may distribute the Software in object code form under your own license, provided that your license agreement: | ||
|
||
(a) complies with the terms and conditions of this license agreement; | ||
|
||
(b) effectively disclaims all warranties and conditions, express or implied, on behalf of PayPal; | ||
|
||
(c) effectively excludes all liability for damages on behalf of PayPal; | ||
|
||
(d) states that any provisions that differ from this Agreement are offered by you alone and not PayPal; and | ||
|
||
(e) states that the Software is available from you or PayPal and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. | ||
|
||
2. DISCLAIMER OF WARRANTY | ||
PAYPAL LICENSES THE SOFTWARE AND DOCUMENTATION TO YOU ONLY ON AN "AS IS" BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. PAYPAL MAKES NO WARRANTY THAT THE SOFTWARE OR DOCUMENTATION WILL BE ERROR-FREE. Each user of the Software or Documentation is solely responsible for determining the appropriateness of using and distributing the Software and Documentation and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs, or equipment, and unavailability or interruption of operations. Use of the Software and Documentation is made with the understanding that PayPal will not provide you with any technical or customer support or maintenance. Some states or jurisdictions do not allow the exclusion of implied warranties or limitations on how long an implied warranty may last, so the above limitations may not apply to you. To the extent permissible, any implied warranties are limited to ninety (90) days. | ||
|
||
|
||
3. LIMITATION OF LIABILITY | ||
PAYPAL AND ITS SUPPLIERS SHALL NOT BE LIABLE FOR LOSS OR DAMAGE ARISING OUT OF THIS AGREEMENT OR FROM THE USE OF THE SOFTWARE OR DOCUMENTATION. IN NO EVENT WILL PAYPAL OR ITS SUPPLIERS BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR SPECIAL DAMAGES INCLUDING LOST PROFITS, LOST SAVINGS, COSTS, FEES, OR EXPENSES OF ANY KIND ARISING OUT OF ANY PROVISION OF THIS AGREEMENT OR THE USE OR THE INABILITY TO USE THE SOFTWARE OR DOCUMENTATION, HOWEVER CAUSED AND UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. PAYPAL'S AGGREGATE LIABILITY AND THAT OF ITS SUPPLIERS UNDER OR IN CONNECTION WITH THIS AGREEMENT SHALL BE LIMITED TO THE AMOUNT PAID BY YOU FOR THE SOFTWARE AND DOCUMENTATION. | ||
|
||
4. TRADEMARK USAGE | ||
PayPal is a trademark PayPal, Inc. in the United States and other countries. Such trademarks may not be used to endorse or promote any product unless expressly permitted under separate agreement with PayPal. | ||
|
||
5. TERM | ||
Your rights under this Agreement shall terminate if you fail to comply with any of the material terms or conditions of this Agreement and do not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all your rights under this Agreement terminate, you agree to cease use and distribution of the Software and Documentation as soon as reasonably practicable. | ||
|
||
6. GOVERNING LAW AND JURISDICTION. This Agreement is governed by the statutes and laws of the State of California, without regard to the conflicts of law principles thereof. If any part of this Agreement is found void and unenforceable, it will not affect the validity of the balance of the Agreement, which shall remain valid and enforceable according to its terms. Any dispute arising out of or related to this Agreement shall be brought in the courts of Santa Clara County, California, USA. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
REST API SDK for PHP (V0.5.0) | ||
============================== | ||
|
||
PayPal's PHP SDK for the RESTful APIs | ||
|
||
|
||
Prerequisites | ||
------------- | ||
|
||
* PHP 5.3 or above | ||
* curl, json & openssl extensions must be enabled | ||
* composer for running the sample out of the box (See http://getcomposer.org) | ||
|
||
|
||
Running the sample | ||
------------------ | ||
|
||
* Ensure that you have composer installed on your machine. | ||
* Navigate to the samples folder and run 'composer update'. | ||
* Optionally, update the sdk_config.ini file with your own client Id and client secret. | ||
* Run any of the command line samples in the folder to see what the APIs can do. | ||
|
||
|
||
Usage | ||
----- | ||
|
||
To write an app that uses the SDK | ||
|
||
* Copy the composer.json file from the sample folder over to your project and run 'composer update' to fetch all | ||
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); | ||
|
||
* 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. | ||
|
||
$payment = new Payment(); | ||
|
||
$payment->setIntent("Sale"); | ||
|
||
... | ||
|
||
$payment->create(); | ||
|
||
*OR* | ||
|
||
$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. | ||
|
||
|
||
Contributing | ||
------------ | ||
|
||
More help | ||
--------- | ||
|
||
* API Reference | ||
* Reporting issues / feature requests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project name="paypal-rest-sdk-php" basedir="." default="all"> | ||
|
||
<property name="release.dir" value="${basedir}/release" /> | ||
<property name="output.dir" value="${basedir}/build" /> | ||
<property name="phplint.out" value="${output.dir}/phplint.txt" /> | ||
<property name="phploc.out" value="${output.dir}/phploc.xml" /> | ||
<property name="coverage.dir" value="${output.dir}/coverage" /> | ||
<property name="coverage.out" value="${coverage.dir}/junit.xml" /> | ||
<property name="clover.out" value="${coverage.dir}/clover.xml" /> | ||
<property name="test.dir" value="${output.dir}/test" /> | ||
<property name="coverage.out" value="${coverage.dir}/junit.xml" /> | ||
<property name="clover.out" value="${coverage.dir}/clover.xml" /> | ||
|
||
|
||
<fileset id="src.files" dir="${basedir}/lib" includes="**/*.php" /> | ||
|
||
<target name="composer-init" description="Downloads composer.phar if not available locally"> | ||
<if> | ||
<available file="composer.phar" /> | ||
<then> | ||
<echo>Composer is installed</echo> | ||
</then> | ||
<else> | ||
<echo message="Installing composer" /> | ||
<exec command="curl -s http://getcomposer.org/installer | php" /> | ||
<exec command="php composer.phar install --dev" /> | ||
</else> | ||
</if> | ||
</target> | ||
|
||
<target name="phplint"> | ||
<delete file="${phplint.out}"/> | ||
<apply executable="php" failonerror="true" output="${phplint.out}" append="true"> | ||
<arg value="-l" /> | ||
<fileset refid="src.files" /> | ||
</apply> | ||
</target> | ||
|
||
<target name="phploc"> | ||
<exec command="phploc.bat --log-xml ${phploc.out} ." dir="${basedir}/lib" /> | ||
</target> | ||
|
||
<target name="coverage"> | ||
<mkdir dir="${output.dir}/coverage"/> | ||
<exec command="phpunit.bat --coverage-html=${coverage.dir} --coverage-clover=${clover.out} --log-junit=${coverage.out} --exclude-group=PayPal\\Api\\*" /> | ||
</target> | ||
|
||
<target name="clean" description="Deletes build artifacts"> | ||
<delete dir="${output.dir}"/> | ||
<mkdir dir="${output.dir}"/> | ||
</target> | ||
|
||
<target name="test" description="Runs test cases"> | ||
<exec command="phpunit.bat --testdox-html=${test.dir}/testdox.html --log-junit=${test.dir}/junit.xml"/> | ||
</target> | ||
|
||
<!-- Requires phing --> | ||
<target name="convert-test-report"> | ||
<mkdir dir="build/test/report"/> | ||
<phpunitreport infile="build/test/junit.xml" | ||
format="frames" | ||
todir="build/test/report" /> | ||
</target> | ||
|
||
<target name="build" depends="test" description="Builds SDK" /> | ||
<target name="report" depends="phplint, coverage, phploc" description="Runs code checks and coverage reports" /> | ||
<target name="all" depends="clean, test, build, report" description="Do everything" /> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "paypal/rest-api-sdk-php", | ||
"description": "PayPal's PHP SDK for REST APIs", | ||
"keywords": ["paypal", "payments", "rest", "sdk"], | ||
"type": "library", | ||
"license": "Apache2", | ||
"homepage": "https://github.com/paypal/rest-api-sdk-php", | ||
"authors": [ | ||
{ | ||
"name": "PayPal", | ||
"homepage": "https://github.com/paypal/rest-api-sdk-php/contributors" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.3.0", | ||
"ext-curl": "*", | ||
"ext-json": "*", | ||
"paypal/sdk-core-php": "1.2.*" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "3.7.*" | ||
}, | ||
"autoload": { | ||
"psr-0": { | ||
"PayPal": "lib/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
<?php | ||
|
||
namespace PayPal\Api; | ||
|
||
/** | ||
* | ||
*/ | ||
class Address extends Resource { | ||
|
||
|
||
/** | ||
* Setter for line1 | ||
* @param string $line1 | ||
*/ | ||
public function setLine1($line1) { | ||
$this->line1 = $line1; | ||
} | ||
|
||
/** | ||
* Getter for line1 | ||
*/ | ||
public function getLine1() { | ||
return $this->line1; | ||
} | ||
|
||
/** | ||
* Setter for line2 | ||
* @param string $line2 | ||
*/ | ||
public function setLine2($line2) { | ||
$this->line2 = $line2; | ||
} | ||
|
||
/** | ||
* Getter for line2 | ||
*/ | ||
public function getLine2() { | ||
return $this->line2; | ||
} | ||
|
||
/** | ||
* Setter for city | ||
* @param string $city | ||
*/ | ||
public function setCity($city) { | ||
$this->city = $city; | ||
} | ||
|
||
/** | ||
* Getter for city | ||
*/ | ||
public function getCity() { | ||
return $this->city; | ||
} | ||
|
||
/** | ||
* Setter for state | ||
* @param string $state | ||
*/ | ||
public function setState($state) { | ||
$this->state = $state; | ||
} | ||
|
||
/** | ||
* Getter for state | ||
*/ | ||
public function getState() { | ||
return $this->state; | ||
} | ||
|
||
/** | ||
* Setter for postal_code | ||
* @param string $postal_code | ||
*/ | ||
public function setPostal_code($postal_code) { | ||
$this->postal_code = $postal_code; | ||
} | ||
|
||
/** | ||
* Getter for postal_code | ||
*/ | ||
public function getPostal_code() { | ||
return $this->postal_code; | ||
} | ||
|
||
/** | ||
* Setter for country_code | ||
* @param string $country_code | ||
*/ | ||
public function setCountry_code($country_code) { | ||
$this->country_code = $country_code; | ||
} | ||
|
||
/** | ||
* Getter for country_code | ||
*/ | ||
public function getCountry_code() { | ||
return $this->country_code; | ||
} | ||
|
||
/** | ||
* Setter for type | ||
* @param string $type | ||
*/ | ||
public function setType($type) { | ||
$this->type = $type; | ||
} | ||
|
||
/** | ||
* Getter for type | ||
*/ | ||
public function getType() { | ||
return $this->type; | ||
} | ||
|
||
/** | ||
* Setter for phone | ||
* @param string $phone | ||
*/ | ||
public function setPhone($phone) { | ||
$this->phone = $phone; | ||
} | ||
|
||
/** | ||
* Getter for phone | ||
*/ | ||
public function getPhone() { | ||
return $this->phone; | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.