forked from LiveCarta/PayPal-PHP-SDK
Merge commit '9d5d0beb57227cc31f1072ad37ddea57f6ea71b7'
Conflicts: sample/payments/ExecutePayment.php
This commit is contained in:
11
.editorconfig
Normal file
11
.editorconfig
Normal file
@@ -0,0 +1,11 @@
|
||||
# EditorConfig: Manage project indentation rules. http://EditorConfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
|
||||
[*.php]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,6 +4,7 @@ build
|
||||
*.log
|
||||
|
||||
# IDE
|
||||
.idea
|
||||
.project
|
||||
.settings
|
||||
.buildpath
|
||||
|
||||
13
.travis.yml
13
.travis.yml
@@ -1,7 +1,14 @@
|
||||
language: php
|
||||
php:
|
||||
- 5.4
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
- hhvm
|
||||
matrix:
|
||||
allow_failures:
|
||||
- php: hhvm
|
||||
fast_finish: true
|
||||
before_script:
|
||||
- composer install --dev
|
||||
- composer update satooshi/php-coveralls --dev
|
||||
@@ -11,5 +18,5 @@ after_script:
|
||||
- php vendor/bin/coveralls -v -c .coveralls.yml
|
||||
notifications:
|
||||
recipients:
|
||||
- DL-PP-Platform-PHP-SDK@ebay.com
|
||||
on_success: change
|
||||
- DL-PP-PHP-SDK@ebay.com
|
||||
on_success: change
|
||||
|
||||
24
CHANGELOG.md
24
CHANGELOG.md
@@ -1,24 +0,0 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
V0.7.1 (July 31, 2013)
|
||||
-----------------------
|
||||
* Added support for Reauthorization
|
||||
|
||||
V0.7.0 (May 30, 2013)
|
||||
-----------------------
|
||||
|
||||
* Added support for Auth and Capture APIs
|
||||
* Types modified to match the API Spec
|
||||
* Updated SDK to use namespace supported core library
|
||||
|
||||
V0.6.0 (April 26, 2013)
|
||||
-----------------------
|
||||
|
||||
* Adding support for dynamic configuration of SDK (Upgrading sdk-core-php dependency to V1.4.0)
|
||||
* Deprecating the setCredential method and changing resource class methods to take an ApiContext argument instead of a OauthTokenCredential argument.
|
||||
|
||||
V0.5.0 (March 07, 2013)
|
||||
-----------------------
|
||||
|
||||
* Initial Release
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
This repository contains PayPal's PHP SDK and samples for REST API.
|
||||
|
||||
> **Before starting to use the sdk, please be aware of the [existing issues and currently unavailable or upcoming features](https://github.com/paypal/rest-api-sdk-python/wiki/Existing-Issues-and-Unavailable%5CUpcoming-features) for the REST APIs. (which the sdks are based on)**
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -15,8 +16,8 @@ This repository contains PayPal's PHP SDK and samples for REST API.
|
||||
|
||||
## Running the sample
|
||||
|
||||
* `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.
|
||||
* 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.
|
||||
* Clone the repo and navigate to the samples folder.
|
||||
* Samples have dependency on the sdk and you can use `Composer` to get the dependencies. Ensure that you have composer installed on your machine, navigate to the samples folder and run 'composer update --no-dev' to fetch the SDK.
|
||||
* Optionally, update the bootstrap.php file with your own client Id and client secret.
|
||||
* Run any of the samples in the 'samples' folder to see what the APIs can do.
|
||||
|
||||
@@ -32,7 +33,7 @@ To write an app that uses the SDK
|
||||
define('PP_CONFIG_PATH', /path/to/your/sdk_config.ini);
|
||||
```
|
||||
|
||||
* Obtain your clientId and client secret from the developer portal. You will use them to create a `OAuthTokenCredential` object.
|
||||
* Obtain your clientId and client secret from the [developer portal](https://developer.paypal.com). You will use them to create a `OAuthTokenCredential` object.
|
||||
* 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
|
||||
@@ -63,3 +64,5 @@ The samples in this repo pick the SDK configuration from the sdk_config.ini file
|
||||
|
||||
* [API Reference](https://developer.paypal.com/webapps/developer/docs/api/)
|
||||
* [Reporting issues / feature requests] (https://github.com/paypal/rest-api-sdk-php/issues)
|
||||
|
||||
[](https://bitdeli.com/free "Bitdeli Badge")
|
||||
|
||||
@@ -1,167 +1,263 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Address extends PPModel {
|
||||
/**
|
||||
* Line 1 of the Address (eg. number, street, etc).
|
||||
* @param string $line1
|
||||
*/
|
||||
public function setLine1($line1) {
|
||||
$this->line1 = $line1;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class Address
|
||||
*
|
||||
* @property string line1
|
||||
* @property string line2
|
||||
* @property string city
|
||||
* @property string country_code
|
||||
* @property string postal_code
|
||||
* @property string state
|
||||
* @property string phone
|
||||
*/
|
||||
class Address extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Line 1
|
||||
* Address (eg. number, street, etc)
|
||||
*
|
||||
* @param string $line1
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLine1($line1)
|
||||
{
|
||||
$this->line1 = $line1;
|
||||
|
||||
/**
|
||||
* Line 1 of the Address (eg. number, street, etc).
|
||||
* @return string
|
||||
*/
|
||||
public function getLine1() {
|
||||
return $this->line1;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Line 1
|
||||
* Address (eg. number, street, etc)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLine1()
|
||||
{
|
||||
return $this->line1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional line 2 of the Address (eg. suite, apt #, etc.).
|
||||
* @param string $line2
|
||||
*/
|
||||
public function setLine2($line2) {
|
||||
$this->line2 = $line2;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Line 2 (Optional)
|
||||
* Address (eg. suite, apt #, etc)
|
||||
*
|
||||
* @param string $line2
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLine2($line2)
|
||||
{
|
||||
$this->line2 = $line2;
|
||||
|
||||
/**
|
||||
* Optional line 2 of the Address (eg. suite, apt #, etc.).
|
||||
* @return string
|
||||
*/
|
||||
public function getLine2() {
|
||||
return $this->line2;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Line 2 (Optional)
|
||||
* Address (eg. suite, apt #, etc)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLine2()
|
||||
{
|
||||
return $this->line2;
|
||||
}
|
||||
|
||||
/**
|
||||
* City name.
|
||||
* @param string $city
|
||||
*/
|
||||
public function setCity($city) {
|
||||
$this->city = $city;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set City Name
|
||||
*
|
||||
* @param string $city
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCity($city)
|
||||
{
|
||||
$this->city = $city;
|
||||
|
||||
/**
|
||||
* City name.
|
||||
* @return string
|
||||
*/
|
||||
public function getCity() {
|
||||
return $this->city;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get City Name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCity()
|
||||
{
|
||||
return $this->city;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 letter country code.
|
||||
* @param string $country_code
|
||||
*/
|
||||
public function setCountryCode($country_code) {
|
||||
$this->country_code = $country_code;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Country Code
|
||||
* Two Letter
|
||||
*
|
||||
* @param string $country_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCountryCode($country_code)
|
||||
{
|
||||
$this->country_code = $country_code;
|
||||
|
||||
/**
|
||||
* 2 letter country code.
|
||||
* @return string
|
||||
*/
|
||||
public function getCountryCode() {
|
||||
return $this->country_code;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 letter country code.
|
||||
* @param string $country_code
|
||||
* @deprecated. Instead use setCountryCode
|
||||
*/
|
||||
public function setCountry_code($country_code) {
|
||||
$this->country_code = $country_code;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* 2 letter country code.
|
||||
* @return string
|
||||
* @deprecated. Instead use getCountryCode
|
||||
*/
|
||||
public function getCountry_code() {
|
||||
return $this->country_code;
|
||||
}
|
||||
/**
|
||||
* Get Country Code
|
||||
* Two Letter
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCountryCode()
|
||||
{
|
||||
return $this->country_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @param string $postal_code
|
||||
*/
|
||||
public function setPostalCode($postal_code) {
|
||||
$this->postal_code = $postal_code;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Country Code
|
||||
* Two Letter
|
||||
*
|
||||
* @param string $country_code
|
||||
*
|
||||
* @deprecated Use setCountryCode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCountry_code($country_code)
|
||||
{
|
||||
$this->country_code = $country_code;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @return string
|
||||
*/
|
||||
public function getPostalCode() {
|
||||
return $this->postal_code;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @param string $postal_code
|
||||
* @deprecated. Instead use setPostalCode
|
||||
*/
|
||||
public function setPostal_code($postal_code) {
|
||||
$this->postal_code = $postal_code;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* 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.
|
||||
* @return string
|
||||
* @deprecated. Instead use getPostalCode
|
||||
*/
|
||||
public function getPostal_code() {
|
||||
return $this->postal_code;
|
||||
}
|
||||
/**
|
||||
* Get Country Code
|
||||
* Two Letter
|
||||
*
|
||||
* @deprecated Use getCountryCode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCountry_code()
|
||||
{
|
||||
return $this->country_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 letter code for US states, and the equivalent for other countries.
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Postal Code
|
||||
* 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
|
||||
*
|
||||
* @param string $postal_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPostalCode($postal_code)
|
||||
{
|
||||
$this->postal_code = $postal_code;
|
||||
|
||||
/**
|
||||
* 2 letter code for US states, and the equivalent for other countries.
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Postal Code
|
||||
* 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
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPostalCode()
|
||||
{
|
||||
return $this->postal_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone number in E.123 format.
|
||||
* @param string $phone
|
||||
*/
|
||||
public function setPhone($phone) {
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Postal Code
|
||||
* 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
|
||||
*
|
||||
* @param string $postal_code
|
||||
*
|
||||
* @deprecated Use setPostalCode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPostal_code($postal_code)
|
||||
{
|
||||
$this->postal_code = $postal_code;
|
||||
|
||||
/**
|
||||
* Phone number in E.123 format.
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone() {
|
||||
return $this->phone;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Postal Code
|
||||
* 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
|
||||
*
|
||||
* @deprecated Use getPostalCode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPostal_code()
|
||||
{
|
||||
return $this->postal_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set State
|
||||
* Two Letter Code for US States and the equivalent for other countries
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get State
|
||||
* Two Letter Code for US States and the equivalent for other countries
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Phone Number
|
||||
* E.123 format
|
||||
*
|
||||
* @param string $phone
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
{
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Phone Number
|
||||
* E.123 format
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone()
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,61 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Amount extends PPModel {
|
||||
/**
|
||||
* 3 letter currency code
|
||||
* @param string $currency
|
||||
*/
|
||||
public function setCurrency($currency) {
|
||||
$this->currency = $currency;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class Amount
|
||||
*
|
||||
* @property string currency
|
||||
* @property string total
|
||||
* @property \PayPal\Api\Details details
|
||||
*/
|
||||
class Amount extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Currency
|
||||
* Three Letter Currency Code
|
||||
*
|
||||
* @param string $currency
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCurrency($currency)
|
||||
{
|
||||
$this->currency = $currency;
|
||||
|
||||
/**
|
||||
* 3 letter currency code
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency() {
|
||||
return $this->currency;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Currency
|
||||
* Three Letter Currency Code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency()
|
||||
{
|
||||
return $this->currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @param string $total
|
||||
*/
|
||||
public function setTotal($total) {
|
||||
$this->total = $total;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set 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
|
||||
*
|
||||
* @param string $total
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTotal($total)
|
||||
{
|
||||
$this->total = $total;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @return string
|
||||
*/
|
||||
public function getTotal() {
|
||||
return $this->total;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get 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
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTotal()
|
||||
{
|
||||
return $this->total;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional details of the payment amount.
|
||||
* @param PayPal\Api\Details $details
|
||||
*/
|
||||
public function setDetails($details) {
|
||||
$this->details = $details;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional details of the payment amount.
|
||||
* @return PayPal\Api\Details
|
||||
*/
|
||||
public function getDetails() {
|
||||
return $this->details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Details
|
||||
* Additional Details of Payment Amount
|
||||
*
|
||||
* @param \PayPal\Api\Details $details
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDetails($details)
|
||||
{
|
||||
$this->details = $details;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Details
|
||||
* Additional Details of Payment Amount
|
||||
*
|
||||
* @return \PayPal\Api\Details
|
||||
*/
|
||||
public function getDetails()
|
||||
{
|
||||
return $this->details;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,299 +1,485 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Rest\Call;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Api\Authorization;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Api\Capture;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
|
||||
class Authorization extends PPModel implements IResource {
|
||||
/**
|
||||
* Class Authorization
|
||||
*
|
||||
* @property string id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string state
|
||||
* @property string parent_payment
|
||||
* @property string valid_until
|
||||
* @property \PayPal\Api\Links links
|
||||
*/
|
||||
class Authorization extends PPModel implements IResource
|
||||
{
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
private static $credential;
|
||||
|
||||
private static $credential;
|
||||
/**
|
||||
* Set Credential
|
||||
*
|
||||
* @param $credential
|
||||
*
|
||||
* @deprecated Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
public static function setCredential($credential)
|
||||
{
|
||||
self::$credential = $credential;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated. Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
public static function setCredential($credential) {
|
||||
self::$credential = $credential;
|
||||
}
|
||||
/**
|
||||
* Set ID
|
||||
* Identifier of the authorization transaction
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
/**
|
||||
* Identifier of the authorization transaction.
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the authorization transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
/**
|
||||
* Get ID
|
||||
* Identifier of the authorization transaction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
*/
|
||||
public function setCreateTime($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime() {
|
||||
return $this->create_time;
|
||||
}
|
||||
/**
|
||||
* Get Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
* @deprecated. Instead use setCreateTime
|
||||
*/
|
||||
public function setCreate_time($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
* @deprecated. Instead use getCreateTime
|
||||
*/
|
||||
public function getCreate_time() {
|
||||
return $this->create_time;
|
||||
}
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @deprecated Use setCreateTime
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreate_time($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @param string $update_time
|
||||
*/
|
||||
public function setUpdateTime($update_time) {
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime() {
|
||||
return $this->update_time;
|
||||
}
|
||||
/**
|
||||
* Get Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @deprecated Use getCreateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreate_time()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @param string $update_time
|
||||
* @deprecated. Instead use setUpdateTime
|
||||
*/
|
||||
public function setUpdate_time($update_time) {
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @return string
|
||||
* @deprecated. Instead use getUpdateTime
|
||||
*/
|
||||
public function getUpdate_time() {
|
||||
return $this->update_time;
|
||||
}
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
|
||||
/**
|
||||
* Amount being authorized for.
|
||||
* @param PayPal\Api\Amount $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being authorized for.
|
||||
* @return PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount() {
|
||||
return $this->amount;
|
||||
}
|
||||
/**
|
||||
* Get Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @deprecated Use setUpdateTime
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdate_time($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
|
||||
/**
|
||||
* State of the authorization transaction.
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the authorization transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
/**
|
||||
* Get Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @deprecated Use getUpdateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdate_time()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Amount
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @param string $parent_payment
|
||||
*/
|
||||
public function setParentPayment($parent_payment) {
|
||||
$this->parent_payment = $parent_payment;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @return string
|
||||
*/
|
||||
public function getParentPayment() {
|
||||
return $this->parent_payment;
|
||||
}
|
||||
/**
|
||||
* Get Amount
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @param string $parent_payment
|
||||
* @deprecated. Instead use setParentPayment
|
||||
*/
|
||||
public function setParent_payment($parent_payment) {
|
||||
$this->parent_payment = $parent_payment;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @return string
|
||||
* @deprecated. Instead use getParentPayment
|
||||
*/
|
||||
public function getParent_payment() {
|
||||
return $this->parent_payment;
|
||||
}
|
||||
/**
|
||||
* Set State
|
||||
* State of the authorization transaction
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
/**
|
||||
* Date/Time until which funds may be captured against this resource.
|
||||
* @param string $valid_until
|
||||
*/
|
||||
public function setValidUntil($valid_until) {
|
||||
$this->valid_until = $valid_until;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until which funds may be captured against this resource.
|
||||
* @return string
|
||||
*/
|
||||
public function getValidUntil() {
|
||||
return $this->valid_until;
|
||||
}
|
||||
/**
|
||||
* Get State
|
||||
* State of the authorization transaction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until which funds may be captured against this resource.
|
||||
* @param string $valid_until
|
||||
* @deprecated. Instead use setValidUntil
|
||||
*/
|
||||
public function setValid_until($valid_until) {
|
||||
$this->valid_until = $valid_until;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Date/Time until which funds may be captured against this resource.
|
||||
* @return string
|
||||
* @deprecated. Instead use getValidUntil
|
||||
*/
|
||||
public function getValid_until() {
|
||||
return $this->valid_until;
|
||||
}
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentPayment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
/**
|
||||
*
|
||||
* @array
|
||||
* @param PayPal\Api\Links $links
|
||||
*/
|
||||
public function setLinks($links) {
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks() {
|
||||
return $this->links;
|
||||
}
|
||||
/**
|
||||
* Get Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getParentPayment()
|
||||
{
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
* @deprecated Use setParentPayment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParent_payment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function get($authorizationId, $apiContext = null) {
|
||||
if (($authorizationId == null) || (strlen($authorizationId) <= 0)) {
|
||||
throw new \InvalidArgumentException("authorizationId cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/$authorizationId", "GET", $payLoad);
|
||||
$ret = new Authorization();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
/**
|
||||
* Get Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @deprecated Use getParentPayment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getParent_payment()
|
||||
{
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
public function capture($capture, $apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
if (($capture == null)) {
|
||||
throw new \InvalidArgumentException("capture cannot be null or empty");
|
||||
}
|
||||
$payLoad = $capture->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/capture", "POST", $payLoad);
|
||||
$ret = new Capture();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
/**
|
||||
* Set Valid Until
|
||||
* Date/Time until which funds may be captured against this resource
|
||||
*
|
||||
* @param string $valid_until
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValidUntil($valid_until)
|
||||
{
|
||||
$this->valid_until = $valid_until;
|
||||
|
||||
public function void($apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/void", "POST", $payLoad);
|
||||
$ret = new Authorization();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function reauthorize($apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
$payLoad = $this->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/reauthorize", "POST", $payLoad);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Get Valid Until
|
||||
* Date/Time until which funds may be captured against this resource
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValidUntil()
|
||||
{
|
||||
return $this->valid_until;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Valid Until
|
||||
* Date/Time until which funds may be captured against this resource
|
||||
*
|
||||
* @param string $valid_until
|
||||
*
|
||||
* @deprecated Use setValidUntil
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValid_until($valid_until)
|
||||
{
|
||||
$this->valid_until = $valid_until;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Valid Until
|
||||
* Date/Time until which funds may be captured against this resource
|
||||
*
|
||||
* @deprecated Use getValidUntil
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValid_until()
|
||||
{
|
||||
return $this->valid_until;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Links
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get
|
||||
*
|
||||
* @param int $authorizationId
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return Authorization
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function get($authorizationId, $apiContext = null)
|
||||
{
|
||||
if (($authorizationId == null) || (strlen($authorizationId) <= 0)) {
|
||||
throw new \InvalidArgumentException("authorizationId cannot be null or empty");
|
||||
}
|
||||
|
||||
$payLoad = "";
|
||||
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/$authorizationId", "GET", $payLoad);
|
||||
|
||||
$ret = new Authorization();
|
||||
$ret->fromJson($json);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Capture
|
||||
*
|
||||
* @param \Paypal\Api\Capture $capture
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return Capture
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function capture($capture, $apiContext = null)
|
||||
{
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
|
||||
if (($capture == null)) {
|
||||
throw new \InvalidArgumentException("capture cannot be null or empty");
|
||||
}
|
||||
|
||||
$payLoad = $capture->toJSON();
|
||||
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/capture", "POST", $payLoad);
|
||||
|
||||
$ret = new Capture();
|
||||
$ret->fromJson($json);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Void
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return Authorization
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function void($apiContext = null)
|
||||
{
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
|
||||
$payLoad = "";
|
||||
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/void", "POST", $payLoad);
|
||||
|
||||
$ret = new Authorization();
|
||||
$ret->fromJson($json);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reauthorize
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return $this
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function reauthorize($apiContext = null)
|
||||
{
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
|
||||
$payLoad = $this->toJSON();
|
||||
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/reauthorize", "POST", $payLoad);
|
||||
$this->fromJson($json);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
224
lib/PayPal/Api/BillingInfo.php
Normal file
224
lib/PayPal/Api/BillingInfo.php
Normal file
@@ -0,0 +1,224 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class BillingInfo extends PPModel {
|
||||
/**
|
||||
* Email address of the invoice recipient. 260 characters max.
|
||||
*
|
||||
* @param string $email
|
||||
*/
|
||||
public function setEmail($email) {
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the invoice recipient. 260 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail() {
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* First name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @param string $first_name
|
||||
*/
|
||||
public function setFirstName($first_name) {
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* First name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName() {
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* First name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @param string $first_name
|
||||
* @deprecated. Instead use setFirstName
|
||||
*/
|
||||
public function setFirst_name($first_name) {
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* First name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getFirstName
|
||||
*/
|
||||
public function getFirst_name() {
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @param string $last_name
|
||||
*/
|
||||
public function setLastName($last_name) {
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName() {
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @param string $last_name
|
||||
* @deprecated. Instead use setLastName
|
||||
*/
|
||||
public function setLast_name($last_name) {
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Last name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getLastName
|
||||
*/
|
||||
public function getLast_name() {
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Company business name of the invoice recipient. 100 characters max.
|
||||
*
|
||||
* @param string $business_name
|
||||
*/
|
||||
public function setBusinessName($business_name) {
|
||||
$this->business_name = $business_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Company business name of the invoice recipient. 100 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBusinessName() {
|
||||
return $this->business_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Company business name of the invoice recipient. 100 characters max.
|
||||
*
|
||||
* @param string $business_name
|
||||
* @deprecated. Instead use setBusinessName
|
||||
*/
|
||||
public function setBusiness_name($business_name) {
|
||||
$this->business_name = $business_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Company business name of the invoice recipient. 100 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getBusinessName
|
||||
*/
|
||||
public function getBusiness_name() {
|
||||
return $this->business_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address of the invoice recipient.
|
||||
*
|
||||
* @param PayPal\Api\Address $address
|
||||
*/
|
||||
public function setAddress($address) {
|
||||
$this->address = $address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address of the invoice recipient.
|
||||
*
|
||||
* @return PayPal\Api\Address
|
||||
*/
|
||||
public function getAddress() {
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Language of the email sent to the payer. Will only be used if payer doesn't have a PayPal account.
|
||||
*
|
||||
* @param string $language
|
||||
*/
|
||||
public function setLanguage($language) {
|
||||
$this->language = $language;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Language of the email sent to the payer. Will only be used if payer doesn't have a PayPal account.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLanguage() {
|
||||
return $this->language;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Option to display additional information such as business hours. 40 characters max.
|
||||
*
|
||||
* @param string $additional_info
|
||||
*/
|
||||
public function setAdditionalInfo($additional_info) {
|
||||
$this->additional_info = $additional_info;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Option to display additional information such as business hours. 40 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAdditionalInfo() {
|
||||
return $this->additional_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Option to display additional information such as business hours. 40 characters max.
|
||||
*
|
||||
* @param string $additional_info
|
||||
* @deprecated. Instead use setAdditionalInfo
|
||||
*/
|
||||
public function setAdditional_info($additional_info) {
|
||||
$this->additional_info = $additional_info;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Option to display additional information such as business hours. 40 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getAdditionalInfo
|
||||
*/
|
||||
public function getAdditional_info() {
|
||||
return $this->additional_info;
|
||||
}
|
||||
|
||||
}
|
||||
126
lib/PayPal/Api/CancelNotification.php
Normal file
126
lib/PayPal/Api/CancelNotification.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class CancelNotification extends PPModel {
|
||||
/**
|
||||
* Subject of the notification.
|
||||
*
|
||||
* @param string $subject
|
||||
*/
|
||||
public function setSubject($subject) {
|
||||
$this->subject = $subject;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subject of the notification.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSubject() {
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Note to the payer.
|
||||
*
|
||||
* @param string $note
|
||||
*/
|
||||
public function setNote($note) {
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote() {
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the merchant.
|
||||
*
|
||||
* @param boolean $send_to_merchant
|
||||
*/
|
||||
public function setSendToMerchant($send_to_merchant) {
|
||||
$this->send_to_merchant = $send_to_merchant;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the merchant.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getSendToMerchant() {
|
||||
return $this->send_to_merchant;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the merchant.
|
||||
*
|
||||
* @param boolean $send_to_merchant
|
||||
* @deprecated. Instead use setSendToMerchant
|
||||
*/
|
||||
public function setSend_to_merchant($send_to_merchant) {
|
||||
$this->send_to_merchant = $send_to_merchant;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the merchant.
|
||||
*
|
||||
* @return boolean
|
||||
* @deprecated. Instead use getSendToMerchant
|
||||
*/
|
||||
public function getSend_to_merchant() {
|
||||
return $this->send_to_merchant;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the payer.
|
||||
*
|
||||
* @param boolean $send_to_payer
|
||||
*/
|
||||
public function setSendToPayer($send_to_payer) {
|
||||
$this->send_to_payer = $send_to_payer;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the payer.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getSendToPayer() {
|
||||
return $this->send_to_payer;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the payer.
|
||||
*
|
||||
* @param boolean $send_to_payer
|
||||
* @deprecated. Instead use setSendToPayer
|
||||
*/
|
||||
public function setSend_to_payer($send_to_payer) {
|
||||
$this->send_to_payer = $send_to_payer;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the payer.
|
||||
*
|
||||
* @return boolean
|
||||
* @deprecated. Instead use getSendToPayer
|
||||
*/
|
||||
public function getSend_to_payer() {
|
||||
return $this->send_to_payer;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,270 +1,439 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Rest\Call;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Api\Capture;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Api\Refund;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
|
||||
class Capture extends PPModel implements IResource {
|
||||
/**
|
||||
* Class Capture
|
||||
*
|
||||
* @property string id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property bool is_final_capture
|
||||
* @property string state
|
||||
* @property string parent_payment
|
||||
* @property \PayPal\Api\Links links
|
||||
*/
|
||||
class Capture extends PPModel implements IResource
|
||||
{
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
private static $credential;
|
||||
|
||||
private static $credential;
|
||||
/**
|
||||
* @param $credential
|
||||
*
|
||||
* @deprecated Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
public static function setCredential($credential)
|
||||
{
|
||||
self::$credential = $credential;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated. Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
public static function setCredential($credential) {
|
||||
self::$credential = $credential;
|
||||
}
|
||||
/**
|
||||
* Set ID
|
||||
* Identifier of the Capture transaction
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
/**
|
||||
* Identifier of the Capture transaction.
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the Capture transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
/**
|
||||
* Get ID
|
||||
* Identifier of the Capture transaction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
*/
|
||||
public function setCreateTime($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime() {
|
||||
return $this->create_time;
|
||||
}
|
||||
/**
|
||||
* Get Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
* @deprecated. Instead use setCreateTime
|
||||
*/
|
||||
public function setCreate_time($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
* @deprecated. Instead use getCreateTime
|
||||
*/
|
||||
public function getCreate_time() {
|
||||
return $this->create_time;
|
||||
}
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @deprecated Use setCreateTime
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreate_time($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @param string $update_time
|
||||
*/
|
||||
public function setUpdateTime($update_time) {
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime() {
|
||||
return $this->update_time;
|
||||
}
|
||||
/**
|
||||
* Get Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @deprecated Use getCreateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreate_time()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @param string $update_time
|
||||
* @deprecated. Instead use setUpdateTime
|
||||
*/
|
||||
public function setUpdate_time($update_time) {
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @return string
|
||||
* @deprecated. Instead use getUpdateTime
|
||||
*/
|
||||
public function getUpdate_time() {
|
||||
return $this->update_time;
|
||||
}
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
|
||||
/**
|
||||
* Amount being captured. If no amount is specified, amount is used from the authorization being captured. If amount is same as the amount that's authorized for, the state of the authorization changes to captured. If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true.
|
||||
* @param PayPal\Api\Amount $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being captured. If no amount is specified, amount is used from the authorization being captured. If amount is same as the amount that's authorized for, the state of the authorization changes to captured. If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true.
|
||||
* @return PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount() {
|
||||
return $this->amount;
|
||||
}
|
||||
/**
|
||||
* Get Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @deprecated Use setUpdateTime
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdate_time($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
|
||||
/**
|
||||
* whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument.
|
||||
* @param boolean $is_final_capture
|
||||
*/
|
||||
public function setIsFinalCapture($is_final_capture) {
|
||||
$this->is_final_capture = $is_final_capture;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument.
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsFinalCapture() {
|
||||
return $this->is_final_capture;
|
||||
}
|
||||
/**
|
||||
* Get Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @deprecated Use getUpdateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdate_time()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument.
|
||||
* @param boolean $is_final_capture
|
||||
* @deprecated. Instead use setIsFinalCapture
|
||||
*/
|
||||
public function setIs_final_capture($is_final_capture) {
|
||||
$this->is_final_capture = $is_final_capture;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument.
|
||||
* @return boolean
|
||||
* @deprecated. Instead use getIsFinalCapture
|
||||
*/
|
||||
public function getIs_final_capture() {
|
||||
return $this->is_final_capture;
|
||||
}
|
||||
/**
|
||||
* Set Amount
|
||||
* Amount being captured
|
||||
* If no amount is specified, amount is used from the authorization being captured
|
||||
* If amount is same as the amount that's authorized for, the state of the authorization changes to captured
|
||||
* If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
/**
|
||||
* State of the capture transaction.
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the capture transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
/**
|
||||
* Get Amount
|
||||
* Amount being captured
|
||||
* If no amount is specified, amount is used from the authorization being captured
|
||||
* If amount is same as the amount that's authorized for, the state of the authorization changes to captured
|
||||
* If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Is Final Capture
|
||||
* Whether this is a final capture for the given authorization or not
|
||||
* If it's final, all the remaining funds held by the authorization, will be released in the funding instrument
|
||||
*
|
||||
* @param boolean $is_final_capture
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsFinalCapture($is_final_capture)
|
||||
{
|
||||
$this->is_final_capture = $is_final_capture;
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @param string $parent_payment
|
||||
*/
|
||||
public function setParentPayment($parent_payment) {
|
||||
$this->parent_payment = $parent_payment;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @return string
|
||||
*/
|
||||
public function getParentPayment() {
|
||||
return $this->parent_payment;
|
||||
}
|
||||
/**
|
||||
* Get Is Final Capture
|
||||
* Whether this is a final capture for the given authorization or not
|
||||
* If it's final, all the remaining funds held by the authorization, will be released in the funding instrument
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsFinalCapture()
|
||||
{
|
||||
return $this->is_final_capture;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @param string $parent_payment
|
||||
* @deprecated. Instead use setParentPayment
|
||||
*/
|
||||
public function setParent_payment($parent_payment) {
|
||||
$this->parent_payment = $parent_payment;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @return string
|
||||
* @deprecated. Instead use getParentPayment
|
||||
*/
|
||||
public function getParent_payment() {
|
||||
return $this->parent_payment;
|
||||
}
|
||||
/**
|
||||
* Set Is Final Capture
|
||||
* Whether this is a final capture for the given authorization or not
|
||||
* If it's final, all the remaining funds held by the authorization, will be released in the funding instrument
|
||||
*
|
||||
* @param boolean $is_final_capture
|
||||
*
|
||||
* @deprecated Use setIsFinalCapture
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIs_final_capture($is_final_capture)
|
||||
{
|
||||
$this->is_final_capture = $is_final_capture;
|
||||
|
||||
/**
|
||||
*
|
||||
* @array
|
||||
* @param PayPal\Api\Links $links
|
||||
*/
|
||||
public function setLinks($links) {
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks() {
|
||||
return $this->links;
|
||||
}
|
||||
/**
|
||||
* Get Is Final Capture
|
||||
* Whether this is a final capture for the given authorization or not
|
||||
* If it's final, all the remaining funds held by the authorization, will be released in the funding instrument
|
||||
*
|
||||
* @deprecated Use getIsFinalCapture
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIs_final_capture()
|
||||
{
|
||||
return $this->is_final_capture;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set State
|
||||
* State of the capture transaction
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function get($captureId, $apiContext = null) {
|
||||
if (($captureId == null) || (strlen($captureId) <= 0)) {
|
||||
throw new \InvalidArgumentException("captureId cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/capture/$captureId", "GET", $payLoad);
|
||||
$ret = new Capture();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
/**
|
||||
* Get State
|
||||
* State of the capture transaction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
public function refund($refund, $apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
if (($refund == null)) {
|
||||
throw new \InvalidArgumentException("refund cannot be null or empty");
|
||||
}
|
||||
$payLoad = $refund->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/capture/{$this->getId()}/refund", "POST", $payLoad);
|
||||
$ret = new Refund();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentPayment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getParentPayment()
|
||||
{
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
* @deprecated Use setParentPayment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParent_payment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @deprecated Use getParentPayment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getParent_payment()
|
||||
{
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Links
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get
|
||||
*
|
||||
* @param int $captureId
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return Capture
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function get($captureId, $apiContext = null)
|
||||
{
|
||||
if (($captureId == null) || (strlen($captureId) <= 0)) {
|
||||
throw new \InvalidArgumentException("captureId cannot be null or empty");
|
||||
}
|
||||
|
||||
$payLoad = "";
|
||||
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/capture/$captureId", "GET", $payLoad);
|
||||
|
||||
$ret = new Capture();
|
||||
$ret->fromJson($json);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refund
|
||||
*
|
||||
* @param \Paypal\Api\Refund $refund
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return Refund
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function refund($refund, $apiContext = null)
|
||||
{
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
|
||||
if (($refund == null)) {
|
||||
throw new \InvalidArgumentException("refund cannot be null or empty");
|
||||
}
|
||||
|
||||
$payLoad = $refund->toJSON();
|
||||
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/capture/{$this->getId()}/refund", "POST", $payLoad);
|
||||
|
||||
$ret = new Refund();
|
||||
$ret->fromJson($json);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
48
lib/PayPal/Api/Cost.php
Normal file
48
lib/PayPal/Api/Cost.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Cost extends PPModel {
|
||||
/**
|
||||
* Cost in percent. Range of 0 to 100.
|
||||
*
|
||||
* @param PayPal\Api\number $percent
|
||||
*/
|
||||
public function setPercent($percent) {
|
||||
$this->percent = $percent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cost in percent. Range of 0 to 100.
|
||||
*
|
||||
* @return PayPal\Api\number
|
||||
*/
|
||||
public function getPercent() {
|
||||
return $this->percent;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cost in amount. Range of 0 to 999999.99.
|
||||
*
|
||||
* @param PayPal\Api\Currency $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cost in amount. Range of 0 to 999999.99.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount() {
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,97 +1,155 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class CreditCardHistory extends PPModel {
|
||||
/**
|
||||
* A list of credit card resources
|
||||
* @array
|
||||
* @param PayPal\Api\CreditCard $credit-cards
|
||||
*/
|
||||
public function setCreditCards($credit_cards) {
|
||||
$this->{"credit-cards"} = $credit_cards;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class CreditCardHistory
|
||||
*
|
||||
* @property int count
|
||||
* @property string next_id
|
||||
*/
|
||||
class CreditCardHistory extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Credit Cards
|
||||
* A list of credit card resources
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $credit_cards
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreditCards($credit_cards)
|
||||
{
|
||||
$this->{"credit-cards"} = $credit_cards;
|
||||
|
||||
/**
|
||||
* A list of credit card resources
|
||||
* @return PayPal\Api\CreditCard
|
||||
*/
|
||||
public function getCreditCards() {
|
||||
return $this->{"credit-cards"};
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of credit card resources
|
||||
* @array
|
||||
* @param PayPal\Api\CreditCard $credit-cards
|
||||
* @deprecated. Instead use setCreditCards
|
||||
*/
|
||||
public function setCredit_cards($credit_cards) {
|
||||
$this->{"credit-cards"} = $credit_cards;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* A list of credit card resources
|
||||
* @return PayPal\Api\CreditCard
|
||||
* @deprecated. Instead use getCreditCards
|
||||
*/
|
||||
public function getCredit_cards() {
|
||||
return $this->{"credit-cards"};
|
||||
}
|
||||
/**
|
||||
* Get Credit Cards
|
||||
* A list of credit card resources
|
||||
*
|
||||
* @return \PayPal\Api\CreditCard
|
||||
*/
|
||||
public function getCreditCards()
|
||||
{
|
||||
return $this->{"credit-cards"};
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
* @param integer $count
|
||||
*/
|
||||
public function setCount($count) {
|
||||
$this->count = $count;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Credit Cards
|
||||
* A list of credit card resources
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $credit_cards
|
||||
*
|
||||
* @deprecated Use setCreditCards
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCredit_cards($credit_cards)
|
||||
{
|
||||
$this->{"credit-cards"} = $credit_cards;
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
* @return integer
|
||||
*/
|
||||
public function getCount() {
|
||||
return $this->count;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Credit Cards
|
||||
* A list of credit card resources
|
||||
*
|
||||
* @deprecated Use getCreditCards
|
||||
*
|
||||
* @return \PayPal\Api\CreditCard
|
||||
*/
|
||||
public function getCredit_cards()
|
||||
{
|
||||
return $this->{"credit-cards"};
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
* @param string $next_id
|
||||
*/
|
||||
public function setNextId($next_id) {
|
||||
$this->next_id = $next_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Count
|
||||
* Number of items returned in each range of results
|
||||
* Note that the last results range could have fewer items than the requested number of items
|
||||
*
|
||||
* @param int $count
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCount($count)
|
||||
{
|
||||
$this->count = $count;
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
* @return string
|
||||
*/
|
||||
public function getNextId() {
|
||||
return $this->next_id;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
* @param string $next_id
|
||||
* @deprecated. Instead use setNextId
|
||||
*/
|
||||
public function setNext_id($next_id) {
|
||||
$this->next_id = $next_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
* @return string
|
||||
* @deprecated. Instead use getNextId
|
||||
*/
|
||||
public function getNext_id() {
|
||||
return $this->next_id;
|
||||
}
|
||||
/**
|
||||
* Set Count
|
||||
* Number of items returned in each range of results
|
||||
* Note that the last results range could have fewer items than the requested number of items
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCount()
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Next ID
|
||||
* Identifier of the next element to get the next range of results
|
||||
*
|
||||
* @param string $next_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNextId($next_id)
|
||||
{
|
||||
$this->next_id = $next_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Next ID
|
||||
* Identifier of the next element to get the next range of results
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNextId()
|
||||
{
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Next ID
|
||||
* Identifier of the next element to get the next range of results
|
||||
*
|
||||
* @param string $next_id
|
||||
*
|
||||
* @deprecated Use setNextId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNext_id($next_id)
|
||||
{
|
||||
$this->next_id = $next_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Next ID
|
||||
* Identifier of the next element to get the next range of results
|
||||
*
|
||||
* @deprecated Use getNextId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNext_id()
|
||||
{
|
||||
return $this->next_id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,183 +1,297 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class CreditCardToken extends PPModel {
|
||||
/**
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API.
|
||||
* @param string $credit_card_id
|
||||
*/
|
||||
public function setCreditCardId($credit_card_id) {
|
||||
$this->credit_card_id = $credit_card_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class CreditCardToken
|
||||
*
|
||||
* @property string credit_card_id
|
||||
* @property string payer_id
|
||||
* @property string last4
|
||||
* @property string type
|
||||
* @property int expire_month
|
||||
* @property int expire_year
|
||||
*/
|
||||
class CreditCardToken extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Credit Card ID
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API
|
||||
*
|
||||
* @param string $credit_card_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreditCardId($credit_card_id)
|
||||
{
|
||||
$this->credit_card_id = $credit_card_id;
|
||||
|
||||
/**
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API.
|
||||
* @return string
|
||||
*/
|
||||
public function getCreditCardId() {
|
||||
return $this->credit_card_id;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API.
|
||||
* @param string $credit_card_id
|
||||
* @deprecated. Instead use setCreditCardId
|
||||
*/
|
||||
public function setCredit_card_id($credit_card_id) {
|
||||
$this->credit_card_id = $credit_card_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API.
|
||||
* @return string
|
||||
* @deprecated. Instead use getCreditCardId
|
||||
*/
|
||||
public function getCredit_card_id() {
|
||||
return $this->credit_card_id;
|
||||
}
|
||||
/**
|
||||
* Get Credit Card ID
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreditCardId()
|
||||
{
|
||||
return $this->credit_card_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API.
|
||||
* @param string $payer_id
|
||||
*/
|
||||
public function setPayerId($payer_id) {
|
||||
$this->payer_id = $payer_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Credit Card ID
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API
|
||||
*
|
||||
* @param string $credit_card_id
|
||||
*
|
||||
* @deprecated Use setCreditCardId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCredit_card_id($credit_card_id)
|
||||
{
|
||||
$this->credit_card_id = $credit_card_id;
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API.
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerId() {
|
||||
return $this->payer_id;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API.
|
||||
* @param string $payer_id
|
||||
* @deprecated. Instead use setPayerId
|
||||
*/
|
||||
public function setPayer_id($payer_id) {
|
||||
$this->payer_id = $payer_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API.
|
||||
* @return string
|
||||
* @deprecated. Instead use getPayerId
|
||||
*/
|
||||
public function getPayer_id() {
|
||||
return $this->payer_id;
|
||||
}
|
||||
/**
|
||||
* Get Credit Card ID
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API
|
||||
*
|
||||
* @deprecated Use getCreditCardId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCredit_card_id()
|
||||
{
|
||||
return $this->credit_card_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last 4 digits of the card number from the saved card.
|
||||
* @param string $last4
|
||||
*/
|
||||
public function setLast4($last4) {
|
||||
$this->last4 = $last4;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Payer ID
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API
|
||||
*
|
||||
* @param string $payer_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerId($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
|
||||
/**
|
||||
* Last 4 digits of the card number from the saved card.
|
||||
* @return string
|
||||
*/
|
||||
public function getLast4() {
|
||||
return $this->last4;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payer ID
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerId()
|
||||
{
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the Card (eg. visa, mastercard, etc.) from the saved card. Please note that the values are always in lowercase and not meant to be used directly for display.
|
||||
* @param string $type
|
||||
*/
|
||||
public function setType($type) {
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Payer ID
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API
|
||||
*
|
||||
* @param string $payer_id
|
||||
*
|
||||
* @deprecated Use setPayerId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayer_id($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
|
||||
/**
|
||||
* Type of the Card (eg. visa, mastercard, etc.) from the saved card. Please note that the values are always in lowercase and not meant to be used directly for display.
|
||||
* @return string
|
||||
*/
|
||||
public function getType() {
|
||||
return $this->type;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payer ID
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API
|
||||
*
|
||||
* @deprecated Use getPayerId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayer_id()
|
||||
{
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* card expiry month from the saved card with value 1 - 12
|
||||
* @param integer $expire_month
|
||||
*/
|
||||
public function setExpireMonth($expire_month) {
|
||||
$this->expire_month = $expire_month;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Last Four
|
||||
* Last 4 digits of the card number from the saved card
|
||||
*
|
||||
* @param string $last4
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLast4($last4)
|
||||
{
|
||||
$this->last4 = $last4;
|
||||
|
||||
/**
|
||||
* card expiry month from the saved card with value 1 - 12
|
||||
* @return integer
|
||||
*/
|
||||
public function getExpireMonth() {
|
||||
return $this->expire_month;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* card expiry month from the saved card with value 1 - 12
|
||||
* @param integer $expire_month
|
||||
* @deprecated. Instead use setExpireMonth
|
||||
*/
|
||||
public function setExpire_month($expire_month) {
|
||||
$this->expire_month = $expire_month;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* card expiry month from the saved card with value 1 - 12
|
||||
* @return integer
|
||||
* @deprecated. Instead use getExpireMonth
|
||||
*/
|
||||
public function getExpire_month() {
|
||||
return $this->expire_month;
|
||||
}
|
||||
/**
|
||||
* Get Last Four
|
||||
* Last 4 digits of the card number from the saved card
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLast4()
|
||||
{
|
||||
return $this->last4;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card expiry year from the saved card
|
||||
* @param integer $expire_year
|
||||
*/
|
||||
public function setExpireYear($expire_year) {
|
||||
$this->expire_year = $expire_year;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Type
|
||||
* (eg. visa, mastercard, etc) from the saved card
|
||||
* Please note that the values are always in lowercase and not meant to be used directly for display
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
/**
|
||||
* 4 digit card expiry year from the saved card
|
||||
* @return integer
|
||||
*/
|
||||
public function getExpireYear() {
|
||||
return $this->expire_year;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card expiry year from the saved card
|
||||
* @param integer $expire_year
|
||||
* @deprecated. Instead use setExpireYear
|
||||
*/
|
||||
public function setExpire_year($expire_year) {
|
||||
$this->expire_year = $expire_year;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* 4 digit card expiry year from the saved card
|
||||
* @return integer
|
||||
* @deprecated. Instead use getExpireYear
|
||||
*/
|
||||
public function getExpire_year() {
|
||||
return $this->expire_year;
|
||||
}
|
||||
/**
|
||||
* Get Type
|
||||
* (eg. visa, mastercard, etc) from the saved card
|
||||
* Please note that the values are always in lowercase and not meant to be used directly for display
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Expire Month
|
||||
* Card Expiration month from the saved card with value 1 - 12
|
||||
*
|
||||
* @param int $expire_month
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireMonth($expire_month)
|
||||
{
|
||||
$this->expire_month = $expire_month;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Expire Month
|
||||
* Card Expiration month from the saved card with value 1 - 12
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpireMonth()
|
||||
{
|
||||
return $this->expire_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Expire Month
|
||||
* Card Expiration month from the saved card with value 1 - 12
|
||||
*
|
||||
* @param int $expire_month
|
||||
*
|
||||
* @deprecated Use setExpireMonth
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpire_month($expire_month)
|
||||
{
|
||||
$this->expire_month = $expire_month;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Expire Month
|
||||
* Card Expiration month from the saved card with value 1 - 12
|
||||
*
|
||||
* @deprecated Use getExpireMonth
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpire_month()
|
||||
{
|
||||
return $this->expire_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Expire Year
|
||||
* 4 digit card expiry year from the saved card
|
||||
*
|
||||
* @param int $expire_year
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireYear($expire_year)
|
||||
{
|
||||
$this->expire_year = $expire_year;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Expire Year
|
||||
* 4 digit card expiry year from the saved card
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpireYear()
|
||||
{
|
||||
return $this->expire_year;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Expire Year
|
||||
* 4 digit card expiry year from the saved card
|
||||
*
|
||||
* @param int $expire_year
|
||||
*
|
||||
* @deprecated Use setExpireYear
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpire_year($expire_year)
|
||||
{
|
||||
$this->expire_year = $expire_year;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Expire Year
|
||||
* 4 digit card expiry year from the saved card
|
||||
*
|
||||
* @deprecated Use getExpireYear
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpire_year()
|
||||
{
|
||||
return $this->expire_year;
|
||||
}
|
||||
}
|
||||
|
||||
48
lib/PayPal/Api/Currency.php
Normal file
48
lib/PayPal/Api/Currency.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Currency extends PPModel {
|
||||
/**
|
||||
* 3 letter currency code
|
||||
*
|
||||
* @param string $currency
|
||||
*/
|
||||
public function setCurrency($currency) {
|
||||
$this->currency = $currency;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3 letter currency code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency() {
|
||||
return $this->currency;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* amount upto 2 decimals represented as string
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
public function setValue($value) {
|
||||
$this->value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* amount upto 2 decimals represented as string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValue() {
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
48
lib/PayPal/Api/CustomAmount.php
Normal file
48
lib/PayPal/Api/CustomAmount.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class CustomAmount extends PPModel {
|
||||
/**
|
||||
* Custom amount label. 25 characters max.
|
||||
*
|
||||
* @param string $label
|
||||
*/
|
||||
public function setLabel($label) {
|
||||
$this->label = $label;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom amount label. 25 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLabel() {
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Custom amount value. Range of 0 to 999999.99.
|
||||
*
|
||||
* @param PayPal\Api\Currency $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom amount value. Range of 0 to 999999.99.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount() {
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,79 +1,119 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Details extends PPModel {
|
||||
/**
|
||||
* Amount being charged for shipping.
|
||||
* @param string $shipping
|
||||
*/
|
||||
public function setShipping($shipping) {
|
||||
$this->shipping = $shipping;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class Details
|
||||
*
|
||||
* @property string shipping
|
||||
* @property string subtotal
|
||||
* @property string tax
|
||||
* @property string fee
|
||||
*/
|
||||
class Details extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Shipping
|
||||
* Amount being charged for shipping
|
||||
*
|
||||
* @param string $shipping
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShipping($shipping)
|
||||
{
|
||||
$this->shipping = $shipping;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged for shipping.
|
||||
* @return string
|
||||
*/
|
||||
public function getShipping() {
|
||||
return $this->shipping;
|
||||
}
|
||||
/**
|
||||
* Get Shipping
|
||||
* Amount being charged for shipping
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShipping()
|
||||
{
|
||||
return $this->shipping;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Subtotal
|
||||
* Sub-total (amount) of items being paid for
|
||||
*
|
||||
* @param string $subtotal
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSubtotal($subtotal)
|
||||
{
|
||||
$this->subtotal = $subtotal;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sub-total (amount) of items being paid for.
|
||||
* @param string $subtotal
|
||||
*/
|
||||
public function setSubtotal($subtotal) {
|
||||
$this->subtotal = $subtotal;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Get Subtotal
|
||||
* Sub-total (amount) of items being paid for
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSubtotal()
|
||||
{
|
||||
return $this->subtotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sub-total (amount) of items being paid for.
|
||||
* @return string
|
||||
*/
|
||||
public function getSubtotal() {
|
||||
return $this->subtotal;
|
||||
}
|
||||
/**
|
||||
* Set Tax
|
||||
* Amount being charged as tax
|
||||
*
|
||||
* @param string $tax
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTax($tax)
|
||||
{
|
||||
$this->tax = $tax;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Tax
|
||||
* Amount being charged as tax
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTax()
|
||||
{
|
||||
return $this->tax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as tax.
|
||||
* @param string $tax
|
||||
*/
|
||||
public function setTax($tax) {
|
||||
$this->tax = $tax;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as tax.
|
||||
* @return string
|
||||
*/
|
||||
public function getTax() {
|
||||
return $this->tax;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment.
|
||||
* @param string $fee
|
||||
*/
|
||||
public function setFee($fee) {
|
||||
$this->fee = $fee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment.
|
||||
* @return string
|
||||
*/
|
||||
public function getFee() {
|
||||
return $this->fee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Fee
|
||||
* Fee charged by PayPal
|
||||
* In case of a refund, this is the fee amount refunded to the original receipient of the payment
|
||||
*
|
||||
* @param string $fee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFee($fee)
|
||||
{
|
||||
$this->fee = $fee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Fee
|
||||
* Fee charged by PayPal
|
||||
* In case of a refund, this is the fee amount refunded to the original receipient of the payment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFee()
|
||||
{
|
||||
return $this->fee;
|
||||
}
|
||||
}
|
||||
|
||||
146
lib/PayPal/Api/Error.php
Normal file
146
lib/PayPal/Api/Error.php
Normal file
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Error extends PPModel {
|
||||
/**
|
||||
* Human readable, unique name of the error.
|
||||
*
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Human readable, unique name of the error.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PayPal internal identifier used for correlation purposes.
|
||||
*
|
||||
* @param string $debug_id
|
||||
*/
|
||||
public function setDebugId($debug_id) {
|
||||
$this->debug_id = $debug_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal internal identifier used for correlation purposes.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDebugId() {
|
||||
return $this->debug_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal internal identifier used for correlation purposes.
|
||||
*
|
||||
* @param string $debug_id
|
||||
* @deprecated. Instead use setDebugId
|
||||
*/
|
||||
public function setDebug_id($debug_id) {
|
||||
$this->debug_id = $debug_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* PayPal internal identifier used for correlation purposes.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getDebugId
|
||||
*/
|
||||
public function getDebug_id() {
|
||||
return $this->debug_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Message describing the error.
|
||||
*
|
||||
* @param string $message
|
||||
*/
|
||||
public function setMessage($message) {
|
||||
$this->message = $message;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Message describing the error.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage() {
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* URI for detailed information related to this error for the developer.
|
||||
*
|
||||
* @param string $information_link
|
||||
*/
|
||||
public function setInformationLink($information_link) {
|
||||
$this->information_link = $information_link;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI for detailed information related to this error for the developer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInformationLink() {
|
||||
return $this->information_link;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI for detailed information related to this error for the developer.
|
||||
*
|
||||
* @param string $information_link
|
||||
* @deprecated. Instead use setInformationLink
|
||||
*/
|
||||
public function setInformation_link($information_link) {
|
||||
$this->information_link = $information_link;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* URI for detailed information related to this error for the developer.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getInformationLink
|
||||
*/
|
||||
public function getInformation_link() {
|
||||
return $this->information_link;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional details of the error
|
||||
*
|
||||
* @param PayPal\Api\ErrorDetails $details
|
||||
*/
|
||||
public function setDetails($details) {
|
||||
$this->details = $details;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional details of the error
|
||||
*
|
||||
* @return PayPal\Api\ErrorDetails
|
||||
*/
|
||||
public function getDetails() {
|
||||
return $this->details;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
48
lib/PayPal/Api/ErrorDetails.php
Normal file
48
lib/PayPal/Api/ErrorDetails.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class ErrorDetails extends PPModel {
|
||||
/**
|
||||
* Name of the field that caused the error.
|
||||
*
|
||||
* @param string $field
|
||||
*/
|
||||
public function setField($field) {
|
||||
$this->field = $field;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the field that caused the error.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getField() {
|
||||
return $this->field;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reason for the error.
|
||||
*
|
||||
* @param string $issue
|
||||
*/
|
||||
public function setIssue($issue) {
|
||||
$this->issue = $issue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason for the error.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIssue() {
|
||||
return $this->issue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,77 +1,119 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class FundingInstrument extends PPModel {
|
||||
/**
|
||||
* Credit Card information.
|
||||
* @param PayPal\Api\CreditCard $credit_card
|
||||
*/
|
||||
public function setCreditCard($credit_card) {
|
||||
$this->credit_card = $credit_card;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class FundingInstrument
|
||||
*
|
||||
* @property \PayPal\Api\CreditCard credit_card
|
||||
* @property \PayPal\Api\CreditCardToken credit_card_token
|
||||
*/
|
||||
class FundingInstrument extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Credit Card
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $credit_card
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreditCard($credit_card)
|
||||
{
|
||||
$this->credit_card = $credit_card;
|
||||
|
||||
/**
|
||||
* Credit Card information.
|
||||
* @return PayPal\Api\CreditCard
|
||||
*/
|
||||
public function getCreditCard() {
|
||||
return $this->credit_card;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit Card information.
|
||||
* @param PayPal\Api\CreditCard $credit_card
|
||||
* @deprecated. Instead use setCreditCard
|
||||
*/
|
||||
public function setCredit_card($credit_card) {
|
||||
$this->credit_card = $credit_card;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Credit Card information.
|
||||
* @return PayPal\Api\CreditCard
|
||||
* @deprecated. Instead use getCreditCard
|
||||
*/
|
||||
public function getCredit_card() {
|
||||
return $this->credit_card;
|
||||
}
|
||||
/**
|
||||
* Get Credit Card
|
||||
*
|
||||
* @return \PayPal\Api\CreditCard
|
||||
*/
|
||||
public function getCreditCard()
|
||||
{
|
||||
return $this->credit_card;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit Card information.
|
||||
* @param PayPal\Api\CreditCardToken $credit_card_token
|
||||
*/
|
||||
public function setCreditCardToken($credit_card_token) {
|
||||
$this->credit_card_token = $credit_card_token;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Credit Card
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $credit_card
|
||||
*
|
||||
* @deprecated Use setCreditCard
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCredit_card($credit_card)
|
||||
{
|
||||
$this->credit_card = $credit_card;
|
||||
|
||||
/**
|
||||
* Credit Card information.
|
||||
* @return PayPal\Api\CreditCardToken
|
||||
*/
|
||||
public function getCreditCardToken() {
|
||||
return $this->credit_card_token;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit Card information.
|
||||
* @param PayPal\Api\CreditCardToken $credit_card_token
|
||||
* @deprecated. Instead use setCreditCardToken
|
||||
*/
|
||||
public function setCredit_card_token($credit_card_token) {
|
||||
$this->credit_card_token = $credit_card_token;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Credit Card information.
|
||||
* @return PayPal\Api\CreditCardToken
|
||||
* @deprecated. Instead use getCreditCardToken
|
||||
*/
|
||||
public function getCredit_card_token() {
|
||||
return $this->credit_card_token;
|
||||
}
|
||||
/**
|
||||
* Get Credit Card
|
||||
*
|
||||
* @deprecated Use getCreditCard
|
||||
*
|
||||
* @return \PayPal\Api\CreditCard
|
||||
*/
|
||||
public function getCredit_card()
|
||||
{
|
||||
return $this->credit_card;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Credit Card Token
|
||||
*
|
||||
* @param \PayPal\Api\CreditCardToken $credit_card_token
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreditCardToken($credit_card_token)
|
||||
{
|
||||
$this->credit_card_token = $credit_card_token;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Credit Card Token
|
||||
*
|
||||
* @return \PayPal\Api\CreditCardToken
|
||||
*/
|
||||
public function getCreditCardToken()
|
||||
{
|
||||
return $this->credit_card_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Credit Card Token
|
||||
*
|
||||
* @param \PayPal\Api\CreditCardToken $credit_card_token
|
||||
*
|
||||
* @deprecated Use setCreditCardToken
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCredit_card_token($credit_card_token)
|
||||
{
|
||||
$this->credit_card_token = $credit_card_token;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Credit Card Token
|
||||
*
|
||||
* @deprecated Use getCreditCardToken
|
||||
*
|
||||
* @return \PayPal\Api\CreditCardToken
|
||||
*/
|
||||
public function getCredit_card_token()
|
||||
{
|
||||
return $this->credit_card_token;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,116 +1,163 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class HyperSchema extends PPModel {
|
||||
/**
|
||||
*
|
||||
* @array
|
||||
* @param PayPal\Api\Links $links
|
||||
*/
|
||||
public function setLinks($links) {
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class HyperSchema
|
||||
*
|
||||
* @property \PayPal\Api\Links links
|
||||
* @property string fragmentResolution
|
||||
* @property bool readonly
|
||||
* @property string contentEncoding
|
||||
* @property string pathStart
|
||||
* @property string mediaType
|
||||
*/
|
||||
class HyperSchema extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Links
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks() {
|
||||
return $this->links;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $fragmentResolution
|
||||
*/
|
||||
public function setFragmentResolution($fragmentResolution) {
|
||||
$this->fragmentResolution = $fragmentResolution;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Fragment Resolution
|
||||
*
|
||||
* @param string $fragmentResolution
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFragmentResolution($fragmentResolution)
|
||||
{
|
||||
$this->fragmentResolution = $fragmentResolution;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFragmentResolution() {
|
||||
return $this->fragmentResolution;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Fragment Resolution
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFragmentResolution()
|
||||
{
|
||||
return $this->fragmentResolution;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param boolean $readonly
|
||||
*/
|
||||
public function setReadonly($readonly) {
|
||||
$this->readonly = $readonly;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Read Only
|
||||
*
|
||||
* @param bool $readonly
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReadonly($readonly)
|
||||
{
|
||||
$this->readonly = $readonly;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getReadonly() {
|
||||
return $this->readonly;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Read Only
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getReadonly()
|
||||
{
|
||||
return $this->readonly;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $contentEncoding
|
||||
*/
|
||||
public function setContentEncoding($contentEncoding) {
|
||||
$this->contentEncoding = $contentEncoding;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Content Encoding
|
||||
*
|
||||
* @param string $contentEncoding
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setContentEncoding($contentEncoding)
|
||||
{
|
||||
$this->contentEncoding = $contentEncoding;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getContentEncoding() {
|
||||
return $this->contentEncoding;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Content Encoding
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getContentEncoding()
|
||||
{
|
||||
return $this->contentEncoding;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $pathStart
|
||||
*/
|
||||
public function setPathStart($pathStart) {
|
||||
$this->pathStart = $pathStart;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Path Start
|
||||
*
|
||||
* @param string $pathStart
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPathStart($pathStart)
|
||||
{
|
||||
$this->pathStart = $pathStart;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPathStart() {
|
||||
return $this->pathStart;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Path Start
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPathStart()
|
||||
{
|
||||
return $this->pathStart;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $mediaType
|
||||
*/
|
||||
public function setMediaType($mediaType) {
|
||||
$this->mediaType = $mediaType;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMediaType() {
|
||||
return $this->mediaType;
|
||||
}
|
||||
/**
|
||||
* Set Media Type
|
||||
*
|
||||
* @param string $mediaType
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMediaType($mediaType)
|
||||
{
|
||||
$this->mediaType = $mediaType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Media Type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMediaType()
|
||||
{
|
||||
return $this->mediaType;
|
||||
}
|
||||
}
|
||||
|
||||
984
lib/PayPal/Api/Invoice.php
Normal file
984
lib/PayPal/Api/Invoice.php
Normal file
@@ -0,0 +1,984 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Api\Invoices;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
|
||||
class Invoice extends PPModel implements IResource {
|
||||
|
||||
private static $credential;
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated. Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
public static function setCredential($credential) {
|
||||
self::$credential = $credential;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unique invoice resource identifier.
|
||||
*
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unique invoice resource identifier.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max.
|
||||
*
|
||||
* @param string $number
|
||||
*/
|
||||
public function setNumber($number) {
|
||||
$this->number = $number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNumber() {
|
||||
return $this->number;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* URI of the invoice resource.
|
||||
*
|
||||
* @param string $uri
|
||||
*/
|
||||
public function setUri($uri) {
|
||||
$this->uri = $uri;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI of the invoice resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUri() {
|
||||
return $this->uri;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Status of the invoice.
|
||||
*
|
||||
* @param string $status
|
||||
*/
|
||||
public function setStatus($status) {
|
||||
$this->status = $status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status of the invoice.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStatus() {
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Information about the merchant who is sending the invoice.
|
||||
*
|
||||
* @param PayPal\Api\MerchantInfo $merchant_info
|
||||
*/
|
||||
public function setMerchantInfo($merchant_info) {
|
||||
$this->merchant_info = $merchant_info;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information about the merchant who is sending the invoice.
|
||||
*
|
||||
* @return PayPal\Api\MerchantInfo
|
||||
*/
|
||||
public function getMerchantInfo() {
|
||||
return $this->merchant_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information about the merchant who is sending the invoice.
|
||||
*
|
||||
* @param PayPal\Api\MerchantInfo $merchant_info
|
||||
* @deprecated. Instead use setMerchantInfo
|
||||
*/
|
||||
public function setMerchant_info($merchant_info) {
|
||||
$this->merchant_info = $merchant_info;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Information about the merchant who is sending the invoice.
|
||||
*
|
||||
* @return PayPal\Api\MerchantInfo
|
||||
* @deprecated. Instead use getMerchantInfo
|
||||
*/
|
||||
public function getMerchant_info() {
|
||||
return $this->merchant_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient).
|
||||
*
|
||||
* @param PayPal\Api\BillingInfo $billing_info
|
||||
*/
|
||||
public function setBillingInfo($billing_info) {
|
||||
$this->billing_info = $billing_info;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient).
|
||||
*
|
||||
* @return PayPal\Api\BillingInfo
|
||||
*/
|
||||
public function getBillingInfo() {
|
||||
return $this->billing_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient).
|
||||
*
|
||||
* @param PayPal\Api\BillingInfo $billing_info
|
||||
* @deprecated. Instead use setBillingInfo
|
||||
*/
|
||||
public function setBilling_info($billing_info) {
|
||||
$this->billing_info = $billing_info;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient).
|
||||
*
|
||||
* @return PayPal\Api\BillingInfo
|
||||
* @deprecated. Instead use getBillingInfo
|
||||
*/
|
||||
public function getBilling_info() {
|
||||
return $this->billing_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping information for entities to whom items are being shipped.
|
||||
*
|
||||
* @param PayPal\Api\ShippingInfo $shipping_info
|
||||
*/
|
||||
public function setShippingInfo($shipping_info) {
|
||||
$this->shipping_info = $shipping_info;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping information for entities to whom items are being shipped.
|
||||
*
|
||||
* @return PayPal\Api\ShippingInfo
|
||||
*/
|
||||
public function getShippingInfo() {
|
||||
return $this->shipping_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping information for entities to whom items are being shipped.
|
||||
*
|
||||
* @param PayPal\Api\ShippingInfo $shipping_info
|
||||
* @deprecated. Instead use setShippingInfo
|
||||
*/
|
||||
public function setShipping_info($shipping_info) {
|
||||
$this->shipping_info = $shipping_info;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Shipping information for entities to whom items are being shipped.
|
||||
*
|
||||
* @return PayPal\Api\ShippingInfo
|
||||
* @deprecated. Instead use getShippingInfo
|
||||
*/
|
||||
public function getShipping_info() {
|
||||
return $this->shipping_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of items included in the invoice. 100 items max per invoice.
|
||||
*
|
||||
* @param PayPal\Api\InvoiceItem $items
|
||||
*/
|
||||
public function setItems($items) {
|
||||
$this->items = $items;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of items included in the invoice. 100 items max per invoice.
|
||||
*
|
||||
* @return PayPal\Api\InvoiceItem
|
||||
*/
|
||||
public function getItems() {
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST
|
||||
*
|
||||
* @param string $invoice_date
|
||||
*/
|
||||
public function setInvoiceDate($invoice_date) {
|
||||
$this->invoice_date = $invoice_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInvoiceDate() {
|
||||
return $this->invoice_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST
|
||||
*
|
||||
* @param string $invoice_date
|
||||
* @deprecated. Instead use setInvoiceDate
|
||||
*/
|
||||
public function setInvoice_date($invoice_date) {
|
||||
$this->invoice_date = $invoice_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getInvoiceDate
|
||||
*/
|
||||
public function getInvoice_date() {
|
||||
return $this->invoice_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both.
|
||||
*
|
||||
* @param PayPal\Api\PaymentTerm $payment_term
|
||||
*/
|
||||
public function setPaymentTerm($payment_term) {
|
||||
$this->payment_term = $payment_term;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both.
|
||||
*
|
||||
* @return PayPal\Api\PaymentTerm
|
||||
*/
|
||||
public function getPaymentTerm() {
|
||||
return $this->payment_term;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both.
|
||||
*
|
||||
* @param PayPal\Api\PaymentTerm $payment_term
|
||||
* @deprecated. Instead use setPaymentTerm
|
||||
*/
|
||||
public function setPayment_term($payment_term) {
|
||||
$this->payment_term = $payment_term;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both.
|
||||
*
|
||||
* @return PayPal\Api\PaymentTerm
|
||||
* @deprecated. Instead use getPaymentTerm
|
||||
*/
|
||||
public function getPayment_term() {
|
||||
return $this->payment_term;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoice level discount in percent or amount.
|
||||
*
|
||||
* @param PayPal\Api\Cost $discount
|
||||
*/
|
||||
public function setDiscount($discount) {
|
||||
$this->discount = $discount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoice level discount in percent or amount.
|
||||
*
|
||||
* @return PayPal\Api\Cost
|
||||
*/
|
||||
public function getDiscount() {
|
||||
return $this->discount;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shipping cost in percent or amount.
|
||||
*
|
||||
* @param PayPal\Api\ShippingCost $shipping_cost
|
||||
*/
|
||||
public function setShippingCost($shipping_cost) {
|
||||
$this->shipping_cost = $shipping_cost;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping cost in percent or amount.
|
||||
*
|
||||
* @return PayPal\Api\ShippingCost
|
||||
*/
|
||||
public function getShippingCost() {
|
||||
return $this->shipping_cost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping cost in percent or amount.
|
||||
*
|
||||
* @param PayPal\Api\ShippingCost $shipping_cost
|
||||
* @deprecated. Instead use setShippingCost
|
||||
*/
|
||||
public function setShipping_cost($shipping_cost) {
|
||||
$this->shipping_cost = $shipping_cost;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Shipping cost in percent or amount.
|
||||
*
|
||||
* @return PayPal\Api\ShippingCost
|
||||
* @deprecated. Instead use getShippingCost
|
||||
*/
|
||||
public function getShipping_cost() {
|
||||
return $this->shipping_cost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom amount applied on an invoice. If a label is included then the amount cannot be empty.
|
||||
*
|
||||
* @param PayPal\Api\CustomAmount $custom
|
||||
*/
|
||||
public function setCustom($custom) {
|
||||
$this->custom = $custom;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom amount applied on an invoice. If a label is included then the amount cannot be empty.
|
||||
*
|
||||
* @return PayPal\Api\CustomAmount
|
||||
*/
|
||||
public function getCustom() {
|
||||
return $this->custom;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount.
|
||||
*
|
||||
* @param boolean $tax_calculated_after_discount
|
||||
*/
|
||||
public function setTaxCalculatedAfterDiscount($tax_calculated_after_discount) {
|
||||
$this->tax_calculated_after_discount = $tax_calculated_after_discount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getTaxCalculatedAfterDiscount() {
|
||||
return $this->tax_calculated_after_discount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount.
|
||||
*
|
||||
* @param boolean $tax_calculated_after_discount
|
||||
* @deprecated. Instead use setTaxCalculatedAfterDiscount
|
||||
*/
|
||||
public function setTax_calculated_after_discount($tax_calculated_after_discount) {
|
||||
$this->tax_calculated_after_discount = $tax_calculated_after_discount;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount.
|
||||
*
|
||||
* @return boolean
|
||||
* @deprecated. Instead use getTaxCalculatedAfterDiscount
|
||||
*/
|
||||
public function getTax_calculated_after_discount() {
|
||||
return $this->tax_calculated_after_discount;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether the unit price includes tax. Default is false
|
||||
*
|
||||
* @param boolean $tax_inclusive
|
||||
*/
|
||||
public function setTaxInclusive($tax_inclusive) {
|
||||
$this->tax_inclusive = $tax_inclusive;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether the unit price includes tax. Default is false
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getTaxInclusive() {
|
||||
return $this->tax_inclusive;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether the unit price includes tax. Default is false
|
||||
*
|
||||
* @param boolean $tax_inclusive
|
||||
* @deprecated. Instead use setTaxInclusive
|
||||
*/
|
||||
public function setTax_inclusive($tax_inclusive) {
|
||||
$this->tax_inclusive = $tax_inclusive;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* A flag indicating whether the unit price includes tax. Default is false
|
||||
*
|
||||
* @return boolean
|
||||
* @deprecated. Instead use getTaxInclusive
|
||||
*/
|
||||
public function getTax_inclusive() {
|
||||
return $this->tax_inclusive;
|
||||
}
|
||||
|
||||
/**
|
||||
* General terms of the invoice. 4000 characters max.
|
||||
*
|
||||
* @param string $terms
|
||||
*/
|
||||
public function setTerms($terms) {
|
||||
$this->terms = $terms;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* General terms of the invoice. 4000 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTerms() {
|
||||
return $this->terms;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Note to the payer. 4000 characters max.
|
||||
*
|
||||
* @param string $note
|
||||
*/
|
||||
public function setNote($note) {
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the payer. 4000 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote() {
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Bookkeeping memo that is private to the merchant. 150 characters max.
|
||||
*
|
||||
* @param string $merchant_memo
|
||||
*/
|
||||
public function setMerchantMemo($merchant_memo) {
|
||||
$this->merchant_memo = $merchant_memo;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bookkeeping memo that is private to the merchant. 150 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMerchantMemo() {
|
||||
return $this->merchant_memo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bookkeeping memo that is private to the merchant. 150 characters max.
|
||||
*
|
||||
* @param string $merchant_memo
|
||||
* @deprecated. Instead use setMerchantMemo
|
||||
*/
|
||||
public function setMerchant_memo($merchant_memo) {
|
||||
$this->merchant_memo = $merchant_memo;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Bookkeeping memo that is private to the merchant. 150 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getMerchantMemo
|
||||
*/
|
||||
public function getMerchant_memo() {
|
||||
return $this->merchant_memo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Full URL of an external image to use as the logo. 4000 characters max.
|
||||
*
|
||||
* @param string $logo_url
|
||||
*/
|
||||
public function setLogoUrl($logo_url) {
|
||||
$this->logo_url = $logo_url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Full URL of an external image to use as the logo. 4000 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLogoUrl() {
|
||||
return $this->logo_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Full URL of an external image to use as the logo. 4000 characters max.
|
||||
*
|
||||
* @param string $logo_url
|
||||
* @deprecated. Instead use setLogoUrl
|
||||
*/
|
||||
public function setLogo_url($logo_url) {
|
||||
$this->logo_url = $logo_url;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Full URL of an external image to use as the logo. 4000 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getLogoUrl
|
||||
*/
|
||||
public function getLogo_url() {
|
||||
return $this->logo_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* The total amount of the invoice.
|
||||
*
|
||||
* @param PayPal\Api\Currency $total_amount
|
||||
*/
|
||||
public function setTotalAmount($total_amount) {
|
||||
$this->total_amount = $total_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The total amount of the invoice.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
*/
|
||||
public function getTotalAmount() {
|
||||
return $this->total_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* The total amount of the invoice.
|
||||
*
|
||||
* @param PayPal\Api\Currency $total_amount
|
||||
* @deprecated. Instead use setTotalAmount
|
||||
*/
|
||||
public function setTotal_amount($total_amount) {
|
||||
$this->total_amount = $total_amount;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* The total amount of the invoice.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
* @deprecated. Instead use getTotalAmount
|
||||
*/
|
||||
public function getTotal_amount() {
|
||||
return $this->total_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payments
|
||||
* A list of Payment resources
|
||||
*
|
||||
* @param \PayPal\Api\Payment $payments
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayments($payments)
|
||||
{
|
||||
$this->payments = $payments;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payments
|
||||
* A list of Payment resources
|
||||
*
|
||||
* @return \PayPal\Api\Payment
|
||||
*/
|
||||
public function getPayments()
|
||||
{
|
||||
return $this->payments;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of payment details for the invoice.
|
||||
*
|
||||
* @param PayPal\Api\PaymentDetail $payment_details
|
||||
*/
|
||||
public function setPaymentDetails($payment_details) {
|
||||
$this->payment_details = $payment_details;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of payment details for the invoice.
|
||||
*
|
||||
* @return PayPal\Api\PaymentDetail
|
||||
*/
|
||||
public function getPaymentDetails() {
|
||||
return $this->payment_details;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of payment details for the invoice.
|
||||
*
|
||||
* @param PayPal\Api\PaymentDetail $payment_details
|
||||
* @deprecated. Instead use setPaymentDetails
|
||||
*/
|
||||
public function setPayment_details($payment_details) {
|
||||
$this->payment_details = $payment_details;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* List of payment details for the invoice.
|
||||
*
|
||||
* @return PayPal\Api\PaymentDetail
|
||||
* @deprecated. Instead use getPaymentDetails
|
||||
*/
|
||||
public function getPayment_details() {
|
||||
return $this->payment_details;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of refund details for the invoice.
|
||||
*
|
||||
* @param PayPal\Api\RefundDetail $refund_details
|
||||
*/
|
||||
public function setRefundDetails($refund_details) {
|
||||
$this->refund_details = $refund_details;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of refund details for the invoice.
|
||||
*
|
||||
* @return PayPal\Api\RefundDetail
|
||||
*/
|
||||
public function getRefundDetails() {
|
||||
return $this->refund_details;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of refund details for the invoice.
|
||||
*
|
||||
* @param PayPal\Api\RefundDetail $refund_details
|
||||
* @deprecated. Instead use setRefundDetails
|
||||
*/
|
||||
public function setRefund_details($refund_details) {
|
||||
$this->refund_details = $refund_details;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* List of refund details for the invoice.
|
||||
*
|
||||
* @return PayPal\Api\RefundDetail
|
||||
* @deprecated. Instead use getRefundDetails
|
||||
*/
|
||||
public function getRefund_details() {
|
||||
return $this->refund_details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Audit information for the invoice.
|
||||
*
|
||||
* @param PayPal\Api\Metadata $metadata
|
||||
*/
|
||||
public function setMetadata($metadata) {
|
||||
$this->metadata = $metadata;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Audit information for the invoice.
|
||||
*
|
||||
* @return PayPal\Api\Metadata
|
||||
*/
|
||||
public function getMetadata() {
|
||||
return $this->metadata;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Creates a new invoice Resource.
|
||||
*
|
||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return Invoice
|
||||
*/
|
||||
public function create($apiContext = null) {
|
||||
$payLoad = $this->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices", "POST", $payLoad);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/*
|
||||
* Search for invoice resources.
|
||||
*
|
||||
* @param Search $search
|
||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return Invoices
|
||||
*/
|
||||
public function search($search, $apiContext = null) {
|
||||
if (($search == null)) {
|
||||
throw new \InvalidArgumentException("search cannot be null or empty");
|
||||
}
|
||||
$payLoad = $search->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/search", "POST", $payLoad);
|
||||
$ret = new Invoices();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sends a legitimate invoice to the payer.
|
||||
*
|
||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return void
|
||||
*/
|
||||
public function send($apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/send", "POST", $payLoad);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Reminds the payer to pay the invoice.
|
||||
*
|
||||
* @param Notification $notification
|
||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return void
|
||||
*/
|
||||
public function remind($notification, $apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
if (($notification == null)) {
|
||||
throw new \InvalidArgumentException("notification cannot be null or empty");
|
||||
}
|
||||
$payLoad = $notification->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/remind", "POST", $payLoad);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Cancels an invoice.
|
||||
*
|
||||
* @param CancelNotification $cancelNotification
|
||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return void
|
||||
*/
|
||||
public function cancel($cancelNotification, $apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
if (($cancelNotification == null)) {
|
||||
throw new \InvalidArgumentException("cancelNotification cannot be null or empty");
|
||||
}
|
||||
$payLoad = $cancelNotification->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/cancel", "POST", $payLoad);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark the status of the invoice as paid.
|
||||
*
|
||||
* @param PaymentDetail $paymentDetail
|
||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return void
|
||||
*/
|
||||
public function record_payment($paymentDetail, $apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
if (($paymentDetail == null)) {
|
||||
throw new \InvalidArgumentException("paymentDetail cannot be null or empty");
|
||||
}
|
||||
$payLoad = $paymentDetail->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/record-payment", "POST", $payLoad);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark the status of the invoice as refunded.
|
||||
*
|
||||
* @param RefundDetail $refundDetail
|
||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return void
|
||||
*/
|
||||
public function record_refund($refundDetail, $apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
if (($refundDetail == null)) {
|
||||
throw new \InvalidArgumentException("refundDetail cannot be null or empty");
|
||||
}
|
||||
$payLoad = $refundDetail->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/record-refund", "POST", $payLoad);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the invoice resource for the given identifier.
|
||||
*
|
||||
* @param string $invoiceId
|
||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return Invoice
|
||||
*/
|
||||
public static function get($invoiceId, $apiContext = null) {
|
||||
if (($invoiceId == null) || (strlen($invoiceId) <= 0)) {
|
||||
throw new \InvalidArgumentException("invoiceId cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/$invoiceId", "GET", $payLoad);
|
||||
$ret = new Invoice();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get all invoices of a merchant.
|
||||
*
|
||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return Invoices
|
||||
*/
|
||||
public static function get_all($apiContext = null) {
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/", "GET", $payLoad);
|
||||
$ret = new Invoices();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Full update of the invoice resource for the given identifier.
|
||||
*
|
||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return Invoice
|
||||
*/
|
||||
public function update($apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
$payLoad = $this->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}", "PUT", $payLoad);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete invoice resource for the given identifier.
|
||||
*
|
||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return void
|
||||
*/
|
||||
public function delete($apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}", "DELETE", $payLoad);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
167
lib/PayPal/Api/InvoiceItem.php
Normal file
167
lib/PayPal/Api/InvoiceItem.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class InvoiceItem extends PPModel {
|
||||
/**
|
||||
* Name of the item. 60 characters max.
|
||||
*
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the item. 60 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the item. 1000 characters max.
|
||||
*
|
||||
* @param string $description
|
||||
*/
|
||||
public function setDescription($description) {
|
||||
$this->description = $description;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the item. 1000 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription() {
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Quantity of the item. Range of 0 to 9999.999.
|
||||
*
|
||||
* @param PayPal\Api\number $quantity
|
||||
*/
|
||||
public function setQuantity($quantity) {
|
||||
$this->quantity = $quantity;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Quantity of the item. Range of 0 to 9999.999.
|
||||
*
|
||||
* @return PayPal\Api\number
|
||||
*/
|
||||
public function getQuantity() {
|
||||
return $this->quantity;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unit price of the item. Range of -999999.99 to 999999.99.
|
||||
*
|
||||
* @param PayPal\Api\Currency $unit_price
|
||||
*/
|
||||
public function setUnitPrice($unit_price) {
|
||||
$this->unit_price = $unit_price;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unit price of the item. Range of -999999.99 to 999999.99.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
*/
|
||||
public function getUnitPrice() {
|
||||
return $this->unit_price;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unit price of the item. Range of -999999.99 to 999999.99.
|
||||
*
|
||||
* @param PayPal\Api\Currency $unit_price
|
||||
* @deprecated. Instead use setUnitPrice
|
||||
*/
|
||||
public function setUnit_price($unit_price) {
|
||||
$this->unit_price = $unit_price;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Unit price of the item. Range of -999999.99 to 999999.99.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
* @deprecated. Instead use getUnitPrice
|
||||
*/
|
||||
public function getUnit_price() {
|
||||
return $this->unit_price;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tax associated with the item.
|
||||
*
|
||||
* @param PayPal\Api\Tax $tax
|
||||
*/
|
||||
public function setTax($tax) {
|
||||
$this->tax = $tax;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tax associated with the item.
|
||||
*
|
||||
* @return PayPal\Api\Tax
|
||||
*/
|
||||
public function getTax() {
|
||||
return $this->tax;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Date on which the item or service was provided. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST.
|
||||
*
|
||||
* @param string $date
|
||||
*/
|
||||
public function setDate($date) {
|
||||
$this->date = $date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date on which the item or service was provided. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDate() {
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Item discount in percent or amount.
|
||||
*
|
||||
* @param PayPal\Api\Cost $discount
|
||||
*/
|
||||
public function setDiscount($discount) {
|
||||
$this->discount = $discount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Item discount in percent or amount.
|
||||
*
|
||||
* @return PayPal\Api\Cost
|
||||
*/
|
||||
public function getDiscount() {
|
||||
return $this->discount;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
67
lib/PayPal/Api/Invoices.php
Normal file
67
lib/PayPal/Api/Invoices.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Invoices extends PPModel {
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param integer $total_count
|
||||
*/
|
||||
public function setTotalCount($total_count) {
|
||||
$this->total_count = $total_count;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getTotalCount() {
|
||||
return $this->total_count;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param integer $total_count
|
||||
* @deprecated. Instead use setTotalCount
|
||||
*/
|
||||
public function setTotal_count($total_count) {
|
||||
$this->total_count = $total_count;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return integer
|
||||
* @deprecated. Instead use getTotalCount
|
||||
*/
|
||||
public function getTotal_count() {
|
||||
return $this->total_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of invoices belonging to a merchant.
|
||||
*
|
||||
* @param PayPal\Api\Invoice $invoices
|
||||
*/
|
||||
public function setInvoices($invoices) {
|
||||
$this->invoices = $invoices;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of invoices belonging to a merchant.
|
||||
*
|
||||
* @return PayPal\Api\Invoice
|
||||
*/
|
||||
public function getInvoices() {
|
||||
return $this->invoices;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
359
lib/PayPal/Api/InvoicingMetaData.php
Normal file
359
lib/PayPal/Api/InvoicingMetaData.php
Normal file
@@ -0,0 +1,359 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class InvoicingMetaData extends PPModel {
|
||||
/**
|
||||
* Date when the resource was created.
|
||||
*
|
||||
* @param string $created_date
|
||||
*/
|
||||
public function setCreatedDate($created_date) {
|
||||
$this->created_date = $created_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was created.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreatedDate() {
|
||||
return $this->created_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was created.
|
||||
*
|
||||
* @param string $created_date
|
||||
* @deprecated. Instead use setCreatedDate
|
||||
*/
|
||||
public function setCreated_date($created_date) {
|
||||
$this->created_date = $created_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Date when the resource was created.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getCreatedDate
|
||||
*/
|
||||
public function getCreated_date() {
|
||||
return $this->created_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that created the resource.
|
||||
*
|
||||
* @param string $created_by
|
||||
*/
|
||||
public function setCreatedBy($created_by) {
|
||||
$this->created_by = $created_by;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that created the resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreatedBy() {
|
||||
return $this->created_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that created the resource.
|
||||
*
|
||||
* @param string $created_by
|
||||
* @deprecated. Instead use setCreatedBy
|
||||
*/
|
||||
public function setCreated_by($created_by) {
|
||||
$this->created_by = $created_by;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Email address of the account that created the resource.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getCreatedBy
|
||||
*/
|
||||
public function getCreated_by() {
|
||||
return $this->created_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was cancelled.
|
||||
*
|
||||
* @param string $cancelled_date
|
||||
*/
|
||||
public function setCancelledDate($cancelled_date) {
|
||||
$this->cancelled_date = $cancelled_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was cancelled.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCancelledDate() {
|
||||
return $this->cancelled_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was cancelled.
|
||||
*
|
||||
* @param string $cancelled_date
|
||||
* @deprecated. Instead use setCancelledDate
|
||||
*/
|
||||
public function setCancelled_date($cancelled_date) {
|
||||
$this->cancelled_date = $cancelled_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Date when the resource was cancelled.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getCancelledDate
|
||||
*/
|
||||
public function getCancelled_date() {
|
||||
return $this->cancelled_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actor who cancelled the resource.
|
||||
*
|
||||
* @param string $cancelled_by
|
||||
*/
|
||||
public function setCancelledBy($cancelled_by) {
|
||||
$this->cancelled_by = $cancelled_by;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actor who cancelled the resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCancelledBy() {
|
||||
return $this->cancelled_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actor who cancelled the resource.
|
||||
*
|
||||
* @param string $cancelled_by
|
||||
* @deprecated. Instead use setCancelledBy
|
||||
*/
|
||||
public function setCancelled_by($cancelled_by) {
|
||||
$this->cancelled_by = $cancelled_by;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Actor who cancelled the resource.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getCancelledBy
|
||||
*/
|
||||
public function getCancelled_by() {
|
||||
return $this->cancelled_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was last edited.
|
||||
*
|
||||
* @param string $last_updated_date
|
||||
*/
|
||||
public function setLastUpdatedDate($last_updated_date) {
|
||||
$this->last_updated_date = $last_updated_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was last edited.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastUpdatedDate() {
|
||||
return $this->last_updated_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was last edited.
|
||||
*
|
||||
* @param string $last_updated_date
|
||||
* @deprecated. Instead use setLastUpdatedDate
|
||||
*/
|
||||
public function setLast_updated_date($last_updated_date) {
|
||||
$this->last_updated_date = $last_updated_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Date when the resource was last edited.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getLastUpdatedDate
|
||||
*/
|
||||
public function getLast_updated_date() {
|
||||
return $this->last_updated_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that last edited the resource.
|
||||
*
|
||||
* @param string $last_updated_by
|
||||
*/
|
||||
public function setLastUpdatedBy($last_updated_by) {
|
||||
$this->last_updated_by = $last_updated_by;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that last edited the resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastUpdatedBy() {
|
||||
return $this->last_updated_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that last edited the resource.
|
||||
*
|
||||
* @param string $last_updated_by
|
||||
* @deprecated. Instead use setLastUpdatedBy
|
||||
*/
|
||||
public function setLast_updated_by($last_updated_by) {
|
||||
$this->last_updated_by = $last_updated_by;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Email address of the account that last edited the resource.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getLastUpdatedBy
|
||||
*/
|
||||
public function getLast_updated_by() {
|
||||
return $this->last_updated_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was first sent.
|
||||
*
|
||||
* @param string $first_sent_date
|
||||
*/
|
||||
public function setFirstSentDate($first_sent_date) {
|
||||
$this->first_sent_date = $first_sent_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was first sent.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstSentDate() {
|
||||
return $this->first_sent_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was first sent.
|
||||
*
|
||||
* @param string $first_sent_date
|
||||
* @deprecated. Instead use setFirstSentDate
|
||||
*/
|
||||
public function setFirst_sent_date($first_sent_date) {
|
||||
$this->first_sent_date = $first_sent_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Date when the resource was first sent.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getFirstSentDate
|
||||
*/
|
||||
public function getFirst_sent_date() {
|
||||
return $this->first_sent_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was last sent.
|
||||
*
|
||||
* @param string $last_sent_date
|
||||
*/
|
||||
public function setLastSentDate($last_sent_date) {
|
||||
$this->last_sent_date = $last_sent_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was last sent.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastSentDate() {
|
||||
return $this->last_sent_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was last sent.
|
||||
*
|
||||
* @param string $last_sent_date
|
||||
* @deprecated. Instead use setLastSentDate
|
||||
*/
|
||||
public function setLast_sent_date($last_sent_date) {
|
||||
$this->last_sent_date = $last_sent_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Date when the resource was last sent.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getLastSentDate
|
||||
*/
|
||||
public function getLast_sent_date() {
|
||||
return $this->last_sent_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that last sent the resource.
|
||||
*
|
||||
* @param string $last_sent_by
|
||||
*/
|
||||
public function setLastSentBy($last_sent_by) {
|
||||
$this->last_sent_by = $last_sent_by;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that last sent the resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastSentBy() {
|
||||
return $this->last_sent_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that last sent the resource.
|
||||
*
|
||||
* @param string $last_sent_by
|
||||
* @deprecated. Instead use setLastSentBy
|
||||
*/
|
||||
public function setLast_sent_by($last_sent_by) {
|
||||
$this->last_sent_by = $last_sent_by;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Email address of the account that last sent the resource.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getLastSentBy
|
||||
*/
|
||||
public function getLast_sent_by() {
|
||||
return $this->last_sent_by;
|
||||
}
|
||||
|
||||
}
|
||||
87
lib/PayPal/Api/InvoicingNotification.php
Normal file
87
lib/PayPal/Api/InvoicingNotification.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class InvoicingNotification extends PPModel {
|
||||
/**
|
||||
* Subject of the notification.
|
||||
*
|
||||
* @param string $subject
|
||||
*/
|
||||
public function setSubject($subject) {
|
||||
$this->subject = $subject;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subject of the notification.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSubject() {
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Note to the payer.
|
||||
*
|
||||
* @param string $note
|
||||
*/
|
||||
public function setNote($note) {
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote() {
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the merchant.
|
||||
*
|
||||
* @param boolean $send_to_merchant
|
||||
*/
|
||||
public function setSendToMerchant($send_to_merchant) {
|
||||
$this->send_to_merchant = $send_to_merchant;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the merchant.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getSendToMerchant() {
|
||||
return $this->send_to_merchant;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the merchant.
|
||||
*
|
||||
* @param boolean $send_to_merchant
|
||||
* @deprecated. Instead use setSendToMerchant
|
||||
*/
|
||||
public function setSend_to_merchant($send_to_merchant) {
|
||||
$this->send_to_merchant = $send_to_merchant;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the merchant.
|
||||
*
|
||||
* @return boolean
|
||||
* @deprecated. Instead use getSendToMerchant
|
||||
*/
|
||||
public function getSend_to_merchant() {
|
||||
return $this->send_to_merchant;
|
||||
}
|
||||
|
||||
}
|
||||
166
lib/PayPal/Api/InvoicingPaymentDetail.php
Normal file
166
lib/PayPal/Api/InvoicingPaymentDetail.php
Normal file
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class InvoicingPaymentDetail extends PPModel {
|
||||
/**
|
||||
* PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility.
|
||||
*
|
||||
* @param string $type
|
||||
*/
|
||||
public function setType($type) {
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType() {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PayPal payment transaction id. Mandatory field in case the type value is PAYPAL.
|
||||
*
|
||||
* @param string $transaction_id
|
||||
*/
|
||||
public function setTransactionId($transaction_id) {
|
||||
$this->transaction_id = $transaction_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal payment transaction id. Mandatory field in case the type value is PAYPAL.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTransactionId() {
|
||||
return $this->transaction_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal payment transaction id. Mandatory field in case the type value is PAYPAL.
|
||||
*
|
||||
* @param string $transaction_id
|
||||
* @deprecated. Instead use setTransactionId
|
||||
*/
|
||||
public function setTransaction_id($transaction_id) {
|
||||
$this->transaction_id = $transaction_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* PayPal payment transaction id. Mandatory field in case the type value is PAYPAL.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getTransactionId
|
||||
*/
|
||||
public function getTransaction_id() {
|
||||
return $this->transaction_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the transaction.
|
||||
*
|
||||
* @param string $transaction_type
|
||||
*/
|
||||
public function setTransactionType($transaction_type) {
|
||||
$this->transaction_type = $transaction_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTransactionType() {
|
||||
return $this->transaction_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the transaction.
|
||||
*
|
||||
* @param string $transaction_type
|
||||
* @deprecated. Instead use setTransactionType
|
||||
*/
|
||||
public function setTransaction_type($transaction_type) {
|
||||
$this->transaction_type = $transaction_type;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Type of the transaction.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getTransactionType
|
||||
*/
|
||||
public function getTransaction_type() {
|
||||
return $this->transaction_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST.
|
||||
*
|
||||
* @param string $date
|
||||
*/
|
||||
public function setDate($date) {
|
||||
$this->date = $date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDate() {
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Payment mode or method. This field is mandatory if the value of the type field is OTHER.
|
||||
*
|
||||
* @param string $method
|
||||
*/
|
||||
public function setMethod($method) {
|
||||
$this->method = $method;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment mode or method. This field is mandatory if the value of the type field is OTHER.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMethod() {
|
||||
return $this->method;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Optional note associated with the payment.
|
||||
*
|
||||
* @param string $note
|
||||
*/
|
||||
public function setNote($note) {
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional note associated with the payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote() {
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
68
lib/PayPal/Api/InvoicingRefundDetail.php
Normal file
68
lib/PayPal/Api/InvoicingRefundDetail.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class InvoicingRefundDetail extends PPModel {
|
||||
/**
|
||||
* PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility.
|
||||
*
|
||||
* @param string $type
|
||||
*/
|
||||
public function setType($type) {
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType() {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date.
|
||||
*
|
||||
* @param string $date
|
||||
*/
|
||||
public function setDate($date) {
|
||||
$this->date = $date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDate() {
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Optional note associated with the refund.
|
||||
*
|
||||
* @param string $note
|
||||
*/
|
||||
public function setNote($note) {
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional note associated with the refund.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote() {
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
673
lib/PayPal/Api/InvoicingSearch.php
Normal file
673
lib/PayPal/Api/InvoicingSearch.php
Normal file
@@ -0,0 +1,673 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class InvoicingSearch extends PPModel {
|
||||
/**
|
||||
* Initial letters of the email address.
|
||||
*
|
||||
* @param string $email
|
||||
*/
|
||||
public function setEmail($email) {
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the email address.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail() {
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's first name.
|
||||
*
|
||||
* @param string $recipient_first_name
|
||||
*/
|
||||
public function setRecipientFirstName($recipient_first_name) {
|
||||
$this->recipient_first_name = $recipient_first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's first name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRecipientFirstName() {
|
||||
return $this->recipient_first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's first name.
|
||||
*
|
||||
* @param string $recipient_first_name
|
||||
* @deprecated. Instead use setRecipientFirstName
|
||||
*/
|
||||
public function setRecipient_first_name($recipient_first_name) {
|
||||
$this->recipient_first_name = $recipient_first_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Initial letters of the recipient's first name.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getRecipientFirstName
|
||||
*/
|
||||
public function getRecipient_first_name() {
|
||||
return $this->recipient_first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's last name.
|
||||
*
|
||||
* @param string $recipient_last_name
|
||||
*/
|
||||
public function setRecipientLastName($recipient_last_name) {
|
||||
$this->recipient_last_name = $recipient_last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's last name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRecipientLastName() {
|
||||
return $this->recipient_last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's last name.
|
||||
*
|
||||
* @param string $recipient_last_name
|
||||
* @deprecated. Instead use setRecipientLastName
|
||||
*/
|
||||
public function setRecipient_last_name($recipient_last_name) {
|
||||
$this->recipient_last_name = $recipient_last_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Initial letters of the recipient's last name.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getRecipientLastName
|
||||
*/
|
||||
public function getRecipient_last_name() {
|
||||
return $this->recipient_last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's business name.
|
||||
*
|
||||
* @param string $recipient_business_name
|
||||
*/
|
||||
public function setRecipientBusinessName($recipient_business_name) {
|
||||
$this->recipient_business_name = $recipient_business_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's business name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRecipientBusinessName() {
|
||||
return $this->recipient_business_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's business name.
|
||||
*
|
||||
* @param string $recipient_business_name
|
||||
* @deprecated. Instead use setRecipientBusinessName
|
||||
*/
|
||||
public function setRecipient_business_name($recipient_business_name) {
|
||||
$this->recipient_business_name = $recipient_business_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Initial letters of the recipient's business name.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getRecipientBusinessName
|
||||
*/
|
||||
public function getRecipient_business_name() {
|
||||
return $this->recipient_business_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice number that appears on the invoice.
|
||||
*
|
||||
* @param string $number
|
||||
*/
|
||||
public function setNumber($number) {
|
||||
$this->number = $number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice number that appears on the invoice.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNumber() {
|
||||
return $this->number;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Status of the invoice.
|
||||
*
|
||||
* @param string $status
|
||||
*/
|
||||
public function setStatus($status) {
|
||||
$this->status = $status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status of the invoice.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStatus() {
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lower limit of total amount.
|
||||
*
|
||||
* @param PayPal\Api\Currency $lower_total_amount
|
||||
*/
|
||||
public function setLowerTotalAmount($lower_total_amount) {
|
||||
$this->lower_total_amount = $lower_total_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lower limit of total amount.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
*/
|
||||
public function getLowerTotalAmount() {
|
||||
return $this->lower_total_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lower limit of total amount.
|
||||
*
|
||||
* @param PayPal\Api\Currency $lower_total_amount
|
||||
* @deprecated. Instead use setLowerTotalAmount
|
||||
*/
|
||||
public function setLower_total_amount($lower_total_amount) {
|
||||
$this->lower_total_amount = $lower_total_amount;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Lower limit of total amount.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
* @deprecated. Instead use getLowerTotalAmount
|
||||
*/
|
||||
public function getLower_total_amount() {
|
||||
return $this->lower_total_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upper limit of total amount.
|
||||
*
|
||||
* @param PayPal\Api\Currency $upper_total_amount
|
||||
*/
|
||||
public function setUpperTotalAmount($upper_total_amount) {
|
||||
$this->upper_total_amount = $upper_total_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upper limit of total amount.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
*/
|
||||
public function getUpperTotalAmount() {
|
||||
return $this->upper_total_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upper limit of total amount.
|
||||
*
|
||||
* @param PayPal\Api\Currency $upper_total_amount
|
||||
* @deprecated. Instead use setUpperTotalAmount
|
||||
*/
|
||||
public function setUpper_total_amount($upper_total_amount) {
|
||||
$this->upper_total_amount = $upper_total_amount;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Upper limit of total amount.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
* @deprecated. Instead use getUpperTotalAmount
|
||||
*/
|
||||
public function getUpper_total_amount() {
|
||||
return $this->upper_total_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice date.
|
||||
*
|
||||
* @param string $start_invoice_date
|
||||
*/
|
||||
public function setStartInvoiceDate($start_invoice_date) {
|
||||
$this->start_invoice_date = $start_invoice_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStartInvoiceDate() {
|
||||
return $this->start_invoice_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice date.
|
||||
*
|
||||
* @param string $start_invoice_date
|
||||
* @deprecated. Instead use setStartInvoiceDate
|
||||
*/
|
||||
public function setStart_invoice_date($start_invoice_date) {
|
||||
$this->start_invoice_date = $start_invoice_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Start invoice date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getStartInvoiceDate
|
||||
*/
|
||||
public function getStart_invoice_date() {
|
||||
return $this->start_invoice_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice date.
|
||||
*
|
||||
* @param string $end_invoice_date
|
||||
*/
|
||||
public function setEndInvoiceDate($end_invoice_date) {
|
||||
$this->end_invoice_date = $end_invoice_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEndInvoiceDate() {
|
||||
return $this->end_invoice_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice date.
|
||||
*
|
||||
* @param string $end_invoice_date
|
||||
* @deprecated. Instead use setEndInvoiceDate
|
||||
*/
|
||||
public function setEnd_invoice_date($end_invoice_date) {
|
||||
$this->end_invoice_date = $end_invoice_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* End invoice date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getEndInvoiceDate
|
||||
*/
|
||||
public function getEnd_invoice_date() {
|
||||
return $this->end_invoice_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice due date.
|
||||
*
|
||||
* @param string $start_due_date
|
||||
*/
|
||||
public function setStartDueDate($start_due_date) {
|
||||
$this->start_due_date = $start_due_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice due date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStartDueDate() {
|
||||
return $this->start_due_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice due date.
|
||||
*
|
||||
* @param string $start_due_date
|
||||
* @deprecated. Instead use setStartDueDate
|
||||
*/
|
||||
public function setStart_due_date($start_due_date) {
|
||||
$this->start_due_date = $start_due_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Start invoice due date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getStartDueDate
|
||||
*/
|
||||
public function getStart_due_date() {
|
||||
return $this->start_due_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice due date.
|
||||
*
|
||||
* @param string $end_due_date
|
||||
*/
|
||||
public function setEndDueDate($end_due_date) {
|
||||
$this->end_due_date = $end_due_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice due date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEndDueDate() {
|
||||
return $this->end_due_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice due date.
|
||||
*
|
||||
* @param string $end_due_date
|
||||
* @deprecated. Instead use setEndDueDate
|
||||
*/
|
||||
public function setEnd_due_date($end_due_date) {
|
||||
$this->end_due_date = $end_due_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* End invoice due date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getEndDueDate
|
||||
*/
|
||||
public function getEnd_due_date() {
|
||||
return $this->end_due_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice payment date.
|
||||
*
|
||||
* @param string $start_payment_date
|
||||
*/
|
||||
public function setStartPaymentDate($start_payment_date) {
|
||||
$this->start_payment_date = $start_payment_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice payment date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStartPaymentDate() {
|
||||
return $this->start_payment_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice payment date.
|
||||
*
|
||||
* @param string $start_payment_date
|
||||
* @deprecated. Instead use setStartPaymentDate
|
||||
*/
|
||||
public function setStart_payment_date($start_payment_date) {
|
||||
$this->start_payment_date = $start_payment_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Start invoice payment date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getStartPaymentDate
|
||||
*/
|
||||
public function getStart_payment_date() {
|
||||
return $this->start_payment_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice payment date.
|
||||
*
|
||||
* @param string $end_payment_date
|
||||
*/
|
||||
public function setEndPaymentDate($end_payment_date) {
|
||||
$this->end_payment_date = $end_payment_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice payment date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEndPaymentDate() {
|
||||
return $this->end_payment_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice payment date.
|
||||
*
|
||||
* @param string $end_payment_date
|
||||
* @deprecated. Instead use setEndPaymentDate
|
||||
*/
|
||||
public function setEnd_payment_date($end_payment_date) {
|
||||
$this->end_payment_date = $end_payment_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* End invoice payment date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getEndPaymentDate
|
||||
*/
|
||||
public function getEnd_payment_date() {
|
||||
return $this->end_payment_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice creation date.
|
||||
*
|
||||
* @param string $start_creation_date
|
||||
*/
|
||||
public function setStartCreationDate($start_creation_date) {
|
||||
$this->start_creation_date = $start_creation_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice creation date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStartCreationDate() {
|
||||
return $this->start_creation_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice creation date.
|
||||
*
|
||||
* @param string $start_creation_date
|
||||
* @deprecated. Instead use setStartCreationDate
|
||||
*/
|
||||
public function setStart_creation_date($start_creation_date) {
|
||||
$this->start_creation_date = $start_creation_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Start invoice creation date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getStartCreationDate
|
||||
*/
|
||||
public function getStart_creation_date() {
|
||||
return $this->start_creation_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice creation date.
|
||||
*
|
||||
* @param string $end_creation_date
|
||||
*/
|
||||
public function setEndCreationDate($end_creation_date) {
|
||||
$this->end_creation_date = $end_creation_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice creation date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEndCreationDate() {
|
||||
return $this->end_creation_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice creation date.
|
||||
*
|
||||
* @param string $end_creation_date
|
||||
* @deprecated. Instead use setEndCreationDate
|
||||
*/
|
||||
public function setEnd_creation_date($end_creation_date) {
|
||||
$this->end_creation_date = $end_creation_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* End invoice creation date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getEndCreationDate
|
||||
*/
|
||||
public function getEnd_creation_date() {
|
||||
return $this->end_creation_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset of the search results.
|
||||
*
|
||||
* @param PayPal\Api\number $page
|
||||
*/
|
||||
public function setPage($page) {
|
||||
$this->page = $page;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset of the search results.
|
||||
*
|
||||
* @return PayPal\Api\number
|
||||
*/
|
||||
public function getPage() {
|
||||
return $this->page;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Page size of the search results.
|
||||
*
|
||||
* @param PayPal\Api\number $page_size
|
||||
*/
|
||||
public function setPageSize($page_size) {
|
||||
$this->page_size = $page_size;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Page size of the search results.
|
||||
*
|
||||
* @return PayPal\Api\number
|
||||
*/
|
||||
public function getPageSize() {
|
||||
return $this->page_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Page size of the search results.
|
||||
*
|
||||
* @param PayPal\Api\number $page_size
|
||||
* @deprecated. Instead use setPageSize
|
||||
*/
|
||||
public function setPage_size($page_size) {
|
||||
$this->page_size = $page_size;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Page size of the search results.
|
||||
*
|
||||
* @return PayPal\Api\number
|
||||
* @deprecated. Instead use getPageSize
|
||||
*/
|
||||
public function getPage_size() {
|
||||
return $this->page_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether total count is required in the response.
|
||||
*
|
||||
* @param boolean $total_count_required
|
||||
*/
|
||||
public function setTotalCountRequired($total_count_required) {
|
||||
$this->total_count_required = $total_count_required;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether total count is required in the response.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getTotalCountRequired() {
|
||||
return $this->total_count_required;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether total count is required in the response.
|
||||
*
|
||||
* @param boolean $total_count_required
|
||||
* @deprecated. Instead use setTotalCountRequired
|
||||
*/
|
||||
public function setTotal_count_required($total_count_required) {
|
||||
$this->total_count_required = $total_count_required;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* A flag indicating whether total count is required in the response.
|
||||
*
|
||||
* @return boolean
|
||||
* @deprecated. Instead use getTotalCountRequired
|
||||
*/
|
||||
public function getTotal_count_required() {
|
||||
return $this->total_count_required;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,97 +1,148 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Item extends PPModel {
|
||||
/**
|
||||
* Number of items.
|
||||
* @param string $quantity
|
||||
*/
|
||||
public function setQuantity($quantity) {
|
||||
$this->quantity = $quantity;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class Item
|
||||
*
|
||||
* @property string quantity
|
||||
* @property string name
|
||||
* @property string price
|
||||
* @property string currency
|
||||
* @property string sku
|
||||
*/
|
||||
class Item extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Quantity
|
||||
* Number of items
|
||||
*
|
||||
* @param string $quantity
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setQuantity($quantity)
|
||||
{
|
||||
$this->quantity = $quantity;
|
||||
|
||||
/**
|
||||
* Number of items.
|
||||
* @return string
|
||||
*/
|
||||
public function getQuantity() {
|
||||
return $this->quantity;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Quantity
|
||||
* Number of items
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getQuantity()
|
||||
{
|
||||
return $this->quantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the item.
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Name
|
||||
* Name of the item
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
/**
|
||||
* Name of the item.
|
||||
* @return string
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Name
|
||||
* Name of the item
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cost of the item.
|
||||
* @param string $price
|
||||
*/
|
||||
public function setPrice($price) {
|
||||
$this->price = $price;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Price
|
||||
* Cost of the item
|
||||
*
|
||||
* @param string $price
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPrice($price)
|
||||
{
|
||||
$this->price = $price;
|
||||
|
||||
/**
|
||||
* Cost of the item.
|
||||
* @return string
|
||||
*/
|
||||
public function getPrice() {
|
||||
return $this->price;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Price
|
||||
* Cost of the item
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3-letter Currency Code
|
||||
* @param string $currency
|
||||
*/
|
||||
public function setCurrency($currency) {
|
||||
$this->currency = $currency;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Currency
|
||||
* Three Letter Currency Code
|
||||
*
|
||||
* @param string $currency
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCurrency($currency)
|
||||
{
|
||||
$this->currency = $currency;
|
||||
|
||||
/**
|
||||
* 3-letter Currency Code
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency() {
|
||||
return $this->currency;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Currency
|
||||
* Three Letter Currency Code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency()
|
||||
{
|
||||
return $this->currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number or code to identify the item in your catalog/records.
|
||||
* @param string $sku
|
||||
*/
|
||||
public function setSku($sku) {
|
||||
$this->sku = $sku;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number or code to identify the item in your catalog/records.
|
||||
* @return string
|
||||
*/
|
||||
public function getSku() {
|
||||
return $this->sku;
|
||||
}
|
||||
/**
|
||||
* Set SKU
|
||||
* Number or code to identify the item in your catalog/records
|
||||
*
|
||||
* @param string $sku
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSku($sku)
|
||||
{
|
||||
$this->sku = $sku;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SKI
|
||||
* Number or code to identify the item in your catalog/records
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSku()
|
||||
{
|
||||
return $this->sku;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,61 +1,128 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class ItemList extends PPModel {
|
||||
/**
|
||||
* List of items.
|
||||
* @array
|
||||
* @param PayPal\Api\Item $items
|
||||
*/
|
||||
public function setItems($items) {
|
||||
$this->items = $items;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class ItemList
|
||||
*
|
||||
* @property array|\PayPal\Api\Item items
|
||||
* @property \PayPal\Api\ShippingAddress shipping_address
|
||||
*/
|
||||
class ItemList extends PPModel
|
||||
{
|
||||
|
||||
/**
|
||||
* Construct an empty list.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->items = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this list empty?
|
||||
*/
|
||||
public function isEmpty() {
|
||||
return empty($this->items);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Items
|
||||
* List of Items
|
||||
*
|
||||
* @param array|\PayPal\Api\Item $items
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setItems($items)
|
||||
{
|
||||
$this->items = $items;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Items
|
||||
* List of items
|
||||
*
|
||||
* @return \PayPal\Api\Item
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shipping Address
|
||||
*
|
||||
* @param \PayPal\Api\ShippingAddress $shipping_address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShippingAddress($shipping_address)
|
||||
{
|
||||
$this->shipping_address = $shipping_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of items.
|
||||
* Append an item to the list.
|
||||
* @return PayPal\Api\Item
|
||||
*/
|
||||
public function getItems() {
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shipping address.
|
||||
* @param PayPal\Api\ShippingAddress $shipping_address
|
||||
*/
|
||||
public function setShippingAddress($shipping_address) {
|
||||
$this->shipping_address = $shipping_address;
|
||||
return $this;
|
||||
public function addItem($item) {
|
||||
return $this->setItems(
|
||||
array_merge($this->items, array($item))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping address.
|
||||
* @return PayPal\Api\ShippingAddress
|
||||
* Remove an item from the list.
|
||||
* Items are compared using === comparision (PHP.net)
|
||||
* @return PayPal\Api\Item
|
||||
*/
|
||||
public function getShippingAddress() {
|
||||
return $this->shipping_address;
|
||||
public function removeItem($item) {
|
||||
return $this->setItems(
|
||||
array_diff($this->items, array($item))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping address.
|
||||
* @param PayPal\Api\ShippingAddress $shipping_address
|
||||
* @deprecated. Instead use setShippingAddress
|
||||
*/
|
||||
public function setShipping_address($shipping_address) {
|
||||
$this->shipping_address = $shipping_address;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Shipping address.
|
||||
* @return PayPal\Api\ShippingAddress
|
||||
* @deprecated. Instead use getShippingAddress
|
||||
*/
|
||||
public function getShipping_address() {
|
||||
return $this->shipping_address;
|
||||
}
|
||||
/**
|
||||
* Get Shipping Address
|
||||
*
|
||||
* @return \PayPal\Api\ShippingAddress
|
||||
*/
|
||||
public function getShippingAddress()
|
||||
{
|
||||
return $this->shipping_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shipping Address
|
||||
*
|
||||
* @param \PayPal\Api\ShippingAddress $shipping_address
|
||||
*
|
||||
* @deprecated Use setShippingAddress
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShipping_address($shipping_address)
|
||||
{
|
||||
$this->shipping_address = $shipping_address;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Shipping Address
|
||||
*
|
||||
* @deprecated Use getShippingAddress
|
||||
*
|
||||
* @return \PayPal\Api\ShippingAddress
|
||||
*/
|
||||
public function getShipping_address()
|
||||
{
|
||||
return $this->shipping_address;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,115 +1,163 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Links extends PPModel {
|
||||
/**
|
||||
*
|
||||
* @param string $href
|
||||
*/
|
||||
public function setHref($href) {
|
||||
$this->href = $href;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class Links
|
||||
*
|
||||
* @property string href
|
||||
* @property string rel
|
||||
* @property \PayPal\Api\HyperSchema targetSchema
|
||||
* @property string method
|
||||
* @property string enctype
|
||||
* @property \PayPal\Api\HyperSchema schema
|
||||
*/
|
||||
class Links extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Href
|
||||
*
|
||||
* @param string $href
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHref($href)
|
||||
{
|
||||
$this->href = $href;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHref() {
|
||||
return $this->href;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Href
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHref()
|
||||
{
|
||||
return $this->href;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $rel
|
||||
*/
|
||||
public function setRel($rel) {
|
||||
$this->rel = $rel;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Rel
|
||||
*
|
||||
* @param string $rel
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRel($rel)
|
||||
{
|
||||
$this->rel = $rel;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRel() {
|
||||
return $this->rel;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Rel
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRel()
|
||||
{
|
||||
return $this->rel;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param PayPal\Api\HyperSchema $targetSchema
|
||||
*/
|
||||
public function setTargetSchema($targetSchema) {
|
||||
$this->targetSchema = $targetSchema;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Target Schema
|
||||
*
|
||||
* @param \PayPal\Api\HyperSchema $targetSchema
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTargetSchema($targetSchema)
|
||||
{
|
||||
$this->targetSchema = $targetSchema;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return PayPal\Api\HyperSchema
|
||||
*/
|
||||
public function getTargetSchema() {
|
||||
return $this->targetSchema;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Target Schema
|
||||
*
|
||||
* @return \PayPal\Api\HyperSchema
|
||||
*/
|
||||
public function getTargetSchema()
|
||||
{
|
||||
return $this->targetSchema;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $method
|
||||
*/
|
||||
public function setMethod($method) {
|
||||
$this->method = $method;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Method
|
||||
*
|
||||
* @param string $method
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMethod($method)
|
||||
{
|
||||
$this->method = $method;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMethod() {
|
||||
return $this->method;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Method
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMethod()
|
||||
{
|
||||
return $this->method;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $enctype
|
||||
*/
|
||||
public function setEnctype($enctype) {
|
||||
$this->enctype = $enctype;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Enctype
|
||||
*
|
||||
* @param string $enctype
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnctype($enctype)
|
||||
{
|
||||
$this->enctype = $enctype;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEnctype() {
|
||||
return $this->enctype;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Enctype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEnctype()
|
||||
{
|
||||
return $this->enctype;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param PayPal\Api\HyperSchema $schema
|
||||
*/
|
||||
public function setSchema($schema) {
|
||||
$this->schema = $schema;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return PayPal\Api\HyperSchema
|
||||
*/
|
||||
public function getSchema() {
|
||||
return $this->schema;
|
||||
}
|
||||
/**
|
||||
* Set Schema
|
||||
*
|
||||
* @param \PayPal\Api\HyperSchema $schema
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSchema($schema)
|
||||
{
|
||||
$this->schema = $schema;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Schema
|
||||
*
|
||||
* @return \PayPal\Api\HyperSchema
|
||||
*/
|
||||
public function getSchema()
|
||||
{
|
||||
return $this->schema;
|
||||
}
|
||||
}
|
||||
|
||||
303
lib/PayPal/Api/MerchantInfo.php
Normal file
303
lib/PayPal/Api/MerchantInfo.php
Normal file
@@ -0,0 +1,303 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class MerchantInfo extends PPModel {
|
||||
/**
|
||||
* Email address of the merchant. 260 characters max.
|
||||
*
|
||||
* @param string $email
|
||||
*/
|
||||
public function setEmail($email) {
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the merchant. 260 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail() {
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* First name of the merchant. 30 characters max.
|
||||
*
|
||||
* @param string $first_name
|
||||
*/
|
||||
public function setFirstName($first_name) {
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* First name of the merchant. 30 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName() {
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* First name of the merchant. 30 characters max.
|
||||
*
|
||||
* @param string $first_name
|
||||
* @deprecated. Instead use setFirstName
|
||||
*/
|
||||
public function setFirst_name($first_name) {
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* First name of the merchant. 30 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getFirstName
|
||||
*/
|
||||
public function getFirst_name() {
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last name of the merchant. 30 characters max.
|
||||
*
|
||||
* @param string $last_name
|
||||
*/
|
||||
public function setLastName($last_name) {
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last name of the merchant. 30 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName() {
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last name of the merchant. 30 characters max.
|
||||
*
|
||||
* @param string $last_name
|
||||
* @deprecated. Instead use setLastName
|
||||
*/
|
||||
public function setLast_name($last_name) {
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Last name of the merchant. 30 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getLastName
|
||||
*/
|
||||
public function getLast_name() {
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address of the merchant.
|
||||
*
|
||||
* @param PayPal\Api\Address $address
|
||||
*/
|
||||
public function setAddress($address) {
|
||||
$this->address = $address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address of the merchant.
|
||||
*
|
||||
* @return PayPal\Api\Address
|
||||
*/
|
||||
public function getAddress() {
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Company business name of the merchant. 100 characters max.
|
||||
*
|
||||
* @param string $business_name
|
||||
*/
|
||||
public function setBusinessName($business_name) {
|
||||
$this->business_name = $business_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Company business name of the merchant. 100 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBusinessName() {
|
||||
return $this->business_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Company business name of the merchant. 100 characters max.
|
||||
*
|
||||
* @param string $business_name
|
||||
* @deprecated. Instead use setBusinessName
|
||||
*/
|
||||
public function setBusiness_name($business_name) {
|
||||
$this->business_name = $business_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Company business name of the merchant. 100 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getBusinessName
|
||||
*/
|
||||
public function getBusiness_name() {
|
||||
return $this->business_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone number of the merchant.
|
||||
*
|
||||
* @param PayPal\Api\Phone $phone
|
||||
*/
|
||||
public function setPhone($phone) {
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone number of the merchant.
|
||||
*
|
||||
* @return PayPal\Api\Phone
|
||||
*/
|
||||
public function getPhone() {
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fax number of the merchant.
|
||||
*
|
||||
* @param PayPal\Api\Phone $fax
|
||||
*/
|
||||
public function setFax($fax) {
|
||||
$this->fax = $fax;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fax number of the merchant.
|
||||
*
|
||||
* @return PayPal\Api\Phone
|
||||
*/
|
||||
public function getFax() {
|
||||
return $this->fax;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Website of the merchant. 2048 characters max.
|
||||
*
|
||||
* @param string $website
|
||||
*/
|
||||
public function setWebsite($website) {
|
||||
$this->website = $website;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Website of the merchant. 2048 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getWebsite() {
|
||||
return $this->website;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tax ID of the merchant. 100 characters max.
|
||||
*
|
||||
* @param string $tax_id
|
||||
*/
|
||||
public function setTaxId($tax_id) {
|
||||
$this->tax_id = $tax_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tax ID of the merchant. 100 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTaxId() {
|
||||
return $this->tax_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tax ID of the merchant. 100 characters max.
|
||||
*
|
||||
* @param string $tax_id
|
||||
* @deprecated. Instead use setTaxId
|
||||
*/
|
||||
public function setTax_id($tax_id) {
|
||||
$this->tax_id = $tax_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Tax ID of the merchant. 100 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getTaxId
|
||||
*/
|
||||
public function getTax_id() {
|
||||
return $this->tax_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Option to display additional information such as business hours. 40 characters max.
|
||||
*
|
||||
* @param string $additional_info
|
||||
*/
|
||||
public function setAdditionalInfo($additional_info) {
|
||||
$this->additional_info = $additional_info;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Option to display additional information such as business hours. 40 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAdditionalInfo() {
|
||||
return $this->additional_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Option to display additional information such as business hours. 40 characters max.
|
||||
*
|
||||
* @param string $additional_info
|
||||
* @deprecated. Instead use setAdditionalInfo
|
||||
*/
|
||||
public function setAdditional_info($additional_info) {
|
||||
$this->additional_info = $additional_info;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Option to display additional information such as business hours. 40 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getAdditionalInfo
|
||||
*/
|
||||
public function getAdditional_info() {
|
||||
return $this->additional_info;
|
||||
}
|
||||
|
||||
}
|
||||
359
lib/PayPal/Api/Metadata.php
Normal file
359
lib/PayPal/Api/Metadata.php
Normal file
@@ -0,0 +1,359 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Metadata extends PPModel {
|
||||
/**
|
||||
* Date when the resource was created.
|
||||
*
|
||||
* @param string $created_date
|
||||
*/
|
||||
public function setCreatedDate($created_date) {
|
||||
$this->created_date = $created_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was created.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreatedDate() {
|
||||
return $this->created_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was created.
|
||||
*
|
||||
* @param string $created_date
|
||||
* @deprecated. Instead use setCreatedDate
|
||||
*/
|
||||
public function setCreated_date($created_date) {
|
||||
$this->created_date = $created_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Date when the resource was created.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getCreatedDate
|
||||
*/
|
||||
public function getCreated_date() {
|
||||
return $this->created_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that created the resource.
|
||||
*
|
||||
* @param string $created_by
|
||||
*/
|
||||
public function setCreatedBy($created_by) {
|
||||
$this->created_by = $created_by;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that created the resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreatedBy() {
|
||||
return $this->created_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that created the resource.
|
||||
*
|
||||
* @param string $created_by
|
||||
* @deprecated. Instead use setCreatedBy
|
||||
*/
|
||||
public function setCreated_by($created_by) {
|
||||
$this->created_by = $created_by;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Email address of the account that created the resource.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getCreatedBy
|
||||
*/
|
||||
public function getCreated_by() {
|
||||
return $this->created_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was cancelled.
|
||||
*
|
||||
* @param string $cancelled_date
|
||||
*/
|
||||
public function setCancelledDate($cancelled_date) {
|
||||
$this->cancelled_date = $cancelled_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was cancelled.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCancelledDate() {
|
||||
return $this->cancelled_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was cancelled.
|
||||
*
|
||||
* @param string $cancelled_date
|
||||
* @deprecated. Instead use setCancelledDate
|
||||
*/
|
||||
public function setCancelled_date($cancelled_date) {
|
||||
$this->cancelled_date = $cancelled_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Date when the resource was cancelled.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getCancelledDate
|
||||
*/
|
||||
public function getCancelled_date() {
|
||||
return $this->cancelled_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actor who cancelled the resource.
|
||||
*
|
||||
* @param string $cancelled_by
|
||||
*/
|
||||
public function setCancelledBy($cancelled_by) {
|
||||
$this->cancelled_by = $cancelled_by;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actor who cancelled the resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCancelledBy() {
|
||||
return $this->cancelled_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actor who cancelled the resource.
|
||||
*
|
||||
* @param string $cancelled_by
|
||||
* @deprecated. Instead use setCancelledBy
|
||||
*/
|
||||
public function setCancelled_by($cancelled_by) {
|
||||
$this->cancelled_by = $cancelled_by;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Actor who cancelled the resource.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getCancelledBy
|
||||
*/
|
||||
public function getCancelled_by() {
|
||||
return $this->cancelled_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was last edited.
|
||||
*
|
||||
* @param string $last_updated_date
|
||||
*/
|
||||
public function setLastUpdatedDate($last_updated_date) {
|
||||
$this->last_updated_date = $last_updated_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was last edited.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastUpdatedDate() {
|
||||
return $this->last_updated_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was last edited.
|
||||
*
|
||||
* @param string $last_updated_date
|
||||
* @deprecated. Instead use setLastUpdatedDate
|
||||
*/
|
||||
public function setLast_updated_date($last_updated_date) {
|
||||
$this->last_updated_date = $last_updated_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Date when the resource was last edited.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getLastUpdatedDate
|
||||
*/
|
||||
public function getLast_updated_date() {
|
||||
return $this->last_updated_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that last edited the resource.
|
||||
*
|
||||
* @param string $last_updated_by
|
||||
*/
|
||||
public function setLastUpdatedBy($last_updated_by) {
|
||||
$this->last_updated_by = $last_updated_by;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that last edited the resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastUpdatedBy() {
|
||||
return $this->last_updated_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that last edited the resource.
|
||||
*
|
||||
* @param string $last_updated_by
|
||||
* @deprecated. Instead use setLastUpdatedBy
|
||||
*/
|
||||
public function setLast_updated_by($last_updated_by) {
|
||||
$this->last_updated_by = $last_updated_by;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Email address of the account that last edited the resource.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getLastUpdatedBy
|
||||
*/
|
||||
public function getLast_updated_by() {
|
||||
return $this->last_updated_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was first sent.
|
||||
*
|
||||
* @param string $first_sent_date
|
||||
*/
|
||||
public function setFirstSentDate($first_sent_date) {
|
||||
$this->first_sent_date = $first_sent_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was first sent.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstSentDate() {
|
||||
return $this->first_sent_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was first sent.
|
||||
*
|
||||
* @param string $first_sent_date
|
||||
* @deprecated. Instead use setFirstSentDate
|
||||
*/
|
||||
public function setFirst_sent_date($first_sent_date) {
|
||||
$this->first_sent_date = $first_sent_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Date when the resource was first sent.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getFirstSentDate
|
||||
*/
|
||||
public function getFirst_sent_date() {
|
||||
return $this->first_sent_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was last sent.
|
||||
*
|
||||
* @param string $last_sent_date
|
||||
*/
|
||||
public function setLastSentDate($last_sent_date) {
|
||||
$this->last_sent_date = $last_sent_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was last sent.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastSentDate() {
|
||||
return $this->last_sent_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the resource was last sent.
|
||||
*
|
||||
* @param string $last_sent_date
|
||||
* @deprecated. Instead use setLastSentDate
|
||||
*/
|
||||
public function setLast_sent_date($last_sent_date) {
|
||||
$this->last_sent_date = $last_sent_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Date when the resource was last sent.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getLastSentDate
|
||||
*/
|
||||
public function getLast_sent_date() {
|
||||
return $this->last_sent_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that last sent the resource.
|
||||
*
|
||||
* @param string $last_sent_by
|
||||
*/
|
||||
public function setLastSentBy($last_sent_by) {
|
||||
$this->last_sent_by = $last_sent_by;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that last sent the resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastSentBy() {
|
||||
return $this->last_sent_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address of the account that last sent the resource.
|
||||
*
|
||||
* @param string $last_sent_by
|
||||
* @deprecated. Instead use setLastSentBy
|
||||
*/
|
||||
public function setLast_sent_by($last_sent_by) {
|
||||
$this->last_sent_by = $last_sent_by;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Email address of the account that last sent the resource.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getLastSentBy
|
||||
*/
|
||||
public function getLast_sent_by() {
|
||||
return $this->last_sent_by;
|
||||
}
|
||||
|
||||
}
|
||||
87
lib/PayPal/Api/Notification.php
Normal file
87
lib/PayPal/Api/Notification.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Notification extends PPModel {
|
||||
/**
|
||||
* Subject of the notification.
|
||||
*
|
||||
* @param string $subject
|
||||
*/
|
||||
public function setSubject($subject) {
|
||||
$this->subject = $subject;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subject of the notification.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSubject() {
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Note to the payer.
|
||||
*
|
||||
* @param string $note
|
||||
*/
|
||||
public function setNote($note) {
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote() {
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the merchant.
|
||||
*
|
||||
* @param boolean $send_to_merchant
|
||||
*/
|
||||
public function setSendToMerchant($send_to_merchant) {
|
||||
$this->send_to_merchant = $send_to_merchant;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the merchant.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getSendToMerchant() {
|
||||
return $this->send_to_merchant;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the merchant.
|
||||
*
|
||||
* @param boolean $send_to_merchant
|
||||
* @deprecated. Instead use setSendToMerchant
|
||||
*/
|
||||
public function setSend_to_merchant($send_to_merchant) {
|
||||
$this->send_to_merchant = $send_to_merchant;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* A flag indicating whether a copy of the email has to be sent to the merchant.
|
||||
*
|
||||
* @return boolean
|
||||
* @deprecated. Instead use getSendToMerchant
|
||||
*/
|
||||
public function getSend_to_merchant() {
|
||||
return $this->send_to_merchant;
|
||||
}
|
||||
|
||||
}
|
||||
231
lib/PayPal/Api/Order.php
Normal file
231
lib/PayPal/Api/Order.php
Normal file
@@ -0,0 +1,231 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Order
|
||||
*
|
||||
* @property string id
|
||||
* @property string createTime
|
||||
* @property string updateTime
|
||||
* @property string state
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string parentPayment
|
||||
* @property \PayPal\Api\Links links
|
||||
* @property string reasonCode
|
||||
*/
|
||||
class Order extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set the identifier of the order transaction.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the identifier of the order transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the time the resource was created.
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the time the resource was created.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the time the resource was last updated.
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the time the resource was last updated.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the state of the order transaction.
|
||||
*
|
||||
* Allowed values are: `PENDING`, `COMPLETED`, `REFUNDED` or `PARTIALLY_REFUNDED`.
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the state of the order transaction.
|
||||
*
|
||||
* Allowed values are: `PENDING`, `COMPLETED`, `REFUNDED` or `PARTIALLY_REFUNDED`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the amount being collected.
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount being collected.
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ID of the payment resource on which this transaction is based.
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentPayment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ID of the payment resource on which this transaction is based.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getParentPayment()
|
||||
{
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Links
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed. Assigned in response.
|
||||
*
|
||||
* Allowed values: `CHARGEBACK`, `GUARANTEE`, `BUYER_COMPLAINT`, `REFUND`,
|
||||
* `UNCONFIRMED_SHIPPING_ADDRESS`,
|
||||
* `ECHECK`, `INTERNATIONAL_WITHDRAWAL`,
|
||||
* `RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION`, `PAYMENT_REVIEW`,
|
||||
* `REGULATORY_REVIEW`, `UNILATERAL`, or `VERIFICATION_REQUIRED`
|
||||
* (`ORDER` can also be set in the response).
|
||||
*
|
||||
* @param string $reason_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReasonCode($reason_code)
|
||||
{
|
||||
$this->reason_code = $reason_code;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed. Assigned in response.
|
||||
*
|
||||
* Allowed values: `CHARGEBACK`, `GUARANTEE`, `BUYER_COMPLAINT`, `REFUND`,
|
||||
* `UNCONFIRMED_SHIPPING_ADDRESS`,
|
||||
* `ECHECK`, `INTERNATIONAL_WITHDRAWAL`,
|
||||
* `RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION`, `PAYMENT_REVIEW`,
|
||||
* `REGULATORY_REVIEW`, `UNILATERAL`, or `VERIFICATION_REQUIRED`
|
||||
* (`ORDER` can also be set in the response).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReasonCode()
|
||||
{
|
||||
return $this->reason_code;
|
||||
}
|
||||
}
|
||||
@@ -1,78 +1,130 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Payee extends PPModel {
|
||||
/**
|
||||
* Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
|
||||
* @param string $email
|
||||
*/
|
||||
public function setEmail($email) {
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class Payee
|
||||
*
|
||||
* @property string email
|
||||
* @property string merchant_id
|
||||
* @property string phone
|
||||
*/
|
||||
class Payee extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Email
|
||||
* Email Address associated with the Payee's PayPal Account
|
||||
* If the provided email address is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments
|
||||
* Direct Credit Card Payments will be denied due to card compliance requirements
|
||||
*
|
||||
* @param string $email
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
/**
|
||||
* Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail() {
|
||||
return $this->email;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Email
|
||||
* Email Address associated with the Payee's PayPal Account
|
||||
* If the provided email address is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments
|
||||
* Direct Credit Card Payments will be denied due to card compliance requirements
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypted PayPal Account identifier for the Payee.
|
||||
* @param string $merchant_id
|
||||
*/
|
||||
public function setMerchantId($merchant_id) {
|
||||
$this->merchant_id = $merchant_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Merchant ID
|
||||
* Encrypted PayPal Account identifier for the Payee
|
||||
*
|
||||
* @param string $merchant_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMerchantId($merchant_id)
|
||||
{
|
||||
$this->merchant_id = $merchant_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypted PayPal Account identifier for the Payee.
|
||||
* @return string
|
||||
*/
|
||||
public function getMerchantId() {
|
||||
return $this->merchant_id;
|
||||
}
|
||||
/**
|
||||
* Get Merchant ID
|
||||
* Encrypted PayPal Account identifier for the Payee
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMerchantId()
|
||||
{
|
||||
return $this->merchant_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypted PayPal Account identifier for the Payee.
|
||||
* @param string $merchant_id
|
||||
* @deprecated. Instead use setMerchantId
|
||||
*/
|
||||
public function setMerchant_id($merchant_id) {
|
||||
$this->merchant_id = $merchant_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Encrypted PayPal Account identifier for the Payee.
|
||||
* @return string
|
||||
* @deprecated. Instead use getMerchantId
|
||||
*/
|
||||
public function getMerchant_id() {
|
||||
return $this->merchant_id;
|
||||
}
|
||||
/**
|
||||
* Set Merchant ID
|
||||
* Encrypted PayPal Account identifier for the Payee
|
||||
*
|
||||
* @param string $merchant_id
|
||||
*
|
||||
* @deprecated Use setMerchantId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMerchant_id($merchant_id)
|
||||
{
|
||||
$this->merchant_id = $merchant_id;
|
||||
|
||||
/**
|
||||
* Phone number (in E.123 format) associated with the Payee's PayPal Account. If the provided phont number is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
|
||||
* @param string $phone
|
||||
*/
|
||||
public function setPhone($phone) {
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone number (in E.123 format) associated with the Payee's PayPal Account. If the provided phont number is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone() {
|
||||
return $this->phone;
|
||||
}
|
||||
/**
|
||||
* Get Merchant ID
|
||||
* Encrypted PayPal Account identifier for the Payee
|
||||
*
|
||||
* @deprecated Use getMerchantId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMerchant_id()
|
||||
{
|
||||
return $this->merchant_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Phone
|
||||
* (in E.123 format) associated with the Payee's PayPal Account
|
||||
* If the provided phont number is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments
|
||||
* Direct Credit Card Payments will be denied due to card compliance requirements
|
||||
*
|
||||
* @param string $phone
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
{
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Phone
|
||||
* (in E.123 format) associated with the Payee's PayPal Account
|
||||
* If the provided phont number is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments
|
||||
* Direct Credit Card Payments will be denied due to card compliance requirements
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone()
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,114 +1,182 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Payer extends PPModel {
|
||||
/**
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card.
|
||||
* @param string $payment_method
|
||||
*/
|
||||
public function setPaymentMethod($payment_method) {
|
||||
$this->payment_method = $payment_method;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class Payer
|
||||
*
|
||||
* @property string payment_method
|
||||
* @property array|\PayPal\Api\FundingInstrument funding_instruments
|
||||
* @property \PayPal\Api\PayerInfo payer_info
|
||||
*/
|
||||
class Payer extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Payment Method
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card
|
||||
*
|
||||
* @param string $payment_method
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentMethod($payment_method)
|
||||
{
|
||||
$this->payment_method = $payment_method;
|
||||
|
||||
/**
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card.
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentMethod() {
|
||||
return $this->payment_method;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card.
|
||||
* @param string $payment_method
|
||||
* @deprecated. Instead use setPaymentMethod
|
||||
*/
|
||||
public function setPayment_method($payment_method) {
|
||||
$this->payment_method = $payment_method;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card.
|
||||
* @return string
|
||||
* @deprecated. Instead use getPaymentMethod
|
||||
*/
|
||||
public function getPayment_method() {
|
||||
return $this->payment_method;
|
||||
}
|
||||
/**
|
||||
* Get Payment Method
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentMethod()
|
||||
{
|
||||
return $this->payment_method;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card.
|
||||
* @array
|
||||
* @param PayPal\Api\FundingInstrument $funding_instruments
|
||||
*/
|
||||
public function setFundingInstruments($funding_instruments) {
|
||||
$this->funding_instruments = $funding_instruments;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Payment Method
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card
|
||||
*
|
||||
* @param string $payment_method
|
||||
*
|
||||
* @deprecated Use setPaymentMethod
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayment_method($payment_method)
|
||||
{
|
||||
$this->payment_method = $payment_method;
|
||||
|
||||
/**
|
||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card.
|
||||
* @return PayPal\Api\FundingInstrument
|
||||
*/
|
||||
public function getFundingInstruments() {
|
||||
return $this->funding_instruments;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card.
|
||||
* @array
|
||||
* @param PayPal\Api\FundingInstrument $funding_instruments
|
||||
* @deprecated. Instead use setFundingInstruments
|
||||
*/
|
||||
public function setFunding_instruments($funding_instruments) {
|
||||
$this->funding_instruments = $funding_instruments;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card.
|
||||
* @return PayPal\Api\FundingInstrument
|
||||
* @deprecated. Instead use getFundingInstruments
|
||||
*/
|
||||
public function getFunding_instruments() {
|
||||
return $this->funding_instruments;
|
||||
}
|
||||
/**
|
||||
* Get Payment Method
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card
|
||||
*
|
||||
* @deprecated Use getPaymentMethod
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayment_method()
|
||||
{
|
||||
return $this->payment_method;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet.
|
||||
* @param PayPal\Api\PayerInfo $payer_info
|
||||
*/
|
||||
public function setPayerInfo($payer_info) {
|
||||
$this->payer_info = $payer_info;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Funding Instruments
|
||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card
|
||||
*
|
||||
* @param \PayPal\Api\FundingInstrument|array $funding_instruments
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFundingInstruments($funding_instruments)
|
||||
{
|
||||
$this->funding_instruments = $funding_instruments;
|
||||
|
||||
/**
|
||||
* Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet.
|
||||
* @return PayPal\Api\PayerInfo
|
||||
*/
|
||||
public function getPayerInfo() {
|
||||
return $this->payer_info;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet.
|
||||
* @param PayPal\Api\PayerInfo $payer_info
|
||||
* @deprecated. Instead use setPayerInfo
|
||||
*/
|
||||
public function setPayer_info($payer_info) {
|
||||
$this->payer_info = $payer_info;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet.
|
||||
* @return PayPal\Api\PayerInfo
|
||||
* @deprecated. Instead use getPayerInfo
|
||||
*/
|
||||
public function getPayer_info() {
|
||||
return $this->payer_info;
|
||||
}
|
||||
/**
|
||||
* Get Funding Instruments
|
||||
*
|
||||
* @return \PayPal\Api\FundingInstrument|array
|
||||
*/
|
||||
public function getFundingInstruments()
|
||||
{
|
||||
return $this->funding_instruments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Funding Instruments
|
||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card
|
||||
*
|
||||
* @param \PayPal\Api\FundingInstrument $funding_instruments
|
||||
*
|
||||
* @deprecated Use setFundingInstruments
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFunding_instruments($funding_instruments)
|
||||
{
|
||||
$this->funding_instruments = $funding_instruments;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Funding Instruments
|
||||
*
|
||||
* @deprecated Use getFundingInstruments
|
||||
*
|
||||
* @return \PayPal\Api\FundingInstrument
|
||||
*/
|
||||
public function getFunding_instruments()
|
||||
{
|
||||
return $this->funding_instruments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payer Info
|
||||
* Information related to the Payer
|
||||
* In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet
|
||||
*
|
||||
* @param \PayPal\Api\PayerInfo $payer_info
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerInfo($payer_info)
|
||||
{
|
||||
$this->payer_info = $payer_info;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payer Info
|
||||
*
|
||||
* @return \PayPal\Api\PayerInfo
|
||||
*/
|
||||
public function getPayerInfo()
|
||||
{
|
||||
return $this->payer_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payer Info
|
||||
* Information related to the Payer
|
||||
* In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet
|
||||
*
|
||||
* @param \PayPal\Api\PayerInfo $payer_info
|
||||
*
|
||||
* @deprecated Use setPayerInfo
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayer_info($payer_info)
|
||||
{
|
||||
$this->payer_info = $payer_info;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payer Info
|
||||
*
|
||||
* @deprecated Use getPayerInfo
|
||||
*
|
||||
* @return \PayPal\Api\PayerInfo
|
||||
*/
|
||||
public function getPayer_info()
|
||||
{
|
||||
return $this->payer_info;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,183 +1,295 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class PayerInfo extends PPModel {
|
||||
/**
|
||||
* Email address representing the Payer.
|
||||
* @param string $email
|
||||
*/
|
||||
public function setEmail($email) {
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class PayerInfo
|
||||
*
|
||||
* @property string email
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* @property string payer_id
|
||||
* @property string phone
|
||||
* @property \PayPal\Api\Address shipping_address
|
||||
*/
|
||||
class PayerInfo extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Email
|
||||
* Email address representing the Payer
|
||||
*
|
||||
* @param string $email
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
/**
|
||||
* Email address representing the Payer.
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail() {
|
||||
return $this->email;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Email
|
||||
* Email address representing the Payer
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* First Name of the Payer from their PayPal Account.
|
||||
* @param string $first_name
|
||||
*/
|
||||
public function setFirstName($first_name) {
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set First Name
|
||||
* First Name of the Payer from their PayPal Account
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirstName($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
|
||||
/**
|
||||
* First Name of the Payer from their PayPal Account.
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName() {
|
||||
return $this->first_name;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* First Name of the Payer from their PayPal Account.
|
||||
* @param string $first_name
|
||||
* @deprecated. Instead use setFirstName
|
||||
*/
|
||||
public function setFirst_name($first_name) {
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* First Name of the Payer from their PayPal Account.
|
||||
* @return string
|
||||
* @deprecated. Instead use getFirstName
|
||||
*/
|
||||
public function getFirst_name() {
|
||||
return $this->first_name;
|
||||
}
|
||||
/**
|
||||
* Get First Name
|
||||
* First Name of the Payer from their PayPal Account
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName()
|
||||
{
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last Name of the Payer from their PayPal Account.
|
||||
* @param string $last_name
|
||||
*/
|
||||
public function setLastName($last_name) {
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set First Name
|
||||
* First Name of the Payer from their PayPal Account
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
* @deprecated Use setFirstName
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirst_name($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
|
||||
/**
|
||||
* Last Name of the Payer from their PayPal Account.
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName() {
|
||||
return $this->last_name;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last Name of the Payer from their PayPal Account.
|
||||
* @param string $last_name
|
||||
* @deprecated. Instead use setLastName
|
||||
*/
|
||||
public function setLast_name($last_name) {
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Last Name of the Payer from their PayPal Account.
|
||||
* @return string
|
||||
* @deprecated. Instead use getLastName
|
||||
*/
|
||||
public function getLast_name() {
|
||||
return $this->last_name;
|
||||
}
|
||||
/**
|
||||
* Get First Name
|
||||
* First Name of the Payer from their PayPal Account
|
||||
*
|
||||
* @deprecated Use getFirstName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirst_name()
|
||||
{
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal assigned Payer ID.
|
||||
* @param string $payer_id
|
||||
*/
|
||||
public function setPayerId($payer_id) {
|
||||
$this->payer_id = $payer_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Last Name
|
||||
* Last Name of the Payer from their PayPal Account
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastName($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
|
||||
/**
|
||||
* PayPal assigned Payer ID.
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerId() {
|
||||
return $this->payer_id;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal assigned Payer ID.
|
||||
* @param string $payer_id
|
||||
* @deprecated. Instead use setPayerId
|
||||
*/
|
||||
public function setPayer_id($payer_id) {
|
||||
$this->payer_id = $payer_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* PayPal assigned Payer ID.
|
||||
* @return string
|
||||
* @deprecated. Instead use getPayerId
|
||||
*/
|
||||
public function getPayer_id() {
|
||||
return $this->payer_id;
|
||||
}
|
||||
/**
|
||||
* Get Last Name
|
||||
* Last Name of the Payer from their PayPal Account
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName()
|
||||
{
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone number representing the Payer.
|
||||
* @param string $phone
|
||||
*/
|
||||
public function setPhone($phone) {
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Last Name
|
||||
* Last Name of the Payer from their PayPal Account
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
* @deprecated Use setLastName
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLast_name($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
|
||||
/**
|
||||
* Phone number representing the Payer.
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone() {
|
||||
return $this->phone;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Last Name
|
||||
* Last Name of the Payer from their PayPal Account
|
||||
*
|
||||
* @deprecated Use getLastName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLast_name()
|
||||
{
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping address of the Payer from their PayPal Account.
|
||||
* @param PayPal\Api\Address $shipping_address
|
||||
*/
|
||||
public function setShippingAddress($shipping_address) {
|
||||
$this->shipping_address = $shipping_address;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Payer ID
|
||||
* PayPal assigned Payer ID
|
||||
*
|
||||
* @param string $payer_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerId($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
|
||||
/**
|
||||
* Shipping address of the Payer from their PayPal Account.
|
||||
* @return PayPal\Api\Address
|
||||
*/
|
||||
public function getShippingAddress() {
|
||||
return $this->shipping_address;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping address of the Payer from their PayPal Account.
|
||||
* @param PayPal\Api\Address $shipping_address
|
||||
* @deprecated. Instead use setShippingAddress
|
||||
*/
|
||||
public function setShipping_address($shipping_address) {
|
||||
$this->shipping_address = $shipping_address;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Shipping address of the Payer from their PayPal Account.
|
||||
* @return PayPal\Api\Address
|
||||
* @deprecated. Instead use getShippingAddress
|
||||
*/
|
||||
public function getShipping_address() {
|
||||
return $this->shipping_address;
|
||||
}
|
||||
/**
|
||||
* Get Payer ID
|
||||
* PayPal assigned Payer ID
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerId()
|
||||
{
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payer ID
|
||||
* PayPal assigned Payer ID
|
||||
*
|
||||
* @param string $payer_id
|
||||
*
|
||||
* @deprecated Use setPayerId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayer_id($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payer ID
|
||||
* PayPal assigned Payer ID
|
||||
*
|
||||
* @deprecated Use setPayerId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayer_id()
|
||||
{
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Phone
|
||||
* Phone number representing the Payer
|
||||
*
|
||||
* @param string $phone
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
{
|
||||
$this->phone = $phone;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Phone
|
||||
* Phone number representing the Payer
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone()
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shipping Address
|
||||
* Shipping address of the Payer from their PayPal Account
|
||||
*
|
||||
* @param \PayPal\Api\ShippingAddress $shipping_address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShippingAddress($shipping_address)
|
||||
{
|
||||
$this->shipping_address = $shipping_address;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Shipping Address
|
||||
* Shipping address of the Payer from their PayPal Account
|
||||
*
|
||||
* @return \PayPal\Api\ShippingAddress
|
||||
*/
|
||||
public function getShippingAddress()
|
||||
{
|
||||
return $this->shipping_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shipping Address
|
||||
* Shipping address of the Payer from their PayPal Account
|
||||
*
|
||||
* @param \PayPal\Api\ShippingAddress $shipping_address
|
||||
*
|
||||
* @deprecated Use setShippingAddress
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShipping_address($shipping_address)
|
||||
{
|
||||
$this->shipping_address = $shipping_address;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Shipping Address
|
||||
* Shipping address of the Payer from their PayPal Account
|
||||
*
|
||||
* @deprecated Use getShippingAddress
|
||||
*
|
||||
* @return \PayPal\Api\ShippingAddress
|
||||
*/
|
||||
public function getShipping_address()
|
||||
{
|
||||
return $this->shipping_address;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,299 +1,492 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Rest\Call;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Api\Payment;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Api\PaymentHistory;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
|
||||
class Payment extends PPModel implements IResource {
|
||||
/**
|
||||
* Class Payment
|
||||
*
|
||||
* @property string id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property string intent
|
||||
* @property \PayPal\Api\Payer payer
|
||||
* @property array|\PayPal\Api\Transaction transactions
|
||||
* @property string state
|
||||
* @property \PayPal\Api\RedirectUrls redirect_urls
|
||||
* @property \PayPal\Api\Links links
|
||||
*/
|
||||
class Payment extends PPModel implements IResource
|
||||
{
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
private static $credential;
|
||||
|
||||
private static $credential;
|
||||
/**
|
||||
* Set Credential
|
||||
*
|
||||
* @param $credential
|
||||
*
|
||||
* @deprecated Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
public static function setCredential($credential)
|
||||
{
|
||||
self::$credential = $credential;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated. Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
public static function setCredential($credential) {
|
||||
self::$credential = $credential;
|
||||
}
|
||||
/**
|
||||
* Set ID
|
||||
* Identifier of the payment resource created
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
/**
|
||||
* Identifier of the payment resource created.
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the payment resource created.
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
/**
|
||||
* Get ID
|
||||
* Identifier of the payment resource created
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @deprecated Use setCreateTime
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreate_time($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @deprecated Use getCreateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreate_time()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @deprecated Use setUpdateTime
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdate_time($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @deprecated Use getUpdateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdate_time()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Intent
|
||||
* Intent of the payment - Sale or Authorization or Order
|
||||
*
|
||||
* @param string $intent
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIntent($intent)
|
||||
{
|
||||
$this->intent = $intent;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Intent
|
||||
* Intent of the payment - Sale or Authorization or Order
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIntent()
|
||||
{
|
||||
return $this->intent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payer
|
||||
* Source of the funds for this payment represented by a PayPal account or a direct credit card
|
||||
*
|
||||
* @param \PayPal\Api\Payer $payer
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayer($payer)
|
||||
{
|
||||
$this->payer = $payer;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payer
|
||||
* Source of the funds for this payment represented by a PayPal account or a direct credit card
|
||||
*
|
||||
* @return \PayPal\Api\Payer
|
||||
*/
|
||||
public function getPayer()
|
||||
{
|
||||
return $this->payer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Transactions
|
||||
* A payment can have more than one transaction, with each transaction establishing a contract between the payer and a payee
|
||||
*
|
||||
* @param array|\PayPal\Api\Transaction $transactions
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTransactions($transactions)
|
||||
{
|
||||
$this->transactions = $transactions;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Transactions
|
||||
* A payment can have more than one transaction, with each transaction establishing a contract between the payer and a payee
|
||||
*
|
||||
* @return \PayPal\Api\Transaction
|
||||
*/
|
||||
public function getTransactions()
|
||||
{
|
||||
return $this->transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set State
|
||||
* State of the payment
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get State
|
||||
* State of the payment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Redirect URLs
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls
|
||||
*
|
||||
* @param \PayPal\Api\RedirectUrls $redirect_urls
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRedirectUrls($redirect_urls)
|
||||
{
|
||||
$this->redirect_urls = $redirect_urls;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Redirect URLs
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls
|
||||
*
|
||||
* @return \PayPal\Api\RedirectUrls
|
||||
*/
|
||||
public function getRedirectUrls()
|
||||
{
|
||||
return $this->redirect_urls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Redirect URLs
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls
|
||||
*
|
||||
* @param \PayPal\Api\RedirectUrls $redirect_urls
|
||||
*
|
||||
* @deprecated Use setRedirectUrls
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRedirect_urls($redirect_urls)
|
||||
{
|
||||
$this->redirect_urls = $redirect_urls;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Redirect URLs
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls
|
||||
*
|
||||
* @deprecated Use getRedirectUrls
|
||||
*
|
||||
* @return \PayPal\Api\RedirectUrls
|
||||
*/
|
||||
public function getRedirect_urls()
|
||||
{
|
||||
return $this->redirect_urls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Links
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
*/
|
||||
public function setCreateTime($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Create
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function create($apiContext = null)
|
||||
{
|
||||
$payLoad = $this->toJSON();
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime() {
|
||||
return $this->create_time;
|
||||
}
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
* @deprecated. Instead use setCreateTime
|
||||
*/
|
||||
public function setCreate_time($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
* @deprecated. Instead use getCreateTime
|
||||
*/
|
||||
public function getCreate_time() {
|
||||
return $this->create_time;
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment", "POST", $payLoad);
|
||||
$this->fromJson($json);
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @param string $update_time
|
||||
*/
|
||||
public function setUpdateTime($update_time) {
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime() {
|
||||
return $this->update_time;
|
||||
}
|
||||
/**
|
||||
* Get
|
||||
*
|
||||
* @param int $paymentId
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return Payment
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function get($paymentId, $apiContext = null)
|
||||
{
|
||||
if (($paymentId == null) || (strlen($paymentId) <= 0)) {
|
||||
throw new \InvalidArgumentException("paymentId cannot be null or empty");
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @param string $update_time
|
||||
* @deprecated. Instead use setUpdateTime
|
||||
*/
|
||||
public function setUpdate_time($update_time) {
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @return string
|
||||
* @deprecated. Instead use getUpdateTime
|
||||
*/
|
||||
public function getUpdate_time() {
|
||||
return $this->update_time;
|
||||
}
|
||||
$payLoad = "";
|
||||
|
||||
/**
|
||||
* Intent of the payment - Sale or Authorization or Order.
|
||||
* @param string $intent
|
||||
*/
|
||||
public function setIntent($intent) {
|
||||
$this->intent = $intent;
|
||||
return $this;
|
||||
}
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
/**
|
||||
* Intent of the payment - Sale or Authorization or Order.
|
||||
* @return string
|
||||
*/
|
||||
public function getIntent() {
|
||||
return $this->intent;
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment/$paymentId", "GET", $payLoad);
|
||||
|
||||
$ret = new Payment();
|
||||
$ret->fromJson($json);
|
||||
|
||||
/**
|
||||
* Source of the funds for this payment represented by a PayPal account or a direct credit card.
|
||||
* @param PayPal\Api\Payer $payer
|
||||
*/
|
||||
public function setPayer($payer) {
|
||||
$this->payer = $payer;
|
||||
return $this;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Source of the funds for this payment represented by a PayPal account or a direct credit card.
|
||||
* @return PayPal\Api\Payer
|
||||
*/
|
||||
public function getPayer() {
|
||||
return $this->payer;
|
||||
}
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @param \Paypal\Api\PaymentExecution $paymentExecution
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return Payment
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function execute($paymentExecution, $apiContext = null)
|
||||
{
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
|
||||
if (($paymentExecution == null)) {
|
||||
throw new \InvalidArgumentException("paymentExecution cannot be null or empty");
|
||||
}
|
||||
|
||||
/**
|
||||
* A payment can have more than one transaction, with each transaction establishing a contract between the payer and a payee
|
||||
* @array
|
||||
* @param PayPal\Api\Transaction $transactions
|
||||
*/
|
||||
public function setTransactions($transactions) {
|
||||
$this->transactions = $transactions;
|
||||
return $this;
|
||||
}
|
||||
$payLoad = $paymentExecution->toJSON();
|
||||
|
||||
/**
|
||||
* A payment can have more than one transaction, with each transaction establishing a contract between the payer and a payee
|
||||
* @return PayPal\Api\Transaction
|
||||
*/
|
||||
public function getTransactions() {
|
||||
return $this->transactions;
|
||||
}
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment/{$this->getId()}/execute", "POST", $payLoad);
|
||||
|
||||
/**
|
||||
* state of the payment
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
$ret = new Payment();
|
||||
$ret->fromJson($json);
|
||||
|
||||
/**
|
||||
* state of the payment
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* All
|
||||
*
|
||||
* @param array $params
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return PaymentHistory
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function all($params, $apiContext = null)
|
||||
{
|
||||
if (($params == null)) {
|
||||
throw new \InvalidArgumentException("params cannot be null or empty");
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls.
|
||||
* @param PayPal\Api\RedirectUrls $redirect_urls
|
||||
*/
|
||||
public function setRedirectUrls($redirect_urls) {
|
||||
$this->redirect_urls = $redirect_urls;
|
||||
return $this;
|
||||
}
|
||||
$payLoad = "";
|
||||
|
||||
/**
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls.
|
||||
* @return PayPal\Api\RedirectUrls
|
||||
*/
|
||||
public function getRedirectUrls() {
|
||||
return $this->redirect_urls;
|
||||
}
|
||||
$allowedParams = array(
|
||||
'count' => 1,
|
||||
'start_id' => 1,
|
||||
'start_index' => 1,
|
||||
'start_time' => 1,
|
||||
'end_time' => 1,
|
||||
'payee_id' => 1,
|
||||
'sort_by' => 1,
|
||||
'sort_order' => 1,
|
||||
);
|
||||
|
||||
/**
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls.
|
||||
* @param PayPal\Api\RedirectUrls $redirect_urls
|
||||
* @deprecated. Instead use setRedirectUrls
|
||||
*/
|
||||
public function setRedirect_urls($redirect_urls) {
|
||||
$this->redirect_urls = $redirect_urls;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls.
|
||||
* @return PayPal\Api\RedirectUrls
|
||||
* @deprecated. Instead use getRedirectUrls
|
||||
*/
|
||||
public function getRedirect_urls() {
|
||||
return $this->redirect_urls;
|
||||
}
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @array
|
||||
* @param PayPal\Api\Links $links
|
||||
*/
|
||||
public function setLinks($links) {
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks() {
|
||||
return $this->links;
|
||||
}
|
||||
$ret = new PaymentHistory();
|
||||
$ret->fromJson($json);
|
||||
|
||||
|
||||
|
||||
public function create($apiContext = null) {
|
||||
$payLoad = $this->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment", "POST", $payLoad);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function get($paymentId, $apiContext = null) {
|
||||
if (($paymentId == null) || (strlen($paymentId) <= 0)) {
|
||||
throw new \InvalidArgumentException("paymentId cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment/$paymentId", "GET", $payLoad);
|
||||
$ret = new Payment();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function execute($paymentExecution, $apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
if (($paymentExecution == null)) {
|
||||
throw new \InvalidArgumentException("paymentExecution cannot be null or empty");
|
||||
}
|
||||
$payLoad = $paymentExecution->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment/{$this->getId()}/execute", "POST", $payLoad);
|
||||
$ret = new Payment();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function all($params, $apiContext = null) {
|
||||
if (($params == null)) {
|
||||
throw new \InvalidArgumentException("params cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
$allowedParams = array('count' => 1, 'start_id' => 1, 'start_index' => 1, 'start_time' => 1, 'end_time' => 1, 'payee_id' => 1, 'sort_by' => 1, 'sort_order' => 1, );
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad);
|
||||
$ret = new PaymentHistory();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
166
lib/PayPal/Api/PaymentDetail.php
Normal file
166
lib/PayPal/Api/PaymentDetail.php
Normal file
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class PaymentDetail extends PPModel {
|
||||
/**
|
||||
* PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility.
|
||||
*
|
||||
* @param string $type
|
||||
*/
|
||||
public function setType($type) {
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType() {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PayPal payment transaction id. Mandatory field in case the type value is PAYPAL.
|
||||
*
|
||||
* @param string $transaction_id
|
||||
*/
|
||||
public function setTransactionId($transaction_id) {
|
||||
$this->transaction_id = $transaction_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal payment transaction id. Mandatory field in case the type value is PAYPAL.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTransactionId() {
|
||||
return $this->transaction_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal payment transaction id. Mandatory field in case the type value is PAYPAL.
|
||||
*
|
||||
* @param string $transaction_id
|
||||
* @deprecated. Instead use setTransactionId
|
||||
*/
|
||||
public function setTransaction_id($transaction_id) {
|
||||
$this->transaction_id = $transaction_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* PayPal payment transaction id. Mandatory field in case the type value is PAYPAL.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getTransactionId
|
||||
*/
|
||||
public function getTransaction_id() {
|
||||
return $this->transaction_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the transaction.
|
||||
*
|
||||
* @param string $transaction_type
|
||||
*/
|
||||
public function setTransactionType($transaction_type) {
|
||||
$this->transaction_type = $transaction_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTransactionType() {
|
||||
return $this->transaction_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the transaction.
|
||||
*
|
||||
* @param string $transaction_type
|
||||
* @deprecated. Instead use setTransactionType
|
||||
*/
|
||||
public function setTransaction_type($transaction_type) {
|
||||
$this->transaction_type = $transaction_type;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Type of the transaction.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getTransactionType
|
||||
*/
|
||||
public function getTransaction_type() {
|
||||
return $this->transaction_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST.
|
||||
*
|
||||
* @param string $date
|
||||
*/
|
||||
public function setDate($date) {
|
||||
$this->date = $date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDate() {
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Payment mode or method. This field is mandatory if the value of the type field is OTHER.
|
||||
*
|
||||
* @param string $method
|
||||
*/
|
||||
public function setMethod($method) {
|
||||
$this->method = $method;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment mode or method. This field is mandatory if the value of the type field is OTHER.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMethod() {
|
||||
return $this->method;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Optional note associated with the payment.
|
||||
*
|
||||
* @param string $note
|
||||
*/
|
||||
public function setNote($note) {
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional note associated with the payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote() {
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,61 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class PaymentExecution extends PPModel {
|
||||
/**
|
||||
* PayPal assigned Payer ID returned in the approval return url.
|
||||
* @param string $payer_id
|
||||
*/
|
||||
public function setPayerId($payer_id) {
|
||||
$this->payer_id = $payer_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class PaymentExecution
|
||||
*
|
||||
* @property string payer_id
|
||||
* @property \PayPal\Api\Transactions transactions
|
||||
*/
|
||||
class PaymentExecution extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Payer ID
|
||||
* PayPal assigned Payer ID returned in the approval return url
|
||||
*
|
||||
* @param string $payer_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerId($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
|
||||
/**
|
||||
* PayPal assigned Payer ID returned in the approval return url.
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerId() {
|
||||
return $this->payer_id;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal assigned Payer ID returned in the approval return url.
|
||||
* @param string $payer_id
|
||||
* @deprecated. Instead use setPayerId
|
||||
*/
|
||||
public function setPayer_id($payer_id) {
|
||||
$this->payer_id = $payer_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* PayPal assigned Payer ID returned in the approval return url.
|
||||
* @return string
|
||||
* @deprecated. Instead use getPayerId
|
||||
*/
|
||||
public function getPayer_id() {
|
||||
return $this->payer_id;
|
||||
}
|
||||
/**
|
||||
* Get Payer ID
|
||||
* PayPal assigned Payer ID returned in the approval return url
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerId()
|
||||
{
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the amount needs to be updated after obtaining the PayPal Payer info (eg. shipping address), it can be updated using this element.
|
||||
* @array
|
||||
* @param PayPal\Api\Transactions $transactions
|
||||
*/
|
||||
public function setTransactions($transactions) {
|
||||
$this->transactions = $transactions;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Payer ID
|
||||
* PayPal assigned Payer ID returned in the approval return url
|
||||
*
|
||||
* @param string $payer_id
|
||||
*
|
||||
* @deprecated Use setPayerId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayer_id($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
|
||||
/**
|
||||
* If the amount needs to be updated after obtaining the PayPal Payer info (eg. shipping address), it can be updated using this element.
|
||||
* @return PayPal\Api\Transactions
|
||||
*/
|
||||
public function getTransactions() {
|
||||
return $this->transactions;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payer ID
|
||||
* PayPal assigned Payer ID returned in the approval return url
|
||||
*
|
||||
* @deprecated Use getPayerId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayer_id()
|
||||
{
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Transactions
|
||||
* If the amount needs to be updated after obtaining the PayPal Payer info (eg. shipping address), it can be updated using this element
|
||||
*
|
||||
* @param \PayPal\Api\Transactions $transactions
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTransactions($transactions)
|
||||
{
|
||||
$this->transactions = $transactions;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Transactions
|
||||
* If the amount needs to be updated after obtaining the PayPal Payer info (eg. shipping address), it can be updated using this element
|
||||
*
|
||||
* @return \PayPal\Api\Transactions
|
||||
*/
|
||||
public function getTransactions()
|
||||
{
|
||||
return $this->transactions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,79 +1,124 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class PaymentHistory extends PPModel {
|
||||
/**
|
||||
* A list of Payment resources
|
||||
* @array
|
||||
* @param PayPal\Api\Payment $payments
|
||||
*/
|
||||
public function setPayments($payments) {
|
||||
$this->payments = $payments;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class PaymentHistory
|
||||
*
|
||||
* @property \PayPal\Api\Payment payments
|
||||
* @property int count
|
||||
* @property string next_id
|
||||
*/
|
||||
class PaymentHistory extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Payments
|
||||
* A list of Payment resources
|
||||
*
|
||||
* @param \PayPal\Api\Payment $payments
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayments($payments)
|
||||
{
|
||||
$this->payments = $payments;
|
||||
|
||||
/**
|
||||
* A list of Payment resources
|
||||
* @return PayPal\Api\Payment
|
||||
*/
|
||||
public function getPayments() {
|
||||
return $this->payments;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payments
|
||||
* A list of Payment resources
|
||||
*
|
||||
* @return \PayPal\Api\Payment
|
||||
*/
|
||||
public function getPayments()
|
||||
{
|
||||
return $this->payments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
* @param integer $count
|
||||
*/
|
||||
public function setCount($count) {
|
||||
$this->count = $count;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Count
|
||||
* Number of items returned in each range of results
|
||||
* Note that the last results range could have fewer items than the requested number of items
|
||||
*
|
||||
* @param int $count
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCount($count)
|
||||
{
|
||||
$this->count = $count;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
* @return integer
|
||||
*/
|
||||
public function getCount() {
|
||||
return $this->count;
|
||||
}
|
||||
/**
|
||||
* Get Count
|
||||
* Number of items returned in each range of results
|
||||
* Note that the last results range could have fewer items than the requested number of items
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCount()
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Next ID
|
||||
* Identifier of the next element to get the next range of results
|
||||
*
|
||||
* @param string $next_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNextId($next_id)
|
||||
{
|
||||
$this->next_id = $next_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
* @param string $next_id
|
||||
*/
|
||||
public function setNextId($next_id) {
|
||||
$this->next_id = $next_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Get Next ID
|
||||
* Identifier of the next element to get the next range of results
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNextId()
|
||||
{
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
* @return string
|
||||
*/
|
||||
public function getNextId() {
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
* @param string $next_id
|
||||
* @deprecated. Instead use setNextId
|
||||
*/
|
||||
public function setNext_id($next_id) {
|
||||
$this->next_id = $next_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
* @return string
|
||||
* @deprecated. Instead use getNextId
|
||||
*/
|
||||
public function getNext_id() {
|
||||
return $this->next_id;
|
||||
}
|
||||
/**
|
||||
* Set Next ID
|
||||
* Identifier of the next element to get the next range of results
|
||||
*
|
||||
* @param string $next_id
|
||||
*
|
||||
* @deprecated Use setNextId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNext_id($next_id)
|
||||
{
|
||||
$this->next_id = $next_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Next ID
|
||||
* Identifier of the next element to get the next range of results
|
||||
*
|
||||
* @deprecated Use getNextId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNext_id()
|
||||
{
|
||||
return $this->next_id;
|
||||
}
|
||||
}
|
||||
|
||||
86
lib/PayPal/Api/PaymentTerm.php
Normal file
86
lib/PayPal/Api/PaymentTerm.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class PaymentTerm extends PPModel {
|
||||
/**
|
||||
* Terms by which the invoice payment is due.
|
||||
*
|
||||
* @param string $term_type
|
||||
*/
|
||||
public function setTermType($term_type) {
|
||||
$this->term_type = $term_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Terms by which the invoice payment is due.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTermType() {
|
||||
return $this->term_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Terms by which the invoice payment is due.
|
||||
*
|
||||
* @param string $term_type
|
||||
* @deprecated. Instead use setTermType
|
||||
*/
|
||||
public function setTerm_type($term_type) {
|
||||
$this->term_type = $term_type;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Terms by which the invoice payment is due.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getTermType
|
||||
*/
|
||||
public function getTerm_type() {
|
||||
return $this->term_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date on which invoice payment is due. It must be always a future date. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST
|
||||
*
|
||||
* @param string $due_date
|
||||
*/
|
||||
public function setDueDate($due_date) {
|
||||
$this->due_date = $due_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date on which invoice payment is due. It must be always a future date. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDueDate() {
|
||||
return $this->due_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date on which invoice payment is due. It must be always a future date. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST
|
||||
*
|
||||
* @param string $due_date
|
||||
* @deprecated. Instead use setDueDate
|
||||
*/
|
||||
public function setDue_date($due_date) {
|
||||
$this->due_date = $due_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Date on which invoice payment is due. It must be always a future date. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getDueDate
|
||||
*/
|
||||
public function getDue_date() {
|
||||
return $this->due_date;
|
||||
}
|
||||
|
||||
}
|
||||
86
lib/PayPal/Api/Phone.php
Normal file
86
lib/PayPal/Api/Phone.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Phone extends PPModel {
|
||||
/**
|
||||
* Country code (in E.164 format). Assume length is n.
|
||||
*
|
||||
* @param string $country_code
|
||||
*/
|
||||
public function setCountryCode($country_code) {
|
||||
$this->country_code = $country_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Country code (in E.164 format). Assume length is n.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCountryCode() {
|
||||
return $this->country_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Country code (in E.164 format). Assume length is n.
|
||||
*
|
||||
* @param string $country_code
|
||||
* @deprecated. Instead use setCountryCode
|
||||
*/
|
||||
public function setCountry_code($country_code) {
|
||||
$this->country_code = $country_code;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Country code (in E.164 format). Assume length is n.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getCountryCode
|
||||
*/
|
||||
public function getCountry_code() {
|
||||
return $this->country_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* In-country phone number (in E.164 format). Maximum (15 - n) digits.
|
||||
*
|
||||
* @param string $national_number
|
||||
*/
|
||||
public function setNationalNumber($national_number) {
|
||||
$this->national_number = $national_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* In-country phone number (in E.164 format). Maximum (15 - n) digits.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNationalNumber() {
|
||||
return $this->national_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* In-country phone number (in E.164 format). Maximum (15 - n) digits.
|
||||
*
|
||||
* @param string $national_number
|
||||
* @deprecated. Instead use setNationalNumber
|
||||
*/
|
||||
public function setNational_number($national_number) {
|
||||
$this->national_number = $national_number;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* In-country phone number (in E.164 format). Maximum (15 - n) digits.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getNationalNumber
|
||||
*/
|
||||
public function getNational_number() {
|
||||
return $this->national_number;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,77 +1,136 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class RedirectUrls extends PPModel {
|
||||
/**
|
||||
* Url where the payer would be redirected to after approving the payment.
|
||||
* @param string $return_url
|
||||
*/
|
||||
public function setReturnUrl($return_url) {
|
||||
$this->return_url = $return_url;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class RedirectUrls
|
||||
*
|
||||
* @property string return_url
|
||||
* @property string cancel_url
|
||||
*/
|
||||
class RedirectUrls extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Return URL
|
||||
* Url where the payer would be redirected to after approving the payment
|
||||
*
|
||||
* @param string $return_url
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReturnUrl($return_url)
|
||||
{
|
||||
if(filter_var($return_url, FILTER_VALIDATE_URL) === false)
|
||||
{
|
||||
throw new \InvalidArgumentException("Return URL is not a fully qualified URL");
|
||||
}
|
||||
|
||||
/**
|
||||
* Url where the payer would be redirected to after approving the payment.
|
||||
* @return string
|
||||
*/
|
||||
public function getReturnUrl() {
|
||||
return $this->return_url;
|
||||
}
|
||||
$this->return_url = $return_url;
|
||||
|
||||
/**
|
||||
* Url where the payer would be redirected to after approving the payment.
|
||||
* @param string $return_url
|
||||
* @deprecated. Instead use setReturnUrl
|
||||
*/
|
||||
public function setReturn_url($return_url) {
|
||||
$this->return_url = $return_url;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Url where the payer would be redirected to after approving the payment.
|
||||
* @return string
|
||||
* @deprecated. Instead use getReturnUrl
|
||||
*/
|
||||
public function getReturn_url() {
|
||||
return $this->return_url;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Url where the payer would be redirected to after canceling the payment.
|
||||
* @param string $cancel_url
|
||||
*/
|
||||
public function setCancelUrl($cancel_url) {
|
||||
$this->cancel_url = $cancel_url;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Get Return URL
|
||||
* Url where the payer would be redirected to after approving the payment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReturnUrl()
|
||||
{
|
||||
return $this->return_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Url where the payer would be redirected to after canceling the payment.
|
||||
* @return string
|
||||
*/
|
||||
public function getCancelUrl() {
|
||||
return $this->cancel_url;
|
||||
}
|
||||
/**
|
||||
* Set Return URL
|
||||
* Url where the payer would be redirected to after approving the payment
|
||||
*
|
||||
* @param string $return_url
|
||||
*
|
||||
* @deprecated Use setReturnUrl
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReturn_url($return_url)
|
||||
{
|
||||
$this->return_url = $return_url;
|
||||
|
||||
/**
|
||||
* Url where the payer would be redirected to after canceling the payment.
|
||||
* @param string $cancel_url
|
||||
* @deprecated. Instead use setCancelUrl
|
||||
*/
|
||||
public function setCancel_url($cancel_url) {
|
||||
$this->cancel_url = $cancel_url;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Url where the payer would be redirected to after canceling the payment.
|
||||
* @return string
|
||||
* @deprecated. Instead use getCancelUrl
|
||||
*/
|
||||
public function getCancel_url() {
|
||||
return $this->cancel_url;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Return URL
|
||||
* Url where the payer would be redirected to after approving the payment
|
||||
*
|
||||
* @deprecated Use getReturnUrl
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReturn_url()
|
||||
{
|
||||
return $this->return_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Cancel URL
|
||||
* Url where the payer would be redirected to after canceling the payment
|
||||
*
|
||||
* @param string $cancel_url
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCancelUrl($cancel_url)
|
||||
{
|
||||
if(filter_var($cancel_url, FILTER_VALIDATE_URL) === false)
|
||||
{
|
||||
throw new \InvalidArgumentException("Cancel URL is not a fully qualified URL");
|
||||
}
|
||||
$this->cancel_url = $cancel_url;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Cancel URL
|
||||
* Url where the payer would be redirected to after canceling the payment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCancelUrl()
|
||||
{
|
||||
return $this->cancel_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Cancel URL
|
||||
* Url where the payer would be redirected to after canceling the payment
|
||||
*
|
||||
* @param string $cancel_url
|
||||
*
|
||||
* @deprecated Use setCancelUrl
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCancel_url($cancel_url)
|
||||
{
|
||||
$this->cancel_url = $cancel_url;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Cancel URL
|
||||
* Url where the payer would be redirected to after canceling the payment
|
||||
*
|
||||
* @deprecated Use getCancelUrl
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCancel_url()
|
||||
{
|
||||
return $this->cancel_url;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,251 +1,398 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Rest\Call;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Api\Refund;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
|
||||
class Refund extends PPModel implements IResource {
|
||||
/**
|
||||
* Class Refund
|
||||
*
|
||||
* @property string id
|
||||
* @property string create_time
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string state
|
||||
* @property string sale_id
|
||||
* @property string capture_id
|
||||
* @property string parent_payment
|
||||
* @property \PayPal\Api\Links links
|
||||
*/
|
||||
class Refund extends PPModel implements IResource
|
||||
{
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
private static $credential;
|
||||
|
||||
private static $credential;
|
||||
/**
|
||||
* Set Credential
|
||||
*
|
||||
* @param $credential
|
||||
*
|
||||
* @deprecated Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
public static function setCredential($credential)
|
||||
{
|
||||
self::$credential = $credential;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated. Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
public static function setCredential($credential) {
|
||||
self::$credential = $credential;
|
||||
}
|
||||
/**
|
||||
* Set ID
|
||||
* Identifier of the refund transaction
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
/**
|
||||
* Identifier of the refund transaction.
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the refund transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
/**
|
||||
* Get ID
|
||||
* Identifier of the refund transaction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
*/
|
||||
public function setCreateTime($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime() {
|
||||
return $this->create_time;
|
||||
}
|
||||
/**
|
||||
* Get Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
* @deprecated. Instead use setCreateTime
|
||||
*/
|
||||
public function setCreate_time($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
* @deprecated. Instead use getCreateTime
|
||||
*/
|
||||
public function getCreate_time() {
|
||||
return $this->create_time;
|
||||
}
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @deprecated Use setCreateTime
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreate_time($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
|
||||
/**
|
||||
* Details including both refunded amount (to Payer) and refunded fee (to Payee).If amount is not specified, it's assumed to be full refund.
|
||||
* @param PayPal\Api\Amount $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Details including both refunded amount (to Payer) and refunded fee (to Payee).If amount is not specified, it's assumed to be full refund.
|
||||
* @return PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount() {
|
||||
return $this->amount;
|
||||
}
|
||||
/**
|
||||
* Get Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @deprecated Use getCreateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreate_time()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Amount
|
||||
* Details including both refunded amount (to Payer) and refunded fee (to Payee)
|
||||
* If amount is not specified, it's assumed to be full refund
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
/**
|
||||
* State of the refund transaction.
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the refund transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
/**
|
||||
* Get Amount
|
||||
* Details including both refunded amount (to Payer) and refunded fee (to Payee)
|
||||
* If amount is not specified, it's assumed to be full refund
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set State
|
||||
* State of the refund transaction
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
/**
|
||||
* ID of the Sale transaction being refunded.
|
||||
* @param string $sale_id
|
||||
*/
|
||||
public function setSaleId($sale_id) {
|
||||
$this->sale_id = $sale_id;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Sale transaction being refunded.
|
||||
* @return string
|
||||
*/
|
||||
public function getSaleId() {
|
||||
return $this->sale_id;
|
||||
}
|
||||
/**
|
||||
* Get State
|
||||
* State of the refund transaction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Sale transaction being refunded.
|
||||
* @param string $sale_id
|
||||
* @deprecated. Instead use setSaleId
|
||||
*/
|
||||
public function setSale_id($sale_id) {
|
||||
$this->sale_id = $sale_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* ID of the Sale transaction being refunded.
|
||||
* @return string
|
||||
* @deprecated. Instead use getSaleId
|
||||
*/
|
||||
public function getSale_id() {
|
||||
return $this->sale_id;
|
||||
}
|
||||
/**
|
||||
* Set Sale ID
|
||||
* ID of the Sale transaction being refunded
|
||||
*
|
||||
* @param string $sale_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSaleId($sale_id)
|
||||
{
|
||||
$this->sale_id = $sale_id;
|
||||
|
||||
/**
|
||||
* ID of the Capture transaction being refunded.
|
||||
* @param string $capture_id
|
||||
*/
|
||||
public function setCaptureId($capture_id) {
|
||||
$this->capture_id = $capture_id;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Capture transaction being refunded.
|
||||
* @return string
|
||||
*/
|
||||
public function getCaptureId() {
|
||||
return $this->capture_id;
|
||||
}
|
||||
/**
|
||||
* Get Sale ID
|
||||
* ID of the Sale transaction being refunded
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSaleId()
|
||||
{
|
||||
return $this->sale_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Capture transaction being refunded.
|
||||
* @param string $capture_id
|
||||
* @deprecated. Instead use setCaptureId
|
||||
*/
|
||||
public function setCapture_id($capture_id) {
|
||||
$this->capture_id = $capture_id;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* ID of the Capture transaction being refunded.
|
||||
* @return string
|
||||
* @deprecated. Instead use getCaptureId
|
||||
*/
|
||||
public function getCapture_id() {
|
||||
return $this->capture_id;
|
||||
}
|
||||
/**
|
||||
* Set Sale ID
|
||||
* ID of the Sale transaction being refunded
|
||||
*
|
||||
* @param string $sale_id
|
||||
*
|
||||
* @deprecated Use setSaleId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSale_id($sale_id)
|
||||
{
|
||||
$this->sale_id = $sale_id;
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @param string $parent_payment
|
||||
*/
|
||||
public function setParentPayment($parent_payment) {
|
||||
$this->parent_payment = $parent_payment;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @return string
|
||||
*/
|
||||
public function getParentPayment() {
|
||||
return $this->parent_payment;
|
||||
}
|
||||
/**
|
||||
* Get Sale ID
|
||||
* ID of the Sale transaction being refunded
|
||||
*
|
||||
* @deprecated Use getSaleId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSale_id()
|
||||
{
|
||||
return $this->sale_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @param string $parent_payment
|
||||
* @deprecated. Instead use setParentPayment
|
||||
*/
|
||||
public function setParent_payment($parent_payment) {
|
||||
$this->parent_payment = $parent_payment;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @return string
|
||||
* @deprecated. Instead use getParentPayment
|
||||
*/
|
||||
public function getParent_payment() {
|
||||
return $this->parent_payment;
|
||||
}
|
||||
/**
|
||||
* Set Capture ID
|
||||
* ID of the Capture transaction being refunded
|
||||
*
|
||||
* @param string $capture_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCaptureId($capture_id)
|
||||
{
|
||||
$this->capture_id = $capture_id;
|
||||
|
||||
/**
|
||||
*
|
||||
* @array
|
||||
* @param PayPal\Api\Links $links
|
||||
*/
|
||||
public function setLinks($links) {
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks() {
|
||||
return $this->links;
|
||||
}
|
||||
/**
|
||||
* Get Capture ID
|
||||
* ID of the Capture transaction being refunded
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCaptureId()
|
||||
{
|
||||
return $this->capture_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Capture ID
|
||||
* ID of the Capture transaction being refunded
|
||||
*
|
||||
* @param string $capture_id
|
||||
*
|
||||
* @deprecated Use setCaptureId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCapture_id($capture_id)
|
||||
{
|
||||
$this->capture_id = $capture_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function get($refundId, $apiContext = null) {
|
||||
if (($refundId == null) || (strlen($refundId) <= 0)) {
|
||||
throw new \InvalidArgumentException("refundId cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/refund/$refundId", "GET", $payLoad);
|
||||
$ret = new Refund();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
/**
|
||||
* Get Capture ID
|
||||
* ID of the Capture transaction being refunded
|
||||
*
|
||||
* @deprecated Use getCaptureId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCapture_id()
|
||||
{
|
||||
return $this->capture_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentPayment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getParentPayment()
|
||||
{
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
* @deprecated Use setParentPayment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParent_payment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @deprecated Use getParentPayment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getParent_payment()
|
||||
{
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Links
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get
|
||||
*
|
||||
* @param $refundId
|
||||
* @param null $apiContext
|
||||
*
|
||||
* @return Refund
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function get($refundId, $apiContext = null)
|
||||
{
|
||||
if (($refundId == null) || (strlen($refundId) <= 0)) {
|
||||
throw new \InvalidArgumentException("refundId cannot be null or empty");
|
||||
}
|
||||
|
||||
$payLoad = "";
|
||||
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/refund/$refundId", "GET", $payLoad);
|
||||
|
||||
$ret = new Refund();
|
||||
$ret->fromJson($json);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
68
lib/PayPal/Api/RefundDetail.php
Normal file
68
lib/PayPal/Api/RefundDetail.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class RefundDetail extends PPModel {
|
||||
/**
|
||||
* PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility.
|
||||
*
|
||||
* @param string $type
|
||||
*/
|
||||
public function setType($type) {
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType() {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date.
|
||||
*
|
||||
* @param string $date
|
||||
*/
|
||||
public function setDate($date) {
|
||||
$this->date = $date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDate() {
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Optional note associated with the refund.
|
||||
*
|
||||
* @param string $note
|
||||
*/
|
||||
public function setNote($note) {
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional note associated with the refund.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote() {
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,79 +1,141 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class RelatedResources extends PPModel {
|
||||
/**
|
||||
* A sale transaction
|
||||
* @param PayPal\Api\Sale $sale
|
||||
*/
|
||||
public function setSale($sale) {
|
||||
$this->sale = $sale;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class RelatedResources
|
||||
*
|
||||
* @property \PayPal\Api\Sale sale
|
||||
* @property \PayPal\Api\Authorization authorization
|
||||
* @property \PayPal\Api\Capture capture
|
||||
* @property \PayPal\Api\Refund refund
|
||||
*/
|
||||
class RelatedResources extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Sale
|
||||
* A sale transaction
|
||||
*
|
||||
* @param \PayPal\Api\Sale $sale
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSale($sale)
|
||||
{
|
||||
$this->sale = $sale;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A sale transaction
|
||||
* @return PayPal\Api\Sale
|
||||
*/
|
||||
public function getSale() {
|
||||
return $this->sale;
|
||||
}
|
||||
/**
|
||||
* Get Sale
|
||||
* A sale transaction
|
||||
*
|
||||
* @return \PayPal\Api\Sale
|
||||
*/
|
||||
public function getSale()
|
||||
{
|
||||
return $this->sale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Authorization
|
||||
* An authorization transaction
|
||||
*
|
||||
* @param \PayPal\Api\Authorization $authorization
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAuthorization($authorization)
|
||||
{
|
||||
$this->authorization = $authorization;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An authorization transaction
|
||||
* @param PayPal\Api\Authorization $authorization
|
||||
*/
|
||||
public function setAuthorization($authorization) {
|
||||
$this->authorization = $authorization;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Get Authorization
|
||||
* An authorization transaction
|
||||
*
|
||||
* @return \PayPal\Api\Authorization
|
||||
*/
|
||||
public function getAuthorization()
|
||||
{
|
||||
return $this->authorization;
|
||||
}
|
||||
|
||||
/**
|
||||
* An authorization transaction
|
||||
* @return PayPal\Api\Authorization
|
||||
*/
|
||||
public function getAuthorization() {
|
||||
return $this->authorization;
|
||||
}
|
||||
/**
|
||||
* Set Capture
|
||||
* A capture transaction
|
||||
*
|
||||
* @param \PayPal\Api\Capture $capture
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCapture($capture)
|
||||
{
|
||||
$this->capture = $capture;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Capture
|
||||
* A capture transaction
|
||||
*
|
||||
* @return \PayPal\Api\Capture
|
||||
*/
|
||||
public function getCapture()
|
||||
{
|
||||
return $this->capture;
|
||||
}
|
||||
|
||||
/**
|
||||
* A capture transaction
|
||||
* @param PayPal\Api\Capture $capture
|
||||
*/
|
||||
public function setCapture($capture) {
|
||||
$this->capture = $capture;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Refund
|
||||
* A refund transaction
|
||||
*
|
||||
* @param \PayPal\Api\Refund $refund
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRefund($refund)
|
||||
{
|
||||
$this->refund = $refund;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A capture transaction
|
||||
* @return PayPal\Api\Capture
|
||||
*/
|
||||
public function getCapture() {
|
||||
return $this->capture;
|
||||
}
|
||||
/**
|
||||
* Get Refund
|
||||
* A refund transaction
|
||||
*
|
||||
* @return \PayPal\Api\Refund
|
||||
*/
|
||||
public function getRefund()
|
||||
{
|
||||
return $this->refund;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Order
|
||||
*
|
||||
* @param \PayPal\Api\Order $order
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOrder($order)
|
||||
{
|
||||
$this->order = $order;
|
||||
|
||||
/**
|
||||
* A refund transaction
|
||||
* @param PayPal\Api\Refund $refund
|
||||
*/
|
||||
public function setRefund($refund) {
|
||||
$this->refund = $refund;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A refund transaction
|
||||
* @return PayPal\Api\Refund
|
||||
*/
|
||||
public function getRefund() {
|
||||
return $this->refund;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Order
|
||||
*
|
||||
* @return \PayPal\Api\Order
|
||||
*/
|
||||
public function getOrder()
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,235 +1,374 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Rest\Call;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Api\Sale;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Api\Refund;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
|
||||
class Sale extends PPModel implements IResource {
|
||||
/**
|
||||
* Class Sale
|
||||
*
|
||||
* @property string id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string state
|
||||
* @property string parent_payment
|
||||
* @property \PayPal\Api\Links links
|
||||
*/
|
||||
class Sale extends PPModel implements IResource
|
||||
{
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
private static $credential;
|
||||
|
||||
private static $credential;
|
||||
/**
|
||||
* Set Credential
|
||||
*
|
||||
* @param $credential
|
||||
*
|
||||
* @deprecated Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
public static function setCredential($credential)
|
||||
{
|
||||
self::$credential = $credential;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated. Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
public static function setCredential($credential) {
|
||||
self::$credential = $credential;
|
||||
}
|
||||
/**
|
||||
* Set ID
|
||||
* Identifier of the authorization transaction
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
/**
|
||||
* Identifier of the authorization transaction.
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the authorization transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
/**
|
||||
* Get ID
|
||||
* Identifier of the authorization transaction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
*/
|
||||
public function setCreateTime($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime() {
|
||||
return $this->create_time;
|
||||
}
|
||||
/**
|
||||
* Get Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
* @deprecated. Instead use setCreateTime
|
||||
*/
|
||||
public function setCreate_time($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
* @deprecated. Instead use getCreateTime
|
||||
*/
|
||||
public function getCreate_time() {
|
||||
return $this->create_time;
|
||||
}
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @deprecated Use setCreateTime
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreate_time($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @param string $update_time
|
||||
*/
|
||||
public function setUpdateTime($update_time) {
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime() {
|
||||
return $this->update_time;
|
||||
}
|
||||
/**
|
||||
* Get Create Time
|
||||
* Time the resource was created
|
||||
*
|
||||
* @deprecated Use getCreateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreate_time()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @param string $update_time
|
||||
* @deprecated. Instead use setUpdateTime
|
||||
*/
|
||||
public function setUpdate_time($update_time) {
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
* @return string
|
||||
* @deprecated. Instead use getUpdateTime
|
||||
*/
|
||||
public function getUpdate_time() {
|
||||
return $this->update_time;
|
||||
}
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
|
||||
/**
|
||||
* Amount being collected.
|
||||
* @param PayPal\Api\Amount $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being collected.
|
||||
* @return PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount() {
|
||||
return $this->amount;
|
||||
}
|
||||
/**
|
||||
* Get Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @deprecated Use setUpdateTime
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdate_time($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
|
||||
/**
|
||||
* State of the sale transaction.
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the sale transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
/**
|
||||
* Get Update Time
|
||||
* Time the resource was last updated
|
||||
*
|
||||
* @deprecated Use getUpdateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdate_time()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Amount
|
||||
* Amount being collected
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @param string $parent_payment
|
||||
*/
|
||||
public function setParentPayment($parent_payment) {
|
||||
$this->parent_payment = $parent_payment;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @return string
|
||||
*/
|
||||
public function getParentPayment() {
|
||||
return $this->parent_payment;
|
||||
}
|
||||
/**
|
||||
* Get Amount
|
||||
* Amount being collected
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @param string $parent_payment
|
||||
* @deprecated. Instead use setParentPayment
|
||||
*/
|
||||
public function setParent_payment($parent_payment) {
|
||||
$this->parent_payment = $parent_payment;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @return string
|
||||
* @deprecated. Instead use getParentPayment
|
||||
*/
|
||||
public function getParent_payment() {
|
||||
return $this->parent_payment;
|
||||
}
|
||||
/**
|
||||
* Set State
|
||||
* State of the sale transaction
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
/**
|
||||
*
|
||||
* @array
|
||||
* @param PayPal\Api\Links $links
|
||||
*/
|
||||
public function setLinks($links) {
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks() {
|
||||
return $this->links;
|
||||
}
|
||||
/**
|
||||
* Get State
|
||||
* State of the sale transaction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentPayment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function get($saleId, $apiContext = null) {
|
||||
if (($saleId == null) || (strlen($saleId) <= 0)) {
|
||||
throw new \InvalidArgumentException("saleId cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/sale/$saleId", "GET", $payLoad);
|
||||
$ret = new Sale();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
/**
|
||||
* Get Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getParentPayment()
|
||||
{
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
public function refund($refund, $apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
if (($refund == null)) {
|
||||
throw new \InvalidArgumentException("refund cannot be null or empty");
|
||||
}
|
||||
$payLoad = $refund->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/sale/{$this->getId()}/refund", "POST", $payLoad);
|
||||
$ret = new Refund();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
* @deprecated Use setParentPayment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParent_payment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
*
|
||||
* @deprecated Use getParentPayment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getParent_payment()
|
||||
{
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Links
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get
|
||||
*
|
||||
* @param int $saleId
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return Sale
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function get($saleId, $apiContext = null)
|
||||
{
|
||||
if (($saleId == null) || (strlen($saleId) <= 0)) {
|
||||
throw new \InvalidArgumentException("saleId cannot be null or empty");
|
||||
}
|
||||
|
||||
$payLoad = "";
|
||||
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/sale/$saleId", "GET", $payLoad);
|
||||
|
||||
$ret = new Sale();
|
||||
$ret->fromJson($json);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refund
|
||||
*
|
||||
* @param \Paypal\Api\Refund $refund
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return Refund
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function refund($refund, $apiContext = null)
|
||||
{
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
|
||||
if (($refund == null)) {
|
||||
throw new \InvalidArgumentException("refund cannot be null or empty");
|
||||
}
|
||||
|
||||
$payLoad = $refund->toJSON();
|
||||
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/sale/{$this->getId()}/refund", "POST", $payLoad);
|
||||
|
||||
$ret = new Refund();
|
||||
$ret->fromJson($json);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
673
lib/PayPal/Api/Search.php
Normal file
673
lib/PayPal/Api/Search.php
Normal file
@@ -0,0 +1,673 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Search extends PPModel {
|
||||
/**
|
||||
* Initial letters of the email address.
|
||||
*
|
||||
* @param string $email
|
||||
*/
|
||||
public function setEmail($email) {
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the email address.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail() {
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's first name.
|
||||
*
|
||||
* @param string $recipient_first_name
|
||||
*/
|
||||
public function setRecipientFirstName($recipient_first_name) {
|
||||
$this->recipient_first_name = $recipient_first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's first name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRecipientFirstName() {
|
||||
return $this->recipient_first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's first name.
|
||||
*
|
||||
* @param string $recipient_first_name
|
||||
* @deprecated. Instead use setRecipientFirstName
|
||||
*/
|
||||
public function setRecipient_first_name($recipient_first_name) {
|
||||
$this->recipient_first_name = $recipient_first_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Initial letters of the recipient's first name.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getRecipientFirstName
|
||||
*/
|
||||
public function getRecipient_first_name() {
|
||||
return $this->recipient_first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's last name.
|
||||
*
|
||||
* @param string $recipient_last_name
|
||||
*/
|
||||
public function setRecipientLastName($recipient_last_name) {
|
||||
$this->recipient_last_name = $recipient_last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's last name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRecipientLastName() {
|
||||
return $this->recipient_last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's last name.
|
||||
*
|
||||
* @param string $recipient_last_name
|
||||
* @deprecated. Instead use setRecipientLastName
|
||||
*/
|
||||
public function setRecipient_last_name($recipient_last_name) {
|
||||
$this->recipient_last_name = $recipient_last_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Initial letters of the recipient's last name.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getRecipientLastName
|
||||
*/
|
||||
public function getRecipient_last_name() {
|
||||
return $this->recipient_last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's business name.
|
||||
*
|
||||
* @param string $recipient_business_name
|
||||
*/
|
||||
public function setRecipientBusinessName($recipient_business_name) {
|
||||
$this->recipient_business_name = $recipient_business_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's business name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRecipientBusinessName() {
|
||||
return $this->recipient_business_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial letters of the recipient's business name.
|
||||
*
|
||||
* @param string $recipient_business_name
|
||||
* @deprecated. Instead use setRecipientBusinessName
|
||||
*/
|
||||
public function setRecipient_business_name($recipient_business_name) {
|
||||
$this->recipient_business_name = $recipient_business_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Initial letters of the recipient's business name.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getRecipientBusinessName
|
||||
*/
|
||||
public function getRecipient_business_name() {
|
||||
return $this->recipient_business_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice number that appears on the invoice.
|
||||
*
|
||||
* @param string $number
|
||||
*/
|
||||
public function setNumber($number) {
|
||||
$this->number = $number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice number that appears on the invoice.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNumber() {
|
||||
return $this->number;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Status of the invoice.
|
||||
*
|
||||
* @param string $status
|
||||
*/
|
||||
public function setStatus($status) {
|
||||
$this->status = $status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status of the invoice.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStatus() {
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lower limit of total amount.
|
||||
*
|
||||
* @param PayPal\Api\Currency $lower_total_amount
|
||||
*/
|
||||
public function setLowerTotalAmount($lower_total_amount) {
|
||||
$this->lower_total_amount = $lower_total_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lower limit of total amount.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
*/
|
||||
public function getLowerTotalAmount() {
|
||||
return $this->lower_total_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lower limit of total amount.
|
||||
*
|
||||
* @param PayPal\Api\Currency $lower_total_amount
|
||||
* @deprecated. Instead use setLowerTotalAmount
|
||||
*/
|
||||
public function setLower_total_amount($lower_total_amount) {
|
||||
$this->lower_total_amount = $lower_total_amount;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Lower limit of total amount.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
* @deprecated. Instead use getLowerTotalAmount
|
||||
*/
|
||||
public function getLower_total_amount() {
|
||||
return $this->lower_total_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upper limit of total amount.
|
||||
*
|
||||
* @param PayPal\Api\Currency $upper_total_amount
|
||||
*/
|
||||
public function setUpperTotalAmount($upper_total_amount) {
|
||||
$this->upper_total_amount = $upper_total_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upper limit of total amount.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
*/
|
||||
public function getUpperTotalAmount() {
|
||||
return $this->upper_total_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upper limit of total amount.
|
||||
*
|
||||
* @param PayPal\Api\Currency $upper_total_amount
|
||||
* @deprecated. Instead use setUpperTotalAmount
|
||||
*/
|
||||
public function setUpper_total_amount($upper_total_amount) {
|
||||
$this->upper_total_amount = $upper_total_amount;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Upper limit of total amount.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
* @deprecated. Instead use getUpperTotalAmount
|
||||
*/
|
||||
public function getUpper_total_amount() {
|
||||
return $this->upper_total_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice date.
|
||||
*
|
||||
* @param string $start_invoice_date
|
||||
*/
|
||||
public function setStartInvoiceDate($start_invoice_date) {
|
||||
$this->start_invoice_date = $start_invoice_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStartInvoiceDate() {
|
||||
return $this->start_invoice_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice date.
|
||||
*
|
||||
* @param string $start_invoice_date
|
||||
* @deprecated. Instead use setStartInvoiceDate
|
||||
*/
|
||||
public function setStart_invoice_date($start_invoice_date) {
|
||||
$this->start_invoice_date = $start_invoice_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Start invoice date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getStartInvoiceDate
|
||||
*/
|
||||
public function getStart_invoice_date() {
|
||||
return $this->start_invoice_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice date.
|
||||
*
|
||||
* @param string $end_invoice_date
|
||||
*/
|
||||
public function setEndInvoiceDate($end_invoice_date) {
|
||||
$this->end_invoice_date = $end_invoice_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEndInvoiceDate() {
|
||||
return $this->end_invoice_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice date.
|
||||
*
|
||||
* @param string $end_invoice_date
|
||||
* @deprecated. Instead use setEndInvoiceDate
|
||||
*/
|
||||
public function setEnd_invoice_date($end_invoice_date) {
|
||||
$this->end_invoice_date = $end_invoice_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* End invoice date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getEndInvoiceDate
|
||||
*/
|
||||
public function getEnd_invoice_date() {
|
||||
return $this->end_invoice_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice due date.
|
||||
*
|
||||
* @param string $start_due_date
|
||||
*/
|
||||
public function setStartDueDate($start_due_date) {
|
||||
$this->start_due_date = $start_due_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice due date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStartDueDate() {
|
||||
return $this->start_due_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice due date.
|
||||
*
|
||||
* @param string $start_due_date
|
||||
* @deprecated. Instead use setStartDueDate
|
||||
*/
|
||||
public function setStart_due_date($start_due_date) {
|
||||
$this->start_due_date = $start_due_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Start invoice due date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getStartDueDate
|
||||
*/
|
||||
public function getStart_due_date() {
|
||||
return $this->start_due_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice due date.
|
||||
*
|
||||
* @param string $end_due_date
|
||||
*/
|
||||
public function setEndDueDate($end_due_date) {
|
||||
$this->end_due_date = $end_due_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice due date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEndDueDate() {
|
||||
return $this->end_due_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice due date.
|
||||
*
|
||||
* @param string $end_due_date
|
||||
* @deprecated. Instead use setEndDueDate
|
||||
*/
|
||||
public function setEnd_due_date($end_due_date) {
|
||||
$this->end_due_date = $end_due_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* End invoice due date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getEndDueDate
|
||||
*/
|
||||
public function getEnd_due_date() {
|
||||
return $this->end_due_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice payment date.
|
||||
*
|
||||
* @param string $start_payment_date
|
||||
*/
|
||||
public function setStartPaymentDate($start_payment_date) {
|
||||
$this->start_payment_date = $start_payment_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice payment date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStartPaymentDate() {
|
||||
return $this->start_payment_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice payment date.
|
||||
*
|
||||
* @param string $start_payment_date
|
||||
* @deprecated. Instead use setStartPaymentDate
|
||||
*/
|
||||
public function setStart_payment_date($start_payment_date) {
|
||||
$this->start_payment_date = $start_payment_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Start invoice payment date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getStartPaymentDate
|
||||
*/
|
||||
public function getStart_payment_date() {
|
||||
return $this->start_payment_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice payment date.
|
||||
*
|
||||
* @param string $end_payment_date
|
||||
*/
|
||||
public function setEndPaymentDate($end_payment_date) {
|
||||
$this->end_payment_date = $end_payment_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice payment date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEndPaymentDate() {
|
||||
return $this->end_payment_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice payment date.
|
||||
*
|
||||
* @param string $end_payment_date
|
||||
* @deprecated. Instead use setEndPaymentDate
|
||||
*/
|
||||
public function setEnd_payment_date($end_payment_date) {
|
||||
$this->end_payment_date = $end_payment_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* End invoice payment date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getEndPaymentDate
|
||||
*/
|
||||
public function getEnd_payment_date() {
|
||||
return $this->end_payment_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice creation date.
|
||||
*
|
||||
* @param string $start_creation_date
|
||||
*/
|
||||
public function setStartCreationDate($start_creation_date) {
|
||||
$this->start_creation_date = $start_creation_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice creation date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStartCreationDate() {
|
||||
return $this->start_creation_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start invoice creation date.
|
||||
*
|
||||
* @param string $start_creation_date
|
||||
* @deprecated. Instead use setStartCreationDate
|
||||
*/
|
||||
public function setStart_creation_date($start_creation_date) {
|
||||
$this->start_creation_date = $start_creation_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Start invoice creation date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getStartCreationDate
|
||||
*/
|
||||
public function getStart_creation_date() {
|
||||
return $this->start_creation_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice creation date.
|
||||
*
|
||||
* @param string $end_creation_date
|
||||
*/
|
||||
public function setEndCreationDate($end_creation_date) {
|
||||
$this->end_creation_date = $end_creation_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice creation date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEndCreationDate() {
|
||||
return $this->end_creation_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* End invoice creation date.
|
||||
*
|
||||
* @param string $end_creation_date
|
||||
* @deprecated. Instead use setEndCreationDate
|
||||
*/
|
||||
public function setEnd_creation_date($end_creation_date) {
|
||||
$this->end_creation_date = $end_creation_date;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* End invoice creation date.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getEndCreationDate
|
||||
*/
|
||||
public function getEnd_creation_date() {
|
||||
return $this->end_creation_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset of the search results.
|
||||
*
|
||||
* @param PayPal\Api\number $page
|
||||
*/
|
||||
public function setPage($page) {
|
||||
$this->page = $page;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset of the search results.
|
||||
*
|
||||
* @return PayPal\Api\number
|
||||
*/
|
||||
public function getPage() {
|
||||
return $this->page;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Page size of the search results.
|
||||
*
|
||||
* @param PayPal\Api\number $page_size
|
||||
*/
|
||||
public function setPageSize($page_size) {
|
||||
$this->page_size = $page_size;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Page size of the search results.
|
||||
*
|
||||
* @return PayPal\Api\number
|
||||
*/
|
||||
public function getPageSize() {
|
||||
return $this->page_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Page size of the search results.
|
||||
*
|
||||
* @param PayPal\Api\number $page_size
|
||||
* @deprecated. Instead use setPageSize
|
||||
*/
|
||||
public function setPage_size($page_size) {
|
||||
$this->page_size = $page_size;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Page size of the search results.
|
||||
*
|
||||
* @return PayPal\Api\number
|
||||
* @deprecated. Instead use getPageSize
|
||||
*/
|
||||
public function getPage_size() {
|
||||
return $this->page_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether total count is required in the response.
|
||||
*
|
||||
* @param boolean $total_count_required
|
||||
*/
|
||||
public function setTotalCountRequired($total_count_required) {
|
||||
$this->total_count_required = $total_count_required;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether total count is required in the response.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getTotalCountRequired() {
|
||||
return $this->total_count_required;
|
||||
}
|
||||
|
||||
/**
|
||||
* A flag indicating whether total count is required in the response.
|
||||
*
|
||||
* @param boolean $total_count_required
|
||||
* @deprecated. Instead use setTotalCountRequired
|
||||
*/
|
||||
public function setTotal_count_required($total_count_required) {
|
||||
$this->total_count_required = $total_count_required;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* A flag indicating whether total count is required in the response.
|
||||
*
|
||||
* @return boolean
|
||||
* @deprecated. Instead use getTotalCountRequired
|
||||
*/
|
||||
public function getTotal_count_required() {
|
||||
return $this->total_count_required;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,42 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class ShippingAddress extends Address {
|
||||
/**
|
||||
* Name of the recipient at this address.
|
||||
* @param string $recipient_name
|
||||
*/
|
||||
public function setRecipientName($recipient_name) {
|
||||
$this->recipient_name = $recipient_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class ShippingAddress
|
||||
*
|
||||
* @property string recipient_name
|
||||
*/
|
||||
class ShippingAddress extends Address
|
||||
{
|
||||
/**
|
||||
* Set Recipient Name
|
||||
* Name of the recipient at this address
|
||||
*
|
||||
* @param string $recipient_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRecipientName($recipient_name)
|
||||
{
|
||||
$this->recipient_name = $recipient_name;
|
||||
|
||||
/**
|
||||
* Name of the recipient at this address.
|
||||
* @return string
|
||||
*/
|
||||
public function getRecipientName() {
|
||||
return $this->recipient_name;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the recipient at this address.
|
||||
* @param string $recipient_name
|
||||
* @deprecated. Instead use setRecipientName
|
||||
*/
|
||||
public function setRecipient_name($recipient_name) {
|
||||
$this->recipient_name = $recipient_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Name of the recipient at this address.
|
||||
* @return string
|
||||
* @deprecated. Instead use getRecipientName
|
||||
*/
|
||||
public function getRecipient_name() {
|
||||
return $this->recipient_name;
|
||||
}
|
||||
/**
|
||||
* Get Recipient Name
|
||||
* Name of the recipient at this address
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRecipientName()
|
||||
{
|
||||
return $this->recipient_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Recipient Name
|
||||
* Name of the recipient at this address
|
||||
*
|
||||
* @param string $recipient_name
|
||||
*
|
||||
* @deprecated Use setRecipientName
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRecipient_name($recipient_name)
|
||||
{
|
||||
$this->recipient_name = $recipient_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Recipient Name
|
||||
* Name of the recipient at this address
|
||||
*
|
||||
* @deprecated Use getRecipientName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRecipient_name()
|
||||
{
|
||||
return $this->recipient_name;
|
||||
}
|
||||
}
|
||||
|
||||
48
lib/PayPal/Api/ShippingCost.php
Normal file
48
lib/PayPal/Api/ShippingCost.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class ShippingCost extends PPModel {
|
||||
/**
|
||||
* Shipping cost in amount. Range of 0 to 999999.99.
|
||||
*
|
||||
* @param PayPal\Api\Currency $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping cost in amount. Range of 0 to 999999.99.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount() {
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tax percentage on shipping amount.
|
||||
*
|
||||
* @param PayPal\Api\Tax $tax
|
||||
*/
|
||||
public function setTax($tax) {
|
||||
$this->tax = $tax;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tax percentage on shipping amount.
|
||||
*
|
||||
* @return PayPal\Api\Tax
|
||||
*/
|
||||
public function getTax() {
|
||||
return $this->tax;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
165
lib/PayPal/Api/ShippingInfo.php
Normal file
165
lib/PayPal/Api/ShippingInfo.php
Normal file
@@ -0,0 +1,165 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class ShippingInfo extends PPModel {
|
||||
/**
|
||||
* First name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @param string $first_name
|
||||
*/
|
||||
public function setFirstName($first_name) {
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* First name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName() {
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* First name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @param string $first_name
|
||||
* @deprecated. Instead use setFirstName
|
||||
*/
|
||||
public function setFirst_name($first_name) {
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* First name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getFirstName
|
||||
*/
|
||||
public function getFirst_name() {
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @param string $last_name
|
||||
*/
|
||||
public function setLastName($last_name) {
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName() {
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @param string $last_name
|
||||
* @deprecated. Instead use setLastName
|
||||
*/
|
||||
public function setLast_name($last_name) {
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Last name of the invoice recipient. 30 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getLastName
|
||||
*/
|
||||
public function getLast_name() {
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Company business name of the invoice recipient. 100 characters max.
|
||||
*
|
||||
* @param string $business_name
|
||||
*/
|
||||
public function setBusinessName($business_name) {
|
||||
$this->business_name = $business_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Company business name of the invoice recipient. 100 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBusinessName() {
|
||||
return $this->business_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Company business name of the invoice recipient. 100 characters max.
|
||||
*
|
||||
* @param string $business_name
|
||||
* @deprecated. Instead use setBusinessName
|
||||
*/
|
||||
public function setBusiness_name($business_name) {
|
||||
$this->business_name = $business_name;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Company business name of the invoice recipient. 100 characters max.
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getBusinessName
|
||||
*/
|
||||
public function getBusiness_name() {
|
||||
return $this->business_name;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param PayPal\Api\Phone $phone
|
||||
*/
|
||||
public function setPhone($phone) {
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return PayPal\Api\Phone
|
||||
*/
|
||||
public function getPhone() {
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Address of the invoice recipient.
|
||||
*
|
||||
* @param PayPal\Api\Address $address
|
||||
*/
|
||||
public function setAddress($address) {
|
||||
$this->address = $address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address of the invoice recipient.
|
||||
*
|
||||
* @return PayPal\Api\Address
|
||||
*/
|
||||
public function getAddress() {
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
88
lib/PayPal/Api/Tax.php
Normal file
88
lib/PayPal/Api/Tax.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Tax extends PPModel {
|
||||
/**
|
||||
* Identifier of the resource.
|
||||
*
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Name of the tax. 10 characters max.
|
||||
*
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the tax. 10 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rate of the specified tax. Range of 0.001 to 99.999.
|
||||
*
|
||||
* @param PayPal\Api\number $percent
|
||||
*/
|
||||
public function setPercent($percent) {
|
||||
$this->percent = $percent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rate of the specified tax. Range of 0.001 to 99.999.
|
||||
*
|
||||
* @return PayPal\Api\number
|
||||
*/
|
||||
public function getPercent() {
|
||||
return $this->percent;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tax in the form of money. Cannot be specified in a request.
|
||||
*
|
||||
* @param PayPal\Api\Currency $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tax in the form of money. Cannot be specified in a request.
|
||||
*
|
||||
* @return PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount() {
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,152 +1,316 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Transaction extends PPModel {
|
||||
/**
|
||||
* Amount being collected.
|
||||
* @param PayPal\Api\Amount $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Class Transaction
|
||||
*
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property \PayPal\Api\Payee payee
|
||||
* @property string description
|
||||
* @property \PayPal\Api\ItemList item_list
|
||||
* @property \PayPal\Api\RelatedResources related_resources
|
||||
* @property \PayPal\Api\Transaction transactions
|
||||
* @property string invoice_number
|
||||
* @property string custom
|
||||
* @property string soft_descriptor
|
||||
*/
|
||||
class Transaction extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Amount
|
||||
* Amount being collected
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
/**
|
||||
* Amount being collected.
|
||||
* @return PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount() {
|
||||
return $this->amount;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Amount
|
||||
* Amount being collected
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recepient of the funds in this transaction.
|
||||
* @param PayPal\Api\Payee $payee
|
||||
*/
|
||||
public function setPayee($payee) {
|
||||
$this->payee = $payee;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Payee
|
||||
* Recepient of the funds in this transaction
|
||||
*
|
||||
* @param \PayPal\Api\Payee $payee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayee($payee)
|
||||
{
|
||||
$this->payee = $payee;
|
||||
|
||||
/**
|
||||
* Recepient of the funds in this transaction.
|
||||
* @return PayPal\Api\Payee
|
||||
*/
|
||||
public function getPayee() {
|
||||
return $this->payee;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payee
|
||||
* Recepient of the funds in this transaction
|
||||
*
|
||||
* @return \PayPal\Api\Payee
|
||||
*/
|
||||
public function getPayee()
|
||||
{
|
||||
return $this->payee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of what is being paid for.
|
||||
* @param string $description
|
||||
*/
|
||||
public function setDescription($description) {
|
||||
$this->description = $description;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Description
|
||||
* Description of what is being paid for
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
/**
|
||||
* Description of what is being paid for.
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription() {
|
||||
return $this->description;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Description
|
||||
* Description of what is being paid for
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of items being paid for.
|
||||
* @param PayPal\Api\ItemList $item_list
|
||||
*/
|
||||
public function setItemList($item_list) {
|
||||
$this->item_list = $item_list;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Item List
|
||||
* List of items being paid for
|
||||
*
|
||||
* @param \PayPal\Api\ItemList $item_list
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setItemList($item_list)
|
||||
{
|
||||
$this->item_list = $item_list;
|
||||
|
||||
/**
|
||||
* List of items being paid for.
|
||||
* @return PayPal\Api\ItemList
|
||||
*/
|
||||
public function getItemList() {
|
||||
return $this->item_list;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of items being paid for.
|
||||
* @param PayPal\Api\ItemList $item_list
|
||||
* @deprecated. Instead use setItemList
|
||||
*/
|
||||
public function setItem_list($item_list) {
|
||||
$this->item_list = $item_list;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* List of items being paid for.
|
||||
* @return PayPal\Api\ItemList
|
||||
* @deprecated. Instead use getItemList
|
||||
*/
|
||||
public function getItem_list() {
|
||||
return $this->item_list;
|
||||
}
|
||||
/**
|
||||
* Get Item List
|
||||
* List of items being paid for
|
||||
*
|
||||
* @return \PayPal\Api\ItemList
|
||||
*/
|
||||
public function getItemList()
|
||||
{
|
||||
return $this->item_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment.
|
||||
* @array
|
||||
* @param PayPal\Api\RelatedResources $related_resources
|
||||
*/
|
||||
public function setRelatedResources($related_resources) {
|
||||
$this->related_resources = $related_resources;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Item List
|
||||
* List of items being paid for
|
||||
*
|
||||
* @param \PayPal\Api\ItemList $item_list
|
||||
*
|
||||
* @deprecated Use setItemList
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setItem_list($item_list)
|
||||
{
|
||||
$this->item_list = $item_list;
|
||||
|
||||
/**
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment.
|
||||
* @return PayPal\Api\RelatedResources
|
||||
*/
|
||||
public function getRelatedResources() {
|
||||
return $this->related_resources;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment.
|
||||
* @array
|
||||
* @param PayPal\Api\RelatedResources $related_resources
|
||||
* @deprecated. Instead use setRelatedResources
|
||||
*/
|
||||
public function setRelated_resources($related_resources) {
|
||||
$this->related_resources = $related_resources;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment.
|
||||
* @return PayPal\Api\RelatedResources
|
||||
* @deprecated. Instead use getRelatedResources
|
||||
*/
|
||||
public function getRelated_resources() {
|
||||
return $this->related_resources;
|
||||
}
|
||||
/**
|
||||
* Get Item List
|
||||
* List of items being paid for
|
||||
*
|
||||
* @deprecated Use getItemList
|
||||
*
|
||||
* @return \PayPal\Api\ItemList
|
||||
*/
|
||||
public function getItem_list()
|
||||
{
|
||||
return $this->item_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional transactions for complex payment (Parallel and Chained) scenarios.
|
||||
* @array
|
||||
* @param PayPal\Api\self $transactions
|
||||
*/
|
||||
public function setTransactions($transactions) {
|
||||
$this->transactions = $transactions;
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Set Related Resources
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment
|
||||
*
|
||||
* @param \PayPal\Api\RelatedResources $related_resources
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRelatedResources($related_resources)
|
||||
{
|
||||
$this->related_resources = $related_resources;
|
||||
|
||||
/**
|
||||
* Additional transactions for complex payment (Parallel and Chained) scenarios.
|
||||
* @return PayPal\Api\self
|
||||
*/
|
||||
public function getTransactions() {
|
||||
return $this->transactions;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Related Resources
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment
|
||||
*
|
||||
* @return \PayPal\Api\RelatedResources
|
||||
*/
|
||||
public function getRelatedResources()
|
||||
{
|
||||
return $this->related_resources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Related Resources
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment
|
||||
*
|
||||
* @param \PayPal\Api\RelatedResources $related_resources
|
||||
*
|
||||
* @deprecated Use setRelatedResources
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRelated_resources($related_resources)
|
||||
{
|
||||
$this->related_resources = $related_resources;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Related Resources
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment
|
||||
*
|
||||
* @deprecated Use getRelatedResources
|
||||
*
|
||||
* @return \PayPal\Api\RelatedResources
|
||||
*/
|
||||
public function getRelated_resources()
|
||||
{
|
||||
return $this->related_resources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set invoice number.
|
||||
* Invoice number used to track the payment. 256 characters max.
|
||||
*
|
||||
* @param string $invoiceNumber
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInvoiceNumber($invoiceNumber)
|
||||
{
|
||||
$this->invoice_number = $invoiceNumber;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get invoice number.
|
||||
* Invoice number used to track the payment. 256 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInvoiceNumber()
|
||||
{
|
||||
return $this->invoice_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set free-form field.
|
||||
* Free-form field for the use of clients. 256 characters max.
|
||||
*
|
||||
* @param string $custom
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCustom($custom)
|
||||
{
|
||||
$this->custom = $custom;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get free-form field.
|
||||
* Free-form field for the use of clients. 256 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCustom()
|
||||
{
|
||||
return $this->custom;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set soft descriptor.
|
||||
* Soft descriptor used when charging this funding source. 22 characters max.
|
||||
*
|
||||
* @param string $softDescriptor
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSoftDescriptor($softDescriptor)
|
||||
{
|
||||
$this->soft_descriptor = $softDescriptor;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get soft descriptor.
|
||||
* Soft descriptor used when charging this funding source. 22 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSoftDescriptor()
|
||||
{
|
||||
return $this->soft_descriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Transactions
|
||||
* Additional transactions for complex payment (Parallel and Chained) scenarios
|
||||
*
|
||||
* @param \PayPal\Api\self $transactions
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTransactions($transactions)
|
||||
{
|
||||
$this->transactions = $transactions;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Transactions
|
||||
* Additional transactions for complex payment (Parallel and Chained) scenarios
|
||||
*
|
||||
* @return \PayPal\Api\self
|
||||
*/
|
||||
public function getTransactions()
|
||||
{
|
||||
return $this->transactions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Transactions extends PPModel {
|
||||
/**
|
||||
* Amount being collected.
|
||||
* @param PayPal\Api\Amount $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being collected.
|
||||
* @return PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount() {
|
||||
return $this->amount;
|
||||
}
|
||||
/**
|
||||
* Class Transactions
|
||||
*
|
||||
* @property \PayPal\Api\Amount amount
|
||||
*/
|
||||
class Transactions extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Amount
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Amount
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,137 +1,180 @@
|
||||
<?php
|
||||
/**
|
||||
* Oauth Token credential
|
||||
*/
|
||||
|
||||
namespace PayPal\Auth;
|
||||
|
||||
/**
|
||||
* Oauth Token credential
|
||||
*
|
||||
*/
|
||||
use PayPal\Rest\RestHandler;
|
||||
use PayPal\Common\PPUserAgent;
|
||||
use PayPal\Core\PPLoggingManager;
|
||||
use PayPal\Core\PPConnectionManager;
|
||||
use PayPal\Core\PPConstants;
|
||||
use PayPal\Core\PPHttpConfig;
|
||||
use PayPal\Core\PPConnectionManager;
|
||||
use PayPal\Core\PPLoggingManager;
|
||||
use PayPal\Exception\PPConfigurationException;
|
||||
use PayPal\Rest\RestHandler;
|
||||
|
||||
class OAuthTokenCredential {
|
||||
|
||||
private static $expiryBufferTime = 120;
|
||||
|
||||
private $logger;
|
||||
|
||||
/**
|
||||
* Client ID as obtained from the developer portal
|
||||
*/
|
||||
private $clientId;
|
||||
|
||||
/**
|
||||
* Client secret as obtained from the developer portal
|
||||
*/
|
||||
private $clientSecret;
|
||||
|
||||
|
||||
/**
|
||||
* Generated Access Token
|
||||
*/
|
||||
private $accessToken;
|
||||
|
||||
/**
|
||||
* Seconds for with access token is valid
|
||||
*/
|
||||
private $tokenExpiresIn;
|
||||
|
||||
/**
|
||||
* Last time (in milliseconds) when access token was generated
|
||||
*/
|
||||
private $tokenCreateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $clientId client id obtained from the developer portal
|
||||
* @param string $clientSecret client secret obtained from the developer portal
|
||||
*/
|
||||
public function __construct($clientId, $clientSecret) {
|
||||
$this->clientId = $clientId;
|
||||
$this->clientSecret = $clientSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the accessToken
|
||||
*/
|
||||
public function getAccessToken($config) {
|
||||
/**
|
||||
* Class OAuthTokenCredential
|
||||
*/
|
||||
class OAuthTokenCredential
|
||||
{
|
||||
/**
|
||||
* Private Variable
|
||||
*
|
||||
* @var int $expiryBufferTime
|
||||
*/
|
||||
private static $expiryBufferTime = 120;
|
||||
|
||||
$this->logger = new PPLoggingManager(__CLASS__, $config);
|
||||
// Check if Access Token is not null and has not expired.
|
||||
// The API returns expiry time as a relative time unit
|
||||
// We use a buffer time when checking for token expiry to account
|
||||
// for API call delays and any delay between the time the token is
|
||||
// retrieved and subsequently used
|
||||
if ($this->accessToken != null &&
|
||||
(time() - $this->tokenCreateTime) > ($this->tokenExpiresIn - self::$expiryBufferTime)) {
|
||||
$this->accessToken = null;
|
||||
}
|
||||
// If accessToken is Null, obtain a new token
|
||||
if ($this->accessToken == null) {
|
||||
$this->_generateAccessToken($config);
|
||||
}
|
||||
return $this->accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a new access token
|
||||
*/
|
||||
private function _generateAccessToken($config) {
|
||||
/**
|
||||
* Private Variable
|
||||
*
|
||||
* @var \PayPal\Core\PPLoggingManager $logger
|
||||
*/
|
||||
private $logger;
|
||||
|
||||
$base64ClientID = base64_encode($this->clientId . ":" . $this->clientSecret);
|
||||
$headers = array(
|
||||
"User-Agent" => PPUserAgent::getValue(RestHandler::$sdkName, RestHandler::$sdkVersion),
|
||||
"Authorization" => "Basic " . $base64ClientID,
|
||||
"Accept" => "*/*"
|
||||
);
|
||||
$httpConfiguration = $this->getOAuthHttpConfiguration($config);
|
||||
$httpConfiguration->setHeaders($headers);
|
||||
|
||||
$connection = PPConnectionManager::getInstance()->getConnection($httpConfiguration, $config);
|
||||
$res = $connection->execute("grant_type=client_credentials");
|
||||
$jsonResponse = json_decode($res, true);
|
||||
if($jsonResponse == NULL ||
|
||||
!isset($jsonResponse["access_token"]) || !isset($jsonResponse["expires_in"]) ) {
|
||||
$this->accessToken = NULL;
|
||||
$this->tokenExpiresIn = NULL;
|
||||
$this->logger->warning("Could not generate new Access token. Invalid response from server: " . $jsonResponse);
|
||||
} else {
|
||||
$this->accessToken = $jsonResponse["access_token"];
|
||||
$this->tokenExpiresIn = $jsonResponse["expires_in"];
|
||||
}
|
||||
$this->tokenCreateTime = time();
|
||||
return $this->accessToken;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get HttpConfiguration object for OAuth API
|
||||
*/
|
||||
private function getOAuthHttpConfiguration($config) {
|
||||
if (isset($config['oauth.EndPoint'])) {
|
||||
$baseEndpoint = $config['oauth.EndPoint'];
|
||||
} else if (isset($config['service.EndPoint'])) {
|
||||
$baseEndpoint = $config['service.EndPoint'];
|
||||
} else if (isset($config['mode'])) {
|
||||
switch (strtoupper($config['mode'])) {
|
||||
case 'SANDBOX':
|
||||
$baseEndpoint = PPConstants::REST_SANDBOX_ENDPOINT;
|
||||
break;
|
||||
case 'LIVE':
|
||||
$baseEndpoint = PPConstants::REST_LIVE_ENDPOINT;
|
||||
break;
|
||||
default:
|
||||
throw new PPConfigurationException('The mode config parameter must be set to either sandbox/live');
|
||||
}
|
||||
} else {
|
||||
throw new PPConfigurationException('You must set one of service.endpoint or mode parameters in your configuration');
|
||||
}
|
||||
|
||||
$baseEndpoint = rtrim(trim($baseEndpoint), '/');
|
||||
return new PPHttpConfig($baseEndpoint . "/v1/oauth2/token", "POST");
|
||||
}
|
||||
/**
|
||||
* Client ID as obtained from the developer portal
|
||||
*
|
||||
* @var string $clientId
|
||||
*/
|
||||
private $clientId;
|
||||
|
||||
/**
|
||||
* Client secret as obtained from the developer portal
|
||||
*
|
||||
* @var string $clientSecret
|
||||
*/
|
||||
private $clientSecret;
|
||||
|
||||
/**
|
||||
* Generated Access Token
|
||||
*
|
||||
* @var $accessToken
|
||||
*/
|
||||
private $accessToken;
|
||||
|
||||
/**
|
||||
* Seconds for with access token is valid
|
||||
*
|
||||
* @var $tokenExpiresIn
|
||||
*/
|
||||
private $tokenExpiresIn;
|
||||
|
||||
/**
|
||||
* Last time (in milliseconds) when access token was generated
|
||||
*
|
||||
* @var $tokenCreateTime
|
||||
*/
|
||||
private $tokenCreateTime;
|
||||
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* @param string $clientId client id obtained from the developer portal
|
||||
* @param string $clientSecret client secret obtained from the developer portal
|
||||
*/
|
||||
public function __construct($clientId, $clientSecret)
|
||||
{
|
||||
$this->clientId = $clientId;
|
||||
$this->clientSecret = $clientSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get AccessToken
|
||||
*
|
||||
* @param $config
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getAccessToken($config)
|
||||
{
|
||||
$this->logger = new PPLoggingManager(__CLASS__, $config);
|
||||
|
||||
// Check if Access Token is not null and has not expired.
|
||||
// The API returns expiry time as a relative time unit
|
||||
// We use a buffer time when checking for token expiry to account
|
||||
// for API call delays and any delay between the time the token is
|
||||
// retrieved and subsequently used
|
||||
if ($this->accessToken != null && (time() - $this->tokenCreateTime) > ($this->tokenExpiresIn - self::$expiryBufferTime)) {
|
||||
$this->accessToken = null;
|
||||
}
|
||||
|
||||
// If accessToken is Null, obtain a new token
|
||||
if ($this->accessToken == null) {
|
||||
$this->_generateAccessToken($config);
|
||||
}
|
||||
|
||||
return $this->accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a new access token
|
||||
*
|
||||
* @param $config
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
private function _generateAccessToken($config)
|
||||
{
|
||||
$base64ClientID = base64_encode($this->clientId . ":" . $this->clientSecret);
|
||||
$headers = array(
|
||||
"User-Agent" => PPUserAgent::getValue(RestHandler::$sdkName, RestHandler::$sdkVersion),
|
||||
"Authorization" => "Basic " . $base64ClientID,
|
||||
"Accept" => "*/*"
|
||||
);
|
||||
|
||||
$httpConfiguration = $this->getOAuthHttpConfiguration($config);
|
||||
$httpConfiguration->setHeaders($headers);
|
||||
|
||||
$connection = PPConnectionManager::getInstance()->getConnection($httpConfiguration, $config);
|
||||
$res = $connection->execute("grant_type=client_credentials");
|
||||
$jsonResponse = json_decode($res, true);
|
||||
|
||||
if ($jsonResponse == null || !isset($jsonResponse["access_token"]) || !isset($jsonResponse["expires_in"])) {
|
||||
$this->accessToken = null;
|
||||
$this->tokenExpiresIn = null;
|
||||
$this->logger->warning("Could not generate new Access token. Invalid response from server: " . $jsonResponse);
|
||||
} else {
|
||||
$this->accessToken = $jsonResponse["access_token"];
|
||||
$this->tokenExpiresIn = $jsonResponse["expires_in"];
|
||||
}
|
||||
|
||||
$this->tokenCreateTime = time();
|
||||
|
||||
return $this->accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HttpConfiguration object for OAuth API
|
||||
*
|
||||
* @param array $config
|
||||
*
|
||||
* @return PPHttpConfig
|
||||
* @throws \PayPal\Exception\PPConfigurationException
|
||||
*/
|
||||
private function getOAuthHttpConfiguration($config)
|
||||
{
|
||||
if (isset($config['oauth.EndPoint'])) {
|
||||
$baseEndpoint = $config['oauth.EndPoint'];
|
||||
} else if (isset($config['service.EndPoint'])) {
|
||||
$baseEndpoint = $config['service.EndPoint'];
|
||||
} else if (isset($config['mode'])) {
|
||||
switch (strtoupper($config['mode'])) {
|
||||
case 'SANDBOX':
|
||||
$baseEndpoint = PPConstants::REST_SANDBOX_ENDPOINT;
|
||||
break;
|
||||
case 'LIVE':
|
||||
$baseEndpoint = PPConstants::REST_LIVE_ENDPOINT;
|
||||
break;
|
||||
default:
|
||||
throw new PPConfigurationException('The mode config parameter must be set to either sandbox/live');
|
||||
}
|
||||
} else {
|
||||
throw new PPConfigurationException('You must set one of service.endpoint or mode parameters in your configuration');
|
||||
}
|
||||
|
||||
$baseEndpoint = rtrim(trim($baseEndpoint), '/');
|
||||
|
||||
return new PPHttpConfig($baseEndpoint . "/v1/oauth2/token", "POST");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,75 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
* Call level parameters such as request id, credentials etc
|
||||
*/
|
||||
|
||||
namespace PayPal\Rest;
|
||||
|
||||
use PayPal\Common\PPApiContext;
|
||||
|
||||
/**
|
||||
*
|
||||
* Call level parameters such as
|
||||
* request id, credentials etc
|
||||
* Class ApiContext
|
||||
*/
|
||||
class ApiContext extends PPApiContext {
|
||||
|
||||
/**
|
||||
* OAuth Credentials to use for this call
|
||||
* @var PayPal/Api/OAuthTokenCredential
|
||||
*/
|
||||
private $credential;
|
||||
|
||||
/**
|
||||
* Unique request id to be used for this call
|
||||
* The user can either generate one as per application
|
||||
* needs or let the SDK generate one
|
||||
* @var string
|
||||
*/
|
||||
private $requestId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getCredential() {
|
||||
return $this->credential;
|
||||
}
|
||||
|
||||
public function getrequestId() {
|
||||
if($this->requestId == null) {
|
||||
$this->requestId = $this->generateRequestId();
|
||||
}
|
||||
return $this->requestId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param PayPal/Api/OAuthTokenCredential $credential
|
||||
* @param string $requestId
|
||||
*/
|
||||
public function __construct($credential, $requestId=null) {
|
||||
$this->credential = $credential;
|
||||
$this->requestId = $requestId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a unique per request id that
|
||||
* can be used to set the PayPal-Request-Id header
|
||||
* that is used for idemptency
|
||||
* @return string
|
||||
*/
|
||||
private function generateRequestId() {
|
||||
|
||||
static $pid = -1;
|
||||
static $addr = -1;
|
||||
|
||||
if ($pid == -1) {
|
||||
$pid = getmypid();
|
||||
}
|
||||
if ($addr == -1) {
|
||||
if(array_key_exists('SERVER_ADDR', $_SERVER)) {
|
||||
$addr = ip2long($_SERVER['SERVER_ADDR']);
|
||||
} else {
|
||||
$addr = php_uname('n');
|
||||
}
|
||||
}
|
||||
|
||||
return $addr . $pid . $_SERVER['REQUEST_TIME'] . mt_rand(0, 0xffff);
|
||||
}
|
||||
class ApiContext extends PPApiContext
|
||||
{
|
||||
/**
|
||||
* OAuth Credentials to use for this call
|
||||
*
|
||||
* @var \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
private $credential;
|
||||
|
||||
/**
|
||||
* Unique request id to be used for this call
|
||||
* The user can either generate one as per application
|
||||
* needs or let the SDK generate one
|
||||
*
|
||||
* @var null|string $requestId
|
||||
*/
|
||||
private $requestId;
|
||||
|
||||
/**
|
||||
* Get Credential
|
||||
*
|
||||
* @return \PayPal\Auth\OAuthTokenCredential
|
||||
*/
|
||||
public function getCredential()
|
||||
{
|
||||
return $this->credential;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Request ID
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getrequestId()
|
||||
{
|
||||
if ($this->requestId == null) {
|
||||
$this->requestId = $this->generateRequestId();
|
||||
}
|
||||
|
||||
return $this->requestId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* @param \PayPal\Auth\OAuthTokenCredential $credential
|
||||
* @param string|null $requestId
|
||||
*/
|
||||
public function __construct($credential, $requestId = null)
|
||||
{
|
||||
$this->credential = $credential;
|
||||
$this->requestId = $requestId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a unique per request id that
|
||||
* can be used to set the PayPal-Request-Id header
|
||||
* that is used for idemptency
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function generateRequestId()
|
||||
{
|
||||
static $pid = -1;
|
||||
static $addr = -1;
|
||||
|
||||
if ($pid == -1) {
|
||||
$pid = getmypid();
|
||||
}
|
||||
|
||||
if ($addr == -1) {
|
||||
if (array_key_exists('SERVER_ADDR', $_SERVER)) {
|
||||
$addr = ip2long($_SERVER['SERVER_ADDR']);
|
||||
} else {
|
||||
$addr = php_uname('n');
|
||||
}
|
||||
}
|
||||
|
||||
return $addr . $pid . $_SERVER['REQUEST_TIME'] . mt_rand(0, 0xffff);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace PayPal\Rest;
|
||||
|
||||
interface IResource {
|
||||
|
||||
}
|
||||
/**
|
||||
* Interface IResource
|
||||
*/
|
||||
interface IResource
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,84 +1,131 @@
|
||||
<?php
|
||||
/**
|
||||
* API handler for all REST API calls
|
||||
*/
|
||||
|
||||
namespace PayPal\Rest;
|
||||
|
||||
use PayPal\Auth\OAuthTokenCredential;
|
||||
use PayPal\Handler\IPPHandler;
|
||||
use PayPal\Core\PPCredentialManager;
|
||||
use PayPal\Core\PPConstants;
|
||||
use PayPal\Exception\PPMissingCredentialException;
|
||||
use PayPal\Exception\PPInvalidCredentialException;
|
||||
use PayPal\Exception\PPConfigurationException;
|
||||
use PayPal\Common\PPUserAgent;
|
||||
use PayPal\Core\PPConstants;
|
||||
use PayPal\Core\PPCredentialManager;
|
||||
use PayPal\Exception\PPConfigurationException;
|
||||
use PayPal\Exception\PPInvalidCredentialException;
|
||||
use PayPal\Exception\PPMissingCredentialException;
|
||||
use PayPal\Handler\IPPHandler;
|
||||
|
||||
/**
|
||||
*
|
||||
* API handler for all REST API calls
|
||||
* Class RestHandler
|
||||
*/
|
||||
class RestHandler implements IPPHandler {
|
||||
class RestHandler implements IPPHandler
|
||||
{
|
||||
/**
|
||||
* Private Variable
|
||||
*
|
||||
* @var \Paypal\Rest\ApiContext $apiContext
|
||||
*/
|
||||
private $apiContext;
|
||||
|
||||
private $apiContext;
|
||||
|
||||
public static $sdkName = "rest-sdk-php";
|
||||
public static $sdkVersion = "0.6.0";
|
||||
|
||||
public function __construct($apiContext) {
|
||||
$this->apiContext = $apiContext;
|
||||
}
|
||||
|
||||
public function handle($httpConfig, $request, $options) {
|
||||
|
||||
$credential = $this->apiContext->getCredential();
|
||||
$config = $this->apiContext->getConfig();
|
||||
|
||||
if($credential == NULL) {
|
||||
// Try picking credentials from the config file
|
||||
$credMgr = PPCredentialManager::getInstance($config);
|
||||
$credValues = $credMgr->getCredentialObject();
|
||||
if(!is_array($credValues)) {
|
||||
throw new PPMissingCredentialException("Empty or invalid credentials passed");
|
||||
}
|
||||
$credential = new OAuthTokenCredential($credValues['clientId'], $credValues['clientSecret']);
|
||||
}
|
||||
if($credential == NULL || ! ($credential instanceof OAuthTokenCredential) ) {
|
||||
throw new PPInvalidCredentialException("Invalid credentials passed");
|
||||
}
|
||||
/**
|
||||
* Public Variable
|
||||
*
|
||||
* @var string $sdkName
|
||||
*/
|
||||
public static $sdkName = "rest-sdk-php";
|
||||
|
||||
|
||||
$httpConfig->setUrl(
|
||||
rtrim( trim($this->_getEndpoint($config)), '/') .
|
||||
(isset($options['path']) ? $options['path'] : '')
|
||||
);
|
||||
|
||||
if(!array_key_exists("User-Agent", $httpConfig->getHeaders())) {
|
||||
$httpConfig->addHeader("User-Agent", PPUserAgent::getValue(self::$sdkName, self::$sdkVersion));
|
||||
}
|
||||
if(!is_null($credential) && $credential instanceof OAuthTokenCredential) {
|
||||
$httpConfig->addHeader('Authorization', "Bearer " . $credential->getAccessToken($config));
|
||||
}
|
||||
if($httpConfig->getMethod() == 'POST' || $httpConfig->getMethod() == 'PUT') {
|
||||
$httpConfig->addHeader('PayPal-Request-Id', $this->apiContext->getRequestId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function _getEndpoint($config) {
|
||||
if (isset($config['service.EndPoint'])) {
|
||||
return $config['service.EndPoint'];
|
||||
} else if (isset($config['mode'])) {
|
||||
switch (strtoupper($config['mode'])) {
|
||||
case 'SANDBOX':
|
||||
return PPConstants::REST_SANDBOX_ENDPOINT;
|
||||
break;
|
||||
case 'LIVE':
|
||||
return PPConstants::REST_LIVE_ENDPOINT;
|
||||
break;
|
||||
default:
|
||||
throw new PPConfigurationException('The mode config parameter must be set to either sandbox/live');
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
throw new PPConfigurationException('You must set one of service.endpoint or mode parameters in your configuration');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Public Variable
|
||||
*
|
||||
* @var string $sdkVersion
|
||||
*/
|
||||
public static $sdkVersion = "0.6.0";
|
||||
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
* @param \Paypal\Rest\ApiContext $apiContext
|
||||
*/
|
||||
public function __construct($apiContext)
|
||||
{
|
||||
$this->apiContext = $apiContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle
|
||||
*
|
||||
* @param \PayPal\Core\PPHttpConfig $httpConfig
|
||||
* @param \PayPal\Core\PPRequest $request
|
||||
* @param array $options
|
||||
*
|
||||
* @throws \PayPal\Exception\PPInvalidCredentialException
|
||||
* @throws \PayPal\Exception\PPMissingCredentialException
|
||||
*/
|
||||
public function handle($httpConfig, $request, $options)
|
||||
{
|
||||
|
||||
$credential = $this->apiContext->getCredential();
|
||||
$config = $this->apiContext->getConfig();
|
||||
|
||||
if ($credential == null) {
|
||||
// Try picking credentials from the config file
|
||||
$credMgr = PPCredentialManager::getInstance($config);
|
||||
$credValues = $credMgr->getCredentialObject();
|
||||
|
||||
if (!is_array($credValues)) {
|
||||
throw new PPMissingCredentialException("Empty or invalid credentials passed");
|
||||
}
|
||||
|
||||
$credential = new OAuthTokenCredential($credValues['clientId'], $credValues['clientSecret']);
|
||||
}
|
||||
|
||||
if ($credential == null || !($credential instanceof OAuthTokenCredential)) {
|
||||
throw new PPInvalidCredentialException("Invalid credentials passed");
|
||||
}
|
||||
|
||||
$httpConfig->setUrl(
|
||||
rtrim(trim($this->_getEndpoint($config)), '/') .
|
||||
(isset($options['path']) ? $options['path'] : '')
|
||||
);
|
||||
|
||||
if (!array_key_exists("User-Agent", $httpConfig->getHeaders())) {
|
||||
$httpConfig->addHeader("User-Agent", PPUserAgent::getValue(self::$sdkName, self::$sdkVersion));
|
||||
}
|
||||
|
||||
if (!is_null($credential) && $credential instanceof OAuthTokenCredential) {
|
||||
$httpConfig->addHeader('Authorization', "Bearer " . $credential->getAccessToken($config));
|
||||
}
|
||||
|
||||
if ($httpConfig->getMethod() == 'POST' || $httpConfig->getMethod() == 'PUT') {
|
||||
$httpConfig->addHeader('PayPal-Request-Id', $this->apiContext->getRequestId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* End Point
|
||||
*
|
||||
* @param array $config
|
||||
*
|
||||
* @return string
|
||||
* @throws \PayPal\Exception\PPConfigurationException
|
||||
*/
|
||||
private function _getEndpoint($config)
|
||||
{
|
||||
if (isset($config['service.EndPoint'])) {
|
||||
return $config['service.EndPoint'];
|
||||
} else if (isset($config['mode'])) {
|
||||
switch (strtoupper($config['mode'])) {
|
||||
case 'SANDBOX':
|
||||
return PPConstants::REST_SANDBOX_ENDPOINT;
|
||||
break;
|
||||
case 'LIVE':
|
||||
return PPConstants::REST_LIVE_ENDPOINT;
|
||||
break;
|
||||
default:
|
||||
throw new PPConfigurationException('The mode config parameter must be set to either sandbox/live');
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
throw new PPConfigurationException('You must set one of service.endpoint or mode parameters in your configuration');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
25
release_notes.md
Normal file
25
release_notes.md
Normal file
@@ -0,0 +1,25 @@
|
||||
PayPal PHP SDK release notes
|
||||
============================
|
||||
|
||||
v0.8.0
|
||||
-----
|
||||
* Invoicing API support added
|
||||
|
||||
v0.7.1
|
||||
-----
|
||||
* Added support for Reauthorization
|
||||
|
||||
v0.7.0
|
||||
-----
|
||||
* Added support for Auth and Capture APIs
|
||||
* Types modified to match the API Spec
|
||||
* Updated SDK to use namespace supported core library
|
||||
|
||||
v0.6.0
|
||||
-----
|
||||
* Adding support for dynamic configuration of SDK (Upgrading sdk-core-php dependency to V1.4.0)
|
||||
* Deprecating the setCredential method and changing resource class methods to take an ApiContext argument instead of a OauthTokenCredential argument.
|
||||
|
||||
v0.5.0
|
||||
-----
|
||||
* Initial Release
|
||||
@@ -2,7 +2,7 @@ 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. To try out the sample, run `composer update --no-dev` from the samples folder and you are all set. In case you cannot install composer on your machine, you can fetch the SDK download 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 contents to the samples folder.
|
||||
This sample project is a simple web app that you can explore to understand what the payment APIs can do for you. To try out the sample, run `composer update --no-dev` from the samples folder and you are all set.
|
||||
|
||||
|
||||
The sample comes pre-configured with a test account but in case you need to try them against your account, you must
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
"php": ">=5.3.0",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"paypal/rest-api-sdk-php" : "0.7.*"
|
||||
"paypal/rest-api-sdk-php" : "0.8.*"
|
||||
}
|
||||
}
|
||||
|
||||
37
sample/invoicing/CancelInvoice.php
Normal file
37
sample/invoicing/CancelInvoice.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
|
||||
use PayPal\Api\Invoice;
|
||||
use PayPal\Api\CancelNotification;
|
||||
|
||||
try {
|
||||
$invoice = Invoice::get("INV2-CJL7-PF4G-BLQF-5FWG", $apiContext);
|
||||
|
||||
$notify = new CancelNotification();
|
||||
$notify
|
||||
->setSubject("Past due")
|
||||
->setNote("Canceling invoice")
|
||||
->setSendToMerchant(true)
|
||||
->setSendToPayer(true);
|
||||
|
||||
|
||||
$cancelStatus = $invoice->cancel($notify, $apiContext);
|
||||
} catch (PayPal\Exception\PPConnectionException $ex) {
|
||||
echo "Exception: " . $ex->getMessage() . PHP_EOL;
|
||||
var_dump($ex->getData());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Cancel Invoice</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>Cancel Invoice:</div>
|
||||
<pre><?php var_dump($invoice);?></pre>
|
||||
<a href='../index.html'>Back</a>
|
||||
</body>
|
||||
</html>
|
||||
100
sample/invoicing/CreateInvoice.php
Normal file
100
sample/invoicing/CreateInvoice.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
use PayPal\Api\Invoice;
|
||||
use PayPal\Api\MerchantInfo;
|
||||
use PayPal\Api\BillingInfo;
|
||||
use PayPal\Api\InvoiceItem;
|
||||
use PayPal\Api\Phone;
|
||||
use PayPal\Api\Address;
|
||||
use PayPal\Api\Currency;
|
||||
use PayPal\Api\PaymentTerm;
|
||||
use PayPal\Api\ShippingInfo;
|
||||
|
||||
$invoice = new Invoice();
|
||||
|
||||
$invoice
|
||||
->setMerchantInfo(new MerchantInfo())
|
||||
->setBillingInfo(array(new BillingInfo()))
|
||||
->setItems(array(new InvoiceItem()))
|
||||
->setNote("Medical Invoice 16 Jul, 2013 PST")
|
||||
->setPaymentTerm(new PaymentTerm())
|
||||
->setShippingInfo(new ShippingInfo());
|
||||
|
||||
$invoice->getMerchantInfo()
|
||||
->setEmail("PPX.DevNet-facilitator@gmail.com")
|
||||
->setFirstName("Dennis")
|
||||
->setLastName("Doctor")
|
||||
->setbusinessName("Medical Professionals, LLC")
|
||||
->setPhone(new Phone())
|
||||
->setAddress(new Address());
|
||||
|
||||
$invoice->getMerchantInfo()->getPhone()
|
||||
->setCountryCode("001")
|
||||
->setNationalNumber("5032141716");
|
||||
|
||||
$invoice->getMerchantInfo()->getAddress()
|
||||
->setLine1("1234 Main St.")
|
||||
->setCity("Portland")
|
||||
->setState("OR")
|
||||
->setPostalCode("97217")
|
||||
->setCountryCode("US");
|
||||
|
||||
$billing = $invoice->getBillingInfo();
|
||||
$billing[0]
|
||||
->setEmail("example@example.com");
|
||||
|
||||
$items = $invoice->getItems();
|
||||
$items[0]
|
||||
->setName("Sutures")
|
||||
->setQuantity(100)
|
||||
->setUnitPrice(new Currency());
|
||||
|
||||
$items[0]->getUnitPrice()
|
||||
->setCurrency("USD")
|
||||
->setValue(5);
|
||||
|
||||
$invoice->getPaymentTerm()
|
||||
->setTermType("NET_45");
|
||||
|
||||
$invoice->getShippingInfo()
|
||||
->setFirstName("Sally")
|
||||
->setLastName("Patient")
|
||||
->setBusinessName("Not applicable")
|
||||
->setPhone(new Phone())
|
||||
->setAddress(new Address());
|
||||
|
||||
$invoice->getShippingInfo()->getPhone()
|
||||
->setCountryCode("001")
|
||||
->setNationalNumber("5039871234");
|
||||
|
||||
$invoice->getShippingInfo()->getAddress()
|
||||
->setLine1("1234 Main St.")
|
||||
->setCity("Portland")
|
||||
->setState("OR")
|
||||
->setPostalCode("97217")
|
||||
->setCountryCode("US");
|
||||
|
||||
print(var_dump($invoice->toArray()));
|
||||
|
||||
try {
|
||||
$invoice->create($apiContext);
|
||||
} catch (PayPal\Exception\PPConnectionException $ex) {
|
||||
echo "Exception: " . $ex->getMessage() . PHP_EOL;
|
||||
var_dump($ex->getData());
|
||||
exit(1);
|
||||
}
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>Direct Credit card payments</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
Created Invoice:
|
||||
<?php echo $invoice->getId();?>
|
||||
</div>
|
||||
<pre><?php var_dump($invoice->toArray());?></pre>
|
||||
<a href='../index.html'>Back</a>
|
||||
</body>
|
||||
</html>
|
||||
19
sample/invoicing/GetInvoice.php
Normal file
19
sample/invoicing/GetInvoice.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
use PayPal\Api\Invoice;
|
||||
|
||||
$invoiceId = "INV2-9DRB-YTHU-2V9Q-7Q24";
|
||||
|
||||
$invoice = Invoice::get($invoiceId, $apiContext);
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>Lookup invoice details</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>Retrieving Invoice: <?php echo $invoiceId;?></div>
|
||||
<pre><?php var_dump($invoice);?></pre>
|
||||
<a href='../index.html'>Back</a>
|
||||
</body>
|
||||
</html>
|
||||
22
sample/invoicing/ListInvoice.php
Normal file
22
sample/invoicing/ListInvoice.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
use PayPal\Api\Invoice;
|
||||
|
||||
try {
|
||||
$invoices = Invoice::get_all($apiContext);
|
||||
} catch (PayPal\Exception\PPConnectionException $ex) {
|
||||
echo "Exception:" . $ex->getMessage() . PHP_EOL;
|
||||
var_dump($ex->getData());
|
||||
exit(1);
|
||||
}
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>Lookup invoice history</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>Got invoices </div>
|
||||
<pre><?php var_dump($invoices->toArray());?></pre>
|
||||
<a href='../index.html'>Back</a>
|
||||
</body>
|
||||
</html>
|
||||
35
sample/invoicing/RemindInvoice.php
Normal file
35
sample/invoicing/RemindInvoice.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
|
||||
use PayPal\Api\Invoice;
|
||||
use PayPal\Api\Notification;
|
||||
|
||||
try {
|
||||
$invoice = Invoice::get("INV2-9CAH-K5G7-2JPL-G4B4", $apiContext);
|
||||
|
||||
$notify = new Notification();
|
||||
$notify
|
||||
->setSubject("Past due")
|
||||
->setNote("Please pay soon")
|
||||
->setSendToMerchant(true);
|
||||
|
||||
$remindStatus = $invoice->remind($notify, $apiContext);
|
||||
} catch (PayPal\Exception\PPConnectionException $ex) {
|
||||
echo "Exception: " . $ex->getMessage() . PHP_EOL;
|
||||
var_dump($ex->getData());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Remind Invoice</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>Remind Invoice:</div>
|
||||
<pre><?php var_dump($invoice);?></pre>
|
||||
<a href='../index.html'>Back</a>
|
||||
</body>
|
||||
</html>
|
||||
27
sample/invoicing/SendInvoice.php
Normal file
27
sample/invoicing/SendInvoice.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
|
||||
use PayPal\Api\Invoice;
|
||||
|
||||
try {
|
||||
$invoice = Invoice::get("INV2-9DRB-YTHU-2V9Q-7Q24", $apiContext);
|
||||
|
||||
$sendStatus = $invoice->send($apiContext);
|
||||
} catch (PayPal\Exception\PPConnectionException $ex) {
|
||||
echo "Exception: " . $ex->getMessage() . PHP_EOL;
|
||||
var_dump($ex->getData());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>Send Invoice</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>Send Invoice:</div>
|
||||
<pre><?php var_dump($invoice);?></pre>
|
||||
<a href='../index.html'>Back</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -29,10 +29,10 @@ if(isset($_GET['success']) && $_GET['success'] == 'true') {
|
||||
|
||||
//Execute the payment
|
||||
// (See bootstrap.php for more on `ApiContext`)
|
||||
$response = $payment->execute($execution, $apiContext);
|
||||
$result = $payment->execute($execution, $apiContext);
|
||||
|
||||
echo "<html><body><pre>";
|
||||
var_dump($response->toArray());
|
||||
var_dump($result);
|
||||
echo "</pre><a href='../index.html'>Back</a></body></html>";
|
||||
|
||||
} else {
|
||||
|
||||
@@ -19,9 +19,11 @@ use PayPal\Exception\PPConnectionException;
|
||||
class AuthorizationTest extends \PHPUnit_Framework_TestCase {
|
||||
private $authorizations = array();
|
||||
public static $create_time = "2013-02-28T00:00:00Z";
|
||||
public static $update_time = "2013-03-28T00:00:00Z";
|
||||
public static $id = "AUTH-123";
|
||||
public static $state = "Created";
|
||||
public static $parent_payment = "PAY-12345";
|
||||
public static $valid_until = "2013-04-28T00:00:00Z";
|
||||
public static $currency = "USD";
|
||||
public static $total = "1.12";
|
||||
public static $href = "USD";
|
||||
@@ -90,20 +92,24 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase {
|
||||
public function setup() {
|
||||
$authorization = new Authorization();
|
||||
$authorization->setCreateTime(self::$create_time);
|
||||
$authorization->setUpdateTime(self::$update_time);
|
||||
$authorization->setId(self::$id);
|
||||
$authorization->setState(self::$state);
|
||||
$authorization->setParentPayment(self::$parent_payment);
|
||||
$authorization->setValidUntil(self::$valid_until);
|
||||
$this->authorizations['partial'] = $authorization;
|
||||
$this->authorizations['full'] = self::createAuthorization();
|
||||
|
||||
}
|
||||
|
||||
public function testGetterSetter() {
|
||||
public function testGetterSetter() {
|
||||
$authorization = $this->authorizations['partial'];
|
||||
$this->assertEquals(self::$create_time, $authorization->getCreateTime());
|
||||
$this->assertEquals(self::$update_time, $authorization->getUpdateTime());
|
||||
$this->assertEquals(self::$id, $authorization->getId());
|
||||
$this->assertEquals(self::$state, $authorization->getState());
|
||||
$this->assertEquals(self::$parent_payment, $authorization->getParentPayment());
|
||||
$this->assertEquals(self::$valid_until, $authorization->getValidUntil());
|
||||
|
||||
$authorization = $this->authorizations['full'];
|
||||
$this->assertEquals(AmountTest::$currency, $authorization->getAmount()->getCurrency());
|
||||
@@ -137,9 +143,15 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase {
|
||||
$void = $auth->void();
|
||||
$this->assertNotNull($void->getId());
|
||||
|
||||
$auth->setId(null);
|
||||
try {
|
||||
$auth->void();
|
||||
} catch (\InvalidArgumentException $ex) {
|
||||
$this->assertEquals($ex->getMessage(), "Id cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
public function testReauthorize(){
|
||||
public function testReauthorize() {
|
||||
$authorization = Authorization::get('7GH53639GA425732B');
|
||||
|
||||
$amount = new Amount();
|
||||
@@ -147,10 +159,18 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase {
|
||||
$amount->setTotal("1.00");
|
||||
|
||||
$authorization->setAmount($amount);
|
||||
try{
|
||||
$reauthorization = $authorization->reauthorize();
|
||||
}catch (PPConnectionException $ex){
|
||||
try {
|
||||
$authorization->reauthorize();
|
||||
} catch (PPConnectionException $ex){
|
||||
//var_dump($ex->getMessage());
|
||||
$this->assertEquals(strpos($ex->getMessage(),"500"), false);
|
||||
}
|
||||
|
||||
$authorization->setId(null);
|
||||
try {
|
||||
$authorization->reauthorize();
|
||||
} catch (\InvalidArgumentException $ex) {
|
||||
$this->assertEquals($ex->getMessage(), "Id cannot be null");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ use PayPal\Api\Address;
|
||||
use PayPal\Api\CreditCard;
|
||||
use PayPal\Test\Constants;
|
||||
class CreditCardTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
|
||||
private $cards;
|
||||
|
||||
|
||||
public static $id = "id";
|
||||
public static $validUntil = "2013-02-28T00:00:00Z";
|
||||
public static $state = "created";
|
||||
@@ -19,7 +19,7 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase {
|
||||
public static $cvv = "012";
|
||||
public static $firstName = "V";
|
||||
public static $lastName = "C";
|
||||
|
||||
|
||||
public static function createCreditCard() {
|
||||
$card = new CreditCard();
|
||||
$card->setType(self::$cardType);
|
||||
@@ -29,24 +29,21 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase {
|
||||
$card->setCvv2(self::$cvv);
|
||||
$card->setFirstName(self::$firstName);
|
||||
$card->setLastName(self::$lastName);
|
||||
$card->setId(self::$id);
|
||||
$card->setValidUntil(self::$validUntil);
|
||||
$card->setState(self::$state);
|
||||
$card->setPayerId(self::$payerId);
|
||||
return $card;
|
||||
}
|
||||
|
||||
|
||||
public function setup() {
|
||||
|
||||
|
||||
$card = self::createCreditCard();
|
||||
$card->setBillingAddress(AddressTest::createAddress());
|
||||
$card->setBillingAddress(AddressTest::createAddress());
|
||||
$card->setLinks(array(LinksTest::createLinks()));
|
||||
$this->cards['full'] = $card;
|
||||
|
||||
$card = self::createCreditCard();
|
||||
|
||||
$card = self::createCreditCard();
|
||||
$this->cards['partial'] = $card;
|
||||
}
|
||||
|
||||
|
||||
public function testGetterSetters() {
|
||||
$c = $this->cards['partial'];
|
||||
$this->assertEquals(self::$cardType, $c->getType());
|
||||
@@ -56,34 +53,32 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase {
|
||||
$this->assertEquals(self::$cvv, $c->getCvv2());
|
||||
$this->assertEquals(self::$firstName, $c->getFirstName());
|
||||
$this->assertEquals(self::$lastName, $c->getLastName());
|
||||
$this->assertEquals(self::$id, $c->getId());
|
||||
$this->assertEquals(self::$validUntil, $c->getValidUntil());
|
||||
$this->assertEquals(self::$state, $c->getState());
|
||||
$this->assertEquals(self::$payerId, $c->getPayerId());
|
||||
|
||||
|
||||
$c = $this->cards['full'];
|
||||
$this->assertEquals(AddressTest::$line1, $c->getBillingAddress()->getLine1());
|
||||
$link = $c->getLinks();
|
||||
$this->assertEquals(LinksTest::$href, $link[0]->getHref());
|
||||
}
|
||||
|
||||
|
||||
public function testSerializeDeserialize() {
|
||||
$c1 = $this->cards['full'];
|
||||
$json = $c1->toJson();
|
||||
|
||||
|
||||
$c2 = new CreditCard();
|
||||
$c2->fromJson($json);
|
||||
|
||||
$c2->fromJson($json);
|
||||
|
||||
$this->assertEquals($c1, $c2);
|
||||
}
|
||||
|
||||
|
||||
public function testOperations() {
|
||||
$c1 = $this->cards['full'];
|
||||
|
||||
|
||||
// $this->assertNull($c1->getId());
|
||||
$c1->create();
|
||||
$c1->create();
|
||||
$this->assertNotNull($c1->getId());
|
||||
|
||||
|
||||
|
||||
$c2 = CreditCard::get($c1->getId());
|
||||
$this->assertEquals($c1->getBillingAddress(), $c2->getBillingAddress());
|
||||
$this->assertGreaterThan(0, count($c2->getLinks()));
|
||||
|
||||
@@ -15,22 +15,22 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase {
|
||||
$fi->setCreditCardToken(CreditCardTokenTest::createCreditCardToken());
|
||||
return $fi;
|
||||
}
|
||||
|
||||
|
||||
public function setup() {
|
||||
$this->fi = self::createFundingInstrument();
|
||||
}
|
||||
|
||||
public function testGetterSetter() {
|
||||
$this->assertEquals(CreditCardTest::$cardNumber, $this->fi->getCreditCard()->getNumber());
|
||||
$this->assertEquals(CreditCardTokenTest::$creditCardId,
|
||||
$this->assertEquals(CreditCardTokenTest::$creditCardId,
|
||||
$this->fi->getCreditCardToken()->getCreditCardId());
|
||||
}
|
||||
|
||||
|
||||
public function testSerializeDeserialize() {
|
||||
$fi1 = $this->fi;
|
||||
|
||||
|
||||
$fi2 = new FundingInstrument();
|
||||
$fi2->fromJson($fi1->toJson());
|
||||
$fi2->fromJson($fi1->toJson());
|
||||
$this->assertEquals($fi1, $fi2);
|
||||
}
|
||||
}
|
||||
61
tests/PayPal/Test/Api/OrderTest.php
Normal file
61
tests/PayPal/Test/Api/OrderTest.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
namespace PayPal\Test\Api;
|
||||
|
||||
use PayPal\Api\Order;
|
||||
use PayPal\Api\Amount;
|
||||
use PayPal\Api\Details;
|
||||
use PayPal\Api\Links;
|
||||
use PayPal\Test\Constants;
|
||||
|
||||
class OrderTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
private $order;
|
||||
|
||||
public static $id = 'O-0AA8876533760860M';
|
||||
public static $createTime = '2014-08-25T19:24:04Z';
|
||||
public static $updateTime = '2014-08-25T19:24:51Z';
|
||||
public static $state = 'pending';
|
||||
public static $parentPayment = 'PAY-0AL32935UM2331537KP5Y2VA';
|
||||
public static $reasonCode = 'order';
|
||||
|
||||
public static function createOrder() {
|
||||
$order = new Order();
|
||||
|
||||
$links = LinksTest::createLinks();
|
||||
|
||||
$order->setId(self::$id);
|
||||
$order->setCreateTime(self::$createTime);
|
||||
$order->setUpdateTime(self::$updateTime);
|
||||
$order->setState(self::$state);
|
||||
$order->setAmount(AmountTest::createAmount());
|
||||
$order->setParentPayment(self::$parentPayment);
|
||||
$order->setLinks(array($links));
|
||||
$order->setReasonCode(self::$reasonCode);
|
||||
|
||||
return $order;
|
||||
}
|
||||
|
||||
public function setup() {
|
||||
$this->order = self::createOrder();
|
||||
}
|
||||
|
||||
public function testGetterSetter() {
|
||||
$this->assertEquals(self::$id, $this->order->getId());
|
||||
$this->assertEquals(self::$createTime, $this->order->getCreateTime());
|
||||
$this->assertEquals(self::$updateTime, $this->order->getUpdateTime());
|
||||
$this->assertEquals(self::$state, $this->order->getState());
|
||||
$this->assertEquals(AmountTest::$currency, $this->order->getAmount()->getCurrency());
|
||||
$this->assertEquals(self::$parentPayment, $this->order->getParentPayment());
|
||||
$this->assertEquals(LinksTest::$href, $this->order->getLinks()[0]->getHref());
|
||||
$this->assertEquals(self::$reasonCode, $this->order->getReasonCode());
|
||||
}
|
||||
|
||||
public function testSerializeDeserialize() {
|
||||
$o1 = $this->order;
|
||||
|
||||
$o2 = new Order();
|
||||
$o2->fromJson($o1->toJson());
|
||||
|
||||
$this->assertEquals($o1, $o2);
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ class PayerInfoTest extends \PHPUnit_Framework_TestCase {
|
||||
$payerInfo->setLastName(self::$lastName);
|
||||
$payerInfo->setPhone(self::$phone);
|
||||
$payerInfo->setPayerId(self::$payerId);
|
||||
$payerInfo->setShippingAddress(AddressTest::createAddress());
|
||||
$payerInfo->setShippingAddress(ShippingAddressTest::createAddress());
|
||||
|
||||
return $payerInfo;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ class PayerInfoTest extends \PHPUnit_Framework_TestCase {
|
||||
$this->assertEquals(self::$lastName, $this->payerInfo->getLastName());
|
||||
$this->assertEquals(self::$phone, $this->payerInfo->getPhone());
|
||||
$this->assertEquals(self::$payerId, $this->payerInfo->getPayerId());
|
||||
$this->assertEquals(AddressTest::$line1, $this->payerInfo->getShippingAddress()->getLine1());
|
||||
$this->assertEquals(ShippingAddressTest::$line1, $this->payerInfo->getShippingAddress()->getLine1());
|
||||
}
|
||||
|
||||
public function testSerializeDeserialize() {
|
||||
|
||||
@@ -12,66 +12,70 @@ use PayPal\Test\Constants;
|
||||
|
||||
class PaymentTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
private $payments;
|
||||
private $payments;
|
||||
|
||||
public static function createPayment() {
|
||||
|
||||
|
||||
$redirectUrls = new RedirectUrls();
|
||||
$redirectUrls->setReturnUrl("http://localhost/return");
|
||||
$redirectUrls->setCancelUrl("http://localhost/cancel");
|
||||
|
||||
|
||||
$payment = new Payment();
|
||||
$payment->setIntent("sale");
|
||||
$payment->setRedirectUrls($redirectUrls);
|
||||
$payment->setPayer(PayerTest::createPayer());
|
||||
$payment->setTransactions(array(TransactionTest::createTransaction()));
|
||||
|
||||
return $payment;
|
||||
|
||||
return $payment;
|
||||
}
|
||||
|
||||
|
||||
public static function createNewPayment() {
|
||||
|
||||
$funding = FundingInstrumentTest::createFundingInstrument();
|
||||
$funding->credit_card_token = null;
|
||||
|
||||
$payer = new Payer();
|
||||
$payer->setPaymentMethod("credit_card");
|
||||
$payer->setFundingInstruments(array(FundingInstrumentTest::createFundingInstrument()));
|
||||
|
||||
$payer->setFundingInstruments(array($funding));
|
||||
|
||||
$transaction = new Transaction();
|
||||
$transaction->setAmount(AmountTest::createAmount());
|
||||
$transaction->setDescription("This is the payment description.");
|
||||
|
||||
|
||||
$redirectUrls = new RedirectUrls();
|
||||
$redirectUrls->setReturnUrl("http://localhost/return");
|
||||
$redirectUrls->setCancelUrl("http://localhost/cancel");
|
||||
|
||||
|
||||
$payment = new Payment();
|
||||
$payment->setIntent("sale");
|
||||
$payment->setRedirectUrls($redirectUrls);
|
||||
$payment->setPayer($payer);
|
||||
$payment->setTransactions(array($transaction));
|
||||
|
||||
return $payment;
|
||||
|
||||
return $payment;
|
||||
}
|
||||
|
||||
public function setup() {
|
||||
|
||||
public function setup() {
|
||||
$this->payments['full'] = self::createPayment();
|
||||
$this->payments['new'] = self::createNewPayment();
|
||||
}
|
||||
|
||||
|
||||
public function testSerializeDeserialize() {
|
||||
$p2 = new Payment();
|
||||
$p2->fromJson($this->payments['full']->toJSON());
|
||||
$p2->fromJson($this->payments['full']->toJSON());
|
||||
$this->assertEquals($p2, $this->payments['full']);
|
||||
}
|
||||
|
||||
|
||||
public function testOperations() {
|
||||
|
||||
$p1 = $this->payments['new'];
|
||||
|
||||
$p1->create();
|
||||
|
||||
$p1->create();
|
||||
$this->assertNotNull($p1->getId());
|
||||
|
||||
|
||||
$p2 = Payment::get($p1->getId());
|
||||
$this->assertNotNull($p2);
|
||||
|
||||
|
||||
$paymentHistory = Payment::all(array('count' => '10'));
|
||||
$this->assertNotNull($paymentHistory);
|
||||
}
|
||||
|
||||
42
tests/PayPal/Test/Api/RedirectUrlsTest.php
Normal file
42
tests/PayPal/Test/Api/RedirectUrlsTest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
namespace PayPal\Test\Api;
|
||||
|
||||
use PayPal\Api\RedirectUrls;
|
||||
|
||||
class RedirectUrlsTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
public function validRedirectUrlsProvider() {
|
||||
return array(
|
||||
array('https://devtools-paypal.com/guide/pay_paypal/php?success=true', 'https://devtools-paypal.com/guide/pay_paypal/php?cancel=true')
|
||||
);
|
||||
}
|
||||
|
||||
public function invalidRedirectUrlsProvider() {
|
||||
return array(
|
||||
array('devtools-paypal.com/guide/pay_paypal/php?success=true', 'devtools-paypal.com/guide/pay_paypal/php?cancel=true')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider validRedirectUrlsProvider
|
||||
*/
|
||||
public function testValidRedirectUrls($return_url, $cancel_url) {
|
||||
$redirectUrls = new RedirectUrls();
|
||||
$redirectUrls->setReturn_url($return_url);
|
||||
$redirectUrls->setCancel_url($cancel_url);
|
||||
|
||||
$this->assertEquals($return_url, $redirectUrls->getReturnUrl());
|
||||
$this->assertEquals($cancel_url, $redirectUrls->getCancelUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider invalidRedirectUrlsProvider
|
||||
*/
|
||||
public function testInvalidRedirectUrls($return_url, $cancel_url) {
|
||||
$redirectUrls = new RedirectUrls();
|
||||
$this->setExpectedException('\InvalidArgumentException');
|
||||
$redirectUrls->setReturnUrl($return_url);
|
||||
$redirectUrls->setCancelUrl($cancel_url);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@ class RelatedResourcesTest extends \PHPUnit_Framework_TestCase {
|
||||
$relatedResources = new RelatedResources();
|
||||
$relatedResources->setAuthorization(AuthorizationTest::createAuthorization());
|
||||
$relatedResources->setCapture(CaptureTest::createCapture());
|
||||
$relatedResources->setOrder(OrderTest::createOrder());
|
||||
return $relatedResources;
|
||||
}
|
||||
|
||||
@@ -22,6 +23,7 @@ class RelatedResourcesTest extends \PHPUnit_Framework_TestCase {
|
||||
public function testGetterSetter() {
|
||||
$this->assertEquals(AuthorizationTest::$create_time, $this->relatedResources->getAuthorization()->getCreateTime());
|
||||
$this->assertEquals(CaptureTest::$create_time, $this->relatedResources->getCapture()->getCreateTime());
|
||||
$this->assertEquals(OrderTest::$id, $this->relatedResources->getOrder()->getId());
|
||||
}
|
||||
|
||||
public function testSerializeDeserialize() {
|
||||
@@ -32,4 +34,4 @@ class RelatedResourcesTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
$this->assertEquals($s1, $s2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,12 +12,18 @@ class TransactionTest extends \PHPUnit_Framework_TestCase {
|
||||
private $transaction;
|
||||
|
||||
public static $description = "desc . . . ";
|
||||
public static $invoiceNumber = "#123";
|
||||
public static $custom = "custom";
|
||||
public static $softDescriptor = "descriptor";
|
||||
public static $total = "1.12";
|
||||
|
||||
public static function createTransaction() {
|
||||
$transaction = new Transaction();
|
||||
$transaction->setAmount(AmountTest::createAmount());
|
||||
$transaction->setDescription(self::$description);
|
||||
$transaction->setInvoiceNumber(self::$invoiceNumber);
|
||||
$transaction->setCustom(self::$custom);
|
||||
$transaction->setSoftDescriptor(self::$softDescriptor);
|
||||
$transaction->setItemList(ItemListTest::createItemList());
|
||||
$transaction->setPayee(PayeeTest::createPayee());
|
||||
$transaction->setRelatedResources( array(RelatedResourcesTest::createRelatedResources()) );
|
||||
@@ -31,6 +37,9 @@ class TransactionTest extends \PHPUnit_Framework_TestCase {
|
||||
public function testGetterSetter() {
|
||||
$this->assertEquals(AmountTest::$currency, $this->transaction->getAmount()->getCurrency());
|
||||
$this->assertEquals(self::$description, $this->transaction->getDescription());
|
||||
$this->assertEquals(self::$invoiceNumber, $this->transaction->getInvoiceNumber());
|
||||
$this->assertEquals(self::$custom, $this->transaction->getCustom());
|
||||
$this->assertEquals(self::$softDescriptor, $this->transaction->getSoftDescriptor());
|
||||
$items = $this->transaction->getItemList()->getItems();
|
||||
$this->assertEquals(ItemTest::$quantity, $items[0]->getQuantity());
|
||||
$this->assertEquals(PayeeTest::$email, $this->transaction->getPayee()->getEmail());
|
||||
|
||||
Reference in New Issue
Block a user