Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Commit b615960

Browse files
committed
Merge branch 'master' into stable
Merge in invoicing api support
2 parents 4193ae1 + 20ed997 commit b615960

File tree

110 files changed

+7839
-1641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+7839
-1641
lines changed

CHANGELOG.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,33 @@
1-
REST API SDK for PHP
2-
====================
1+
# REST API SDK for PHP
2+
33
[![Build Status](https://travis-ci.org/paypal/rest-api-sdk-php.png?branch=master)](https://travis-ci.org/paypal/rest-api-sdk-php) [![Coverage Status](https://coveralls.io/repos/paypal/rest-api-sdk-php/badge.png?branch=master)](https://coveralls.io/r/paypal/rest-api-sdk-php?branch=master) [![Latest Stable Version](https://poser.pugx.org/paypal/rest-api-sdk-php/v/stable.png)](https://packagist.org/packages/paypal/rest-api-sdk-php) [![Total Downloads](https://poser.pugx.org/paypal/rest-api-sdk-php/downloads.png)](https://packagist.org/packages/paypal/rest-api-sdk-php)
44

55
This repository contains PayPal's PHP SDK and samples for REST API.
66

77

8-
Prerequisites
9-
-------------
8+
## Prerequisites
109

1110
* PHP 5.3 or above
1211
* curl, json & openssl extensions must be enabled
13-
* composer for running the sample out of the box (See http://getcomposer.org)
12+
* composer for fetching dependencies (See http://getcomposer.org)
13+
1414

1515

16-
Running the sample
17-
------------------
16+
## Running the sample
1817

19-
* Ensure that you have composer installed on your machine.
20-
* Navigate to the samples folder and run 'composer update'.
18+
* `Composer` is the recommended way to get the SDK. Ensure that you have composer installed on your machine, navigate to the samples folder and run 'composer update --no-dev' to fetch the SDK.
19+
* In case you cannot install composer on your machine, you can also fetch the SDK bundle from https://github.com/paypal/sdk-packages/raw/gh-pages/rest-api-sdk/php/rest-api-sdk-php-0.7.1.zip and unzip the bundle in to the samples folder.
2120
* Optionally, update the bootstrap.php file with your own client Id and client secret.
2221
* Run any of the samples in the 'samples' folder to see what the APIs can do.
2322

2423

25-
Usage
26-
-----
24+
## Usage
2725

2826
To write an app that uses the SDK
2927

30-
* Copy the composer.json file from the sample folder over to your project and run 'composer update' to fetch all
31-
dependencies
32-
* 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
33-
28+
* Copy the composer.json file from the sample folder over to your project and run 'composer update --no-dev' to fetch all dependencies.
29+
* 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.
30+
3431
```php
3532
define('PP_CONFIG_PATH', /path/to/your/sdk_config.ini);
3633
```
@@ -40,7 +37,7 @@ dependencies
4037

4138
```php
4239

43-
$apiContext = new ApiContext(new OAuthTokenCredential('<clientId>', '<clientSecret'));
40+
$apiContext = new ApiContext(new OAuthTokenCredential('<clientId>', '<clientSecret>'));
4441

4542
$payment = new Payment();
4643

@@ -55,14 +52,16 @@ dependencies
5552
$payment = Payment::get('payment_id', $apiContext);
5653
```
5754

58-
These examples pick the SDK configuration from the sdk_config.ini file. If you do not want to use an ini file or want to pick your configuration dynamically, you can use the `$apiContext->setConfig()` method to pass in the configuration.
55+
## SDK Configuration
56+
57+
The samples in this repo pick the SDK configuration from the sdk_config.ini file. If you do not want to use an ini file or want to pick your configuration dynamically, you can use the `$apiContext->setConfig()` method to pass in the configuration as a hashmap. See the `sample/bootstrap.php` file for an example.
5958

6059

61-
Contributing
62-
------------
60+
## Contributing
6361

64-
More help
65-
---------
62+
## More help
6663

6764
* [API Reference](https://developer.paypal.com/webapps/developer/docs/api/)
68-
* [Reporting issues / feature requests] (https://github.com/paypal/rest-api-sdk-php/issues)
65+
* [Reporting issues / feature requests] (https://github.com/paypal/rest-api-sdk-php/issues)
66+
67+
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/paypal/rest-api-sample-app-php/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"paypal/sdk-core-php": "2.4.*"
1919
},
2020
"require-dev": {
21-
"phpunit/phpunit": "3.7.*",
22-
"satooshi/php-coveralls": "dev-master"
21+
"phpunit/phpunit": "3.7.*"
2322
},
2423
"autoload": {
2524
"psr-0": {

lib/PayPal/Api/Address.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
namespace PayPal\Api;
33

44
use PayPal\Common\PPModel;
5+
use PayPal\Rest\ApiContext;
56

67
class Address extends PPModel {
78
/**
89
* Line 1 of the Address (eg. number, street, etc).
10+
*
911
* @param string $line1
1012
*/
1113
public function setLine1($line1) {
@@ -15,6 +17,7 @@ public function setLine1($line1) {
1517

1618
/**
1719
* Line 1 of the Address (eg. number, street, etc).
20+
*
1821
* @return string
1922
*/
2023
public function getLine1() {
@@ -24,6 +27,7 @@ public function getLine1() {
2427

2528
/**
2629
* Optional line 2 of the Address (eg. suite, apt #, etc.).
30+
*
2731
* @param string $line2
2832
*/
2933
public function setLine2($line2) {
@@ -33,6 +37,7 @@ public function setLine2($line2) {
3337

3438
/**
3539
* Optional line 2 of the Address (eg. suite, apt #, etc.).
40+
*
3641
* @return string
3742
*/
3843
public function getLine2() {
@@ -42,6 +47,7 @@ public function getLine2() {
4247

4348
/**
4449
* City name.
50+
*
4551
* @param string $city
4652
*/
4753
public function setCity($city) {
@@ -51,6 +57,7 @@ public function setCity($city) {
5157

5258
/**
5359
* City name.
60+
*
5461
* @return string
5562
*/
5663
public function getCity() {
@@ -60,6 +67,7 @@ public function getCity() {
6067

6168
/**
6269
* 2 letter country code.
70+
*
6371
* @param string $country_code
6472
*/
6573
public function setCountryCode($country_code) {
@@ -69,6 +77,7 @@ public function setCountryCode($country_code) {
6977

7078
/**
7179
* 2 letter country code.
80+
*
7281
* @return string
7382
*/
7483
public function getCountryCode() {
@@ -77,6 +86,7 @@ public function getCountryCode() {
7786

7887
/**
7988
* 2 letter country code.
89+
*
8090
* @param string $country_code
8191
* @deprecated. Instead use setCountryCode
8292
*/
@@ -86,6 +96,7 @@ public function setCountry_code($country_code) {
8696
}
8797
/**
8898
* 2 letter country code.
99+
*
89100
* @return string
90101
* @deprecated. Instead use getCountryCode
91102
*/
@@ -95,6 +106,7 @@ public function getCountry_code() {
95106

96107
/**
97108
* Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code.
109+
*
98110
* @param string $postal_code
99111
*/
100112
public function setPostalCode($postal_code) {
@@ -104,6 +116,7 @@ public function setPostalCode($postal_code) {
104116

105117
/**
106118
* Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code.
119+
*
107120
* @return string
108121
*/
109122
public function getPostalCode() {
@@ -112,6 +125,7 @@ public function getPostalCode() {
112125

113126
/**
114127
* Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code.
128+
*
115129
* @param string $postal_code
116130
* @deprecated. Instead use setPostalCode
117131
*/
@@ -121,6 +135,7 @@ public function setPostal_code($postal_code) {
121135
}
122136
/**
123137
* Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code.
138+
*
124139
* @return string
125140
* @deprecated. Instead use getPostalCode
126141
*/
@@ -130,6 +145,7 @@ public function getPostal_code() {
130145

131146
/**
132147
* 2 letter code for US states, and the equivalent for other countries.
148+
*
133149
* @param string $state
134150
*/
135151
public function setState($state) {
@@ -139,6 +155,7 @@ public function setState($state) {
139155

140156
/**
141157
* 2 letter code for US states, and the equivalent for other countries.
158+
*
142159
* @return string
143160
*/
144161
public function getState() {
@@ -148,6 +165,7 @@ public function getState() {
148165

149166
/**
150167
* Phone number in E.123 format.
168+
*
151169
* @param string $phone
152170
*/
153171
public function setPhone($phone) {
@@ -157,6 +175,7 @@ public function setPhone($phone) {
157175

158176
/**
159177
* Phone number in E.123 format.
178+
*
160179
* @return string
161180
*/
162181
public function getPhone() {

lib/PayPal/Api/Amount.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
namespace PayPal\Api;
33

44
use PayPal\Common\PPModel;
5+
use PayPal\Rest\ApiContext;
56

67
class Amount extends PPModel {
78
/**
89
* 3 letter currency code
10+
*
911
* @param string $currency
1012
*/
1113
public function setCurrency($currency) {
@@ -15,6 +17,7 @@ public function setCurrency($currency) {
1517

1618
/**
1719
* 3 letter currency code
20+
*
1821
* @return string
1922
*/
2023
public function getCurrency() {
@@ -24,6 +27,7 @@ public function getCurrency() {
2427

2528
/**
2629
* Total amount charged from the Payer account (or card) to Payee. In case of a refund, this is the refunded amount to the original Payer from Payee account.
30+
*
2731
* @param string $total
2832
*/
2933
public function setTotal($total) {
@@ -33,6 +37,7 @@ public function setTotal($total) {
3337

3438
/**
3539
* Total amount charged from the Payer account (or card) to Payee. In case of a refund, this is the refunded amount to the original Payer from Payee account.
40+
*
3641
* @return string
3742
*/
3843
public function getTotal() {
@@ -42,6 +47,7 @@ public function getTotal() {
4247

4348
/**
4449
* Additional details of the payment amount.
50+
*
4551
* @param PayPal\Api\Details $details
4652
*/
4753
public function setDetails($details) {
@@ -51,6 +57,7 @@ public function setDetails($details) {
5157

5258
/**
5359
* Additional details of the payment amount.
60+
*
5461
* @return PayPal\Api\Details
5562
*/
5663
public function getDetails() {

0 commit comments

Comments
 (0)