forked from LiveCarta/PayPal-PHP-SDK
Cleaned up Code Comments and added Type-Hinting to all Class/Functions closes #42
This commit is contained in:
@@ -1,186 +1,263 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class Address extends PPModel {
|
/**
|
||||||
/**
|
* Class Address
|
||||||
* Line 1 of the Address (eg. number, street, etc).
|
*
|
||||||
*
|
* @property string line1
|
||||||
* @param string $line1
|
* @property string line2
|
||||||
*/
|
* @property string city
|
||||||
public function setLine1($line1) {
|
* @property string country_code
|
||||||
$this->line1 = $line1;
|
* @property string postal_code
|
||||||
return $this;
|
* @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;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Line 1 of the Address (eg. number, street, etc).
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getLine1() {
|
|
||||||
return $this->line1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.).
|
* Set Line 2 (Optional)
|
||||||
*
|
* Address (eg. suite, apt #, etc)
|
||||||
* @param string $line2
|
*
|
||||||
*/
|
* @param string $line2
|
||||||
public function setLine2($line2) {
|
*
|
||||||
$this->line2 = $line2;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setLine2($line2)
|
||||||
|
{
|
||||||
|
$this->line2 = $line2;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Optional line 2 of the Address (eg. suite, apt #, etc.).
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getLine2() {
|
|
||||||
return $this->line2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Line 2 (Optional)
|
||||||
|
* Address (eg. suite, apt #, etc)
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getLine2()
|
||||||
|
{
|
||||||
|
return $this->line2;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* City name.
|
* Set City Name
|
||||||
*
|
*
|
||||||
* @param string $city
|
* @param string $city
|
||||||
*/
|
*
|
||||||
public function setCity($city) {
|
* @return $this
|
||||||
$this->city = $city;
|
*/
|
||||||
return $this;
|
public function setCity($city)
|
||||||
}
|
{
|
||||||
|
$this->city = $city;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* City name.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getCity() {
|
|
||||||
return $this->city;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get City Name
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getCity()
|
||||||
|
{
|
||||||
|
return $this->city;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2 letter country code.
|
* Set Country Code
|
||||||
*
|
* Two Letter
|
||||||
* @param string $country_code
|
*
|
||||||
*/
|
* @param string $country_code
|
||||||
public function setCountryCode($country_code) {
|
*
|
||||||
$this->country_code = $country_code;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setCountryCode($country_code)
|
||||||
|
{
|
||||||
|
$this->country_code = $country_code;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 2 letter country code.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getCountryCode() {
|
|
||||||
return $this->country_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2 letter country code.
|
* Get Country Code
|
||||||
*
|
* Two Letter
|
||||||
* @param string $country_code
|
*
|
||||||
* @deprecated. Instead use setCountryCode
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function setCountry_code($country_code) {
|
public function getCountryCode()
|
||||||
$this->country_code = $country_code;
|
{
|
||||||
return $this;
|
return $this->country_code;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 2 letter country code.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getCountryCode
|
|
||||||
*/
|
|
||||||
public function getCountry_code() {
|
|
||||||
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.
|
* Set Country Code
|
||||||
*
|
* Two Letter
|
||||||
* @param string $postal_code
|
*
|
||||||
*/
|
* @param string $country_code
|
||||||
public function setPostalCode($postal_code) {
|
*
|
||||||
$this->postal_code = $postal_code;
|
* @deprecated Use setCountryCode
|
||||||
return $this;
|
*
|
||||||
}
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setCountry_code($country_code)
|
||||||
|
{
|
||||||
|
$this->country_code = $country_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
|
|
||||||
*/
|
|
||||||
public function getPostalCode() {
|
|
||||||
return $this->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.
|
* Get Country Code
|
||||||
*
|
* Two Letter
|
||||||
* @param string $postal_code
|
*
|
||||||
* @deprecated. Instead use setPostalCode
|
* @deprecated Use getCountryCode
|
||||||
*/
|
*
|
||||||
public function setPostal_code($postal_code) {
|
* @return string
|
||||||
$this->postal_code = $postal_code;
|
*/
|
||||||
return $this;
|
public function getCountry_code()
|
||||||
}
|
{
|
||||||
/**
|
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.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getPostalCode
|
|
||||||
*/
|
|
||||||
public function getPostal_code() {
|
|
||||||
return $this->postal_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2 letter code for US states, and the equivalent for other countries.
|
* Set Postal Code
|
||||||
*
|
* Zip code or equivalent is usually required for countries that have them
|
||||||
* @param string $state
|
* For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code
|
||||||
*/
|
*
|
||||||
public function setState($state) {
|
* @param string $postal_code
|
||||||
$this->state = $state;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
|
public function setPostalCode($postal_code)
|
||||||
|
{
|
||||||
|
$this->postal_code = $postal_code;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 2 letter code for US states, and the equivalent for other countries.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getState() {
|
|
||||||
return $this->state;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Set Postal Code
|
||||||
*
|
* Zip code or equivalent is usually required for countries that have them
|
||||||
* @param string $phone
|
* For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code
|
||||||
*/
|
*
|
||||||
public function setPhone($phone) {
|
* @param string $postal_code
|
||||||
$this->phone = $phone;
|
*
|
||||||
return $this;
|
* @deprecated Use setPostalCode
|
||||||
}
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setPostal_code($postal_code)
|
||||||
|
{
|
||||||
|
$this->postal_code = $postal_code;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Phone number in E.123 format.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getPhone() {
|
|
||||||
return $this->phone;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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,68 +1,95 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class Amount extends PPModel {
|
/**
|
||||||
/**
|
* Class Amount
|
||||||
* 3 letter currency code
|
*
|
||||||
*
|
* @property string currency
|
||||||
* @param string $currency
|
* @property string total
|
||||||
*/
|
* @property \PayPal\Api\Details details
|
||||||
public function setCurrency($currency) {
|
*/
|
||||||
$this->currency = $currency;
|
class Amount extends PPModel
|
||||||
return $this;
|
{
|
||||||
}
|
/**
|
||||||
|
* Set Currency
|
||||||
|
* Three Letter Currency Code
|
||||||
|
*
|
||||||
|
* @param string $currency
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setCurrency($currency)
|
||||||
|
{
|
||||||
|
$this->currency = $currency;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 3 letter currency code
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getCurrency() {
|
|
||||||
return $this->currency;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Set Total
|
||||||
*
|
* Amount charged from the Payer account (or card) to Payee
|
||||||
* @param string $total
|
* In case of a refund, this is the refunded amount to the original Payer from Payee account
|
||||||
*/
|
*
|
||||||
public function setTotal($total) {
|
* @param string $total
|
||||||
$this->total = $total;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
|
public function setTotal($total)
|
||||||
|
{
|
||||||
|
$this->total = $total;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Set Details
|
||||||
*
|
* Additional Details of Payment Amount
|
||||||
* @param PayPal\Api\Details $details
|
*
|
||||||
*/
|
* @param \PayPal\Api\Details $details
|
||||||
public function setDetails($details) {
|
*
|
||||||
$this->details = $details;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setDetails($details)
|
||||||
|
{
|
||||||
/**
|
$this->details = $details;
|
||||||
* Additional details of the payment amount.
|
return $this;
|
||||||
*
|
}
|
||||||
* @return PayPal\Api\Details
|
|
||||||
*/
|
|
||||||
public function getDetails() {
|
|
||||||
return $this->details;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Details
|
||||||
|
* Additional Details of Payment Amount
|
||||||
|
*
|
||||||
|
* @return \PayPal\Api\Details
|
||||||
|
*/
|
||||||
|
public function getDetails()
|
||||||
|
{
|
||||||
|
return $this->details;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
@@ -7,341 +8,478 @@ use PayPal\Rest\IResource;
|
|||||||
use PayPal\Api\Capture;
|
use PayPal\Api\Capture;
|
||||||
use PayPal\Transport\PPRestCall;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set ID
|
||||||
* @deprecated. Pass ApiContext to create/get methods instead
|
* Identifier of the authorization transaction
|
||||||
*/
|
*
|
||||||
public static function setCredential($credential) {
|
* @param string $id
|
||||||
self::$credential = $credential;
|
*
|
||||||
}
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setId($id)
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Identifier of the authorization transaction.
|
}
|
||||||
*
|
|
||||||
* @param string $id
|
|
||||||
*/
|
|
||||||
public function setId($id) {
|
|
||||||
$this->id = $id;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identifier of the authorization transaction.
|
* Get ID
|
||||||
*
|
* Identifier of the authorization transaction
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getId() {
|
*/
|
||||||
return $this->id;
|
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;
|
||||||
* Time the resource was created.
|
}
|
||||||
*
|
|
||||||
* @param string $create_time
|
|
||||||
*/
|
|
||||||
public function setCreateTime($create_time) {
|
|
||||||
$this->create_time = $create_time;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was created.
|
* Get Create Time
|
||||||
*
|
* Time the resource was created
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getCreateTime() {
|
*/
|
||||||
return $this->create_time;
|
public function getCreateTime()
|
||||||
}
|
{
|
||||||
|
return $this->create_time;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was created.
|
* Set Create Time
|
||||||
*
|
* Time the resource was created
|
||||||
* @param string $create_time
|
*
|
||||||
* @deprecated. Instead use setCreateTime
|
* @param string $create_time
|
||||||
*/
|
*
|
||||||
public function setCreate_time($create_time) {
|
* @deprecated Use setCreateTime
|
||||||
$this->create_time = $create_time;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
/**
|
public function setCreate_time($create_time)
|
||||||
* Time the resource was created.
|
{
|
||||||
*
|
$this->create_time = $create_time;
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getCreateTime
|
|
||||||
*/
|
|
||||||
public function getCreate_time() {
|
|
||||||
return $this->create_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Time the resource was last updated.
|
}
|
||||||
*
|
|
||||||
* @param string $update_time
|
|
||||||
*/
|
|
||||||
public function setUpdateTime($update_time) {
|
|
||||||
$this->update_time = $update_time;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was last updated.
|
* Get Create Time
|
||||||
*
|
* Time the resource was created
|
||||||
* @return string
|
*
|
||||||
*/
|
* @deprecated Use getCreateTime
|
||||||
public function getUpdateTime() {
|
*
|
||||||
return $this->update_time;
|
* @return string
|
||||||
}
|
*/
|
||||||
|
public function getCreate_time()
|
||||||
|
{
|
||||||
|
return $this->create_time;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was last updated.
|
* Set Update Time
|
||||||
*
|
* Time the resource was last updated
|
||||||
* @param string $update_time
|
*
|
||||||
* @deprecated. Instead use setUpdateTime
|
* @param string $update_time
|
||||||
*/
|
*
|
||||||
public function setUpdate_time($update_time) {
|
* @return $this
|
||||||
$this->update_time = $update_time;
|
*/
|
||||||
return $this;
|
public function setUpdateTime($update_time)
|
||||||
}
|
{
|
||||||
/**
|
$this->update_time = $update_time;
|
||||||
* Time the resource was last updated.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getUpdateTime
|
|
||||||
*/
|
|
||||||
public function getUpdate_time() {
|
|
||||||
return $this->update_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Amount being authorized for.
|
}
|
||||||
*
|
|
||||||
* @param PayPal\Api\Amount $amount
|
|
||||||
*/
|
|
||||||
public function setAmount($amount) {
|
|
||||||
$this->amount = $amount;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Amount being authorized for.
|
* Get Update Time
|
||||||
*
|
* Time the resource was last updated
|
||||||
* @return PayPal\Api\Amount
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getAmount() {
|
*/
|
||||||
return $this->amount;
|
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;
|
||||||
* State of the authorization transaction.
|
}
|
||||||
*
|
|
||||||
* @param string $state
|
|
||||||
*/
|
|
||||||
public function setState($state) {
|
|
||||||
$this->state = $state;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* State of the authorization transaction.
|
* Get Update Time
|
||||||
*
|
* Time the resource was last updated
|
||||||
* @return string
|
*
|
||||||
*/
|
* @deprecated Use getUpdateTime
|
||||||
public function getState() {
|
*
|
||||||
return $this->state;
|
* @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;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the Payment resource that this transaction is based on.
|
* Get Amount
|
||||||
*
|
*
|
||||||
* @return string
|
* @return \PayPal\Api\Amount
|
||||||
*/
|
*/
|
||||||
public function getParentPayment() {
|
public function getAmount()
|
||||||
return $this->parent_payment;
|
{
|
||||||
}
|
return $this->amount;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the Payment resource that this transaction is based on.
|
* Set State
|
||||||
*
|
* State of the authorization transaction
|
||||||
* @param string $parent_payment
|
*
|
||||||
* @deprecated. Instead use setParentPayment
|
* @param string $state
|
||||||
*/
|
*
|
||||||
public function setParent_payment($parent_payment) {
|
* @return $this
|
||||||
$this->parent_payment = $parent_payment;
|
*/
|
||||||
return $this;
|
public function setState($state)
|
||||||
}
|
{
|
||||||
/**
|
$this->state = $state;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date/Time until which funds may be captured against this resource.
|
* Get State
|
||||||
*
|
* State of the authorization transaction
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getValidUntil() {
|
*/
|
||||||
return $this->valid_until;
|
public function getState()
|
||||||
}
|
{
|
||||||
|
return $this->state;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Date/Time until which funds may be captured against this resource.
|
* Set Parent Payment
|
||||||
*
|
* ID of the Payment resource that this transaction is based on
|
||||||
* @param string $valid_until
|
*
|
||||||
* @deprecated. Instead use setValidUntil
|
* @param string $parent_payment
|
||||||
*/
|
*
|
||||||
public function setValid_until($valid_until) {
|
* @return $this
|
||||||
$this->valid_until = $valid_until;
|
*/
|
||||||
return $this;
|
public function setParentPayment($parent_payment)
|
||||||
}
|
{
|
||||||
/**
|
$this->parent_payment = $parent_payment;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @array
|
|
||||||
* @param PayPal\Api\Links $links
|
|
||||||
*/
|
|
||||||
public function setLinks($links) {
|
|
||||||
$this->links = $links;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get Parent Payment
|
||||||
*
|
* ID of the Payment resource that this transaction is based on
|
||||||
* @return PayPal\Api\Links
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getLinks() {
|
*/
|
||||||
return $this->links;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Obtain the Authorization transaction resource for the given identifier.
|
* Get Parent Payment
|
||||||
*
|
* ID of the Payment resource that this transaction is based on
|
||||||
* @param string $authorizationId
|
*
|
||||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
* @deprecated Use getParentPayment
|
||||||
* @return Authorization
|
*
|
||||||
*/
|
* @return string
|
||||||
public static function get($authorizationId, $apiContext = null) {
|
*/
|
||||||
if (($authorizationId == null) || (strlen($authorizationId) <= 0)) {
|
public function getParent_payment()
|
||||||
throw new \InvalidArgumentException("authorizationId cannot be null or empty");
|
{
|
||||||
}
|
return $this->parent_payment;
|
||||||
$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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Creates (and processes) a new Capture Transaction added as a related resource.
|
* Set Valid Until
|
||||||
*
|
* Date/Time until which funds may be captured against this resource
|
||||||
* @param Capture $capture
|
*
|
||||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
* @param string $valid_until
|
||||||
* @return Capture
|
*
|
||||||
*/
|
* @return $this
|
||||||
public function capture($capture, $apiContext = null) {
|
*/
|
||||||
if ($this->getId() == null) {
|
public function setValidUntil($valid_until)
|
||||||
throw new \InvalidArgumentException("Id cannot be null");
|
{
|
||||||
}
|
$this->valid_until = $valid_until;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
return $this;
|
||||||
* Voids (cancels) an Authorization.
|
}
|
||||||
*
|
|
||||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
|
||||||
* @return Authorization
|
|
||||||
*/
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Reauthorizes an expired Authorization.
|
* Get Valid Until
|
||||||
*
|
* Date/Time until which funds may be captured against this resource
|
||||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
*
|
||||||
* @return Authorization
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function reauthorize($apiContext = null) {
|
public function getValidUntil()
|
||||||
if ($this->getId() == null) {
|
{
|
||||||
throw new \InvalidArgumentException("Id cannot be null");
|
return $this->valid_until;
|
||||||
}
|
}
|
||||||
$payLoad = $this->toJSON();
|
|
||||||
if ($apiContext == null) {
|
/**
|
||||||
$apiContext = new ApiContext(self::$credential);
|
* Set Valid Until
|
||||||
}
|
* Date/Time until which funds may be captured against this resource
|
||||||
$call = new PPRestCall($apiContext);
|
*
|
||||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/reauthorize", "POST", $payLoad);
|
* @param string $valid_until
|
||||||
$this->fromJson($json);
|
*
|
||||||
return $this;
|
* @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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
@@ -7,300 +8,432 @@ use PayPal\Rest\IResource;
|
|||||||
use PayPal\Api\Refund;
|
use PayPal\Api\Refund;
|
||||||
use PayPal\Transport\PPRestCall;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set ID
|
||||||
* @deprecated. Pass ApiContext to create/get methods instead
|
* Identifier of the Capture transaction
|
||||||
*/
|
*
|
||||||
public static function setCredential($credential) {
|
* @param string $id
|
||||||
self::$credential = $credential;
|
*
|
||||||
}
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setId($id)
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Identifier of the Capture transaction.
|
}
|
||||||
*
|
|
||||||
* @param string $id
|
|
||||||
*/
|
|
||||||
public function setId($id) {
|
|
||||||
$this->id = $id;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identifier of the Capture transaction.
|
* Get ID
|
||||||
*
|
* Identifier of the Capture transaction
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getId() {
|
*/
|
||||||
return $this->id;
|
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;
|
||||||
* Time the resource was created.
|
}
|
||||||
*
|
|
||||||
* @param string $create_time
|
|
||||||
*/
|
|
||||||
public function setCreateTime($create_time) {
|
|
||||||
$this->create_time = $create_time;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was created.
|
* Get Create Time
|
||||||
*
|
* Time the resource was created
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getCreateTime() {
|
*/
|
||||||
return $this->create_time;
|
public function getCreateTime()
|
||||||
}
|
{
|
||||||
|
return $this->create_time;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was created.
|
* Set Create Time
|
||||||
*
|
* Time the resource was created
|
||||||
* @param string $create_time
|
*
|
||||||
* @deprecated. Instead use setCreateTime
|
* @param string $create_time
|
||||||
*/
|
*
|
||||||
public function setCreate_time($create_time) {
|
* @deprecated Use setCreateTime
|
||||||
$this->create_time = $create_time;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
/**
|
public function setCreate_time($create_time)
|
||||||
* Time the resource was created.
|
{
|
||||||
*
|
$this->create_time = $create_time;
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getCreateTime
|
|
||||||
*/
|
|
||||||
public function getCreate_time() {
|
|
||||||
return $this->create_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Time the resource was last updated.
|
}
|
||||||
*
|
|
||||||
* @param string $update_time
|
|
||||||
*/
|
|
||||||
public function setUpdateTime($update_time) {
|
|
||||||
$this->update_time = $update_time;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was last updated.
|
* Get Create Time
|
||||||
*
|
* Time the resource was created
|
||||||
* @return string
|
*
|
||||||
*/
|
* @deprecated Use getCreateTime
|
||||||
public function getUpdateTime() {
|
*
|
||||||
return $this->update_time;
|
* @return string
|
||||||
}
|
*/
|
||||||
|
public function getCreate_time()
|
||||||
|
{
|
||||||
|
return $this->create_time;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was last updated.
|
* Set Update Time
|
||||||
*
|
* Time the resource was last updated
|
||||||
* @param string $update_time
|
*
|
||||||
* @deprecated. Instead use setUpdateTime
|
* @param string $update_time
|
||||||
*/
|
*
|
||||||
public function setUpdate_time($update_time) {
|
* @return $this
|
||||||
$this->update_time = $update_time;
|
*/
|
||||||
return $this;
|
public function setUpdateTime($update_time)
|
||||||
}
|
{
|
||||||
/**
|
$this->update_time = $update_time;
|
||||||
* Time the resource was last updated.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getUpdateTime
|
|
||||||
*/
|
|
||||||
public function getUpdate_time() {
|
|
||||||
return $this->update_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
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.
|
}
|
||||||
*
|
|
||||||
* @param PayPal\Api\Amount $amount
|
|
||||||
*/
|
|
||||||
public function setAmount($amount) {
|
|
||||||
$this->amount = $amount;
|
|
||||||
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.
|
* Get Update Time
|
||||||
*
|
* Time the resource was last updated
|
||||||
* @return PayPal\Api\Amount
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getAmount() {
|
*/
|
||||||
return $this->amount;
|
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;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
* Get Update Time
|
||||||
*
|
* Time the resource was last updated
|
||||||
* @return boolean
|
*
|
||||||
*/
|
* @deprecated Use getUpdateTime
|
||||||
public function getIsFinalCapture() {
|
*
|
||||||
return $this->is_final_capture;
|
* @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.
|
* Set Amount
|
||||||
*
|
* Amount being captured
|
||||||
* @param boolean $is_final_capture
|
* If no amount is specified, amount is used from the authorization being captured
|
||||||
* @deprecated. Instead use setIsFinalCapture
|
* 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
|
||||||
public function setIs_final_capture($is_final_capture) {
|
*
|
||||||
$this->is_final_capture = $is_final_capture;
|
* @param \PayPal\Api\Amount $amount
|
||||||
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.
|
public function setAmount($amount)
|
||||||
*
|
{
|
||||||
* @return boolean
|
$this->amount = $amount;
|
||||||
* @deprecated. Instead use getIsFinalCapture
|
|
||||||
*/
|
|
||||||
public function getIs_final_capture() {
|
|
||||||
return $this->is_final_capture;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* State of the capture transaction.
|
}
|
||||||
*
|
|
||||||
* @param string $state
|
|
||||||
*/
|
|
||||||
public function setState($state) {
|
|
||||||
$this->state = $state;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* State of the capture transaction.
|
* Get Amount
|
||||||
*
|
* Amount being captured
|
||||||
* @return string
|
* 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
|
||||||
public function getState() {
|
* 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 $this->state;
|
*
|
||||||
}
|
* @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;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the Payment resource that this transaction is based on.
|
* Get Is Final Capture
|
||||||
*
|
* Whether this is a final capture for the given authorization or not
|
||||||
* @return string
|
* If it's final, all the remaining funds held by the authorization, will be released in the funding instrument
|
||||||
*/
|
*
|
||||||
public function getParentPayment() {
|
* @return boolean
|
||||||
return $this->parent_payment;
|
*/
|
||||||
}
|
public function getIsFinalCapture()
|
||||||
|
{
|
||||||
|
return $this->is_final_capture;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the Payment resource that this transaction is based on.
|
* Set Is Final Capture
|
||||||
*
|
* Whether this is a final capture for the given authorization or not
|
||||||
* @param string $parent_payment
|
* If it's final, all the remaining funds held by the authorization, will be released in the funding instrument
|
||||||
* @deprecated. Instead use setParentPayment
|
*
|
||||||
*/
|
* @param boolean $is_final_capture
|
||||||
public function setParent_payment($parent_payment) {
|
*
|
||||||
$this->parent_payment = $parent_payment;
|
* @deprecated Use setIsFinalCapture
|
||||||
return $this;
|
*
|
||||||
}
|
* @return $this
|
||||||
/**
|
*/
|
||||||
* ID of the Payment resource that this transaction is based on.
|
public function setIs_final_capture($is_final_capture)
|
||||||
*
|
{
|
||||||
* @return string
|
$this->is_final_capture = $is_final_capture;
|
||||||
* @deprecated. Instead use getParentPayment
|
|
||||||
*/
|
|
||||||
public function getParent_payment() {
|
|
||||||
return $this->parent_payment;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @array
|
|
||||||
* @param PayPal\Api\Links $links
|
|
||||||
*/
|
|
||||||
public function setLinks($links) {
|
|
||||||
$this->links = $links;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get Is Final Capture
|
||||||
*
|
* Whether this is a final capture for the given authorization or not
|
||||||
* @return PayPal\Api\Links
|
* If it's final, all the remaining funds held by the authorization, will be released in the funding instrument
|
||||||
*/
|
*
|
||||||
public function getLinks() {
|
* @deprecated Use getIsFinalCapture
|
||||||
return $this->links;
|
*
|
||||||
}
|
* @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;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Obtain the Capture transaction resource for the given identifier.
|
* Get State
|
||||||
*
|
* State of the capture transaction
|
||||||
* @param string $captureId
|
*
|
||||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
* @return string
|
||||||
* @return Capture
|
*/
|
||||||
*/
|
public function getState()
|
||||||
public static function get($captureId, $apiContext = null) {
|
{
|
||||||
if (($captureId == null) || (strlen($captureId) <= 0)) {
|
return $this->state;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Creates (and processes) a new Refund Transaction added as a related resource.
|
* Set Parent Payment
|
||||||
*
|
* ID of the Payment resource that this transaction is based on
|
||||||
* @param Refund $refund
|
*
|
||||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
* @param string $parent_payment
|
||||||
* @return Refund
|
*
|
||||||
*/
|
* @return $this
|
||||||
public function refund($refund, $apiContext = null) {
|
*/
|
||||||
if ($this->getId() == null) {
|
public function setParentPayment($parent_payment)
|
||||||
throw new \InvalidArgumentException("Id cannot be null");
|
{
|
||||||
}
|
$this->parent_payment = $parent_payment;
|
||||||
if (($refund == null)) {
|
|
||||||
throw new \InvalidArgumentException("refund cannot be null or empty");
|
return $this;
|
||||||
}
|
}
|
||||||
$payLoad = $refund->toJSON();
|
|
||||||
if ($apiContext == null) {
|
/**
|
||||||
$apiContext = new ApiContext(self::$credential);
|
* Get Parent Payment
|
||||||
}
|
* ID of the Payment resource that this transaction is based on
|
||||||
$call = new PPRestCall($apiContext);
|
*
|
||||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/capture/{$this->getId()}/refund", "POST", $payLoad);
|
* @return string
|
||||||
$ret = new Refund();
|
*/
|
||||||
$ret->fromJson($json);
|
public function getParentPayment()
|
||||||
return $ret;
|
{
|
||||||
}
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,108 +1,155 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class CreditCardHistory extends PPModel {
|
/**
|
||||||
/**
|
* Class CreditCardHistory
|
||||||
* A list of credit card resources
|
*
|
||||||
*
|
* @property int count
|
||||||
* @array
|
* @property string next_id
|
||||||
* @param PayPal\Api\CreditCard $credit-cards
|
*/
|
||||||
*/
|
class CreditCardHistory extends PPModel
|
||||||
public function setCreditCards($credit_cards) {
|
{
|
||||||
$this->{"credit-cards"} = $credit_cards;
|
/**
|
||||||
return $this;
|
* 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;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* A list of credit card resources
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\CreditCard
|
|
||||||
*/
|
|
||||||
public function getCreditCards() {
|
|
||||||
return $this->{"credit-cards"};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of credit card resources
|
* Get Credit Cards
|
||||||
*
|
* A list of credit card resources
|
||||||
* @array
|
*
|
||||||
* @param PayPal\Api\CreditCard $credit-cards
|
* @return \PayPal\Api\CreditCard
|
||||||
* @deprecated. Instead use setCreditCards
|
*/
|
||||||
*/
|
public function getCreditCards()
|
||||||
public function setCredit_cards($credit_cards) {
|
{
|
||||||
$this->{"credit-cards"} = $credit_cards;
|
return $this->{"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"};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
* Set Credit Cards
|
||||||
*
|
* A list of credit card resources
|
||||||
* @param integer $count
|
*
|
||||||
*/
|
* @param \PayPal\Api\CreditCard $credit_cards
|
||||||
public function setCount($count) {
|
*
|
||||||
$this->count = $count;
|
* @deprecated Use setCreditCards
|
||||||
return $this;
|
*
|
||||||
}
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setCredit_cards($credit_cards)
|
||||||
|
{
|
||||||
|
$this->{"credit-cards"} = $credit_cards;
|
||||||
|
|
||||||
/**
|
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 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.
|
* Set Count
|
||||||
*
|
* Number of items returned in each range of results
|
||||||
* @param string $next_id
|
* Note that the last results range could have fewer items than the requested number of items
|
||||||
*/
|
*
|
||||||
public function setNextId($next_id) {
|
* @param int $count
|
||||||
$this->next_id = $next_id;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
|
public function setCount($count)
|
||||||
|
{
|
||||||
|
$this->count = $count;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 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.
|
* Set Count
|
||||||
*
|
* Number of items returned in each range of results
|
||||||
* @param string $next_id
|
* Note that the last results range could have fewer items than the requested number of items
|
||||||
* @deprecated. Instead use setNextId
|
*
|
||||||
*/
|
* @return int
|
||||||
public function setNext_id($next_id) {
|
*/
|
||||||
$this->next_id = $next_id;
|
public function getCount()
|
||||||
return $this;
|
{
|
||||||
}
|
return $this->count;
|
||||||
/**
|
}
|
||||||
* 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
|
||||||
|
*
|
||||||
|
* @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,204 +1,297 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class CreditCardToken extends PPModel {
|
/**
|
||||||
/**
|
* Class CreditCardToken
|
||||||
* ID of a previously saved Credit Card resource using /vault/credit-card API.
|
*
|
||||||
*
|
* @property string credit_card_id
|
||||||
* @param string $credit_card_id
|
* @property string payer_id
|
||||||
*/
|
* @property string last4
|
||||||
public function setCreditCardId($credit_card_id) {
|
* @property string type
|
||||||
$this->credit_card_id = $credit_card_id;
|
* @property int expire_month
|
||||||
return $this;
|
* @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;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* ID of a previously saved Credit Card resource using /vault/credit-card API.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getCreditCardId() {
|
|
||||||
return $this->credit_card_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of a previously saved Credit Card resource using /vault/credit-card API.
|
* Get Credit Card ID
|
||||||
*
|
* ID of a previously saved Credit Card resource using /vault/credit-card API
|
||||||
* @param string $credit_card_id
|
*
|
||||||
* @deprecated. Instead use setCreditCardId
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function setCredit_card_id($credit_card_id) {
|
public function getCreditCardId()
|
||||||
$this->credit_card_id = $credit_card_id;
|
{
|
||||||
return $this;
|
return $this->credit_card_id;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API.
|
* Set Credit Card ID
|
||||||
*
|
* ID of a previously saved Credit Card resource using /vault/credit-card API
|
||||||
* @param string $payer_id
|
*
|
||||||
*/
|
* @param string $credit_card_id
|
||||||
public function setPayerId($payer_id) {
|
*
|
||||||
$this->payer_id = $payer_id;
|
* @deprecated Use setCreditCardId
|
||||||
return $this;
|
*
|
||||||
}
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setCredit_card_id($credit_card_id)
|
||||||
|
{
|
||||||
|
$this->credit_card_id = $credit_card_id;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API.
|
* Get Credit Card ID
|
||||||
*
|
* ID of a previously saved Credit Card resource using /vault/credit-card API
|
||||||
* @param string $payer_id
|
*
|
||||||
* @deprecated. Instead use setPayerId
|
* @deprecated Use getCreditCardId
|
||||||
*/
|
*
|
||||||
public function setPayer_id($payer_id) {
|
* @return string
|
||||||
$this->payer_id = $payer_id;
|
*/
|
||||||
return $this;
|
public function getCredit_card_id()
|
||||||
}
|
{
|
||||||
/**
|
return $this->credit_card_id;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Last 4 digits of the card number from the saved card.
|
* Set Payer ID
|
||||||
*
|
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API
|
||||||
* @param string $last4
|
*
|
||||||
*/
|
* @param string $payer_id
|
||||||
public function setLast4($last4) {
|
*
|
||||||
$this->last4 = $last4;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setPayerId($payer_id)
|
||||||
|
{
|
||||||
|
$this->payer_id = $payer_id;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Last 4 digits of the card number from the saved card.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getLast4() {
|
|
||||||
return $this->last4;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Set Payer ID
|
||||||
*
|
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API
|
||||||
* @param string $type
|
*
|
||||||
*/
|
* @param string $payer_id
|
||||||
public function setType($type) {
|
*
|
||||||
$this->type = $type;
|
* @deprecated Use setPayerId
|
||||||
return $this;
|
*
|
||||||
}
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setPayer_id($payer_id)
|
||||||
|
{
|
||||||
|
$this->payer_id = $payer_id;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
* Set Last Four
|
||||||
*
|
* Last 4 digits of the card number from the saved card
|
||||||
* @param integer $expire_month
|
*
|
||||||
*/
|
* @param string $last4
|
||||||
public function setExpireMonth($expire_month) {
|
*
|
||||||
$this->expire_month = $expire_month;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setLast4($last4)
|
||||||
|
{
|
||||||
|
$this->last4 = $last4;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* card expiry month from the saved card with value 1 - 12
|
}
|
||||||
*
|
|
||||||
* @return integer
|
|
||||||
*/
|
|
||||||
public function getExpireMonth() {
|
|
||||||
return $this->expire_month;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* card expiry month from the saved card with value 1 - 12
|
* Get Last Four
|
||||||
*
|
* Last 4 digits of the card number from the saved card
|
||||||
* @param integer $expire_month
|
*
|
||||||
* @deprecated. Instead use setExpireMonth
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function setExpire_month($expire_month) {
|
public function getLast4()
|
||||||
$this->expire_month = $expire_month;
|
{
|
||||||
return $this;
|
return $this->last4;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 4 digit card expiry year from the saved card
|
* Set Type
|
||||||
*
|
* (eg. visa, mastercard, etc) from the saved card
|
||||||
* @param integer $expire_year
|
* Please note that the values are always in lowercase and not meant to be used directly for display
|
||||||
*/
|
*
|
||||||
public function setExpireYear($expire_year) {
|
* @param string $type
|
||||||
$this->expire_year = $expire_year;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
|
public function setType($type)
|
||||||
|
{
|
||||||
|
$this->type = $type;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 4 digit card expiry year from the saved card
|
}
|
||||||
*
|
|
||||||
* @return integer
|
|
||||||
*/
|
|
||||||
public function getExpireYear() {
|
|
||||||
return $this->expire_year;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 4 digit card expiry year from the saved card
|
* Get Type
|
||||||
*
|
* (eg. visa, mastercard, etc) from the saved card
|
||||||
* @param integer $expire_year
|
* Please note that the values are always in lowercase and not meant to be used directly for display
|
||||||
* @deprecated. Instead use setExpireYear
|
*
|
||||||
*/
|
* @return string
|
||||||
public function setExpire_year($expire_year) {
|
*/
|
||||||
$this->expire_year = $expire_year;
|
public function getType()
|
||||||
return $this;
|
{
|
||||||
}
|
return $this->type;
|
||||||
/**
|
}
|
||||||
* 4 digit card expiry year from the saved card
|
|
||||||
*
|
|
||||||
* @return integer
|
|
||||||
* @deprecated. Instead use getExpireYear
|
|
||||||
*/
|
|
||||||
public function getExpire_year() {
|
|
||||||
return $this->expire_year;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,88 +1,119 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class Details extends PPModel {
|
/**
|
||||||
/**
|
* Class Details
|
||||||
* Amount being charged for shipping.
|
*
|
||||||
*
|
* @property string shipping
|
||||||
* @param string $shipping
|
* @property string subtotal
|
||||||
*/
|
* @property string tax
|
||||||
public function setShipping($shipping) {
|
* @property string fee
|
||||||
$this->shipping = $shipping;
|
*/
|
||||||
return $this;
|
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.
|
* Get Shipping
|
||||||
*
|
* Amount being charged for shipping
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getShipping() {
|
*/
|
||||||
return $this->shipping;
|
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.
|
* Get Subtotal
|
||||||
*
|
* Sub-total (amount) of items being paid for
|
||||||
* @param string $subtotal
|
*
|
||||||
*/
|
* @return string
|
||||||
public function setSubtotal($subtotal) {
|
*/
|
||||||
$this->subtotal = $subtotal;
|
public function getSubtotal()
|
||||||
return $this;
|
{
|
||||||
}
|
return $this->subtotal;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sub-total (amount) of items being paid for.
|
* Set Tax
|
||||||
*
|
* Amount being charged as tax
|
||||||
* @return string
|
*
|
||||||
*/
|
* @param string $tax
|
||||||
public function getSubtotal() {
|
*
|
||||||
return $this->subtotal;
|
* @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.
|
* Set Fee
|
||||||
*
|
* Fee charged by PayPal
|
||||||
* @param string $tax
|
* In case of a refund, this is the fee amount refunded to the original receipient of the payment
|
||||||
*/
|
*
|
||||||
public function setTax($tax) {
|
* @param string $fee
|
||||||
$this->tax = $tax;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
|
public function setFee($fee)
|
||||||
/**
|
{
|
||||||
* Amount being charged as tax.
|
$this->fee = $fee;
|
||||||
*
|
return $this;
|
||||||
* @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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,86 +1,119 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class FundingInstrument extends PPModel {
|
/**
|
||||||
/**
|
* Class FundingInstrument
|
||||||
* Credit Card information.
|
*
|
||||||
*
|
* @property \PayPal\Api\CreditCard credit_card
|
||||||
* @param PayPal\Api\CreditCard $credit_card
|
* @property \PayPal\Api\CreditCardToken credit_card_token
|
||||||
*/
|
*/
|
||||||
public function setCreditCard($credit_card) {
|
class FundingInstrument extends PPModel
|
||||||
$this->credit_card = $credit_card;
|
{
|
||||||
return $this;
|
/**
|
||||||
}
|
* Set Credit Card
|
||||||
|
*
|
||||||
|
* @param \PayPal\Api\CreditCard $credit_card
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setCreditCard($credit_card)
|
||||||
|
{
|
||||||
|
$this->credit_card = $credit_card;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Credit Card information.
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\CreditCard
|
|
||||||
*/
|
|
||||||
public function getCreditCard() {
|
|
||||||
return $this->credit_card;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Credit Card information.
|
* Get Credit Card
|
||||||
*
|
*
|
||||||
* @param PayPal\Api\CreditCard $credit_card
|
* @return \PayPal\Api\CreditCard
|
||||||
* @deprecated. Instead use setCreditCard
|
*/
|
||||||
*/
|
public function getCreditCard()
|
||||||
public function setCredit_card($credit_card) {
|
{
|
||||||
$this->credit_card = $credit_card;
|
return $this->credit_card;
|
||||||
return $this;
|
}
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Credit Card information.
|
|
||||||
*
|
|
||||||
* @return PayPal\Api\CreditCard
|
|
||||||
* @deprecated. Instead use getCreditCard
|
|
||||||
*/
|
|
||||||
public function getCredit_card() {
|
|
||||||
return $this->credit_card;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Credit Card information.
|
* Set Credit Card
|
||||||
*
|
*
|
||||||
* @param PayPal\Api\CreditCardToken $credit_card_token
|
* @param \PayPal\Api\CreditCard $credit_card
|
||||||
*/
|
*
|
||||||
public function setCreditCardToken($credit_card_token) {
|
* @deprecated Use setCreditCard
|
||||||
$this->credit_card_token = $credit_card_token;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
|
public function setCredit_card($credit_card)
|
||||||
|
{
|
||||||
|
$this->credit_card = $credit_card;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Credit Card information.
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\CreditCardToken
|
|
||||||
*/
|
|
||||||
public function getCreditCardToken() {
|
|
||||||
return $this->credit_card_token;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Credit Card information.
|
* Get Credit Card
|
||||||
*
|
*
|
||||||
* @param PayPal\Api\CreditCardToken $credit_card_token
|
* @deprecated Use getCreditCard
|
||||||
* @deprecated. Instead use setCreditCardToken
|
*
|
||||||
*/
|
* @return \PayPal\Api\CreditCard
|
||||||
public function setCredit_card_token($credit_card_token) {
|
*/
|
||||||
$this->credit_card_token = $credit_card_token;
|
public function getCredit_card()
|
||||||
return $this;
|
{
|
||||||
}
|
return $this->credit_card;
|
||||||
/**
|
}
|
||||||
* Credit Card information.
|
|
||||||
*
|
|
||||||
* @return PayPal\Api\CreditCardToken
|
|
||||||
* @deprecated. Instead use getCreditCardToken
|
|
||||||
*/
|
|
||||||
public function getCredit_card_token() {
|
|
||||||
return $this->credit_card_token;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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,129 +1,163 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class HyperSchema extends PPModel {
|
/**
|
||||||
/**
|
* Class HyperSchema
|
||||||
*
|
*
|
||||||
*
|
* @property \PayPal\Api\Links links
|
||||||
* @array
|
* @property string fragmentResolution
|
||||||
* @param PayPal\Api\Links $links
|
* @property bool readonly
|
||||||
*/
|
* @property string contentEncoding
|
||||||
public function setLinks($links) {
|
* @property string pathStart
|
||||||
$this->links = $links;
|
* @property string mediaType
|
||||||
return $this;
|
*/
|
||||||
}
|
class HyperSchema extends PPModel
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Set Links
|
||||||
|
*
|
||||||
|
* @param \PayPal\Api\Links $links
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setLinks($links)
|
||||||
|
{
|
||||||
|
$this->links = $links;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\Links
|
|
||||||
*/
|
|
||||||
public function getLinks() {
|
|
||||||
return $this->links;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Links
|
||||||
|
*
|
||||||
|
* @return \PayPal\Api\Links
|
||||||
|
*/
|
||||||
|
public function getLinks()
|
||||||
|
{
|
||||||
|
return $this->links;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set Fragment Resolution
|
||||||
*
|
*
|
||||||
* @param string $fragmentResolution
|
* @param string $fragmentResolution
|
||||||
*/
|
*
|
||||||
public function setFragmentResolution($fragmentResolution) {
|
* @return $this
|
||||||
$this->fragmentResolution = $fragmentResolution;
|
*/
|
||||||
return $this;
|
public function setFragmentResolution($fragmentResolution)
|
||||||
}
|
{
|
||||||
|
$this->fragmentResolution = $fragmentResolution;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getFragmentResolution() {
|
|
||||||
return $this->fragmentResolution;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Fragment Resolution
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getFragmentResolution()
|
||||||
|
{
|
||||||
|
return $this->fragmentResolution;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set Read Only
|
||||||
*
|
*
|
||||||
* @param boolean $readonly
|
* @param bool $readonly
|
||||||
*/
|
*
|
||||||
public function setReadonly($readonly) {
|
* @return $this
|
||||||
$this->readonly = $readonly;
|
*/
|
||||||
return $this;
|
public function setReadonly($readonly)
|
||||||
}
|
{
|
||||||
|
$this->readonly = $readonly;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
public function getReadonly() {
|
|
||||||
return $this->readonly;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Read Only
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function getReadonly()
|
||||||
|
{
|
||||||
|
return $this->readonly;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set Content Encoding
|
||||||
*
|
*
|
||||||
* @param string $contentEncoding
|
* @param string $contentEncoding
|
||||||
*/
|
*
|
||||||
public function setContentEncoding($contentEncoding) {
|
* @return $this
|
||||||
$this->contentEncoding = $contentEncoding;
|
*/
|
||||||
return $this;
|
public function setContentEncoding($contentEncoding)
|
||||||
}
|
{
|
||||||
|
$this->contentEncoding = $contentEncoding;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getContentEncoding() {
|
|
||||||
return $this->contentEncoding;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Content Encoding
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getContentEncoding()
|
||||||
|
{
|
||||||
|
return $this->contentEncoding;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set Path Start
|
||||||
*
|
*
|
||||||
* @param string $pathStart
|
* @param string $pathStart
|
||||||
*/
|
*
|
||||||
public function setPathStart($pathStart) {
|
* @return $this
|
||||||
$this->pathStart = $pathStart;
|
*/
|
||||||
return $this;
|
public function setPathStart($pathStart)
|
||||||
}
|
{
|
||||||
|
$this->pathStart = $pathStart;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getPathStart() {
|
|
||||||
return $this->pathStart;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Path Start
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getPathStart()
|
||||||
|
{
|
||||||
|
return $this->pathStart;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set Media Type
|
||||||
*
|
*
|
||||||
* @param string $mediaType
|
* @param string $mediaType
|
||||||
*/
|
*
|
||||||
public function setMediaType($mediaType) {
|
* @return $this
|
||||||
$this->mediaType = $mediaType;
|
*/
|
||||||
return $this;
|
public function setMediaType($mediaType)
|
||||||
}
|
{
|
||||||
|
$this->mediaType = $mediaType;
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getMediaType() {
|
|
||||||
return $this->mediaType;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Media Type
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getMediaType()
|
||||||
|
{
|
||||||
|
return $this->mediaType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,108 +1,148 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class Item extends PPModel {
|
/**
|
||||||
/**
|
* Class Item
|
||||||
* Number of items.
|
*
|
||||||
*
|
* @property string quantity
|
||||||
* @param string $quantity
|
* @property string name
|
||||||
*/
|
* @property string price
|
||||||
public function setQuantity($quantity) {
|
* @property string currency
|
||||||
$this->quantity = $quantity;
|
* @property string sku
|
||||||
return $this;
|
*/
|
||||||
}
|
class Item extends PPModel
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Set Quantity
|
||||||
|
* Number of items
|
||||||
|
*
|
||||||
|
* @param string $quantity
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setQuantity($quantity)
|
||||||
|
{
|
||||||
|
$this->quantity = $quantity;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Number of items.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getQuantity() {
|
|
||||||
return $this->quantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Quantity
|
||||||
|
* Number of items
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getQuantity()
|
||||||
|
{
|
||||||
|
return $this->quantity;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the item.
|
* Set Name
|
||||||
*
|
* Name of the item
|
||||||
* @param string $name
|
*
|
||||||
*/
|
* @param string $name
|
||||||
public function setName($name) {
|
*
|
||||||
$this->name = $name;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setName($name)
|
||||||
|
{
|
||||||
|
$this->name = $name;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Name of the item.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getName() {
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Name
|
||||||
|
* Name of the item
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cost of the item.
|
* Set Price
|
||||||
*
|
* Cost of the item
|
||||||
* @param string $price
|
*
|
||||||
*/
|
* @param string $price
|
||||||
public function setPrice($price) {
|
*
|
||||||
$this->price = $price;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setPrice($price)
|
||||||
|
{
|
||||||
|
$this->price = $price;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Cost of the item.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getPrice() {
|
|
||||||
return $this->price;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Price
|
||||||
|
* Cost of the item
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getPrice()
|
||||||
|
{
|
||||||
|
return $this->price;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 3-letter Currency Code
|
* Set Currency
|
||||||
*
|
* Three Letter Currency Code
|
||||||
* @param string $currency
|
*
|
||||||
*/
|
* @param string $currency
|
||||||
public function setCurrency($currency) {
|
*
|
||||||
$this->currency = $currency;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setCurrency($currency)
|
||||||
|
{
|
||||||
|
$this->currency = $currency;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 3-letter Currency Code
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getCurrency() {
|
|
||||||
return $this->currency;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Set SKU
|
||||||
*
|
* Number or code to identify the item in your catalog/records
|
||||||
* @param string $sku
|
*
|
||||||
*/
|
* @param string $sku
|
||||||
public function setSku($sku) {
|
*
|
||||||
$this->sku = $sku;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setSku($sku)
|
||||||
|
{
|
||||||
/**
|
$this->sku = $sku;
|
||||||
* Number or code to identify the item in your catalog/records.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getSku() {
|
|
||||||
return $this->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,68 +1,93 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class ItemList extends PPModel {
|
/**
|
||||||
/**
|
* Class ItemList
|
||||||
* List of items.
|
*
|
||||||
*
|
* @property array|\PayPal\Api\Item items
|
||||||
* @array
|
* @property \PayPal\Api\ShippingAddress shipping_address
|
||||||
* @param PayPal\Api\Item $items
|
*/
|
||||||
*/
|
class ItemList extends PPModel
|
||||||
public function setItems(array $items) {
|
{
|
||||||
$this->items = $items;
|
/**
|
||||||
return $this;
|
* Set Items
|
||||||
}
|
* List of Items
|
||||||
|
*
|
||||||
|
* @param array|\PayPal\Api\Item $items
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setItems($items)
|
||||||
|
{
|
||||||
|
$this->items = $items;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* List of items.
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\Item
|
|
||||||
*/
|
|
||||||
public function getItems() {
|
|
||||||
return $this->items;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Items
|
||||||
|
* List of items
|
||||||
|
*
|
||||||
|
* @return \PayPal\Api\Item
|
||||||
|
*/
|
||||||
|
public function getItems()
|
||||||
|
{
|
||||||
|
return $this->items;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shipping address.
|
* Set Shipping Address
|
||||||
*
|
*
|
||||||
* @param PayPal\Api\ShippingAddress $shipping_address
|
* @param \PayPal\Api\ShippingAddress $shipping_address
|
||||||
*/
|
*
|
||||||
public function setShippingAddress($shipping_address) {
|
* @return $this
|
||||||
$this->shipping_address = $shipping_address;
|
*/
|
||||||
return $this;
|
public function setShippingAddress($shipping_address)
|
||||||
}
|
{
|
||||||
|
$this->shipping_address = $shipping_address;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Shipping address.
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\ShippingAddress
|
|
||||||
*/
|
|
||||||
public function getShippingAddress() {
|
|
||||||
return $this->shipping_address;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shipping address.
|
* Get Shipping Address
|
||||||
*
|
*
|
||||||
* @param PayPal\Api\ShippingAddress $shipping_address
|
* @return \PayPal\Api\ShippingAddress
|
||||||
* @deprecated. Instead use setShippingAddress
|
*/
|
||||||
*/
|
public function getShippingAddress()
|
||||||
public function setShipping_address($shipping_address) {
|
{
|
||||||
$this->shipping_address = $shipping_address;
|
return $this->shipping_address;
|
||||||
return $this;
|
}
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Shipping address.
|
|
||||||
*
|
|
||||||
* @return PayPal\Api\ShippingAddress
|
|
||||||
* @deprecated. Instead use getShippingAddress
|
|
||||||
*/
|
|
||||||
public function getShipping_address() {
|
|
||||||
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,128 +1,163 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class Links extends PPModel {
|
/**
|
||||||
/**
|
* Class Links
|
||||||
*
|
*
|
||||||
*
|
* @property string href
|
||||||
* @param string $href
|
* @property string rel
|
||||||
*/
|
* @property \PayPal\Api\HyperSchema targetSchema
|
||||||
public function setHref($href) {
|
* @property string method
|
||||||
$this->href = $href;
|
* @property string enctype
|
||||||
return $this;
|
* @property \PayPal\Api\HyperSchema schema
|
||||||
}
|
*/
|
||||||
|
class Links extends PPModel
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Set Href
|
||||||
|
*
|
||||||
|
* @param string $href
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setHref($href)
|
||||||
|
{
|
||||||
|
$this->href = $href;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getHref() {
|
|
||||||
return $this->href;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Href
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getHref()
|
||||||
|
{
|
||||||
|
return $this->href;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set Rel
|
||||||
*
|
*
|
||||||
* @param string $rel
|
* @param string $rel
|
||||||
*/
|
*
|
||||||
public function setRel($rel) {
|
* @return $this
|
||||||
$this->rel = $rel;
|
*/
|
||||||
return $this;
|
public function setRel($rel)
|
||||||
}
|
{
|
||||||
|
$this->rel = $rel;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getRel() {
|
|
||||||
return $this->rel;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Rel
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getRel()
|
||||||
|
{
|
||||||
|
return $this->rel;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set Target Schema
|
||||||
*
|
*
|
||||||
* @param PayPal\Api\HyperSchema $targetSchema
|
* @param \PayPal\Api\HyperSchema $targetSchema
|
||||||
*/
|
*
|
||||||
public function setTargetSchema($targetSchema) {
|
* @return $this
|
||||||
$this->targetSchema = $targetSchema;
|
*/
|
||||||
return $this;
|
public function setTargetSchema($targetSchema)
|
||||||
}
|
{
|
||||||
|
$this->targetSchema = $targetSchema;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\HyperSchema
|
|
||||||
*/
|
|
||||||
public function getTargetSchema() {
|
|
||||||
return $this->targetSchema;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Target Schema
|
||||||
|
*
|
||||||
|
* @return \PayPal\Api\HyperSchema
|
||||||
|
*/
|
||||||
|
public function getTargetSchema()
|
||||||
|
{
|
||||||
|
return $this->targetSchema;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set Method
|
||||||
*
|
*
|
||||||
* @param string $method
|
* @param string $method
|
||||||
*/
|
*
|
||||||
public function setMethod($method) {
|
* @return $this
|
||||||
$this->method = $method;
|
*/
|
||||||
return $this;
|
public function setMethod($method)
|
||||||
}
|
{
|
||||||
|
$this->method = $method;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getMethod() {
|
|
||||||
return $this->method;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Method
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getMethod()
|
||||||
|
{
|
||||||
|
return $this->method;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set Enctype
|
||||||
*
|
*
|
||||||
* @param string $enctype
|
* @param string $enctype
|
||||||
*/
|
*
|
||||||
public function setEnctype($enctype) {
|
* @return $this
|
||||||
$this->enctype = $enctype;
|
*/
|
||||||
return $this;
|
public function setEnctype($enctype)
|
||||||
}
|
{
|
||||||
|
$this->enctype = $enctype;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getEnctype() {
|
|
||||||
return $this->enctype;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Enctype
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getEnctype()
|
||||||
|
{
|
||||||
|
return $this->enctype;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set Schema
|
||||||
*
|
*
|
||||||
* @param PayPal\Api\HyperSchema $schema
|
* @param \PayPal\Api\HyperSchema $schema
|
||||||
*/
|
*
|
||||||
public function setSchema($schema) {
|
* @return $this
|
||||||
$this->schema = $schema;
|
*/
|
||||||
return $this;
|
public function setSchema($schema)
|
||||||
}
|
{
|
||||||
|
$this->schema = $schema;
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return PayPal\Api\HyperSchema
|
|
||||||
*/
|
|
||||||
public function getSchema() {
|
|
||||||
return $this->schema;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Schema
|
||||||
|
*
|
||||||
|
* @return \PayPal\Api\HyperSchema
|
||||||
|
*/
|
||||||
|
public function getSchema()
|
||||||
|
{
|
||||||
|
return $this->schema;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,87 +1,130 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class Payee extends PPModel {
|
/**
|
||||||
/**
|
* Class Payee
|
||||||
* 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.
|
*
|
||||||
*
|
* @property string email
|
||||||
* @param string $email
|
* @property string merchant_id
|
||||||
*/
|
* @property string phone
|
||||||
public function setEmail($email) {
|
*/
|
||||||
$this->email = $email;
|
class Payee extends PPModel
|
||||||
return $this;
|
{
|
||||||
}
|
/**
|
||||||
|
* 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;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Set Merchant ID
|
||||||
*
|
* Encrypted PayPal Account identifier for the Payee
|
||||||
* @param string $merchant_id
|
*
|
||||||
*/
|
* @param string $merchant_id
|
||||||
public function setMerchantId($merchant_id) {
|
*
|
||||||
$this->merchant_id = $merchant_id;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setMerchantId($merchant_id)
|
||||||
|
{
|
||||||
|
$this->merchant_id = $merchant_id;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encrypted PayPal Account identifier for the Payee.
|
* Get Merchant ID
|
||||||
*
|
* Encrypted PayPal Account identifier for the Payee
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getMerchantId() {
|
*/
|
||||||
return $this->merchant_id;
|
public function getMerchantId()
|
||||||
}
|
{
|
||||||
|
return $this->merchant_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encrypted PayPal Account identifier for the Payee.
|
* Set Merchant ID
|
||||||
*
|
* Encrypted PayPal Account identifier for the Payee
|
||||||
* @param string $merchant_id
|
*
|
||||||
* @deprecated. Instead use setMerchantId
|
* @param string $merchant_id
|
||||||
*/
|
*
|
||||||
public function setMerchant_id($merchant_id) {
|
* @deprecated Use setMerchantId
|
||||||
$this->merchant_id = $merchant_id;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
/**
|
public function setMerchant_id($merchant_id)
|
||||||
* Encrypted PayPal Account identifier for the Payee.
|
{
|
||||||
*
|
$this->merchant_id = $merchant_id;
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getMerchantId
|
|
||||||
*/
|
|
||||||
public function getMerchant_id() {
|
|
||||||
return $this->merchant_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
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.
|
}
|
||||||
*
|
|
||||||
* @param string $phone
|
|
||||||
*/
|
|
||||||
public function setPhone($phone) {
|
|
||||||
$this->phone = $phone;
|
|
||||||
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.
|
* Get Merchant ID
|
||||||
*
|
* Encrypted PayPal Account identifier for the Payee
|
||||||
* @return string
|
*
|
||||||
*/
|
* @deprecated Use getMerchantId
|
||||||
public function getPhone() {
|
*
|
||||||
return $this->phone;
|
* @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,127 +1,182 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class Payer extends PPModel {
|
/**
|
||||||
/**
|
* Class Payer
|
||||||
* Payment method being used - PayPal Wallet payment or Direct Credit card.
|
*
|
||||||
*
|
* @property string payment_method
|
||||||
* @param string $payment_method
|
* @property array|\PayPal\Api\FundingInstrument funding_instruments
|
||||||
*/
|
* @property \PayPal\Api\PayerInfo payer_info
|
||||||
public function setPaymentMethod($payment_method) {
|
*/
|
||||||
$this->payment_method = $payment_method;
|
class Payer extends PPModel
|
||||||
return $this;
|
{
|
||||||
}
|
/**
|
||||||
|
* 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;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Payment method being used - PayPal Wallet payment or Direct Credit card.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getPaymentMethod() {
|
|
||||||
return $this->payment_method;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Payment method being used - PayPal Wallet payment or Direct Credit card.
|
* Get Payment Method
|
||||||
*
|
* Payment method being used - PayPal Wallet payment or Direct Credit card
|
||||||
* @param string $payment_method
|
*
|
||||||
* @deprecated. Instead use setPaymentMethod
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function setPayment_method($payment_method) {
|
public function getPaymentMethod()
|
||||||
$this->payment_method = $payment_method;
|
{
|
||||||
return $this;
|
return $this->payment_method;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card.
|
* Set Payment Method
|
||||||
*
|
* Payment method being used - PayPal Wallet payment or Direct Credit card
|
||||||
* @array
|
*
|
||||||
* @param PayPal\Api\FundingInstrument $funding_instruments
|
* @param string $payment_method
|
||||||
*/
|
*
|
||||||
public function setFundingInstruments($funding_instruments) {
|
* @deprecated Use setPaymentMethod
|
||||||
$this->funding_instruments = $funding_instruments;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
|
public function setPayment_method($payment_method)
|
||||||
|
{
|
||||||
|
$this->payment_method = $payment_method;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card.
|
* Get Payment Method
|
||||||
*
|
* Payment method being used - PayPal Wallet payment or Direct Credit card
|
||||||
* @array
|
*
|
||||||
* @param PayPal\Api\FundingInstrument $funding_instruments
|
* @deprecated Use getPaymentMethod
|
||||||
* @deprecated. Instead use setFundingInstruments
|
*
|
||||||
*/
|
* @return string
|
||||||
public function setFunding_instruments($funding_instruments) {
|
*/
|
||||||
$this->funding_instruments = $funding_instruments;
|
public function getPayment_method()
|
||||||
return $this;
|
{
|
||||||
}
|
return $this->payment_method;
|
||||||
/**
|
}
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
* Set Funding Instruments
|
||||||
*
|
* List of funding instruments from where the funds of the current payment come from. Typically a credit card
|
||||||
* @param PayPal\Api\PayerInfo $payer_info
|
*
|
||||||
*/
|
* @param \PayPal\Api\FundingInstrument|array $funding_instruments
|
||||||
public function setPayerInfo($payer_info) {
|
*
|
||||||
$this->payer_info = $payer_info;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setFundingInstruments($funding_instruments)
|
||||||
|
{
|
||||||
|
$this->funding_instruments = $funding_instruments;
|
||||||
|
|
||||||
/**
|
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
|
|
||||||
*/
|
|
||||||
public function getPayerInfo() {
|
|
||||||
return $this->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.
|
* Get Funding Instruments
|
||||||
*
|
*
|
||||||
* @param PayPal\Api\PayerInfo $payer_info
|
* @return \PayPal\Api\FundingInstrument|array
|
||||||
* @deprecated. Instead use setPayerInfo
|
*/
|
||||||
*/
|
public function getFundingInstruments()
|
||||||
public function setPayer_info($payer_info) {
|
{
|
||||||
$this->payer_info = $payer_info;
|
return $this->funding_instruments;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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,204 +1,295 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class PayerInfo extends PPModel {
|
/**
|
||||||
/**
|
* Class PayerInfo
|
||||||
* Email address representing the Payer.
|
*
|
||||||
*
|
* @property string email
|
||||||
* @param string $email
|
* @property string first_name
|
||||||
*/
|
* @property string last_name
|
||||||
public function setEmail($email) {
|
* @property string payer_id
|
||||||
$this->email = $email;
|
* @property string phone
|
||||||
return $this;
|
* @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;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Email address representing the Payer.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getEmail() {
|
|
||||||
return $this->email;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Email
|
||||||
|
* Email address representing the Payer
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getEmail()
|
||||||
|
{
|
||||||
|
return $this->email;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* First Name of the Payer from their PayPal Account.
|
* Set First Name
|
||||||
*
|
* First Name of the Payer from their PayPal Account
|
||||||
* @param string $first_name
|
*
|
||||||
*/
|
* @param string $first_name
|
||||||
public function setFirstName($first_name) {
|
*
|
||||||
$this->first_name = $first_name;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setFirstName($first_name)
|
||||||
|
{
|
||||||
|
$this->first_name = $first_name;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* First Name of the Payer from their PayPal Account.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getFirstName() {
|
|
||||||
return $this->first_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* First Name of the Payer from their PayPal Account.
|
* Get First Name
|
||||||
*
|
* First Name of the Payer from their PayPal Account
|
||||||
* @param string $first_name
|
*
|
||||||
* @deprecated. Instead use setFirstName
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function setFirst_name($first_name) {
|
public function getFirstName()
|
||||||
$this->first_name = $first_name;
|
{
|
||||||
return $this;
|
return $this->first_name;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* First Name of the Payer from their PayPal Account.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getFirstName
|
|
||||||
*/
|
|
||||||
public function getFirst_name() {
|
|
||||||
return $this->first_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Last Name of the Payer from their PayPal Account.
|
* Set First Name
|
||||||
*
|
* First Name of the Payer from their PayPal Account
|
||||||
* @param string $last_name
|
*
|
||||||
*/
|
* @param string $first_name
|
||||||
public function setLastName($last_name) {
|
*
|
||||||
$this->last_name = $last_name;
|
* @deprecated Use setFirstName
|
||||||
return $this;
|
*
|
||||||
}
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setFirst_name($first_name)
|
||||||
|
{
|
||||||
|
$this->first_name = $first_name;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Last Name of the Payer from their PayPal Account.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getLastName() {
|
|
||||||
return $this->last_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Last Name of the Payer from their PayPal Account.
|
* Get First Name
|
||||||
*
|
* First Name of the Payer from their PayPal Account
|
||||||
* @param string $last_name
|
*
|
||||||
* @deprecated. Instead use setLastName
|
* @deprecated Use getFirstName
|
||||||
*/
|
*
|
||||||
public function setLast_name($last_name) {
|
* @return string
|
||||||
$this->last_name = $last_name;
|
*/
|
||||||
return $this;
|
public function getFirst_name()
|
||||||
}
|
{
|
||||||
/**
|
return $this->first_name;
|
||||||
* Last Name of the Payer from their PayPal Account.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getLastName
|
|
||||||
*/
|
|
||||||
public function getLast_name() {
|
|
||||||
return $this->last_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PayPal assigned Payer ID.
|
* Set Last Name
|
||||||
*
|
* Last Name of the Payer from their PayPal Account
|
||||||
* @param string $payer_id
|
*
|
||||||
*/
|
* @param string $last_name
|
||||||
public function setPayerId($payer_id) {
|
*
|
||||||
$this->payer_id = $payer_id;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setLastName($last_name)
|
||||||
|
{
|
||||||
|
$this->last_name = $last_name;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* PayPal assigned Payer ID.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getPayerId() {
|
|
||||||
return $this->payer_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PayPal assigned Payer ID.
|
* Get Last Name
|
||||||
*
|
* Last Name of the Payer from their PayPal Account
|
||||||
* @param string $payer_id
|
*
|
||||||
* @deprecated. Instead use setPayerId
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function setPayer_id($payer_id) {
|
public function getLastName()
|
||||||
$this->payer_id = $payer_id;
|
{
|
||||||
return $this;
|
return $this->last_name;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* PayPal assigned Payer ID.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getPayerId
|
|
||||||
*/
|
|
||||||
public function getPayer_id() {
|
|
||||||
return $this->payer_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Phone number representing the Payer.
|
* Set Last Name
|
||||||
*
|
* Last Name of the Payer from their PayPal Account
|
||||||
* @param string $phone
|
*
|
||||||
*/
|
* @param string $last_name
|
||||||
public function setPhone($phone) {
|
*
|
||||||
$this->phone = $phone;
|
* @deprecated Use setLastName
|
||||||
return $this;
|
*
|
||||||
}
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setLast_name($last_name)
|
||||||
|
{
|
||||||
|
$this->last_name = $last_name;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Phone number representing the Payer.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getPhone() {
|
|
||||||
return $this->phone;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Set Payer ID
|
||||||
*
|
* PayPal assigned Payer ID
|
||||||
* @param PayPal\Api\Address $shipping_address
|
*
|
||||||
*/
|
* @param string $payer_id
|
||||||
public function setShippingAddress($shipping_address) {
|
*
|
||||||
$this->shipping_address = $shipping_address;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setPayerId($payer_id)
|
||||||
|
{
|
||||||
|
$this->payer_id = $payer_id;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Shipping address of the Payer from their PayPal Account.
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\Address
|
|
||||||
*/
|
|
||||||
public function getShippingAddress() {
|
|
||||||
return $this->shipping_address;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shipping address of the Payer from their PayPal Account.
|
* Get Payer ID
|
||||||
*
|
* PayPal assigned Payer ID
|
||||||
* @param PayPal\Api\Address $shipping_address
|
*
|
||||||
* @deprecated. Instead use setShippingAddress
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function setShipping_address($shipping_address) {
|
public function getPayerId()
|
||||||
$this->shipping_address = $shipping_address;
|
{
|
||||||
return $this;
|
return $this->payer_id;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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\Address $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\Address
|
||||||
|
*/
|
||||||
|
public function getShippingAddress()
|
||||||
|
{
|
||||||
|
return $this->shipping_address;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Shipping Address
|
||||||
|
* Shipping address of the Payer from their PayPal Account
|
||||||
|
*
|
||||||
|
* @param \PayPal\Api\Address $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\Address
|
||||||
|
*/
|
||||||
|
public function getShipping_address()
|
||||||
|
{
|
||||||
|
return $this->shipping_address;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
@@ -7,342 +8,485 @@ use PayPal\Rest\IResource;
|
|||||||
use PayPal\Api\PaymentHistory;
|
use PayPal\Api\PaymentHistory;
|
||||||
use PayPal\Transport\PPRestCall;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set ID
|
||||||
* @deprecated. Pass ApiContext to create/get methods instead
|
* Identifier of the payment resource created
|
||||||
*/
|
*
|
||||||
public static function setCredential($credential) {
|
* @param string $id
|
||||||
self::$credential = $credential;
|
*
|
||||||
}
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setId($id)
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Identifier of the payment resource created.
|
}
|
||||||
*
|
|
||||||
* @param string $id
|
|
||||||
*/
|
|
||||||
public function setId($id) {
|
|
||||||
$this->id = $id;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identifier of the payment resource created.
|
* Get ID
|
||||||
*
|
* Identifier of the payment resource created
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getId() {
|
*/
|
||||||
return $this->id;
|
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.
|
* Create
|
||||||
*
|
*
|
||||||
* @param string $create_time
|
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||||
*/
|
*
|
||||||
public function setCreateTime($create_time) {
|
* @return $this
|
||||||
$this->create_time = $create_time;
|
*/
|
||||||
return $this;
|
public function create($apiContext = null)
|
||||||
}
|
{
|
||||||
|
$payLoad = $this->toJSON();
|
||||||
|
|
||||||
/**
|
if ($apiContext == null) {
|
||||||
* Time the resource was created.
|
$apiContext = new ApiContext(self::$credential);
|
||||||
*
|
}
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getCreateTime() {
|
|
||||||
return $this->create_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
$call = new PPRestCall($apiContext);
|
||||||
* Time the resource was created.
|
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment", "POST", $payLoad);
|
||||||
*
|
$this->fromJson($json);
|
||||||
* @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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Time the resource was last updated.
|
}
|
||||||
*
|
|
||||||
* @param string $update_time
|
|
||||||
*/
|
|
||||||
public function setUpdateTime($update_time) {
|
|
||||||
$this->update_time = $update_time;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was last updated.
|
* Get
|
||||||
*
|
*
|
||||||
* @return string
|
* @param int $paymentId
|
||||||
*/
|
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||||
public function getUpdateTime() {
|
*
|
||||||
return $this->update_time;
|
* @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");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
$payLoad = "";
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
if ($apiContext == null) {
|
||||||
* Intent of the payment - Sale or Authorization or Order.
|
$apiContext = new ApiContext(self::$credential);
|
||||||
*
|
}
|
||||||
* @param string $intent
|
|
||||||
*/
|
|
||||||
public function setIntent($intent) {
|
|
||||||
$this->intent = $intent;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
$call = new PPRestCall($apiContext);
|
||||||
* Intent of the payment - Sale or Authorization or Order.
|
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment/$paymentId", "GET", $payLoad);
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getIntent() {
|
|
||||||
return $this->intent;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$ret = new Payment();
|
||||||
|
$ret->fromJson($json);
|
||||||
|
|
||||||
/**
|
return $ret;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Source of the funds for this payment represented by a PayPal account or a direct credit card.
|
* Execute
|
||||||
*
|
*
|
||||||
* @return PayPal\Api\Payer
|
* @param \Paypal\Api\PaymentExecution $paymentExecution
|
||||||
*/
|
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||||
public function getPayer() {
|
*
|
||||||
return $this->payer;
|
* @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");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
$payLoad = $paymentExecution->toJSON();
|
||||||
* 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(array $transactions) {
|
|
||||||
$this->transactions = $transactions;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
if ($apiContext == null) {
|
||||||
* A payment can have more than one transaction, with each transaction establishing a contract between the payer and a payee
|
$apiContext = new ApiContext(self::$credential);
|
||||||
*
|
}
|
||||||
* @return PayPal\Api\Transaction
|
|
||||||
*/
|
|
||||||
public function getTransactions() {
|
|
||||||
return $this->transactions;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$call = new PPRestCall($apiContext);
|
||||||
|
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment/{$this->getId()}/execute", "POST", $payLoad);
|
||||||
|
|
||||||
/**
|
$ret = new Payment();
|
||||||
* state of the payment
|
$ret->fromJson($json);
|
||||||
*
|
|
||||||
* @param string $state
|
|
||||||
*/
|
|
||||||
public function setState($state) {
|
|
||||||
$this->state = $state;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $ret;
|
||||||
* state of the payment
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getState() {
|
|
||||||
return $this->state;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
$payLoad = "";
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
$allowedParams = array(
|
||||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls.
|
'count' => 1,
|
||||||
*
|
'start_id' => 1,
|
||||||
* @return PayPal\Api\RedirectUrls
|
'start_index' => 1,
|
||||||
*/
|
'start_time' => 1,
|
||||||
public function getRedirectUrls() {
|
'end_time' => 1,
|
||||||
return $this->redirect_urls;
|
'payee_id' => 1,
|
||||||
}
|
'sort_by' => 1,
|
||||||
|
'sort_order' => 1,
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
if ($apiContext == null) {
|
||||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls.
|
$apiContext = new ApiContext(self::$credential);
|
||||||
*
|
}
|
||||||
* @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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
$call = new PPRestCall($apiContext);
|
||||||
*
|
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad);
|
||||||
*
|
|
||||||
* @array
|
|
||||||
* @param PayPal\Api\Links $links
|
|
||||||
*/
|
|
||||||
public function setLinks($links) {
|
|
||||||
$this->links = $links;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
$ret = new PaymentHistory();
|
||||||
*
|
$ret->fromJson($json);
|
||||||
*
|
|
||||||
* @return PayPal\Api\Links
|
|
||||||
*/
|
|
||||||
public function getLinks() {
|
|
||||||
return $this->links;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
/*
|
|
||||||
* Creates (and processes) a new Payment Resource.
|
|
||||||
*
|
|
||||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
|
||||||
* @return Payment
|
|
||||||
*/
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Obtain the Payment resource for the given identifier.
|
|
||||||
*
|
|
||||||
* @param string $paymentId
|
|
||||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
|
||||||
* @return Payment
|
|
||||||
*/
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Executes the payment (after approved by the Payer) associated with this resource when the payment method is PayPal.
|
|
||||||
*
|
|
||||||
* @param PaymentExecution $paymentExecution
|
|
||||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
|
||||||
* @return Payment
|
|
||||||
*/
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Retrieves a list of Payment resources.
|
|
||||||
*
|
|
||||||
* @param array $params
|
|
||||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
|
||||||
* @return PaymentHistory
|
|
||||||
*/
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,68 +1,96 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class PaymentExecution extends PPModel {
|
/**
|
||||||
/**
|
* Class PaymentExecution
|
||||||
* PayPal assigned Payer ID returned in the approval return url.
|
*
|
||||||
*
|
* @property string payer_id
|
||||||
* @param string $payer_id
|
* @property \PayPal\Api\Transactions transactions
|
||||||
*/
|
*/
|
||||||
public function setPayerId($payer_id) {
|
class PaymentExecution extends PPModel
|
||||||
$this->payer_id = $payer_id;
|
{
|
||||||
return $this;
|
/**
|
||||||
}
|
* 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;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* PayPal assigned Payer ID returned in the approval return url.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getPayerId() {
|
|
||||||
return $this->payer_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PayPal assigned Payer ID returned in the approval return url.
|
* Get Payer ID
|
||||||
*
|
* PayPal assigned Payer ID returned in the approval return url
|
||||||
* @param string $payer_id
|
*
|
||||||
* @deprecated. Instead use setPayerId
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function setPayer_id($payer_id) {
|
public function getPayerId()
|
||||||
$this->payer_id = $payer_id;
|
{
|
||||||
return $this;
|
return $this->payer_id;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* PayPal assigned Payer ID returned in the approval return url.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getPayerId
|
|
||||||
*/
|
|
||||||
public function getPayer_id() {
|
|
||||||
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.
|
* Set Payer ID
|
||||||
*
|
* PayPal assigned Payer ID returned in the approval return url
|
||||||
* @array
|
*
|
||||||
* @param PayPal\Api\Transactions $transactions
|
* @param string $payer_id
|
||||||
*/
|
*
|
||||||
public function setTransactions($transactions) {
|
* @deprecated Use setPayerId
|
||||||
$this->transactions = $transactions;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
|
public function setPayer_id($payer_id)
|
||||||
|
{
|
||||||
|
$this->payer_id = $payer_id;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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,88 +1,124 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class PaymentHistory extends PPModel {
|
/**
|
||||||
/**
|
* Class PaymentHistory
|
||||||
* A list of Payment resources
|
*
|
||||||
*
|
* @property \PayPal\Api\Payment payments
|
||||||
* @array
|
* @property int count
|
||||||
* @param PayPal\Api\Payment $payments
|
* @property string next_id
|
||||||
*/
|
*/
|
||||||
public function setPayments($payments) {
|
class PaymentHistory extends PPModel
|
||||||
$this->payments = $payments;
|
{
|
||||||
return $this;
|
/**
|
||||||
}
|
* Set Payments
|
||||||
|
* A list of Payment resources
|
||||||
|
*
|
||||||
|
* @param \PayPal\Api\Payment $payments
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setPayments($payments)
|
||||||
|
{
|
||||||
|
$this->payments = $payments;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* A list of Payment resources
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\Payment
|
|
||||||
*/
|
|
||||||
public function getPayments() {
|
|
||||||
return $this->payments;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Set Count
|
||||||
*
|
* Number of items returned in each range of results
|
||||||
* @param integer $count
|
* Note that the last results range could have fewer items than the requested number of items
|
||||||
*/
|
*
|
||||||
public function setCount($count) {
|
* @param int $count
|
||||||
$this->count = $count;
|
*
|
||||||
return $this;
|
* @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.
|
* Get Count
|
||||||
*
|
* Number of items returned in each range of results
|
||||||
* @return integer
|
* Note that the last results range could have fewer items than the requested number of items
|
||||||
*/
|
*
|
||||||
public function getCount() {
|
* @return int
|
||||||
return $this->count;
|
*/
|
||||||
}
|
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.
|
* Get Next ID
|
||||||
*
|
* Identifier of the next element to get the next range of results
|
||||||
* @param string $next_id
|
*
|
||||||
*/
|
* @return string
|
||||||
public function setNextId($next_id) {
|
*/
|
||||||
$this->next_id = $next_id;
|
public function getNextId()
|
||||||
return $this;
|
{
|
||||||
}
|
return $this->next_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identifier of the next element to get the next range of results.
|
* Set Next ID
|
||||||
*
|
* Identifier of the next element to get the next range of results
|
||||||
* @return string
|
*
|
||||||
*/
|
* @param string $next_id
|
||||||
public function getNextId() {
|
*
|
||||||
return $this->next_id;
|
* @deprecated Use setNextId
|
||||||
}
|
*
|
||||||
|
* @return $this
|
||||||
/**
|
*/
|
||||||
* Identifier of the next element to get the next range of results.
|
public function setNext_id($next_id)
|
||||||
*
|
{
|
||||||
* @param string $next_id
|
$this->next_id = $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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
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,86 +1,127 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class RedirectUrls extends PPModel {
|
/**
|
||||||
/**
|
* Class RedirectUrls
|
||||||
* Url where the payer would be redirected to after approving the payment.
|
*
|
||||||
*
|
* @property string return_url
|
||||||
* @param string $return_url
|
* @property string cancel_url
|
||||||
*/
|
*/
|
||||||
public function setReturnUrl($return_url) {
|
class RedirectUrls extends PPModel
|
||||||
$this->return_url = $return_url;
|
{
|
||||||
return $this;
|
/**
|
||||||
}
|
* 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)
|
||||||
|
{
|
||||||
|
$this->return_url = $return_url;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 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 approving the payment.
|
* Get Return URL
|
||||||
*
|
* Url where the payer would be redirected to after approving the payment
|
||||||
* @param string $return_url
|
*
|
||||||
* @deprecated. Instead use setReturnUrl
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function setReturn_url($return_url) {
|
public function getReturnUrl()
|
||||||
$this->return_url = $return_url;
|
{
|
||||||
return $this;
|
return $this->return_url;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Url where the payer would be redirected to after canceling the payment.
|
* Set Return URL
|
||||||
*
|
* Url where the payer would be redirected to after approving the payment
|
||||||
* @param string $cancel_url
|
*
|
||||||
*/
|
* @param string $return_url
|
||||||
public function setCancelUrl($cancel_url) {
|
*
|
||||||
$this->cancel_url = $cancel_url;
|
* @deprecated Use setReturnUrl
|
||||||
return $this;
|
*
|
||||||
}
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setReturn_url($return_url)
|
||||||
|
{
|
||||||
|
$this->return_url = $return_url;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Url where the payer would be redirected to after canceling the payment.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getCancelUrl() {
|
|
||||||
return $this->cancel_url;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Url where the payer would be redirected to after canceling the payment.
|
* Get Return URL
|
||||||
*
|
* Url where the payer would be redirected to after approving the payment
|
||||||
* @param string $cancel_url
|
*
|
||||||
* @deprecated. Instead use setCancelUrl
|
* @deprecated Use getReturnUrl
|
||||||
*/
|
*
|
||||||
public function setCancel_url($cancel_url) {
|
* @return string
|
||||||
$this->cancel_url = $cancel_url;
|
*/
|
||||||
return $this;
|
public function getReturn_url()
|
||||||
}
|
{
|
||||||
/**
|
return $this->return_url;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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)
|
||||||
|
{
|
||||||
|
$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,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
@@ -6,314 +7,392 @@ use PayPal\Rest\ApiContext;
|
|||||||
use PayPal\Rest\IResource;
|
use PayPal\Rest\IResource;
|
||||||
use PayPal\Transport\PPRestCall;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set ID
|
||||||
* @deprecated. Pass ApiContext to create/get methods instead
|
* Identifier of the refund transaction
|
||||||
*/
|
*
|
||||||
public static function setCredential($credential) {
|
* @param string $id
|
||||||
self::$credential = $credential;
|
*
|
||||||
}
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setId($id)
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Identifier of the refund transaction.
|
}
|
||||||
*
|
|
||||||
* @param string $id
|
|
||||||
*/
|
|
||||||
public function setId($id) {
|
|
||||||
$this->id = $id;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identifier of the refund transaction.
|
* Get ID
|
||||||
*
|
* Identifier of the refund transaction
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getId() {
|
*/
|
||||||
return $this->id;
|
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;
|
||||||
* Time the resource was created.
|
}
|
||||||
*
|
|
||||||
* @param string $create_time
|
|
||||||
*/
|
|
||||||
public function setCreateTime($create_time) {
|
|
||||||
$this->create_time = $create_time;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was created.
|
* Get Create Time
|
||||||
*
|
* Time the resource was created
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getCreateTime() {
|
*/
|
||||||
return $this->create_time;
|
public function getCreateTime()
|
||||||
}
|
{
|
||||||
|
return $this->create_time;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was created.
|
* Set Create Time
|
||||||
*
|
* Time the resource was created
|
||||||
* @param string $create_time
|
*
|
||||||
* @deprecated. Instead use setCreateTime
|
* @param string $create_time
|
||||||
*/
|
*
|
||||||
public function setCreate_time($create_time) {
|
* @deprecated Use setCreateTime
|
||||||
$this->create_time = $create_time;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
/**
|
public function setCreate_time($create_time)
|
||||||
* Time the resource was created.
|
{
|
||||||
*
|
$this->create_time = $create_time;
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getCreateTime
|
|
||||||
*/
|
|
||||||
public function getCreate_time() {
|
|
||||||
return $this->create_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Time the resource was last updated.
|
}
|
||||||
*
|
|
||||||
* @param string $update_time
|
|
||||||
*/
|
|
||||||
public function setUpdateTime($update_time) {
|
|
||||||
$this->update_time = $update_time;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was last updated.
|
* Get Create Time
|
||||||
*
|
* Time the resource was created
|
||||||
* @return string
|
*
|
||||||
*/
|
* @deprecated Use getCreateTime
|
||||||
public function getUpdateTime() {
|
*
|
||||||
return $this->update_time;
|
* @return string
|
||||||
}
|
*/
|
||||||
|
public function getCreate_time()
|
||||||
|
{
|
||||||
|
return $this->create_time;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was last updated.
|
* Set Amount
|
||||||
*
|
* Details including both refunded amount (to Payer) and refunded fee (to Payee)
|
||||||
* @param string $update_time
|
* If amount is not specified, it's assumed to be full refund
|
||||||
* @deprecated. Instead use setUpdateTime
|
*
|
||||||
*/
|
* @param \PayPal\Api\Amount $amount
|
||||||
public function setUpdate_time($update_time) {
|
*
|
||||||
$this->update_time = $update_time;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setAmount($amount)
|
||||||
/**
|
{
|
||||||
* Time the resource was last updated.
|
$this->amount = $amount;
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getUpdateTime
|
|
||||||
*/
|
|
||||||
public function getUpdate_time() {
|
|
||||||
return $this->update_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
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.
|
}
|
||||||
*
|
|
||||||
* @param PayPal\Api\Amount $amount
|
|
||||||
*/
|
|
||||||
public function setAmount($amount) {
|
|
||||||
$this->amount = $amount;
|
|
||||||
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.
|
* Get Amount
|
||||||
*
|
* Details including both refunded amount (to Payer) and refunded fee (to Payee)
|
||||||
* @return PayPal\Api\Amount
|
* If amount is not specified, it's assumed to be full refund
|
||||||
*/
|
*
|
||||||
public function getAmount() {
|
* @return \PayPal\Api\Amount
|
||||||
return $this->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;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* State of the refund transaction.
|
}
|
||||||
*
|
|
||||||
* @param string $state
|
|
||||||
*/
|
|
||||||
public function setState($state) {
|
|
||||||
$this->state = $state;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* State of the refund transaction.
|
* Get State
|
||||||
*
|
* State of the refund transaction
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getState() {
|
*/
|
||||||
return $this->state;
|
public function getState()
|
||||||
}
|
{
|
||||||
|
return $this->state;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* ID of the Sale transaction being refunded.
|
}
|
||||||
*
|
|
||||||
* @param string $sale_id
|
|
||||||
*/
|
|
||||||
public function setSaleId($sale_id) {
|
|
||||||
$this->sale_id = $sale_id;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the Sale transaction being refunded.
|
* Get Sale ID
|
||||||
*
|
* ID of the Sale transaction being refunded
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getSaleId() {
|
*/
|
||||||
return $this->sale_id;
|
public function getSaleId()
|
||||||
}
|
{
|
||||||
|
return $this->sale_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the Sale transaction being refunded.
|
* Set Sale ID
|
||||||
*
|
* ID of the Sale transaction being refunded
|
||||||
* @param string $sale_id
|
*
|
||||||
* @deprecated. Instead use setSaleId
|
* @param string $sale_id
|
||||||
*/
|
*
|
||||||
public function setSale_id($sale_id) {
|
* @deprecated Use setSaleId
|
||||||
$this->sale_id = $sale_id;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
/**
|
public function setSale_id($sale_id)
|
||||||
* ID of the Sale transaction being refunded.
|
{
|
||||||
*
|
$this->sale_id = $sale_id;
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getSaleId
|
|
||||||
*/
|
|
||||||
public function getSale_id() {
|
|
||||||
return $this->sale_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* ID of the Capture transaction being refunded.
|
}
|
||||||
*
|
|
||||||
* @param string $capture_id
|
|
||||||
*/
|
|
||||||
public function setCaptureId($capture_id) {
|
|
||||||
$this->capture_id = $capture_id;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the Capture transaction being refunded.
|
* Get Sale ID
|
||||||
*
|
* ID of the Sale transaction being refunded
|
||||||
* @return string
|
*
|
||||||
*/
|
* @deprecated Use getSaleId
|
||||||
public function getCaptureId() {
|
*
|
||||||
return $this->capture_id;
|
* @return string
|
||||||
}
|
*/
|
||||||
|
public function getSale_id()
|
||||||
|
{
|
||||||
|
return $this->sale_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the Capture transaction being refunded.
|
* Set Capture ID
|
||||||
*
|
* ID of the Capture transaction being refunded
|
||||||
* @param string $capture_id
|
*
|
||||||
* @deprecated. Instead use setCaptureId
|
* @param string $capture_id
|
||||||
*/
|
*
|
||||||
public function setCapture_id($capture_id) {
|
* @return $this
|
||||||
$this->capture_id = $capture_id;
|
*/
|
||||||
return $this;
|
public function setCaptureId($capture_id)
|
||||||
}
|
{
|
||||||
/**
|
$this->capture_id = $capture_id;
|
||||||
* ID of the Capture transaction being refunded.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getCaptureId
|
|
||||||
*/
|
|
||||||
public function getCapture_id() {
|
|
||||||
return $this->capture_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the Payment resource that this transaction is based on.
|
* Get Capture ID
|
||||||
*
|
* ID of the Capture transaction being refunded
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getParentPayment() {
|
*/
|
||||||
return $this->parent_payment;
|
public function getCaptureId()
|
||||||
}
|
{
|
||||||
|
return $this->capture_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the Payment resource that this transaction is based on.
|
* Set Capture ID
|
||||||
*
|
* ID of the Capture transaction being refunded
|
||||||
* @param string $parent_payment
|
*
|
||||||
* @deprecated. Instead use setParentPayment
|
* @param string $capture_id
|
||||||
*/
|
*
|
||||||
public function setParent_payment($parent_payment) {
|
* @deprecated Use setCaptureId
|
||||||
$this->parent_payment = $parent_payment;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
/**
|
public function setCapture_id($capture_id)
|
||||||
* ID of the Payment resource that this transaction is based on.
|
{
|
||||||
*
|
$this->capture_id = $capture_id;
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getParentPayment
|
|
||||||
*/
|
|
||||||
public function getParent_payment() {
|
|
||||||
return $this->parent_payment;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @array
|
|
||||||
* @param PayPal\Api\Links $links
|
|
||||||
*/
|
|
||||||
public function setLinks($links) {
|
|
||||||
$this->links = $links;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get Capture ID
|
||||||
*
|
* ID of the Capture transaction being refunded
|
||||||
* @return PayPal\Api\Links
|
*
|
||||||
*/
|
* @deprecated Use getCaptureId
|
||||||
public function getLinks() {
|
*
|
||||||
return $this->links;
|
* @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;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Obtain the Refund transaction resource for the given identifier.
|
* Get Parent Payment
|
||||||
*
|
* ID of the Payment resource that this transaction is based on
|
||||||
* @param string $refundId
|
*
|
||||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
* @return string
|
||||||
* @return Refund
|
*/
|
||||||
*/
|
public function getParentPayment()
|
||||||
public static function get($refundId, $apiContext = null) {
|
{
|
||||||
if (($refundId == null) || (strlen($refundId) <= 0)) {
|
return $this->parent_payment;
|
||||||
throw new \InvalidArgumentException("refundId cannot be null or empty");
|
}
|
||||||
}
|
|
||||||
$payLoad = "";
|
/**
|
||||||
if ($apiContext == null) {
|
* Set Parent Payment
|
||||||
$apiContext = new ApiContext(self::$credential);
|
* ID of the Payment resource that this transaction is based on
|
||||||
}
|
*
|
||||||
$call = new PPRestCall($apiContext);
|
* @param string $parent_payment
|
||||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/refund/$refundId", "GET", $payLoad);
|
*
|
||||||
$ret = new Refund();
|
* @deprecated Use setParentPayment
|
||||||
$ret->fromJson($json);
|
*
|
||||||
return $ret;
|
* @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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,88 +1,117 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class RelatedResources extends PPModel {
|
/**
|
||||||
/**
|
* Class RelatedResources
|
||||||
* A sale transaction
|
*
|
||||||
*
|
* @property \PayPal\Api\Sale sale
|
||||||
* @param PayPal\Api\Sale $sale
|
* @property \PayPal\Api\Authorization authorization
|
||||||
*/
|
* @property \PayPal\Api\Capture capture
|
||||||
public function setSale($sale) {
|
* @property \PayPal\Api\Refund refund
|
||||||
$this->sale = $sale;
|
*/
|
||||||
return $this;
|
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
|
* Get Sale
|
||||||
*
|
* A sale transaction
|
||||||
* @return PayPal\Api\Sale
|
*
|
||||||
*/
|
* @return \PayPal\Api\Sale
|
||||||
public function getSale() {
|
*/
|
||||||
return $this->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
|
* Get Authorization
|
||||||
*
|
* An authorization transaction
|
||||||
* @param PayPal\Api\Authorization $authorization
|
*
|
||||||
*/
|
* @return \PayPal\Api\Authorization
|
||||||
public function setAuthorization($authorization) {
|
*/
|
||||||
$this->authorization = $authorization;
|
public function getAuthorization()
|
||||||
return $this;
|
{
|
||||||
}
|
return $this->authorization;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An authorization transaction
|
* Set Capture
|
||||||
*
|
* A capture transaction
|
||||||
* @return PayPal\Api\Authorization
|
*
|
||||||
*/
|
* @param \PayPal\Api\Capture $capture
|
||||||
public function getAuthorization() {
|
*
|
||||||
return $this->authorization;
|
* @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
|
* Set Refund
|
||||||
*
|
* A refund transaction
|
||||||
* @param PayPal\Api\Capture $capture
|
*
|
||||||
*/
|
* @param \PayPal\Api\Refund $refund
|
||||||
public function setCapture($capture) {
|
*
|
||||||
$this->capture = $capture;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setRefund($refund)
|
||||||
|
{
|
||||||
/**
|
$this->refund = $refund;
|
||||||
* A capture transaction
|
return $this;
|
||||||
*
|
}
|
||||||
* @return PayPal\Api\Capture
|
|
||||||
*/
|
|
||||||
public function getCapture() {
|
|
||||||
return $this->capture;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Refund
|
||||||
|
* A refund transaction
|
||||||
|
*
|
||||||
|
* @return \PayPal\Api\Refund
|
||||||
|
*/
|
||||||
|
public function getRefund()
|
||||||
|
{
|
||||||
|
return $this->refund;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
@@ -7,261 +8,367 @@ use PayPal\Rest\IResource;
|
|||||||
use PayPal\Api\Refund;
|
use PayPal\Api\Refund;
|
||||||
use PayPal\Transport\PPRestCall;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Set ID
|
||||||
* @deprecated. Pass ApiContext to create/get methods instead
|
* Identifier of the authorization transaction
|
||||||
*/
|
*
|
||||||
public static function setCredential($credential) {
|
* @param string $id
|
||||||
self::$credential = $credential;
|
*
|
||||||
}
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setId($id)
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Identifier of the authorization transaction.
|
}
|
||||||
*
|
|
||||||
* @param string $id
|
|
||||||
*/
|
|
||||||
public function setId($id) {
|
|
||||||
$this->id = $id;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identifier of the authorization transaction.
|
* Get ID
|
||||||
*
|
* Identifier of the authorization transaction
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getId() {
|
*/
|
||||||
return $this->id;
|
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;
|
||||||
* Time the resource was created.
|
}
|
||||||
*
|
|
||||||
* @param string $create_time
|
|
||||||
*/
|
|
||||||
public function setCreateTime($create_time) {
|
|
||||||
$this->create_time = $create_time;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was created.
|
* Get Create Time
|
||||||
*
|
* Time the resource was created
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getCreateTime() {
|
*/
|
||||||
return $this->create_time;
|
public function getCreateTime()
|
||||||
}
|
{
|
||||||
|
return $this->create_time;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was created.
|
* Set Create Time
|
||||||
*
|
* Time the resource was created
|
||||||
* @param string $create_time
|
*
|
||||||
* @deprecated. Instead use setCreateTime
|
* @param string $create_time
|
||||||
*/
|
*
|
||||||
public function setCreate_time($create_time) {
|
* @deprecated Use setCreateTime
|
||||||
$this->create_time = $create_time;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
/**
|
public function setCreate_time($create_time)
|
||||||
* Time the resource was created.
|
{
|
||||||
*
|
$this->create_time = $create_time;
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getCreateTime
|
|
||||||
*/
|
|
||||||
public function getCreate_time() {
|
|
||||||
return $this->create_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Time the resource was last updated.
|
}
|
||||||
*
|
|
||||||
* @param string $update_time
|
|
||||||
*/
|
|
||||||
public function setUpdateTime($update_time) {
|
|
||||||
$this->update_time = $update_time;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was last updated.
|
* Get Create Time
|
||||||
*
|
* Time the resource was created
|
||||||
* @return string
|
*
|
||||||
*/
|
* @deprecated Use getCreateTime
|
||||||
public function getUpdateTime() {
|
*
|
||||||
return $this->update_time;
|
* @return string
|
||||||
}
|
*/
|
||||||
|
public function getCreate_time()
|
||||||
|
{
|
||||||
|
return $this->create_time;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Time the resource was last updated.
|
* Set Update Time
|
||||||
*
|
* Time the resource was last updated
|
||||||
* @param string $update_time
|
*
|
||||||
* @deprecated. Instead use setUpdateTime
|
* @param string $update_time
|
||||||
*/
|
*
|
||||||
public function setUpdate_time($update_time) {
|
* @return $this
|
||||||
$this->update_time = $update_time;
|
*/
|
||||||
return $this;
|
public function setUpdateTime($update_time)
|
||||||
}
|
{
|
||||||
/**
|
$this->update_time = $update_time;
|
||||||
* Time the resource was last updated.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getUpdateTime
|
|
||||||
*/
|
|
||||||
public function getUpdate_time() {
|
|
||||||
return $this->update_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Amount being collected.
|
}
|
||||||
*
|
|
||||||
* @param PayPal\Api\Amount $amount
|
|
||||||
*/
|
|
||||||
public function setAmount($amount) {
|
|
||||||
$this->amount = $amount;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Amount being collected.
|
* Get Update Time
|
||||||
*
|
* Time the resource was last updated
|
||||||
* @return PayPal\Api\Amount
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getAmount() {
|
*/
|
||||||
return $this->amount;
|
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;
|
||||||
* State of the sale transaction.
|
}
|
||||||
*
|
|
||||||
* @param string $state
|
|
||||||
*/
|
|
||||||
public function setState($state) {
|
|
||||||
$this->state = $state;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* State of the sale transaction.
|
* Get Update Time
|
||||||
*
|
* Time the resource was last updated
|
||||||
* @return string
|
*
|
||||||
*/
|
* @deprecated Use getUpdateTime
|
||||||
public function getState() {
|
*
|
||||||
return $this->state;
|
* @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;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the Payment resource that this transaction is based on.
|
* Get Amount
|
||||||
*
|
* Amount being collected
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return \PayPal\Api\Amount
|
||||||
public function getParentPayment() {
|
*/
|
||||||
return $this->parent_payment;
|
public function getAmount()
|
||||||
}
|
{
|
||||||
|
return $this->amount;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the Payment resource that this transaction is based on.
|
* Set State
|
||||||
*
|
* State of the sale transaction
|
||||||
* @param string $parent_payment
|
*
|
||||||
* @deprecated. Instead use setParentPayment
|
* @param string $state
|
||||||
*/
|
*
|
||||||
public function setParent_payment($parent_payment) {
|
* @return $this
|
||||||
$this->parent_payment = $parent_payment;
|
*/
|
||||||
return $this;
|
public function setState($state)
|
||||||
}
|
{
|
||||||
/**
|
$this->state = $state;
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
*
|
}
|
||||||
*
|
|
||||||
* @array
|
|
||||||
* @param PayPal\Api\Links $links
|
|
||||||
*/
|
|
||||||
public function setLinks($links) {
|
|
||||||
$this->links = $links;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Get State
|
||||||
*
|
* State of the sale transaction
|
||||||
* @return PayPal\Api\Links
|
*
|
||||||
*/
|
* @return string
|
||||||
public function getLinks() {
|
*/
|
||||||
return $this->links;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Obtain the Sale transaction resource for the given identifier.
|
* Get Parent Payment
|
||||||
*
|
* ID of the Payment resource that this transaction is based on
|
||||||
* @param string $saleId
|
*
|
||||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
* @return string
|
||||||
* @return Sale
|
*/
|
||||||
*/
|
public function getParentPayment()
|
||||||
public static function get($saleId, $apiContext = null) {
|
{
|
||||||
if (($saleId == null) || (strlen($saleId) <= 0)) {
|
return $this->parent_payment;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Creates (and processes) a new Refund Transaction added as a related resource.
|
* Set Parent Payment
|
||||||
*
|
* ID of the Payment resource that this transaction is based on
|
||||||
* @param Refund $refund
|
*
|
||||||
* @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
* @param string $parent_payment
|
||||||
* @return Refund
|
*
|
||||||
*/
|
* @deprecated Use setParentPayment
|
||||||
public function refund($refund, $apiContext = null) {
|
*
|
||||||
if ($this->getId() == null) {
|
* @return $this
|
||||||
throw new \InvalidArgumentException("Id cannot be null");
|
*/
|
||||||
}
|
public function setParent_payment($parent_payment)
|
||||||
if (($refund == null)) {
|
{
|
||||||
throw new \InvalidArgumentException("refund cannot be null or empty");
|
$this->parent_payment = $parent_payment;
|
||||||
}
|
|
||||||
$payLoad = $refund->toJSON();
|
return $this;
|
||||||
if ($apiContext == null) {
|
}
|
||||||
$apiContext = new ApiContext(self::$credential);
|
|
||||||
}
|
/**
|
||||||
$call = new PPRestCall($apiContext);
|
* Get Parent Payment
|
||||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/sale/{$this->getId()}/refund", "POST", $payLoad);
|
* ID of the Payment resource that this transaction is based on
|
||||||
$ret = new Refund();
|
*
|
||||||
$ret->fromJson($json);
|
* @deprecated Use getParentPayment
|
||||||
return $ret;
|
*
|
||||||
}
|
* @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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,47 +1,70 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class ShippingAddress extends Address {
|
/**
|
||||||
/**
|
* Class ShippingAddress
|
||||||
* Name of the recipient at this address.
|
*
|
||||||
*
|
* @property string recipient_name
|
||||||
* @param string $recipient_name
|
*/
|
||||||
*/
|
class ShippingAddress extends Address
|
||||||
public function setRecipientName($recipient_name) {
|
{
|
||||||
$this->recipient_name = $recipient_name;
|
/**
|
||||||
return $this;
|
* 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;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Name of the recipient at this address.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getRecipientName() {
|
|
||||||
return $this->recipient_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the recipient at this address.
|
* Get Recipient Name
|
||||||
*
|
* Name of the recipient at this address
|
||||||
* @param string $recipient_name
|
*
|
||||||
* @deprecated. Instead use setRecipientName
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function setRecipient_name($recipient_name) {
|
public function getRecipientName()
|
||||||
$this->recipient_name = $recipient_name;
|
{
|
||||||
return $this;
|
return $this->recipient_name;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Name of the recipient at this address.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
* @deprecated. Instead use getRecipientName
|
|
||||||
*/
|
|
||||||
public function getRecipient_name() {
|
|
||||||
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,169 +1,235 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class Transaction extends PPModel {
|
/**
|
||||||
/**
|
* Class Transaction
|
||||||
* Amount being collected.
|
*
|
||||||
*
|
* @property \PayPal\Api\Amount amount
|
||||||
* @param PayPal\Api\Amount $amount
|
* @property \PayPal\Api\Payee payee
|
||||||
*/
|
* @property string description
|
||||||
public function setAmount($amount) {
|
* @property \PayPal\Api\ItemList item_list
|
||||||
$this->amount = $amount;
|
* @property \PayPal\Api\RelatedResources related_resources
|
||||||
return $this;
|
* @property \PayPal\Api\Transaction transactions
|
||||||
}
|
*/
|
||||||
|
class Transaction extends PPModel
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Set Amount
|
||||||
|
* Amount being collected
|
||||||
|
*
|
||||||
|
* @param \PayPal\Api\Amount $amount
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setAmount($amount)
|
||||||
|
{
|
||||||
|
$this->amount = $amount;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Amount being collected.
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\Amount
|
|
||||||
*/
|
|
||||||
public function getAmount() {
|
|
||||||
return $this->amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Amount
|
||||||
|
* Amount being collected
|
||||||
|
*
|
||||||
|
* @return \PayPal\Api\Amount
|
||||||
|
*/
|
||||||
|
public function getAmount()
|
||||||
|
{
|
||||||
|
return $this->amount;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recepient of the funds in this transaction.
|
* Set Payee
|
||||||
*
|
* Recepient of the funds in this transaction
|
||||||
* @param PayPal\Api\Payee $payee
|
*
|
||||||
*/
|
* @param \PayPal\Api\Payee $payee
|
||||||
public function setPayee($payee) {
|
*
|
||||||
$this->payee = $payee;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setPayee($payee)
|
||||||
|
{
|
||||||
|
$this->payee = $payee;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Recepient of the funds in this transaction.
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\Payee
|
|
||||||
*/
|
|
||||||
public function getPayee() {
|
|
||||||
return $this->payee;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Set Description
|
||||||
*
|
* Description of what is being paid for
|
||||||
* @param string $description
|
*
|
||||||
*/
|
* @param string $description
|
||||||
public function setDescription($description) {
|
*
|
||||||
$this->description = $description;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setDescription($description)
|
||||||
|
{
|
||||||
|
$this->description = $description;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Description of what is being paid for.
|
}
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getDescription() {
|
|
||||||
return $this->description;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Description
|
||||||
|
* Description of what is being paid for
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDescription()
|
||||||
|
{
|
||||||
|
return $this->description;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of items being paid for.
|
* Set Item List
|
||||||
*
|
* List of items being paid for
|
||||||
* @param PayPal\Api\ItemList $item_list
|
*
|
||||||
*/
|
* @param \PayPal\Api\ItemList $item_list
|
||||||
public function setItemList($item_list) {
|
*
|
||||||
$this->item_list = $item_list;
|
* @return $this
|
||||||
return $this;
|
*/
|
||||||
}
|
public function setItemList($item_list)
|
||||||
|
{
|
||||||
|
$this->item_list = $item_list;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* List of items being paid for.
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\ItemList
|
|
||||||
*/
|
|
||||||
public function getItemList() {
|
|
||||||
return $this->item_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of items being paid for.
|
* Get Item List
|
||||||
*
|
* List of items being paid for
|
||||||
* @param PayPal\Api\ItemList $item_list
|
*
|
||||||
* @deprecated. Instead use setItemList
|
* @return \PayPal\Api\ItemList
|
||||||
*/
|
*/
|
||||||
public function setItem_list($item_list) {
|
public function getItemList()
|
||||||
$this->item_list = $item_list;
|
{
|
||||||
return $this;
|
return $this->item_list;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* List of items being paid for.
|
|
||||||
*
|
|
||||||
* @return PayPal\Api\ItemList
|
|
||||||
* @deprecated. Instead use getItemList
|
|
||||||
*/
|
|
||||||
public function getItem_list() {
|
|
||||||
return $this->item_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment.
|
* Set Item List
|
||||||
*
|
* List of items being paid for
|
||||||
* @array
|
*
|
||||||
* @param PayPal\Api\RelatedResources $related_resources
|
* @param \PayPal\Api\ItemList $item_list
|
||||||
*/
|
*
|
||||||
public function setRelatedResources($related_resources) {
|
* @deprecated Use setItemList
|
||||||
$this->related_resources = $related_resources;
|
*
|
||||||
return $this;
|
* @return $this
|
||||||
}
|
*/
|
||||||
|
public function setItem_list($item_list)
|
||||||
|
{
|
||||||
|
$this->item_list = $item_list;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment.
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\RelatedResources
|
|
||||||
*/
|
|
||||||
public function getRelatedResources() {
|
|
||||||
return $this->related_resources;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment.
|
* Get Item List
|
||||||
*
|
* List of items being paid for
|
||||||
* @array
|
*
|
||||||
* @param PayPal\Api\RelatedResources $related_resources
|
* @deprecated Use getItemList
|
||||||
* @deprecated. Instead use setRelatedResources
|
*
|
||||||
*/
|
* @return \PayPal\Api\ItemList
|
||||||
public function setRelated_resources($related_resources) {
|
*/
|
||||||
$this->related_resources = $related_resources;
|
public function getItem_list()
|
||||||
return $this;
|
{
|
||||||
}
|
return $this->item_list;
|
||||||
/**
|
}
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Additional transactions for complex payment (Parallel and Chained) scenarios.
|
* Set Related Resources
|
||||||
*
|
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment
|
||||||
* @array
|
*
|
||||||
* @param PayPal\Api\self $transactions
|
* @param \PayPal\Api\RelatedResources $related_resources
|
||||||
*/
|
*
|
||||||
public function setTransactions($transactions) {
|
* @return $this
|
||||||
$this->transactions = $transactions;
|
*/
|
||||||
return $this;
|
public function setRelatedResources($related_resources)
|
||||||
}
|
{
|
||||||
|
$this->related_resources = $related_resources;
|
||||||
|
|
||||||
/**
|
return $this;
|
||||||
* Additional transactions for complex payment (Parallel and Chained) scenarios.
|
}
|
||||||
*
|
|
||||||
* @return PayPal\Api\self
|
|
||||||
*/
|
|
||||||
public function getTransactions() {
|
|
||||||
return $this->transactions;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 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,28 +1,38 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PayPal\Api;
|
namespace PayPal\Api;
|
||||||
|
|
||||||
use PayPal\Common\PPModel;
|
use PayPal\Common\PPModel;
|
||||||
use PayPal\Rest\ApiContext;
|
use PayPal\Rest\ApiContext;
|
||||||
|
|
||||||
class Transactions extends PPModel {
|
/**
|
||||||
/**
|
* Class Transactions
|
||||||
* Amount being collected.
|
*
|
||||||
*
|
* @property \PayPal\Api\Amount amount
|
||||||
* @param PayPal\Api\Amount $amount
|
*/
|
||||||
*/
|
class Transactions extends PPModel
|
||||||
public function setAmount($amount) {
|
{
|
||||||
$this->amount = $amount;
|
/**
|
||||||
return $this;
|
* Set Amount
|
||||||
}
|
*
|
||||||
|
* @param \PayPal\Api\Amount $amount
|
||||||
/**
|
*
|
||||||
* Amount being collected.
|
* @return $this
|
||||||
*
|
*/
|
||||||
* @return PayPal\Api\Amount
|
public function setAmount($amount)
|
||||||
*/
|
{
|
||||||
public function getAmount() {
|
$this->amount = $amount;
|
||||||
return $this->amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Amount
|
||||||
|
*
|
||||||
|
* @return \PayPal\Api\Amount
|
||||||
|
*/
|
||||||
|
public function getAmount()
|
||||||
|
{
|
||||||
|
return $this->amount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,137 +1,180 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Oauth Token credential
|
||||||
|
*/
|
||||||
|
|
||||||
namespace PayPal\Auth;
|
namespace PayPal\Auth;
|
||||||
|
|
||||||
/**
|
|
||||||
* Oauth Token credential
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
use PayPal\Rest\RestHandler;
|
|
||||||
use PayPal\Common\PPUserAgent;
|
use PayPal\Common\PPUserAgent;
|
||||||
use PayPal\Core\PPLoggingManager;
|
use PayPal\Core\PPConnectionManager;
|
||||||
use PayPal\Core\PPConstants;
|
use PayPal\Core\PPConstants;
|
||||||
use PayPal\Core\PPHttpConfig;
|
use PayPal\Core\PPHttpConfig;
|
||||||
use PayPal\Core\PPConnectionManager;
|
use PayPal\Core\PPLoggingManager;
|
||||||
use PayPal\Exception\PPConfigurationException;
|
use PayPal\Exception\PPConfigurationException;
|
||||||
|
use PayPal\Rest\RestHandler;
|
||||||
|
|
||||||
class OAuthTokenCredential {
|
/**
|
||||||
|
* Class OAuthTokenCredential
|
||||||
private static $expiryBufferTime = 120;
|
*/
|
||||||
|
class OAuthTokenCredential
|
||||||
private $logger;
|
{
|
||||||
|
/**
|
||||||
/**
|
* Private Variable
|
||||||
* Client ID as obtained from the developer portal
|
*
|
||||||
*/
|
* @var int $expiryBufferTime
|
||||||
private $clientId;
|
*/
|
||||||
|
private static $expiryBufferTime = 120;
|
||||||
/**
|
|
||||||
* 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) {
|
|
||||||
|
|
||||||
$this->logger = new PPLoggingManager(__CLASS__, $config);
|
/**
|
||||||
// Check if Access Token is not null and has not expired.
|
* Private Variable
|
||||||
// The API returns expiry time as a relative time unit
|
*
|
||||||
// We use a buffer time when checking for token expiry to account
|
* @var \PayPal\Core\PPLoggingManager $logger
|
||||||
// for API call delays and any delay between the time the token is
|
*/
|
||||||
// retrieved and subsequently used
|
private $logger;
|
||||||
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) {
|
|
||||||
|
|
||||||
$base64ClientID = base64_encode($this->clientId . ":" . $this->clientSecret);
|
/**
|
||||||
$headers = array(
|
* Client ID as obtained from the developer portal
|
||||||
"User-Agent" => PPUserAgent::getValue(RestHandler::$sdkName, RestHandler::$sdkVersion),
|
*
|
||||||
"Authorization" => "Basic " . $base64ClientID,
|
* @var string $clientId
|
||||||
"Accept" => "*/*"
|
*/
|
||||||
);
|
private $clientId;
|
||||||
$httpConfiguration = $this->getOAuthHttpConfiguration($config);
|
|
||||||
$httpConfiguration->setHeaders($headers);
|
/**
|
||||||
|
* Client secret as obtained from the developer portal
|
||||||
$connection = PPConnectionManager::getInstance()->getConnection($httpConfiguration, $config);
|
*
|
||||||
$res = $connection->execute("grant_type=client_credentials");
|
* @var string $clientSecret
|
||||||
$jsonResponse = json_decode($res, true);
|
*/
|
||||||
if($jsonResponse == NULL ||
|
private $clientSecret;
|
||||||
!isset($jsonResponse["access_token"]) || !isset($jsonResponse["expires_in"]) ) {
|
|
||||||
$this->accessToken = NULL;
|
/**
|
||||||
$this->tokenExpiresIn = NULL;
|
* Generated Access Token
|
||||||
$this->logger->warning("Could not generate new Access token. Invalid response from server: " . $jsonResponse);
|
*
|
||||||
} else {
|
* @var $accessToken
|
||||||
$this->accessToken = $jsonResponse["access_token"];
|
*/
|
||||||
$this->tokenExpiresIn = $jsonResponse["expires_in"];
|
private $accessToken;
|
||||||
}
|
|
||||||
$this->tokenCreateTime = time();
|
/**
|
||||||
return $this->accessToken;
|
* Seconds for with access token is valid
|
||||||
}
|
*
|
||||||
|
* @var $tokenExpiresIn
|
||||||
/*
|
*/
|
||||||
* Get HttpConfiguration object for OAuth API
|
private $tokenExpiresIn;
|
||||||
*/
|
|
||||||
private function getOAuthHttpConfiguration($config) {
|
/**
|
||||||
if (isset($config['oauth.EndPoint'])) {
|
* Last time (in milliseconds) when access token was generated
|
||||||
$baseEndpoint = $config['oauth.EndPoint'];
|
*
|
||||||
} else if (isset($config['service.EndPoint'])) {
|
* @var $tokenCreateTime
|
||||||
$baseEndpoint = $config['service.EndPoint'];
|
*/
|
||||||
} else if (isset($config['mode'])) {
|
private $tokenCreateTime;
|
||||||
switch (strtoupper($config['mode'])) {
|
|
||||||
case 'SANDBOX':
|
/**
|
||||||
$baseEndpoint = PPConstants::REST_SANDBOX_ENDPOINT;
|
* Construct
|
||||||
break;
|
*
|
||||||
case 'LIVE':
|
* @param string $clientId client id obtained from the developer portal
|
||||||
$baseEndpoint = PPConstants::REST_LIVE_ENDPOINT;
|
* @param string $clientSecret client secret obtained from the developer portal
|
||||||
break;
|
*/
|
||||||
default:
|
public function __construct($clientId, $clientSecret)
|
||||||
throw new PPConfigurationException('The mode config parameter must be set to either sandbox/live');
|
{
|
||||||
}
|
$this->clientId = $clientId;
|
||||||
} else {
|
$this->clientSecret = $clientSecret;
|
||||||
throw new PPConfigurationException('You must set one of service.endpoint or mode parameters in your configuration');
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
$baseEndpoint = rtrim(trim($baseEndpoint), '/');
|
* Get AccessToken
|
||||||
return new PPHttpConfig($baseEndpoint . "/v1/oauth2/token", "POST");
|
*
|
||||||
}
|
* @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
|
<?php
|
||||||
|
/**
|
||||||
|
* Call level parameters such as request id, credentials etc
|
||||||
|
*/
|
||||||
|
|
||||||
namespace PayPal\Rest;
|
namespace PayPal\Rest;
|
||||||
|
|
||||||
use PayPal\Common\PPApiContext;
|
use PayPal\Common\PPApiContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Class ApiContext
|
||||||
* Call level parameters such as
|
|
||||||
* request id, credentials etc
|
|
||||||
*/
|
*/
|
||||||
class ApiContext extends PPApiContext {
|
class ApiContext extends PPApiContext
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* OAuth Credentials to use for this call
|
* OAuth Credentials to use for this call
|
||||||
* @var PayPal/Api/OAuthTokenCredential
|
*
|
||||||
*/
|
* @var \PayPal\Auth\OAuthTokenCredential $credential
|
||||||
private $credential;
|
*/
|
||||||
|
private $credential;
|
||||||
/**
|
|
||||||
* Unique request id to be used for this call
|
/**
|
||||||
* The user can either generate one as per application
|
* Unique request id to be used for this call
|
||||||
* needs or let the SDK generate one
|
* The user can either generate one as per application
|
||||||
* @var string
|
* needs or let the SDK generate one
|
||||||
*/
|
*
|
||||||
private $requestId;
|
* @var null|string $requestId
|
||||||
|
*/
|
||||||
/**
|
private $requestId;
|
||||||
*
|
|
||||||
*/
|
/**
|
||||||
public function getCredential() {
|
* Get Credential
|
||||||
return $this->credential;
|
*
|
||||||
}
|
* @return \PayPal\Auth\OAuthTokenCredential
|
||||||
|
*/
|
||||||
public function getrequestId() {
|
public function getCredential()
|
||||||
if($this->requestId == null) {
|
{
|
||||||
$this->requestId = $this->generateRequestId();
|
return $this->credential;
|
||||||
}
|
}
|
||||||
return $this->requestId;
|
|
||||||
}
|
/**
|
||||||
|
* Get Request ID
|
||||||
|
*
|
||||||
/**
|
* @return string
|
||||||
*
|
*/
|
||||||
* @param PayPal/Api/OAuthTokenCredential $credential
|
public function getrequestId()
|
||||||
* @param string $requestId
|
{
|
||||||
*/
|
if ($this->requestId == null) {
|
||||||
public function __construct($credential, $requestId=null) {
|
$this->requestId = $this->generateRequestId();
|
||||||
$this->credential = $credential;
|
}
|
||||||
$this->requestId = $requestId;
|
|
||||||
}
|
return $this->requestId;
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Generates a unique per request id that
|
/**
|
||||||
* can be used to set the PayPal-Request-Id header
|
* Construct
|
||||||
* that is used for idemptency
|
*
|
||||||
* @return string
|
* @param \PayPal\Auth\OAuthTokenCredential $credential
|
||||||
*/
|
* @param string|null $requestId
|
||||||
private function generateRequestId() {
|
*/
|
||||||
|
public function __construct($credential, $requestId = null)
|
||||||
static $pid = -1;
|
{
|
||||||
static $addr = -1;
|
$this->credential = $credential;
|
||||||
|
$this->requestId = $requestId;
|
||||||
if ($pid == -1) {
|
}
|
||||||
$pid = getmypid();
|
|
||||||
}
|
/**
|
||||||
if ($addr == -1) {
|
* Generates a unique per request id that
|
||||||
if(array_key_exists('SERVER_ADDR', $_SERVER)) {
|
* can be used to set the PayPal-Request-Id header
|
||||||
$addr = ip2long($_SERVER['SERVER_ADDR']);
|
* that is used for idemptency
|
||||||
} else {
|
*
|
||||||
$addr = php_uname('n');
|
* @return string
|
||||||
}
|
*/
|
||||||
}
|
private function generateRequestId()
|
||||||
|
{
|
||||||
return $addr . $pid . $_SERVER['REQUEST_TIME'] . mt_rand(0, 0xffff);
|
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;
|
namespace PayPal\Rest;
|
||||||
|
|
||||||
interface IResource {
|
/**
|
||||||
|
* Interface IResource
|
||||||
}
|
*/
|
||||||
|
interface IResource
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,84 +1,131 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* API handler for all REST API calls
|
||||||
|
*/
|
||||||
|
|
||||||
namespace PayPal\Rest;
|
namespace PayPal\Rest;
|
||||||
|
|
||||||
use PayPal\Auth\OAuthTokenCredential;
|
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\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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Class RestHandler
|
||||||
* API handler for all REST API calls
|
|
||||||
*/
|
*/
|
||||||
class RestHandler implements IPPHandler {
|
class RestHandler implements IPPHandler
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Private Variable
|
||||||
|
*
|
||||||
|
* @var \Paypal\Rest\ApiContext $apiContext
|
||||||
|
*/
|
||||||
|
private $apiContext;
|
||||||
|
|
||||||
private $apiContext;
|
/**
|
||||||
|
* Public Variable
|
||||||
public static $sdkName = "rest-sdk-php";
|
*
|
||||||
public static $sdkVersion = "0.6.0";
|
* @var string $sdkName
|
||||||
|
*/
|
||||||
public function __construct($apiContext) {
|
public static $sdkName = "rest-sdk-php";
|
||||||
$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");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
$httpConfig->setUrl(
|
* Public Variable
|
||||||
rtrim( trim($this->_getEndpoint($config)), '/') .
|
*
|
||||||
(isset($options['path']) ? $options['path'] : '')
|
* @var string $sdkVersion
|
||||||
);
|
*/
|
||||||
|
public static $sdkVersion = "0.6.0";
|
||||||
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');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user