forked from LiveCarta/PayPal-PHP-SDK
Enabled EC Parameters support
- Updated Api to enabled EC Parameters - Updated Tests - Updated Logging Manager - Added a feature to do validation on accessors.
This commit is contained in:
@@ -8,6 +8,10 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class Address
|
||||
*
|
||||
* Base Address object used as billing address in a payment or extended for Shipping Address.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string line1
|
||||
* @property string line2
|
||||
* @property string city
|
||||
@@ -19,23 +23,21 @@ use PayPal\Rest\ApiContext;
|
||||
class Address extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Line 1
|
||||
* Address (eg. number, street, etc)
|
||||
* Line 1 of the Address (eg. number, street, etc).
|
||||
*
|
||||
*
|
||||
* @param string $line1
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLine1($line1)
|
||||
{
|
||||
$this->line1 = $line1;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Line 1
|
||||
* Address (eg. number, street, etc)
|
||||
* Line 1 of the Address (eg. number, street, etc).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -45,23 +47,21 @@ class Address extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Line 2 (Optional)
|
||||
* Address (eg. suite, apt #, etc)
|
||||
* Optional line 2 of the Address (eg. suite, apt #, etc.).
|
||||
*
|
||||
*
|
||||
* @param string $line2
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLine2($line2)
|
||||
{
|
||||
$this->line2 = $line2;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Line 2 (Optional)
|
||||
* Address (eg. suite, apt #, etc)
|
||||
* Optional line 2 of the Address (eg. suite, apt #, etc.).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -71,21 +71,21 @@ class Address extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set City Name
|
||||
* City name.
|
||||
*
|
||||
*
|
||||
* @param string $city
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCity($city)
|
||||
{
|
||||
$this->city = $city;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get City Name
|
||||
* City name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -95,23 +95,21 @@ class Address extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Country Code
|
||||
* Two Letter
|
||||
* 2 letter country code.
|
||||
*
|
||||
*
|
||||
* @param string $country_code
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCountryCode($country_code)
|
||||
{
|
||||
$this->country_code = $country_code;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Country Code
|
||||
* Two Letter
|
||||
* 2 letter country code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -121,27 +119,22 @@ class Address extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Country Code
|
||||
* Two Letter
|
||||
* 2 letter country code.
|
||||
*
|
||||
* @deprecated Instead use setCountryCode
|
||||
*
|
||||
* @param string $country_code
|
||||
*
|
||||
* @deprecated Use setCountryCode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCountry_code($country_code)
|
||||
{
|
||||
$this->country_code = $country_code;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Country Code
|
||||
* Two Letter
|
||||
*
|
||||
* @deprecated Use getCountryCode
|
||||
* 2 letter country code.
|
||||
* @deprecated Instead use getCountryCode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -151,25 +144,21 @@ class Address extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Postal Code
|
||||
* Zip code or equivalent is usually required for countries that have them
|
||||
* For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code
|
||||
* Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code.
|
||||
*
|
||||
*
|
||||
* @param string $postal_code
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPostalCode($postal_code)
|
||||
{
|
||||
$this->postal_code = $postal_code;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Postal Code
|
||||
* Zip code or equivalent is usually required for countries that have them
|
||||
* For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code
|
||||
* 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
|
||||
*/
|
||||
@@ -179,29 +168,22 @@ class Address extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Postal Code
|
||||
* Zip code or equivalent is usually required for countries that have them
|
||||
* For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code
|
||||
* 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 Instead use setPostalCode
|
||||
*
|
||||
* @param string $postal_code
|
||||
*
|
||||
* @deprecated Use setPostalCode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPostal_code($postal_code)
|
||||
{
|
||||
$this->postal_code = $postal_code;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Postal Code
|
||||
* Zip code or equivalent is usually required for countries that have them
|
||||
* For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code
|
||||
*
|
||||
* @deprecated Use getPostalCode
|
||||
* 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 Instead use getPostalCode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -211,23 +193,21 @@ class Address extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set State
|
||||
* Two Letter Code for US States and the equivalent for other countries
|
||||
* 2 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
|
||||
* 2 letter code for US states, and the equivalent for other countries.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -237,11 +217,11 @@ class Address extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Phone Number
|
||||
* E.123 format
|
||||
* Phone number in E.123 format.
|
||||
*
|
||||
*
|
||||
* @param string $phone
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
@@ -251,8 +231,7 @@ class Address extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Phone Number
|
||||
* E.123 format
|
||||
* Phone number in E.123 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -260,4 +239,5 @@ class Address extends PPModel
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,30 +8,32 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class Amount
|
||||
*
|
||||
* @property string currency
|
||||
* @property string total
|
||||
* @property \PayPal\Api\Details details
|
||||
* Let's you specify details of a payment amount.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string currency
|
||||
* @property string total
|
||||
* @property \PayPal\Api\Details details
|
||||
*/
|
||||
class Amount extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Currency
|
||||
* Three Letter Currency Code
|
||||
* 3 letter currency code
|
||||
*
|
||||
*
|
||||
* @param string $currency
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCurrency($currency)
|
||||
{
|
||||
$this->currency = $currency;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Currency
|
||||
* Three Letter Currency Code
|
||||
* 3 letter currency code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -41,25 +43,21 @@ class Amount extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Total
|
||||
* Amount charged from the Payer account (or card) to Payee
|
||||
* In case of a refund, this is the refunded amount to the original Payer from Payee account
|
||||
* Total amount charged from the Payer account (or card) to Payee. In case of a refund, this is the refunded amount to the original Payer from Payee account.
|
||||
*
|
||||
*
|
||||
* @param string $total
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTotal($total)
|
||||
{
|
||||
$this->total = $total;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Total
|
||||
* Amount charged from the Payer account (or card) to Payee
|
||||
* In case of a refund, this is the refunded amount to the original Payer from Payee account
|
||||
* 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
|
||||
*/
|
||||
@@ -69,11 +67,11 @@ class Amount extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Details
|
||||
* Additional Details of Payment Amount
|
||||
* Additional details of the payment amount.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Details $details
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDetails($details)
|
||||
@@ -83,8 +81,7 @@ class Amount extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Details
|
||||
* Additional Details of Payment Amount
|
||||
* Additional details of the payment amount.
|
||||
*
|
||||
* @return \PayPal\Api\Details
|
||||
*/
|
||||
@@ -92,4 +89,5 @@ class Amount extends PPModel
|
||||
{
|
||||
return $this->details;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,32 +7,42 @@ use PayPal\Rest\ApiContext;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Api\Capture;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* Class Authorization
|
||||
*
|
||||
* @property string id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* An authorization transaction.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @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
|
||||
* @property string payment_mode
|
||||
* @property string state
|
||||
* @property string protection_eligibility
|
||||
* @property string protection_eligibility_type
|
||||
* @property string parent_payment
|
||||
* @property string clearing_time
|
||||
* @property string valid_until
|
||||
* @property \PayPal\Api\Links links
|
||||
*/
|
||||
class Authorization extends PPModel implements IResource
|
||||
{
|
||||
/**
|
||||
* @var
|
||||
* OAuth Credentials to use for this call
|
||||
*
|
||||
* @var \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
private static $credential;
|
||||
protected static $credential;
|
||||
|
||||
/**
|
||||
* Set Credential
|
||||
*
|
||||
* @param $credential
|
||||
* Sets Credential
|
||||
*
|
||||
* @deprecated Pass ApiContext to create/get methods instead
|
||||
* @param \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
public static function setCredential($credential)
|
||||
{
|
||||
@@ -40,23 +50,21 @@ class Authorization extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ID
|
||||
* Identifier of the authorization transaction
|
||||
* Identifier of the authorization transaction.
|
||||
*
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ID
|
||||
* Identifier of the authorization transaction
|
||||
* Identifier of the authorization transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -66,23 +74,21 @@ class Authorization extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
*
|
||||
* @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
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -92,27 +98,22 @@ class Authorization extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @deprecated Instead use setCreateTime
|
||||
*
|
||||
* @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
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
* @deprecated Instead use getCreateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -122,23 +123,21 @@ class Authorization extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
*
|
||||
* @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
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -148,27 +147,22 @@ class Authorization extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* @deprecated Instead use setUpdateTime
|
||||
*
|
||||
* @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
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
* @deprecated Instead use getUpdateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -178,21 +172,21 @@ class Authorization extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Amount
|
||||
* Amount being authorized for.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Amount
|
||||
* Amount being authorized for.
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
@@ -202,23 +196,70 @@ class Authorization extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set State
|
||||
* State of the authorization transaction
|
||||
* specifies payment mode of the transaction
|
||||
* Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
|
||||
*
|
||||
* @param string $payment_mode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentMode($payment_mode)
|
||||
{
|
||||
$this->payment_mode = $payment_mode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* specifies payment mode of the transaction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentMode()
|
||||
{
|
||||
return $this->payment_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* specifies payment mode of the transaction
|
||||
*
|
||||
* @deprecated Instead use setPaymentMode
|
||||
*
|
||||
* @param string $payment_mode
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayment_mode($payment_mode)
|
||||
{
|
||||
$this->payment_mode = $payment_mode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* specifies payment mode of the transaction
|
||||
* @deprecated Instead use getPaymentMode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayment_mode()
|
||||
{
|
||||
return $this->payment_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the authorization transaction.
|
||||
* Valid Values: ["pending", "authorized", "partially_captured", "captured", "expired", "voided"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get State
|
||||
* State of the authorization transaction
|
||||
* State of the authorization transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -228,23 +269,119 @@ class Authorization extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
* Protection Eligibility of the Payer
|
||||
* Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
|
||||
*
|
||||
* @param string $protection_eligibility
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtectionEligibility($protection_eligibility)
|
||||
{
|
||||
$this->protection_eligibility = $protection_eligibility;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility of the Payer
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtectionEligibility()
|
||||
{
|
||||
return $this->protection_eligibility;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility of the Payer
|
||||
*
|
||||
* @deprecated Instead use setProtectionEligibility
|
||||
*
|
||||
* @param string $protection_eligibility
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtection_eligibility($protection_eligibility)
|
||||
{
|
||||
$this->protection_eligibility = $protection_eligibility;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility of the Payer
|
||||
* @deprecated Instead use getProtectionEligibility
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtection_eligibility()
|
||||
{
|
||||
return $this->protection_eligibility;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility Type of the Payer
|
||||
* Valid Values: ["ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE", "INELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE"]
|
||||
*
|
||||
* @param string $protection_eligibility_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtectionEligibilityType($protection_eligibility_type)
|
||||
{
|
||||
$this->protection_eligibility_type = $protection_eligibility_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility Type of the Payer
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtectionEligibilityType()
|
||||
{
|
||||
return $this->protection_eligibility_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility Type of the Payer
|
||||
*
|
||||
* @deprecated Instead use setProtectionEligibilityType
|
||||
*
|
||||
* @param string $protection_eligibility_type
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtection_eligibility_type($protection_eligibility_type)
|
||||
{
|
||||
$this->protection_eligibility_type = $protection_eligibility_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility Type of the Payer
|
||||
* @deprecated Instead use getProtectionEligibilityType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtection_eligibility_type()
|
||||
{
|
||||
return $this->protection_eligibility_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentPayment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -254,27 +391,22 @@ class Authorization extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
* @deprecated Instead use setParentPayment
|
||||
*
|
||||
* @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
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @deprecated Instead use getParentPayment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -284,23 +416,70 @@ class Authorization extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Valid Until
|
||||
* Date/Time until which funds may be captured against this resource
|
||||
* Expected clearing time for eCheck Transactions
|
||||
*
|
||||
*
|
||||
* @param string $clearing_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setClearingTime($clearing_time)
|
||||
{
|
||||
$this->clearing_time = $clearing_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expected clearing time for eCheck Transactions
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getClearingTime()
|
||||
{
|
||||
return $this->clearing_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expected clearing time for eCheck Transactions
|
||||
*
|
||||
* @deprecated Instead use setClearingTime
|
||||
*
|
||||
* @param string $clearing_time
|
||||
* @return $this
|
||||
*/
|
||||
public function setClearing_time($clearing_time)
|
||||
{
|
||||
$this->clearing_time = $clearing_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expected clearing time for eCheck Transactions
|
||||
* @deprecated Instead use getClearingTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getClearing_time()
|
||||
{
|
||||
return $this->clearing_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until which funds may be captured against this resource.
|
||||
*
|
||||
*
|
||||
* @param string $valid_until
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValidUntil($valid_until)
|
||||
{
|
||||
$this->valid_until = $valid_until;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Valid Until
|
||||
* Date/Time until which funds may be captured against this resource
|
||||
* Date/Time until which funds may be captured against this resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -310,27 +489,22 @@ class Authorization extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Valid Until
|
||||
* Date/Time until which funds may be captured against this resource
|
||||
* Date/Time until which funds may be captured against this resource.
|
||||
*
|
||||
* @deprecated Instead use setValidUntil
|
||||
*
|
||||
* @param string $valid_until
|
||||
*
|
||||
* @deprecated Use setValidUntil
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValid_until($valid_until)
|
||||
{
|
||||
$this->valid_until = $valid_until;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Valid Until
|
||||
* Date/Time until which funds may be captured against this resource
|
||||
*
|
||||
* @deprecated Use getValidUntil
|
||||
* Date/Time until which funds may be captured against this resource.
|
||||
* @deprecated Instead use getValidUntil
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -340,23 +514,23 @@ class Authorization extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Links
|
||||
* Sets Links
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
@@ -364,122 +538,88 @@ class Authorization extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Get
|
||||
*
|
||||
* @param int $authorizationId
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
* Obtain the Authorization transaction resource for the given identifier.
|
||||
*
|
||||
* @param string $authorizationId
|
||||
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @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");
|
||||
}
|
||||
ArgumentValidator::validate($authorizationId, 'authorizationId');
|
||||
|
||||
$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
|
||||
* Creates (and processes) a new Capture Transaction added as a related 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.
|
||||
* @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");
|
||||
}
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($capture, 'capture');
|
||||
|
||||
$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
|
||||
* 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
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function void($apiContext = null)
|
||||
{
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
|
||||
$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;
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reauthorize
|
||||
* Reauthorizes an expired Authorization.
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return $this
|
||||
* @throws \InvalidArgumentException
|
||||
* @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 reauthorize($apiContext = null)
|
||||
{
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
1244
lib/PayPal/Api/BankAccount.php
Normal file
1244
lib/PayPal/Api/BankAccount.php
Normal file
File diff suppressed because it is too large
Load Diff
143
lib/PayPal/Api/BankAccountsList.php
Normal file
143
lib/PayPal/Api/BankAccountsList.php
Normal file
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class BankAccountsList
|
||||
*
|
||||
* A list of Bank Account Resources
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\BankAccount bank_accounts
|
||||
* @property int count
|
||||
* @property string next_id
|
||||
*/
|
||||
class BankAccountsList extends PPModel
|
||||
{
|
||||
/**
|
||||
* A list of bank account resources
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\BankAccount $bank_accounts
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBankAccounts($bank_accounts)
|
||||
{
|
||||
$this->{"bank-accounts"} = $bank_accounts;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of bank account resources
|
||||
*
|
||||
* @return \PayPal\Api\BankAccount[]
|
||||
*/
|
||||
public function getBankAccounts()
|
||||
{
|
||||
return $this->{"bank-accounts"};
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of bank account resources
|
||||
*
|
||||
* @deprecated Instead use setBankAccounts
|
||||
*
|
||||
* @param \PayPal\Api\BankAccount $bank-accounts
|
||||
* @return $this
|
||||
*/
|
||||
public function setBank_accounts($bank_accounts)
|
||||
{
|
||||
$this->{"bank-accounts"} = $bank_accounts;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of bank account resources
|
||||
* @deprecated Instead use getBankAccounts
|
||||
*
|
||||
* @return \PayPal\Api\BankAccount
|
||||
*/
|
||||
public function getBank_accounts()
|
||||
{
|
||||
return $this->{"bank-accounts"};
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
*
|
||||
*
|
||||
* @param int $count
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCount($count)
|
||||
{
|
||||
$this->count = $count;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCount()
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNextId()
|
||||
{
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
*
|
||||
* @deprecated Instead use setNextId
|
||||
*
|
||||
* @param string $next_id
|
||||
* @return $this
|
||||
*/
|
||||
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.
|
||||
* @deprecated Instead use getNextId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNext_id()
|
||||
{
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
}
|
||||
168
lib/PayPal/Api/BankToken.php
Normal file
168
lib/PayPal/Api/BankToken.php
Normal file
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class BankToken
|
||||
*
|
||||
* A resource representing a bank that can be used to fund a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string bank_id
|
||||
* @property string external_customer_id
|
||||
* @property string mandate_reference_number
|
||||
*/
|
||||
class BankToken extends PPModel
|
||||
{
|
||||
/**
|
||||
* ID of a previously saved Bank resource using /vault/bank API.
|
||||
*
|
||||
*
|
||||
* @param string $bank_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBankId($bank_id)
|
||||
{
|
||||
$this->bank_id = $bank_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a previously saved Bank resource using /vault/bank API.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBankId()
|
||||
{
|
||||
return $this->bank_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a previously saved Bank resource using /vault/bank API.
|
||||
*
|
||||
* @deprecated Instead use setBankId
|
||||
*
|
||||
* @param string $bank_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setBank_id($bank_id)
|
||||
{
|
||||
$this->bank_id = $bank_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a previously saved Bank resource using /vault/bank API.
|
||||
* @deprecated Instead use getBankId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBank_id()
|
||||
{
|
||||
return $this->bank_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this bank using /vault/bank API.
|
||||
*
|
||||
*
|
||||
* @param string $external_customer_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternalCustomerId($external_customer_id)
|
||||
{
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this bank using /vault/bank API.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalCustomerId()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this bank using /vault/bank API.
|
||||
*
|
||||
* @deprecated Instead use setExternalCustomerId
|
||||
*
|
||||
* @param string $external_customer_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternal_customer_id($external_customer_id)
|
||||
{
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this bank using /vault/bank API.
|
||||
* @deprecated Instead use getExternalCustomerId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternal_customer_id()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
|
||||
*
|
||||
*
|
||||
* @param string $mandate_reference_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMandateReferenceNumber($mandate_reference_number)
|
||||
{
|
||||
$this->mandate_reference_number = $mandate_reference_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMandateReferenceNumber()
|
||||
{
|
||||
return $this->mandate_reference_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
|
||||
*
|
||||
* @deprecated Instead use setMandateReferenceNumber
|
||||
*
|
||||
* @param string $mandate_reference_number
|
||||
* @return $this
|
||||
*/
|
||||
public function setMandate_reference_number($mandate_reference_number)
|
||||
{
|
||||
$this->mandate_reference_number = $mandate_reference_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
|
||||
* @deprecated Instead use getMandateReferenceNumber
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMandate_reference_number()
|
||||
{
|
||||
return $this->mandate_reference_number;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,30 +7,38 @@ use PayPal\Rest\ApiContext;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Api\Refund;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* Class Capture
|
||||
*
|
||||
* @property string id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* A capture transaction.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @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
|
||||
* @property bool is_final_capture
|
||||
* @property string state
|
||||
* @property string parent_payment
|
||||
* @property \PayPal\Api\Links links
|
||||
*/
|
||||
class Capture extends PPModel implements IResource
|
||||
{
|
||||
/**
|
||||
* @var
|
||||
* OAuth Credentials to use for this call
|
||||
*
|
||||
* @var \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
private static $credential;
|
||||
protected static $credential;
|
||||
|
||||
/**
|
||||
* @param $credential
|
||||
* Sets Credential
|
||||
*
|
||||
* @deprecated Pass ApiContext to create/get methods instead
|
||||
* @param \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
public static function setCredential($credential)
|
||||
{
|
||||
@@ -38,23 +46,21 @@ class Capture extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ID
|
||||
* Identifier of the Capture transaction
|
||||
* Identifier of the Capture transaction.
|
||||
*
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ID
|
||||
* Identifier of the Capture transaction
|
||||
* Identifier of the Capture transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -64,23 +70,21 @@ class Capture extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
*
|
||||
* @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
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -90,27 +94,22 @@ class Capture extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @deprecated Instead use setCreateTime
|
||||
*
|
||||
* @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
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
* @deprecated Instead use getCreateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -120,23 +119,21 @@ class Capture extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
*
|
||||
* @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
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -146,27 +143,22 @@ class Capture extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* @deprecated Instead use setUpdateTime
|
||||
*
|
||||
* @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
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
* @deprecated Instead use getUpdateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -176,29 +168,21 @@ class Capture extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Amount
|
||||
* Amount being captured
|
||||
* If no amount is specified, amount is used from the authorization being captured
|
||||
* If amount is same as the amount that's authorized for, the state of the authorization changes to captured
|
||||
* If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true
|
||||
* Amount being captured. If no amount is specified, amount is used from the authorization being captured. If amount is same as the amount that's authorized for, the state of the authorization changes to captured. If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Amount
|
||||
* Amount being captured
|
||||
* If no amount is specified, amount is used from the authorization being captured
|
||||
* If amount is same as the amount that's authorized for, the state of the authorization changes to captured
|
||||
* If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true
|
||||
* Amount being captured. If no amount is specified, amount is used from the authorization being captured. If amount is same as the amount that's authorized for, the state of the authorization changes to captured. If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true.
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
@@ -208,27 +192,23 @@ class Capture extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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 bool $is_final_capture
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsFinalCapture($is_final_capture)
|
||||
{
|
||||
$this->is_final_capture = $is_final_capture;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Is Final Capture
|
||||
* Whether this is a final capture for the given authorization or not
|
||||
* If it's final, all the remaining funds held by the authorization, will be released in the funding instrument
|
||||
* whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument.
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function getIsFinalCapture()
|
||||
{
|
||||
@@ -236,31 +216,24 @@ class Capture extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument.
|
||||
*
|
||||
* @param boolean $is_final_capture
|
||||
*
|
||||
* @deprecated Use setIsFinalCapture
|
||||
* @deprecated Instead use setIsFinalCapture
|
||||
*
|
||||
* @param bool $is_final_capture
|
||||
* @return $this
|
||||
*/
|
||||
public function setIs_final_capture($is_final_capture)
|
||||
{
|
||||
$this->is_final_capture = $is_final_capture;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Is Final Capture
|
||||
* Whether this is a final capture for the given authorization or not
|
||||
* If it's final, all the remaining funds held by the authorization, will be released in the funding instrument
|
||||
* whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument.
|
||||
* @deprecated Instead use getIsFinalCapture
|
||||
*
|
||||
* @deprecated Use getIsFinalCapture
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function getIs_final_capture()
|
||||
{
|
||||
@@ -268,23 +241,21 @@ class Capture extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set State
|
||||
* State of the capture transaction
|
||||
* State of the capture transaction.
|
||||
* Valid Values: ["pending", "completed", "refunded", "partially_refunded"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get State
|
||||
* State of the capture transaction
|
||||
* State of the capture transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -294,23 +265,21 @@ class Capture extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentPayment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -320,27 +289,22 @@ class Capture extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
* @deprecated Instead use setParentPayment
|
||||
*
|
||||
* @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
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @deprecated Instead use getParentPayment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -350,23 +314,23 @@ class Capture extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Links
|
||||
* Sets Links
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
@@ -374,66 +338,48 @@ class Capture extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Get
|
||||
*
|
||||
* @param int $captureId
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
* Obtain the Capture transaction resource for the given identifier.
|
||||
*
|
||||
* @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 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");
|
||||
}
|
||||
ArgumentValidator::validate($captureId, 'captureId');
|
||||
|
||||
$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
|
||||
* Creates (and processes) a new Refund Transaction added as a related resource.
|
||||
*
|
||||
* @param Refund $refund
|
||||
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @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");
|
||||
}
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($refund, 'refund');
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
117
lib/PayPal/Api/CarrierAccountToken.php
Normal file
117
lib/PayPal/Api/CarrierAccountToken.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
|
||||
/**
|
||||
* Class CarrierAccountToken
|
||||
*
|
||||
* A resource representing a carrier account that can be used to fund a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string carrier_account_id
|
||||
* @property string external_customer_id
|
||||
*/
|
||||
class CarrierAccountToken extends PPModel
|
||||
{
|
||||
/**
|
||||
* ID of a previously saved carrier account resource.
|
||||
*
|
||||
*
|
||||
* @param string $carrier_account_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setCarrierAccountId($carrier_account_id)
|
||||
{
|
||||
$this->carrier_account_id = $carrier_account_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a previously saved carrier account resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCarrierAccountId()
|
||||
{
|
||||
return $this->carrier_account_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a previously saved carrier account resource.
|
||||
*
|
||||
* @deprecated Instead use setCarrierAccountId
|
||||
*
|
||||
* @param string $carrier_account_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setCarrier_account_id($carrier_account_id)
|
||||
{
|
||||
$this->carrier_account_id = $carrier_account_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a previously saved carrier account resource.
|
||||
* @deprecated Instead use getCarrierAccountId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCarrier_account_id()
|
||||
{
|
||||
return $this->carrier_account_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this carrier account instrument.
|
||||
*
|
||||
*
|
||||
* @param string $external_customer_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternalCustomerId($external_customer_id)
|
||||
{
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this carrier account instrument.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalCustomerId()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this carrier account instrument.
|
||||
*
|
||||
* @deprecated Instead use setExternalCustomerId
|
||||
*
|
||||
* @param string $external_customer_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternal_customer_id($external_customer_id)
|
||||
{
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this carrier account instrument.
|
||||
* @deprecated Instead use getExternalCustomerId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternal_customer_id()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
}
|
||||
368
lib/PayPal/Api/CartBase.php
Normal file
368
lib/PayPal/Api/CartBase.php
Normal file
@@ -0,0 +1,368 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class CartBase
|
||||
*
|
||||
* Base properties of a cart resource
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property \PayPal\Api\Payee payee
|
||||
* @property string description
|
||||
* @property string note_to_payee
|
||||
* @property string custom
|
||||
* @property string invoice_number
|
||||
* @property string soft_descriptor
|
||||
* @property \PayPal\Api\PaymentOptions payment_options
|
||||
* @property \PayPal\Api\ItemList item_list
|
||||
*/
|
||||
class CartBase extends PPModel
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recipient of the funds in this transaction.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Payee $payee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayee($payee)
|
||||
{
|
||||
$this->payee = $payee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recipient of the funds in this transaction.
|
||||
*
|
||||
* @return \PayPal\Api\Payee
|
||||
*/
|
||||
public function getPayee()
|
||||
{
|
||||
return $this->payee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of what is being paid for.
|
||||
*
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the recipient of the funds in this transaction.
|
||||
*
|
||||
*
|
||||
* @param string $note_to_payee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNoteToPayee($note_to_payee)
|
||||
{
|
||||
$this->note_to_payee = $note_to_payee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the recipient of the funds in this transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNoteToPayee()
|
||||
{
|
||||
return $this->note_to_payee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the recipient of the funds in this transaction.
|
||||
*
|
||||
* @deprecated Instead use setNoteToPayee
|
||||
*
|
||||
* @param string $note_to_payee
|
||||
* @return $this
|
||||
*/
|
||||
public function setNote_to_payee($note_to_payee)
|
||||
{
|
||||
$this->note_to_payee = $note_to_payee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the recipient of the funds in this transaction.
|
||||
* @deprecated Instead use getNoteToPayee
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote_to_payee()
|
||||
{
|
||||
return $this->note_to_payee;
|
||||
}
|
||||
|
||||
/**
|
||||
* free-form field for the use of clients
|
||||
*
|
||||
*
|
||||
* @param string $custom
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCustom($custom)
|
||||
{
|
||||
$this->custom = $custom;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* free-form field for the use of clients
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCustom()
|
||||
{
|
||||
return $this->custom;
|
||||
}
|
||||
|
||||
/**
|
||||
* invoice number to track this payment
|
||||
*
|
||||
*
|
||||
* @param string $invoice_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInvoiceNumber($invoice_number)
|
||||
{
|
||||
$this->invoice_number = $invoice_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* invoice number to track this payment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInvoiceNumber()
|
||||
{
|
||||
return $this->invoice_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* invoice number to track this payment
|
||||
*
|
||||
* @deprecated Instead use setInvoiceNumber
|
||||
*
|
||||
* @param string $invoice_number
|
||||
* @return $this
|
||||
*/
|
||||
public function setInvoice_number($invoice_number)
|
||||
{
|
||||
$this->invoice_number = $invoice_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* invoice number to track this payment
|
||||
* @deprecated Instead use getInvoiceNumber
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInvoice_number()
|
||||
{
|
||||
return $this->invoice_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Soft descriptor used when charging this funding source.
|
||||
*
|
||||
*
|
||||
* @param string $soft_descriptor
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSoftDescriptor($soft_descriptor)
|
||||
{
|
||||
$this->soft_descriptor = $soft_descriptor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Soft descriptor used when charging this funding source.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSoftDescriptor()
|
||||
{
|
||||
return $this->soft_descriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Soft descriptor used when charging this funding source.
|
||||
*
|
||||
* @deprecated Instead use setSoftDescriptor
|
||||
*
|
||||
* @param string $soft_descriptor
|
||||
* @return $this
|
||||
*/
|
||||
public function setSoft_descriptor($soft_descriptor)
|
||||
{
|
||||
$this->soft_descriptor = $soft_descriptor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Soft descriptor used when charging this funding source.
|
||||
* @deprecated Instead use getSoftDescriptor
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSoft_descriptor()
|
||||
{
|
||||
return $this->soft_descriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment options requested for this purchase unit
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\PaymentOptions $payment_options
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentOptions($payment_options)
|
||||
{
|
||||
$this->payment_options = $payment_options;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment options requested for this purchase unit
|
||||
*
|
||||
* @return \PayPal\Api\PaymentOptions
|
||||
*/
|
||||
public function getPaymentOptions()
|
||||
{
|
||||
return $this->payment_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment options requested for this purchase unit
|
||||
*
|
||||
* @deprecated Instead use setPaymentOptions
|
||||
*
|
||||
* @param \PayPal\Api\PaymentOptions $payment_options
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayment_options($payment_options)
|
||||
{
|
||||
$this->payment_options = $payment_options;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment options requested for this purchase unit
|
||||
* @deprecated Instead use getPaymentOptions
|
||||
*
|
||||
* @return \PayPal\Api\PaymentOptions
|
||||
*/
|
||||
public function getPayment_options()
|
||||
{
|
||||
return $this->payment_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of items being paid for.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\ItemList $item_list
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @deprecated Instead use setItemList
|
||||
*
|
||||
* @param \PayPal\Api\ItemList $item_list
|
||||
* @return $this
|
||||
*/
|
||||
public function setItem_list($item_list)
|
||||
{
|
||||
$this->item_list = $item_list;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of items being paid for.
|
||||
* @deprecated Instead use getItemList
|
||||
*
|
||||
* @return \PayPal\Api\ItemList
|
||||
*/
|
||||
public function getItem_list()
|
||||
{
|
||||
return $this->item_list;
|
||||
}
|
||||
|
||||
}
|
||||
93
lib/PayPal/Api/Credit.php
Normal file
93
lib/PayPal/Api/Credit.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Credit
|
||||
*
|
||||
* A resource representing a credit instrument.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string type
|
||||
* @property string terms
|
||||
*/
|
||||
class Credit extends PPModel
|
||||
{
|
||||
/**
|
||||
* Unique identifier of credit resource.
|
||||
*
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unique identifier of credit resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* specifies type of credit
|
||||
* Valid Values: ["BILL_ME_LATER", "PAYPAL_EXTRAS_MASTERCARD", "EBAY_MASTERCARD", "PAYPAL_SMART_CONNECT"]
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* specifies type of credit
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI to the associated terms
|
||||
*
|
||||
*
|
||||
* @param string $terms
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTerms($terms)
|
||||
{
|
||||
$this->terms = $terms;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* URI to the associated terms
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTerms()
|
||||
{
|
||||
return $this->terms;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,41 +5,46 @@ namespace PayPal\Api;
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Api\CreditCardHistory;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* Class CreditCard
|
||||
*
|
||||
* @property string id
|
||||
* @property string number
|
||||
* @property string type
|
||||
* @property int expire_month
|
||||
* @property int expire_year
|
||||
* @property string cvv2
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* A resource representing a credit card that can be used to fund a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string number
|
||||
* @property string type
|
||||
* @property int expire_month
|
||||
* @property int expire_year
|
||||
* @property int cvv2
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* @property \PayPal\Api\Address billing_address
|
||||
* @property string payer_id
|
||||
* @property string state
|
||||
* @property string valid_until
|
||||
* @property \PayPal\Api\Links links
|
||||
* @property string external_customer_id
|
||||
* @property string state
|
||||
* @property string valid_until
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Links links
|
||||
*/
|
||||
class CreditCard extends PPModel implements IResource
|
||||
{
|
||||
/**
|
||||
* Private Variable
|
||||
* OAuth Credentials to use for this call
|
||||
*
|
||||
* @var $credential
|
||||
* @var \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
private static $credential;
|
||||
protected static $credential;
|
||||
|
||||
/**
|
||||
* Set Credential
|
||||
*
|
||||
* @param $credential
|
||||
* Sets Credential
|
||||
*
|
||||
* @deprecated Pass ApiContext to create/get methods instead
|
||||
* @param \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
public static function setCredential($credential)
|
||||
{
|
||||
@@ -47,23 +52,21 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ID
|
||||
* ID of the credit card being saved for later use
|
||||
* ID of the credit card being saved for later use.
|
||||
*
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ID
|
||||
* ID of the credit card being saved for later use
|
||||
* ID of the credit card being saved for later use.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -73,23 +76,21 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Number
|
||||
* Credit Card
|
||||
* Card number.
|
||||
*
|
||||
*
|
||||
* @param string $number
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNumber($number)
|
||||
{
|
||||
$this->number = $number;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Number
|
||||
* Credit Card
|
||||
* Card number.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -99,25 +100,23 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Type
|
||||
* (eg. Visa, Mastercard, etc)
|
||||
* Type of the Card (eg. Visa, Mastercard, etc.).
|
||||
*
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
* (eg. Visa, Mastercard, etc)
|
||||
* Type of the Card (eg. Visa, Mastercard, etc.).
|
||||
*
|
||||
* @return mixed
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
@@ -125,23 +124,21 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Expire Month
|
||||
* (eg. 1 - 12)
|
||||
* 2 digit card expiry month.
|
||||
*
|
||||
*
|
||||
* @param int $expire_month
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireMonth($expire_month)
|
||||
{
|
||||
$this->expire_month = $expire_month;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Expire Month
|
||||
* (eg. 1 - 12)
|
||||
* 2 digit card expiry month.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@@ -151,27 +148,22 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Expire Month
|
||||
* (eg. 1 - 12)
|
||||
* 2 digit card expiry month.
|
||||
*
|
||||
* @deprecated Instead use setExpireMonth
|
||||
*
|
||||
* @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
|
||||
* (eg. 1 - 12)
|
||||
*
|
||||
* @deprecated Use getExpireMonth
|
||||
* 2 digit card expiry month.
|
||||
* @deprecated Instead use getExpireMonth
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@@ -181,23 +173,21 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Expire Year
|
||||
* Four Digit
|
||||
* 4 digit card expiry year
|
||||
*
|
||||
*
|
||||
* @param int $expire_year
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireYear($expire_year)
|
||||
{
|
||||
$this->expire_year = $expire_year;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Expire Year
|
||||
* Four Digit
|
||||
* 4 digit card expiry year
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@@ -207,27 +197,22 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Expire Year
|
||||
* Four Digit
|
||||
* 4 digit card expiry year
|
||||
*
|
||||
* @deprecated Instead use setExpireYear
|
||||
*
|
||||
* @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
|
||||
* Four Digit
|
||||
*
|
||||
* @deprecated Use getExpireYear
|
||||
* 4 digit card expiry year
|
||||
* @deprecated Instead use getExpireYear
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@@ -237,27 +222,23 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set CVV2
|
||||
* Card validation code
|
||||
* Only supported when making a Payment but not when saving a credit card for future use
|
||||
*
|
||||
* @param string $cvv2
|
||||
* Card validation code. Only supported when making a Payment but not when saving a credit card for future use.
|
||||
*
|
||||
*
|
||||
* @param int $cvv2
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCvv2($cvv2)
|
||||
{
|
||||
$this->cvv2 = $cvv2;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get CVV2
|
||||
* Card validation code
|
||||
* Only supported when making a Payment but not when saving a credit card for future use
|
||||
* Card validation code. Only supported when making a Payment but not when saving a credit card for future use.
|
||||
*
|
||||
* @return string
|
||||
* @return int
|
||||
*/
|
||||
public function getCvv2()
|
||||
{
|
||||
@@ -265,23 +246,21 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set First Name
|
||||
* Card holder's first name
|
||||
* Card holder's first name.
|
||||
*
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirstName($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get First Name
|
||||
* Card holder's first name
|
||||
* Card holder's first name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -291,27 +270,22 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set First Name
|
||||
* Card holder's first name
|
||||
* Card holder's first name.
|
||||
*
|
||||
* @deprecated Instead use setFirstName
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
* @deprecated Use setFirstName
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirst_name($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get First Name
|
||||
* Card holder's first name
|
||||
*
|
||||
* @deprecated Use getFirstName
|
||||
* Card holder's first name.
|
||||
* @deprecated Instead use getFirstName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -321,23 +295,21 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Last Name
|
||||
* Card holder's last name
|
||||
* Card holder's last name.
|
||||
*
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastName($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Last Name
|
||||
* Card holder's last name
|
||||
* Card holder's last name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -347,27 +319,22 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Last Name
|
||||
* Card holder's last name
|
||||
* Card holder's last name.
|
||||
*
|
||||
* @deprecated Instead use setLastName
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
* @deprecated Use setLastName
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLast_name($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Last Name
|
||||
* Card holder's last name
|
||||
*
|
||||
* @deprecated Use getLastName
|
||||
* Card holder's last name.
|
||||
* @deprecated Instead use getLastName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -377,21 +344,21 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Billing Address associated with this card
|
||||
* Billing Address associated with this card.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Address $billing_address
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBillingAddress($billing_address)
|
||||
{
|
||||
$this->billing_address = $billing_address;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing Address associated with this card
|
||||
* Billing Address associated with this card.
|
||||
*
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
@@ -401,25 +368,22 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Billing Address associated with this card
|
||||
* Billing Address associated with this card.
|
||||
*
|
||||
* @deprecated Instead use setBillingAddress
|
||||
*
|
||||
* @param \PayPal\Api\Address $billing_address
|
||||
*
|
||||
* @deprecated Use setBillingAddress
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBilling_address($billing_address)
|
||||
{
|
||||
$this->billing_address = $billing_address;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing Address associated with this card
|
||||
*
|
||||
* @deprecated Use getBillingAddress
|
||||
* Billing Address associated with this card.
|
||||
* @deprecated Instead use getBillingAddress
|
||||
*
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
@@ -429,83 +393,70 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payer ID
|
||||
* A unique identifier of the payer generated and provided by the facilitator
|
||||
* This is required when creating or using a tokenized funding instrument
|
||||
*
|
||||
* @param string $payer_id
|
||||
* A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault.
|
||||
*
|
||||
*
|
||||
* @param string $external_customer_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerId($payer_id)
|
||||
public function setExternalCustomerId($external_customer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payer ID
|
||||
* A unique identifier of the payer generated and provided by the facilitator
|
||||
* This is required when creating or using a tokenized funding instrument
|
||||
* A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerId()
|
||||
public function getExternalCustomerId()
|
||||
{
|
||||
return $this->payer_id;
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payer ID
|
||||
* A unique identifier of the payer generated and provided by the facilitator
|
||||
* This is required when creating or using a tokenized funding instrument
|
||||
* A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault.
|
||||
*
|
||||
* @param string $payer_id
|
||||
*
|
||||
* @deprecated Use setPayerId
|
||||
* @deprecated Instead use setExternalCustomerId
|
||||
*
|
||||
* @param string $external_customer_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayer_id($payer_id)
|
||||
public function setExternal_customer_id($external_customer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payer ID
|
||||
* A unique identifier of the payer generated and provided by the facilitator
|
||||
* This is required when creating or using a tokenized funding instrument
|
||||
*
|
||||
* @deprecated Use getPayerId
|
||||
* A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault.
|
||||
* @deprecated Instead use getExternalCustomerId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayer_id()
|
||||
public function getExternal_customer_id()
|
||||
{
|
||||
return $this->payer_id;
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set State
|
||||
* State of the funding instrument
|
||||
* State of the funding instrument.
|
||||
* Valid Values: ["expired", "ok"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get State
|
||||
* State of the funding instrument
|
||||
* State of the funding instrument.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -515,23 +466,21 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Valid Until
|
||||
* Date/Time until this resource can be used fund a payment
|
||||
* Date/Time until this resource can be used fund a payment.
|
||||
*
|
||||
*
|
||||
* @param string $valid_until
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValidUntil($valid_until)
|
||||
{
|
||||
$this->valid_until = $valid_until;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Valid Until
|
||||
* Date/Time until this resource can be used fund a payment
|
||||
* Date/Time until this resource can be used fund a payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -541,27 +490,22 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Valid Until
|
||||
* Date/Time until this resource can be used fund a payment
|
||||
* Date/Time until this resource can be used fund a payment.
|
||||
*
|
||||
* @deprecated Instead use setValidUntil
|
||||
*
|
||||
* @param string $valid_until
|
||||
*
|
||||
* @deprecated Use setValidUntil
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValid_until($valid_until)
|
||||
{
|
||||
$this->valid_until = $valid_until;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Valid Until
|
||||
* Date/Time until this resource can be used fund a payment
|
||||
*
|
||||
* @deprecated Use getValidUntil
|
||||
* Date/Time until this resource can be used fund a payment.
|
||||
* @deprecated Instead use getValidUntil
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -571,23 +515,121 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Links
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @deprecated Instead use setCreateTime
|
||||
*
|
||||
* @param string $create_time
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreate_time($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
* @deprecated Instead use getCreateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreate_time()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* @deprecated Instead use setUpdateTime
|
||||
*
|
||||
* @param string $update_time
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdate_time($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
* @deprecated Instead use getUpdateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdate_time()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
@@ -595,80 +637,83 @@ class CreditCard extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Create
|
||||
* Creates a new Credit Card Resource (aka Tokenize).
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return $this
|
||||
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return CreditCard
|
||||
*/
|
||||
public function create($apiContext = null)
|
||||
{
|
||||
$payLoad = $this->toJSON();
|
||||
|
||||
$payLoad = $this->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/vault/credit-card", "POST", $payLoad);
|
||||
$this->fromJson($json);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get
|
||||
*
|
||||
* @param int $creditCardId
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
* Obtain the Credit Card resource for the given identifier.
|
||||
*
|
||||
* @param string $creditCardId
|
||||
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return CreditCard
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function get($creditCardId, $apiContext = null)
|
||||
{
|
||||
if (($creditCardId == null) || (strlen($creditCardId) <= 0)) {
|
||||
throw new \InvalidArgumentException("creditCardId cannot be null or empty");
|
||||
}
|
||||
ArgumentValidator::validate($creditCardId, 'creditCardId');
|
||||
|
||||
$payLoad = "";
|
||||
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/vault/credit-card/$creditCardId", "GET", $payLoad);
|
||||
|
||||
$ret = new CreditCard();
|
||||
$ret->fromJson($json);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
* Delete the Credit Card resource for the given identifier.
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return bool
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function delete($apiContext = null)
|
||||
{
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
|
||||
$payLoad = "";
|
||||
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
|
||||
$call = new PPRestCall($apiContext);
|
||||
$call->execute(array('PayPal\Rest\RestHandler'), "/v1/vault/credit-card/{$this->getId()}", "DELETE", $payLoad);
|
||||
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/vault/credit-card/{$this->getId()}", "DELETE", $payLoad);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update information in a previously saved card. Only the modified fields need to be passed in the request.
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @return CreditCard
|
||||
*/
|
||||
public function update($apiContext = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
|
||||
$payLoad = $this->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/vault/credit-card/{$this->getId()}", "PATCH", $payLoad);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,28 +8,31 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class CreditCardHistory
|
||||
*
|
||||
* @property int count
|
||||
* A list of Credit Card Resources
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\CreditCard credit_cards
|
||||
* @property int count
|
||||
* @property string next_id
|
||||
*/
|
||||
class CreditCardHistory extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Credit Cards
|
||||
* A list of credit card resources
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $credit_cards
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $credit-cards
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreditCards($credit_cards)
|
||||
{
|
||||
$this->{"credit-cards"} = $credit_cards;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Credit Cards
|
||||
* A list of credit card resources
|
||||
*
|
||||
* @return \PayPal\Api\CreditCard
|
||||
@@ -40,27 +43,22 @@ class CreditCardHistory extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Credit Cards
|
||||
* A list of credit card resources
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $credit_cards
|
||||
*
|
||||
* @deprecated Use setCreditCards
|
||||
* @deprecated Instead use setCreditCards
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $credit-cards
|
||||
* @return $this
|
||||
*/
|
||||
public function setCredit_cards($credit_cards)
|
||||
{
|
||||
$this->{"credit-cards"} = $credit_cards;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Credit Cards
|
||||
* A list of credit card resources
|
||||
*
|
||||
* @deprecated Use getCreditCards
|
||||
* @deprecated Instead use getCreditCards
|
||||
*
|
||||
* @return \PayPal\Api\CreditCard
|
||||
*/
|
||||
@@ -70,25 +68,21 @@ class CreditCardHistory extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Count
|
||||
* Number of items returned in each range of results
|
||||
* Note that the last results range could have fewer items than the requested number of items
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
*
|
||||
*
|
||||
* @param int $count
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCount($count)
|
||||
{
|
||||
$this->count = $count;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Count
|
||||
* Number of items returned in each range of results
|
||||
* Note that the last results range could have fewer items than the requested number of items
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@@ -98,23 +92,21 @@ class CreditCardHistory extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Next ID
|
||||
* Identifier of the next element to get the next range of results
|
||||
* 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
|
||||
* Identifier of the next element to get the next range of results.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -124,27 +116,22 @@ class CreditCardHistory extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Next ID
|
||||
* Identifier of the next element to get the next range of results
|
||||
* Identifier of the next element to get the next range of results.
|
||||
*
|
||||
* @deprecated Instead use setNextId
|
||||
*
|
||||
* @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
|
||||
* Identifier of the next element to get the next range of results.
|
||||
* @deprecated Instead use getNextId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -152,4 +139,5 @@ class CreditCardHistory extends PPModel
|
||||
{
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
143
lib/PayPal/Api/CreditCardList.php
Normal file
143
lib/PayPal/Api/CreditCardList.php
Normal file
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class CreditCardList
|
||||
*
|
||||
* A list of Credit Card Resources
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\CreditCard credit_cards
|
||||
* @property int count
|
||||
* @property string next_id
|
||||
*/
|
||||
class CreditCardList extends PPModel
|
||||
{
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @deprecated Instead use setCreditCards
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $credit-cards
|
||||
* @return $this
|
||||
*/
|
||||
public function setCredit_cards($credit_cards)
|
||||
{
|
||||
$this->{"credit-cards"} = $credit_cards;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of credit card resources
|
||||
* @deprecated Instead use getCreditCards
|
||||
*
|
||||
* @return \PayPal\Api\CreditCard
|
||||
*/
|
||||
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.
|
||||
*
|
||||
*
|
||||
* @param int $count
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCount($count)
|
||||
{
|
||||
$this->count = $count;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCount()
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNextId()
|
||||
{
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
*
|
||||
* @deprecated Instead use setNextId
|
||||
*
|
||||
* @param string $next_id
|
||||
* @return $this
|
||||
*/
|
||||
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.
|
||||
* @deprecated Instead use getNextId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNext_id()
|
||||
{
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,33 +8,35 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class CreditCardToken
|
||||
*
|
||||
* A resource representing a credit card that can be used to fund a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string credit_card_id
|
||||
* @property string payer_id
|
||||
* @property string last4
|
||||
* @property string type
|
||||
* @property int expire_month
|
||||
* @property int expire_year
|
||||
* @property int expire_month
|
||||
* @property int expire_year
|
||||
*/
|
||||
class CreditCardToken extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Credit Card ID
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Credit Card ID
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -44,27 +46,22 @@ class CreditCardToken extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Credit Card ID
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API.
|
||||
*
|
||||
* @deprecated Instead use setCreditCardId
|
||||
*
|
||||
* @param string $credit_card_id
|
||||
*
|
||||
* @deprecated Use setCreditCardId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCredit_card_id($credit_card_id)
|
||||
{
|
||||
$this->credit_card_id = $credit_card_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Credit Card ID
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API
|
||||
*
|
||||
* @deprecated Use getCreditCardId
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API.
|
||||
* @deprecated Instead use getCreditCardId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -74,23 +71,21 @@ class CreditCardToken extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payer ID
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API.
|
||||
*
|
||||
*
|
||||
* @param string $payer_id
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerId($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payer ID
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -100,27 +95,22 @@ class CreditCardToken extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payer ID
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API.
|
||||
*
|
||||
* @deprecated Instead use setPayerId
|
||||
*
|
||||
* @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
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API
|
||||
*
|
||||
* @deprecated Use getPayerId
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API.
|
||||
* @deprecated Instead use getPayerId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -130,23 +120,21 @@ class CreditCardToken extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Last Four
|
||||
* Last 4 digits of the card number from the saved card
|
||||
* Last 4 digits of the card number from the saved card.
|
||||
*
|
||||
*
|
||||
* @param string $last4
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLast4($last4)
|
||||
{
|
||||
$this->last4 = $last4;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Last Four
|
||||
* Last 4 digits of the card number from the saved card
|
||||
* Last 4 digits of the card number from the saved card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -156,25 +144,21 @@ class CreditCardToken extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Type
|
||||
* (eg. visa, mastercard, etc) from the saved card
|
||||
* Please note that the values are always in lowercase and not meant to be used directly for display
|
||||
* Type of the Card (eg. visa, mastercard, etc.) from the saved card. Please note that the values are always in lowercase and not meant to be used directly for display.
|
||||
*
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type
|
||||
* (eg. visa, mastercard, etc) from the saved card
|
||||
* Please note that the values are always in lowercase and not meant to be used directly for display
|
||||
* 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
|
||||
*/
|
||||
@@ -184,23 +168,21 @@ class CreditCardToken extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Expire Month
|
||||
* Card Expiration month from the saved card with value 1 - 12
|
||||
* card expiry 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
|
||||
* card expiry month from the saved card with value 1 - 12
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@@ -210,27 +192,22 @@ class CreditCardToken extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Expire Month
|
||||
* Card Expiration month from the saved card with value 1 - 12
|
||||
* card expiry month from the saved card with value 1 - 12
|
||||
*
|
||||
* @deprecated Instead use setExpireMonth
|
||||
*
|
||||
* @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
|
||||
* card expiry month from the saved card with value 1 - 12
|
||||
* @deprecated Instead use getExpireMonth
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@@ -240,22 +217,20 @@ class CreditCardToken extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
@@ -266,27 +241,22 @@ class CreditCardToken extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Expire Year
|
||||
* 4 digit card expiry year from the saved card
|
||||
*
|
||||
* @deprecated Instead use setExpireYear
|
||||
*
|
||||
* @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
|
||||
* @deprecated Instead use getExpireYear
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@@ -294,4 +264,5 @@ class CreditCardToken extends PPModel
|
||||
{
|
||||
return $this->expire_year;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,19 +8,27 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class Details
|
||||
*
|
||||
* Additional details of the payment amount.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string shipping
|
||||
* @property string subtotal
|
||||
* @property string tax
|
||||
* @property string fee
|
||||
* @property string shipping_discount
|
||||
* @property string insurance
|
||||
* @property string handling_fee
|
||||
* @property string gift_wrap
|
||||
*/
|
||||
class Details extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Shipping
|
||||
* Amount being charged for shipping
|
||||
* Amount being charged for shipping.
|
||||
*
|
||||
*
|
||||
* @param string $shipping
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShipping($shipping)
|
||||
@@ -30,8 +38,7 @@ class Details extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Shipping
|
||||
* Amount being charged for shipping
|
||||
* Amount being charged for shipping.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -41,11 +48,11 @@ class Details extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Subtotal
|
||||
* Sub-total (amount) of items being paid for
|
||||
* Sub-total (amount) of items being paid for.
|
||||
*
|
||||
*
|
||||
* @param string $subtotal
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSubtotal($subtotal)
|
||||
@@ -55,8 +62,7 @@ class Details extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Subtotal
|
||||
* Sub-total (amount) of items being paid for
|
||||
* Sub-total (amount) of items being paid for.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -66,11 +72,11 @@ class Details extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Tax
|
||||
* Amount being charged as tax
|
||||
* Amount being charged as tax.
|
||||
*
|
||||
*
|
||||
* @param string $tax
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTax($tax)
|
||||
@@ -80,8 +86,7 @@ class Details extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Tax
|
||||
* Amount being charged as tax
|
||||
* Amount being charged as tax.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -91,12 +96,11 @@ class Details extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Fee
|
||||
* Fee charged by PayPal
|
||||
* In case of a refund, this is the fee amount refunded to the original receipient of the payment
|
||||
* Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment.
|
||||
*
|
||||
*
|
||||
* @param string $fee
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFee($fee)
|
||||
@@ -106,9 +110,7 @@ class Details extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Fee
|
||||
* Fee charged by PayPal
|
||||
* In case of a refund, this is the fee amount refunded to the original receipient of the payment
|
||||
* Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -116,4 +118,176 @@ class Details extends PPModel
|
||||
{
|
||||
return $this->fee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as shipping discount.
|
||||
*
|
||||
*
|
||||
* @param string $shipping_discount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShippingDiscount($shipping_discount)
|
||||
{
|
||||
$this->shipping_discount = $shipping_discount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as shipping discount.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShippingDiscount()
|
||||
{
|
||||
return $this->shipping_discount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as shipping discount.
|
||||
*
|
||||
* @deprecated Instead use setShippingDiscount
|
||||
*
|
||||
* @param string $shipping_discount
|
||||
* @return $this
|
||||
*/
|
||||
public function setShipping_discount($shipping_discount)
|
||||
{
|
||||
$this->shipping_discount = $shipping_discount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as shipping discount.
|
||||
* @deprecated Instead use getShippingDiscount
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShipping_discount()
|
||||
{
|
||||
return $this->shipping_discount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as insurance.
|
||||
*
|
||||
*
|
||||
* @param string $insurance
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInsurance($insurance)
|
||||
{
|
||||
$this->insurance = $insurance;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as insurance.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInsurance()
|
||||
{
|
||||
return $this->insurance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as handling fee.
|
||||
*
|
||||
*
|
||||
* @param string $handling_fee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHandlingFee($handling_fee)
|
||||
{
|
||||
$this->handling_fee = $handling_fee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as handling fee.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHandlingFee()
|
||||
{
|
||||
return $this->handling_fee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as handling fee.
|
||||
*
|
||||
* @deprecated Instead use setHandlingFee
|
||||
*
|
||||
* @param string $handling_fee
|
||||
* @return $this
|
||||
*/
|
||||
public function setHandling_fee($handling_fee)
|
||||
{
|
||||
$this->handling_fee = $handling_fee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as handling fee.
|
||||
* @deprecated Instead use getHandlingFee
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHandling_fee()
|
||||
{
|
||||
return $this->handling_fee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as gift wrap fee.
|
||||
*
|
||||
*
|
||||
* @param string $gift_wrap
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setGiftWrap($gift_wrap)
|
||||
{
|
||||
$this->gift_wrap = $gift_wrap;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as gift wrap fee.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getGiftWrap()
|
||||
{
|
||||
return $this->gift_wrap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as gift wrap fee.
|
||||
*
|
||||
* @deprecated Instead use setGiftWrap
|
||||
*
|
||||
* @param string $gift_wrap
|
||||
* @return $this
|
||||
*/
|
||||
public function setGift_wrap($gift_wrap)
|
||||
{
|
||||
$this->gift_wrap = $gift_wrap;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as gift wrap fee.
|
||||
* @deprecated Instead use getGiftWrap
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getGift_wrap()
|
||||
{
|
||||
return $this->gift_wrap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
68
lib/PayPal/Api/ExtendedBankAccount.php
Normal file
68
lib/PayPal/Api/ExtendedBankAccount.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class ExtendedBankAccount
|
||||
*
|
||||
* A resource representing a bank account that can be used to fund a payment including support for SEPA.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string mandate_reference_number
|
||||
*/
|
||||
class ExtendedBankAccount extends BankAccount
|
||||
{
|
||||
/**
|
||||
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
|
||||
*
|
||||
*
|
||||
* @param string $mandate_reference_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMandateReferenceNumber($mandate_reference_number)
|
||||
{
|
||||
$this->mandate_reference_number = $mandate_reference_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMandateReferenceNumber()
|
||||
{
|
||||
return $this->mandate_reference_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
|
||||
*
|
||||
* @deprecated Instead use setMandateReferenceNumber
|
||||
*
|
||||
* @param string $mandate_reference_number
|
||||
* @return $this
|
||||
*/
|
||||
public function setMandate_reference_number($mandate_reference_number)
|
||||
{
|
||||
$this->mandate_reference_number = $mandate_reference_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
|
||||
* @deprecated Instead use getMandateReferenceNumber
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMandate_reference_number()
|
||||
{
|
||||
return $this->mandate_reference_number;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,27 +8,36 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class FundingInstrument
|
||||
*
|
||||
* @property \PayPal\Api\CreditCard credit_card
|
||||
* A resource representing a Payer's funding instrument.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\CreditCard credit_card
|
||||
* @property \PayPal\Api\CreditCardToken credit_card_token
|
||||
* @property \PayPal\Api\PaymentCard payment_card
|
||||
* @property \PayPal\Api\PaymentCardToken payment_card_token
|
||||
* @property \PayPal\Api\ExtendedBankAccount bank_account
|
||||
* @property \PayPal\Api\BankToken bank_account_token
|
||||
* @property \PayPal\Api\Credit credit
|
||||
*/
|
||||
class FundingInstrument extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Credit Card
|
||||
* Credit Card information.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $credit_card
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreditCard($credit_card)
|
||||
{
|
||||
$this->credit_card = $credit_card;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Credit Card
|
||||
* Credit Card information.
|
||||
*
|
||||
* @return \PayPal\Api\CreditCard
|
||||
*/
|
||||
@@ -38,25 +47,22 @@ class FundingInstrument extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Credit Card
|
||||
* Credit Card information.
|
||||
*
|
||||
* @deprecated Instead use setCreditCard
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $credit_card
|
||||
*
|
||||
* @deprecated Use setCreditCard
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCredit_card($credit_card)
|
||||
{
|
||||
$this->credit_card = $credit_card;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Credit Card
|
||||
*
|
||||
* @deprecated Use getCreditCard
|
||||
* Credit Card information.
|
||||
* @deprecated Instead use getCreditCard
|
||||
*
|
||||
* @return \PayPal\Api\CreditCard
|
||||
*/
|
||||
@@ -66,21 +72,21 @@ class FundingInstrument extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Credit Card Token
|
||||
* Credit Card information.
|
||||
*
|
||||
*
|
||||
* @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
|
||||
* Credit Card information.
|
||||
*
|
||||
* @return \PayPal\Api\CreditCardToken
|
||||
*/
|
||||
@@ -90,25 +96,22 @@ class FundingInstrument extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Credit Card Token
|
||||
* Credit Card information.
|
||||
*
|
||||
* @deprecated Instead use setCreditCardToken
|
||||
*
|
||||
* @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
|
||||
* Credit Card information.
|
||||
* @deprecated Instead use getCreditCardToken
|
||||
*
|
||||
* @return \PayPal\Api\CreditCardToken
|
||||
*/
|
||||
@@ -116,4 +119,225 @@ class FundingInstrument extends PPModel
|
||||
{
|
||||
return $this->credit_card_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment Card information.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\PaymentCard $payment_card
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentCard($payment_card)
|
||||
{
|
||||
$this->payment_card = $payment_card;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment Card information.
|
||||
*
|
||||
* @return \PayPal\Api\PaymentCard
|
||||
*/
|
||||
public function getPaymentCard()
|
||||
{
|
||||
return $this->payment_card;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment Card information.
|
||||
*
|
||||
* @deprecated Instead use setPaymentCard
|
||||
*
|
||||
* @param \PayPal\Api\PaymentCard $payment_card
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayment_card($payment_card)
|
||||
{
|
||||
$this->payment_card = $payment_card;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment Card information.
|
||||
* @deprecated Instead use getPaymentCard
|
||||
*
|
||||
* @return \PayPal\Api\PaymentCard
|
||||
*/
|
||||
public function getPayment_card()
|
||||
{
|
||||
return $this->payment_card;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment card token information.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\PaymentCardToken $payment_card_token
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentCardToken($payment_card_token)
|
||||
{
|
||||
$this->payment_card_token = $payment_card_token;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment card token information.
|
||||
*
|
||||
* @return \PayPal\Api\PaymentCardToken
|
||||
*/
|
||||
public function getPaymentCardToken()
|
||||
{
|
||||
return $this->payment_card_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment card token information.
|
||||
*
|
||||
* @deprecated Instead use setPaymentCardToken
|
||||
*
|
||||
* @param \PayPal\Api\PaymentCardToken $payment_card_token
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayment_card_token($payment_card_token)
|
||||
{
|
||||
$this->payment_card_token = $payment_card_token;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment card token information.
|
||||
* @deprecated Instead use getPaymentCardToken
|
||||
*
|
||||
* @return \PayPal\Api\PaymentCardToken
|
||||
*/
|
||||
public function getPayment_card_token()
|
||||
{
|
||||
return $this->payment_card_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bank Account information.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\ExtendedBankAccount $bank_account
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBankAccount($bank_account)
|
||||
{
|
||||
$this->bank_account = $bank_account;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bank Account information.
|
||||
*
|
||||
* @return \PayPal\Api\ExtendedBankAccount
|
||||
*/
|
||||
public function getBankAccount()
|
||||
{
|
||||
return $this->bank_account;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bank Account information.
|
||||
*
|
||||
* @deprecated Instead use setBankAccount
|
||||
*
|
||||
* @param \PayPal\Api\ExtendedBankAccount $bank_account
|
||||
* @return $this
|
||||
*/
|
||||
public function setBank_account($bank_account)
|
||||
{
|
||||
$this->bank_account = $bank_account;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bank Account information.
|
||||
* @deprecated Instead use getBankAccount
|
||||
*
|
||||
* @return \PayPal\Api\ExtendedBankAccount
|
||||
*/
|
||||
public function getBank_account()
|
||||
{
|
||||
return $this->bank_account;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bank Account information.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\BankToken $bank_account_token
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBankAccountToken($bank_account_token)
|
||||
{
|
||||
$this->bank_account_token = $bank_account_token;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bank Account information.
|
||||
*
|
||||
* @return \PayPal\Api\BankToken
|
||||
*/
|
||||
public function getBankAccountToken()
|
||||
{
|
||||
return $this->bank_account_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bank Account information.
|
||||
*
|
||||
* @deprecated Instead use setBankAccountToken
|
||||
*
|
||||
* @param \PayPal\Api\BankToken $bank_account_token
|
||||
* @return $this
|
||||
*/
|
||||
public function setBank_account_token($bank_account_token)
|
||||
{
|
||||
$this->bank_account_token = $bank_account_token;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bank Account information.
|
||||
* @deprecated Instead use getBankAccountToken
|
||||
*
|
||||
* @return \PayPal\Api\BankToken
|
||||
*/
|
||||
public function getBank_account_token()
|
||||
{
|
||||
return $this->bank_account_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit funding information.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Credit $credit
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCredit($credit)
|
||||
{
|
||||
$this->credit = $credit;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit funding information.
|
||||
*
|
||||
* @return \PayPal\Api\Credit
|
||||
*/
|
||||
public function getCredit()
|
||||
{
|
||||
return $this->credit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,33 +8,37 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class HyperSchema
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Links links
|
||||
* @property string fragmentResolution
|
||||
* @property bool readonly
|
||||
* @property string contentEncoding
|
||||
* @property string pathStart
|
||||
* @property string mediaType
|
||||
* @property string fragmentResolution
|
||||
* @property bool readonly
|
||||
* @property string contentEncoding
|
||||
* @property string pathStart
|
||||
* @property string mediaType
|
||||
*/
|
||||
class HyperSchema extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Links
|
||||
* Sets Links
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
@@ -42,21 +46,21 @@ class HyperSchema extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Fragment Resolution
|
||||
* Sets FragmentResolution
|
||||
*
|
||||
*
|
||||
* @param string $fragmentResolution
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFragmentResolution($fragmentResolution)
|
||||
{
|
||||
$this->fragmentResolution = $fragmentResolution;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Fragment Resolution
|
||||
* Gets FragmentResolution
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -66,21 +70,21 @@ class HyperSchema extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Read Only
|
||||
* Sets Readonly
|
||||
*
|
||||
*
|
||||
* @param bool $readonly
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReadonly($readonly)
|
||||
{
|
||||
$this->readonly = $readonly;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Read Only
|
||||
* Gets Readonly
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
@@ -90,21 +94,21 @@ class HyperSchema extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Content Encoding
|
||||
* Sets ContentEncoding
|
||||
*
|
||||
*
|
||||
* @param string $contentEncoding
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setContentEncoding($contentEncoding)
|
||||
{
|
||||
$this->contentEncoding = $contentEncoding;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Content Encoding
|
||||
* Gets ContentEncoding
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -114,21 +118,21 @@ class HyperSchema extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Path Start
|
||||
* Sets PathStart
|
||||
*
|
||||
*
|
||||
* @param string $pathStart
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPathStart($pathStart)
|
||||
{
|
||||
$this->pathStart = $pathStart;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Path Start
|
||||
* Gets PathStart
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -138,21 +142,21 @@ class HyperSchema extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Media Type
|
||||
* Sets MediaType
|
||||
*
|
||||
*
|
||||
* @param string $mediaType
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMediaType($mediaType)
|
||||
{
|
||||
$this->mediaType = $mediaType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Media Type
|
||||
* Gets MediaType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -160,4 +164,5 @@ class HyperSchema extends PPModel
|
||||
{
|
||||
return $this->mediaType;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,13 @@ use PayPal\Rest\ApiContext;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Api\Invoices;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* Class Invoice
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*/
|
||||
class Invoice extends PPModel implements IResource
|
||||
{
|
||||
|
||||
@@ -866,9 +872,7 @@ class Invoice extends PPModel implements IResource
|
||||
*/
|
||||
public function search($search, $apiContext = null)
|
||||
{
|
||||
if (($search == null)) {
|
||||
throw new \InvalidArgumentException("search cannot be null or empty");
|
||||
}
|
||||
ArgumentValidator::validate($search, 'search');
|
||||
$payLoad = $search->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
|
||||
@@ -4,38 +4,45 @@ namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Validation\UrlValidator;
|
||||
|
||||
/**
|
||||
* Class Item
|
||||
*
|
||||
* An item being paid for.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string quantity
|
||||
* @property string name
|
||||
* @property string description
|
||||
* @property string price
|
||||
* @property string tax
|
||||
* @property string currency
|
||||
* @property string sku
|
||||
* @property string description
|
||||
* @property string tax
|
||||
* @property string url
|
||||
* @property string category
|
||||
* @property \PayPal\Api\NameValuePair supplementary_data
|
||||
* @property \PayPal\Api\NameValuePair postback_data
|
||||
*/
|
||||
class Item extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Quantity
|
||||
* Number of items
|
||||
* Number of items.
|
||||
*
|
||||
*
|
||||
* @param string $quantity
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setQuantity($quantity)
|
||||
{
|
||||
$this->quantity = $quantity;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Quantity
|
||||
* Number of items
|
||||
* Number of items.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -45,23 +52,21 @@ class Item extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Name
|
||||
* Name of the item
|
||||
* Name of the item.
|
||||
*
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Name
|
||||
* Name of the item
|
||||
* Name of the item.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -71,101 +76,21 @@ class Item extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Price
|
||||
* Cost of the item
|
||||
*
|
||||
* @param string $price
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPrice($price)
|
||||
{
|
||||
$this->price = $price;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Price
|
||||
* Cost of the item
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Currency
|
||||
* Three Letter Currency Code
|
||||
*
|
||||
* @param string $currency
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCurrency($currency)
|
||||
{
|
||||
$this->currency = $currency;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Currency
|
||||
* Three Letter Currency Code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency()
|
||||
{
|
||||
return $this->currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set SKU
|
||||
* Number or code to identify the item in your catalog/records
|
||||
*
|
||||
* @param string $sku
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSku($sku)
|
||||
{
|
||||
$this->sku = $sku;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SKU
|
||||
* Number or code to identify the item in your catalog/records
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSku()
|
||||
{
|
||||
return $this->sku;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Description
|
||||
* Description of the item
|
||||
* Description of the item.
|
||||
*
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Description
|
||||
* Description of the item
|
||||
* Description of the item.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -175,23 +100,45 @@ class Item extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Tax
|
||||
* Tax of the item
|
||||
* Cost of the item.
|
||||
*
|
||||
*
|
||||
* @param string $price
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPrice($price)
|
||||
{
|
||||
$this->price = $price;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cost of the item.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
/**
|
||||
* tax of the item.
|
||||
*
|
||||
*
|
||||
* @param string $tax
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTax($tax)
|
||||
{
|
||||
$this->tax = $tax;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Tax
|
||||
* Tax of the item
|
||||
* tax of the item.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -199,4 +146,200 @@ class Item extends PPModel
|
||||
{
|
||||
return $this->tax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3-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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number or code to identify the item in your catalog/records.
|
||||
*
|
||||
*
|
||||
* @param string $sku
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSku($sku)
|
||||
{
|
||||
$this->sku = $sku;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number or code to identify the item in your catalog/records.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSku()
|
||||
{
|
||||
return $this->sku;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL linking to item information. Available to payer in transaction history.
|
||||
*
|
||||
*
|
||||
* @param string $url
|
||||
* @throws InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setUrl($url)
|
||||
{
|
||||
UrlValidator::validate($url, "Url");
|
||||
$this->url = $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL linking to item information. Available to payer in transaction history.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Category type of the item. This can be either Digital or Physical.
|
||||
*
|
||||
*
|
||||
* @param string $category
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCategory($category)
|
||||
{
|
||||
$this->category = $category;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Category type of the item. This can be either Digital or Physical.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCategory()
|
||||
{
|
||||
return $this->category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal risk determination.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\NameValuePair $supplementary_data
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSupplementaryData($supplementary_data)
|
||||
{
|
||||
$this->supplementary_data = $supplementary_data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal risk determination.
|
||||
*
|
||||
* @return \PayPal\Api\NameValuePair[]
|
||||
*/
|
||||
public function getSupplementaryData()
|
||||
{
|
||||
return $this->supplementary_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal risk determination.
|
||||
*
|
||||
* @deprecated Instead use setSupplementaryData
|
||||
*
|
||||
* @param \PayPal\Api\NameValuePair $supplementary_data
|
||||
* @return $this
|
||||
*/
|
||||
public function setSupplementary_data($supplementary_data)
|
||||
{
|
||||
$this->supplementary_data = $supplementary_data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal risk determination.
|
||||
* @deprecated Instead use getSupplementaryData
|
||||
*
|
||||
* @return \PayPal\Api\NameValuePair
|
||||
*/
|
||||
public function getSupplementary_data()
|
||||
{
|
||||
return $this->supplementary_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal post-transaction notifications.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\NameValuePair $postback_data
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPostbackData($postback_data)
|
||||
{
|
||||
$this->postback_data = $postback_data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal post-transaction notifications.
|
||||
*
|
||||
* @return \PayPal\Api\NameValuePair[]
|
||||
*/
|
||||
public function getPostbackData()
|
||||
{
|
||||
return $this->postback_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal post-transaction notifications.
|
||||
*
|
||||
* @deprecated Instead use setPostbackData
|
||||
*
|
||||
* @param \PayPal\Api\NameValuePair $postback_data
|
||||
* @return $this
|
||||
*/
|
||||
public function setPostback_data($postback_data)
|
||||
{
|
||||
$this->postback_data = $postback_data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal post-transaction notifications.
|
||||
* @deprecated Instead use getPostbackData
|
||||
*
|
||||
* @return \PayPal\Api\NameValuePair
|
||||
*/
|
||||
public function getPostback_data()
|
||||
{
|
||||
return $this->postback_data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,48 +8,33 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class ItemList
|
||||
*
|
||||
* @property array|\PayPal\Api\Item items
|
||||
* List of items being paid for.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Item items
|
||||
* @property \PayPal\Api\ShippingAddress shipping_address
|
||||
*/
|
||||
class ItemList extends PPModel
|
||||
{
|
||||
|
||||
/**
|
||||
* Construct an empty list.
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
$this->items = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this list empty?
|
||||
*/
|
||||
public function isEmpty()
|
||||
{
|
||||
return empty($this->items);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Items
|
||||
* List of Items
|
||||
*
|
||||
* @param array|\PayPal\Api\Item $items
|
||||
* List of items.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Item $items
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setItems($items)
|
||||
{
|
||||
$this->items = $items;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Items
|
||||
* List of items
|
||||
* List of items.
|
||||
*
|
||||
* @return \PayPal\Api\Item
|
||||
* @return \PayPal\Api\Item[]
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
@@ -57,10 +42,11 @@ class ItemList extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shipping Address
|
||||
* Shipping address.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\ShippingAddress $shipping_address
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShippingAddress($shipping_address)
|
||||
@@ -70,32 +56,7 @@ class ItemList extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Append an item to the list.
|
||||
*
|
||||
* @return PayPal\Api\Item
|
||||
*/
|
||||
public function addItem($item)
|
||||
{
|
||||
return $this->setItems(
|
||||
array_merge($this->items, array($item))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an item from the list.
|
||||
* Items are compared using === comparision (PHP.net)
|
||||
*
|
||||
* @return PayPal\Api\Item
|
||||
*/
|
||||
public function removeItem($item)
|
||||
{
|
||||
return $this->setItems(
|
||||
array_diff($this->items, array($item))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Shipping Address
|
||||
* Shipping address.
|
||||
*
|
||||
* @return \PayPal\Api\ShippingAddress
|
||||
*/
|
||||
@@ -105,25 +66,22 @@ class ItemList extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shipping Address
|
||||
* Shipping address.
|
||||
*
|
||||
* @deprecated Instead use setShippingAddress
|
||||
*
|
||||
* @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
|
||||
* Shipping address.
|
||||
* @deprecated Instead use getShippingAddress
|
||||
*
|
||||
* @return \PayPal\Api\ShippingAddress
|
||||
*/
|
||||
@@ -131,4 +89,5 @@ class ItemList extends PPModel
|
||||
{
|
||||
return $this->shipping_address;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,31 +8,35 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class Links
|
||||
*
|
||||
* @property string href
|
||||
* @property string rel
|
||||
*
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string href
|
||||
* @property string rel
|
||||
* @property \PayPal\Api\HyperSchema targetSchema
|
||||
* @property string method
|
||||
* @property string enctype
|
||||
* @property string method
|
||||
* @property string enctype
|
||||
* @property \PayPal\Api\HyperSchema schema
|
||||
*/
|
||||
class Links extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Href
|
||||
* Sets Href
|
||||
*
|
||||
*
|
||||
* @param string $href
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHref($href)
|
||||
{
|
||||
$this->href = $href;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Href
|
||||
* Gets Href
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -42,21 +46,21 @@ class Links extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Rel
|
||||
* Sets Rel
|
||||
*
|
||||
*
|
||||
* @param string $rel
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRel($rel)
|
||||
{
|
||||
$this->rel = $rel;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Rel
|
||||
* Gets Rel
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -66,21 +70,21 @@ class Links extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Target Schema
|
||||
* Sets TargetSchema
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\HyperSchema $targetSchema
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTargetSchema($targetSchema)
|
||||
{
|
||||
$this->targetSchema = $targetSchema;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Target Schema
|
||||
* Gets TargetSchema
|
||||
*
|
||||
* @return \PayPal\Api\HyperSchema
|
||||
*/
|
||||
@@ -90,21 +94,21 @@ class Links extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Method
|
||||
* Sets Method
|
||||
*
|
||||
*
|
||||
* @param string $method
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMethod($method)
|
||||
{
|
||||
$this->method = $method;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Method
|
||||
* Gets Method
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -114,21 +118,21 @@ class Links extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Enctype
|
||||
* Sets Enctype
|
||||
*
|
||||
*
|
||||
* @param string $enctype
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnctype($enctype)
|
||||
{
|
||||
$this->enctype = $enctype;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Enctype
|
||||
* Gets Enctype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -138,21 +142,21 @@ class Links extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Schema
|
||||
* Sets Schema
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\HyperSchema $schema
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSchema($schema)
|
||||
{
|
||||
$this->schema = $schema;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Schema
|
||||
* Gets Schema
|
||||
*
|
||||
* @return \PayPal\Api\HyperSchema
|
||||
*/
|
||||
@@ -160,4 +164,5 @@ class Links extends PPModel
|
||||
{
|
||||
return $this->schema;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
68
lib/PayPal/Api/NameValuePair.php
Normal file
68
lib/PayPal/Api/NameValuePair.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class NameValuePair
|
||||
*
|
||||
* Used to define a type for name-value pairs. The use of name value pairs in an API should be limited and approved by architecture.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string name
|
||||
* @property string value
|
||||
*/
|
||||
class NameValuePair extends PPModel
|
||||
{
|
||||
/**
|
||||
* Key for the name value pair. The value name types should be correlated
|
||||
*
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Key for the name value pair. The value name types should be correlated
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Value for the name value pair.
|
||||
*
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Value for the name value pair.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,33 +8,40 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class Order
|
||||
*
|
||||
* @property string id
|
||||
* @property string createTime
|
||||
* @property string updateTime
|
||||
* @property string state
|
||||
* An order transaction.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string purchase_unit_reference_id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string parentPayment
|
||||
* @property \PayPal\Api\Links links
|
||||
* @property string reasonCode
|
||||
* @property string payment_mode
|
||||
* @property string state
|
||||
* @property string reason_code
|
||||
* @property string protection_eligibility
|
||||
* @property string protection_eligibility_type
|
||||
* @property \PayPal\Api\Links links
|
||||
*/
|
||||
class Order extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set the identifier of the order transaction.
|
||||
* Identifier of the order transaction.
|
||||
*
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the identifier of the order transaction.
|
||||
* Identifier of the order transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -44,21 +51,70 @@ class Order extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the time the resource was created.
|
||||
* Identifier to the purchase unit associated with this object
|
||||
*
|
||||
*
|
||||
* @param string $purchase_unit_reference_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPurchaseUnitReferenceId($purchase_unit_reference_id)
|
||||
{
|
||||
$this->purchase_unit_reference_id = $purchase_unit_reference_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier to the purchase unit associated with this object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPurchaseUnitReferenceId()
|
||||
{
|
||||
return $this->purchase_unit_reference_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier to the purchase unit associated with this object
|
||||
*
|
||||
* @deprecated Instead use setPurchaseUnitReferenceId
|
||||
*
|
||||
* @param string $purchase_unit_reference_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setPurchase_unit_reference_id($purchase_unit_reference_id)
|
||||
{
|
||||
$this->purchase_unit_reference_id = $purchase_unit_reference_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier to the purchase unit associated with this object
|
||||
* @deprecated Instead use getPurchaseUnitReferenceId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPurchase_unit_reference_id()
|
||||
{
|
||||
return $this->purchase_unit_reference_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the time the resource was created.
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -68,21 +124,46 @@ class Order extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the time the resource was last updated.
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @deprecated Instead use setCreateTime
|
||||
*
|
||||
* @param string $create_time
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreate_time($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
* @deprecated Instead use getCreateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreate_time()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the time the resource was last updated.
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -92,49 +173,46 @@ class Order extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the state of the order transaction.
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* Allowed values are: `PENDING`, `COMPLETED`, `REFUNDED` or `PARTIALLY_REFUNDED`.
|
||||
*
|
||||
* @param string $state
|
||||
* @deprecated Instead use setUpdateTime
|
||||
*
|
||||
* @param string $update_time
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
public function setUpdate_time($update_time)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the state of the order transaction.
|
||||
*
|
||||
* Allowed values are: `PENDING`, `COMPLETED`, `REFUNDED` or `PARTIALLY_REFUNDED`.
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
* @deprecated Instead use getUpdateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
public function getUpdate_time()
|
||||
{
|
||||
return $this->state;
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the amount being collected.
|
||||
* Amount being collected.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount being collected.
|
||||
* Amount being collected.
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
@@ -144,83 +222,94 @@ class Order extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ID of the payment resource on which this transaction is based.
|
||||
*
|
||||
* @param string $parent_payment
|
||||
* specifies payment mode of the transaction
|
||||
* Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
|
||||
*
|
||||
* @param string $payment_mode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentPayment($parent_payment)
|
||||
public function setPaymentMode($payment_mode)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
$this->payment_mode = $payment_mode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ID of the payment resource on which this transaction is based.
|
||||
* specifies payment mode of the transaction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getParentPayment()
|
||||
public function getPaymentMode()
|
||||
{
|
||||
return $this->parent_payment;
|
||||
return $this->payment_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Links
|
||||
* specifies payment mode of the transaction
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @deprecated Instead use setPaymentMode
|
||||
*
|
||||
* @param string $payment_mode
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
public function setPayment_mode($payment_mode)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
$this->payment_mode = $payment_mode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
* specifies payment mode of the transaction
|
||||
* @deprecated Instead use getPaymentMode
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
* @return string
|
||||
*/
|
||||
public function getLinks()
|
||||
public function getPayment_mode()
|
||||
{
|
||||
return $this->links;
|
||||
return $this->payment_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed. Assigned in response.
|
||||
* State of the order transaction.
|
||||
* Valid Values: ["PENDING", "COMPLETED", "REFUNDED", "PARTIALLY_REFUNDED"]
|
||||
*
|
||||
* Allowed values: `CHARGEBACK`, `GUARANTEE`, `BUYER_COMPLAINT`, `REFUND`,
|
||||
* `UNCONFIRMED_SHIPPING_ADDRESS`,
|
||||
* `ECHECK`, `INTERNATIONAL_WITHDRAWAL`,
|
||||
* `RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION`, `PAYMENT_REVIEW`,
|
||||
* `REGULATORY_REVIEW`, `UNILATERAL`, or `VERIFICATION_REQUIRED`
|
||||
* (`ORDER` can also be set in the response).
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the order transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed.
|
||||
* Valid Values: ["CHARGEBACK", "GUARANTEE", "BUYER_COMPLAINT", "REFUND", "UNCONFIRMED_SHIPPING_ADDRESS", "ECHECK", "INTERNATIONAL_WITHDRAWAL", "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION", "PAYMENT_REVIEW", "REGULATORY_REVIEW", "UNILATERAL", "VERIFICATION_REQUIRED"]
|
||||
*
|
||||
* @param string $reason_code
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReasonCode($reason_code)
|
||||
{
|
||||
$this->reason_code = $reason_code;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed. Assigned in response.
|
||||
*
|
||||
* Allowed values: `CHARGEBACK`, `GUARANTEE`, `BUYER_COMPLAINT`, `REFUND`,
|
||||
* `UNCONFIRMED_SHIPPING_ADDRESS`,
|
||||
* `ECHECK`, `INTERNATIONAL_WITHDRAWAL`,
|
||||
* `RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION`, `PAYMENT_REVIEW`,
|
||||
* `REGULATORY_REVIEW`, `UNILATERAL`, or `VERIFICATION_REQUIRED`
|
||||
* (`ORDER` can also be set in the response).
|
||||
* Reason code for the transaction state being Pending or Reversed.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -228,4 +317,152 @@ class Order extends PPModel
|
||||
{
|
||||
return $this->reason_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed.
|
||||
*
|
||||
* @deprecated Instead use setReasonCode
|
||||
*
|
||||
* @param string $reason_code
|
||||
* @return $this
|
||||
*/
|
||||
public function setReason_code($reason_code)
|
||||
{
|
||||
$this->reason_code = $reason_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed.
|
||||
* @deprecated Instead use getReasonCode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReason_code()
|
||||
{
|
||||
return $this->reason_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility of the Payer
|
||||
* Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
|
||||
*
|
||||
* @param string $protection_eligibility
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtectionEligibility($protection_eligibility)
|
||||
{
|
||||
$this->{"protection-eligibility"} = $protection_eligibility;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility of the Payer
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtectionEligibility()
|
||||
{
|
||||
return $this->{"protection-eligibility"};
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility of the Payer
|
||||
*
|
||||
* @deprecated Instead use setProtectionEligibility
|
||||
*
|
||||
* @param string $protection-eligibility
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtection_eligibility($protection_eligibility)
|
||||
{
|
||||
$this->{"protection-eligibility"} = $protection_eligibility;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility of the Payer
|
||||
* @deprecated Instead use getProtectionEligibility
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtection_eligibility()
|
||||
{
|
||||
return $this->{"protection-eligibility"};
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility Type of the Payer
|
||||
* Valid Values: ["ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE", "INELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE"]
|
||||
*
|
||||
* @param string $protection_eligibility_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtectionEligibilityType($protection_eligibility_type)
|
||||
{
|
||||
$this->{"protection-eligibility_type"} = $protection_eligibility_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility Type of the Payer
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtectionEligibilityType()
|
||||
{
|
||||
return $this->{"protection-eligibility_type"};
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility Type of the Payer
|
||||
*
|
||||
* @deprecated Instead use setProtectionEligibilityType
|
||||
*
|
||||
* @param string $protection-eligibility_type
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtection_eligibility_type($protection_eligibility_type)
|
||||
{
|
||||
$this->{"protection-eligibility_type"} = $protection_eligibility_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility Type of the Payer
|
||||
* @deprecated Instead use getProtectionEligibilityType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtection_eligibility_type()
|
||||
{
|
||||
return $this->{"protection-eligibility_type"};
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,34 +8,32 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class Payee
|
||||
*
|
||||
* A resource representing a Payee that received the funds and fulfills the order. Only one of the following identifiers need to be supplied.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string email
|
||||
* @property string merchant_id
|
||||
* @property string phone
|
||||
* @property \PayPal\Api\Phone phone
|
||||
*/
|
||||
class Payee extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Email
|
||||
* Email Address associated with the Payee's PayPal Account
|
||||
* If the provided email address is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments
|
||||
* Direct Credit Card Payments will be denied due to card compliance requirements
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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
|
||||
*/
|
||||
@@ -45,11 +43,11 @@ class Payee extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Merchant ID
|
||||
* Encrypted PayPal Account identifier for the Payee
|
||||
* Encrypted PayPal Account identifier for the Payee.
|
||||
*
|
||||
*
|
||||
* @param string $merchant_id
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMerchantId($merchant_id)
|
||||
@@ -59,8 +57,7 @@ class Payee extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Merchant ID
|
||||
* Encrypted PayPal Account identifier for the Payee
|
||||
* Encrypted PayPal Account identifier for the Payee.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -70,27 +67,22 @@ class Payee extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Merchant ID
|
||||
* Encrypted PayPal Account identifier for the Payee
|
||||
* Encrypted PayPal Account identifier for the Payee.
|
||||
*
|
||||
* @deprecated Instead use setMerchantId
|
||||
*
|
||||
* @param string $merchant_id
|
||||
*
|
||||
* @deprecated Use setMerchantId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMerchant_id($merchant_id)
|
||||
{
|
||||
$this->merchant_id = $merchant_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Merchant ID
|
||||
* Encrypted PayPal Account identifier for the Payee
|
||||
*
|
||||
* @deprecated Use getMerchantId
|
||||
* Encrypted PayPal Account identifier for the Payee.
|
||||
* @deprecated Instead use getMerchantId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -100,13 +92,11 @@ class Payee extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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\Phone $phone
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
@@ -116,15 +106,13 @@ class Payee extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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 string
|
||||
* @return \PayPal\Api\Phone
|
||||
*/
|
||||
public function getPhone()
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,30 +8,34 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class Payer
|
||||
*
|
||||
* @property string payment_method
|
||||
* @property array|\PayPal\Api\FundingInstrument funding_instruments
|
||||
* @property \PayPal\Api\PayerInfo payer_info
|
||||
* A resource representing a Payer that funds a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string payment_method
|
||||
* @property string status
|
||||
* @property \PayPal\Api\FundingInstrument funding_instruments
|
||||
* @property string funding_option_id
|
||||
* @property \PayPal\Api\PayerInfo payer_info
|
||||
*/
|
||||
class Payer extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Payment Method
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card
|
||||
* Payment method being used - PayPal Wallet payment, Bank Direct Debit or Direct Credit card.
|
||||
* Valid Values: ["credit_card", "bank", "paypal"]
|
||||
*
|
||||
* @param string $payment_method
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentMethod($payment_method)
|
||||
{
|
||||
$this->payment_method = $payment_method;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payment Method
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card
|
||||
* Payment method being used - PayPal Wallet payment, Bank Direct Debit or Direct Credit card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -41,27 +45,22 @@ class Payer extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payment Method
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card
|
||||
* Payment method being used - PayPal Wallet payment, Bank Direct Debit or Direct Credit card.
|
||||
*
|
||||
* @deprecated Instead use setPaymentMethod
|
||||
*
|
||||
* @param string $payment_method
|
||||
*
|
||||
* @deprecated Use setPaymentMethod
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayment_method($payment_method)
|
||||
{
|
||||
$this->payment_method = $payment_method;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payment Method
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card
|
||||
*
|
||||
* @deprecated Use getPaymentMethod
|
||||
* Payment method being used - PayPal Wallet payment, Bank Direct Debit or Direct Credit card.
|
||||
* @deprecated Instead use getPaymentMethod
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -71,24 +70,47 @@ class Payer extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Funding Instruments
|
||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card
|
||||
* Status of Payer PayPal Account.
|
||||
* Valid Values: ["VERIFIED", "UNVERIFIED"]
|
||||
*
|
||||
* @param \PayPal\Api\FundingInstrument|array $funding_instruments
|
||||
* @param string $status
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStatus($status)
|
||||
{
|
||||
$this->status = $status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status of Payer PayPal Account.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\FundingInstrument $funding_instruments
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFundingInstruments($funding_instruments)
|
||||
{
|
||||
$this->funding_instruments = $funding_instruments;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Funding Instruments
|
||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card.
|
||||
*
|
||||
* @return \PayPal\Api\FundingInstrument|array
|
||||
* @return \PayPal\Api\FundingInstrument[]
|
||||
*/
|
||||
public function getFundingInstruments()
|
||||
{
|
||||
@@ -96,26 +118,22 @@ class Payer extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Funding Instruments
|
||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card
|
||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card.
|
||||
*
|
||||
* @deprecated Instead use setFundingInstruments
|
||||
*
|
||||
* @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
|
||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card.
|
||||
* @deprecated Instead use getFundingInstruments
|
||||
*
|
||||
* @return \PayPal\Api\FundingInstrument
|
||||
*/
|
||||
@@ -125,23 +143,70 @@ class Payer extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* Id of user selected funding option for the payment. 'OneOf' funding_instruments or funding_option_id to be present
|
||||
*
|
||||
*
|
||||
* @param string $funding_option_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFundingOptionId($funding_option_id)
|
||||
{
|
||||
$this->funding_option_id = $funding_option_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Id of user selected funding option for the payment. 'OneOf' funding_instruments or funding_option_id to be present
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFundingOptionId()
|
||||
{
|
||||
return $this->funding_option_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Id of user selected funding option for the payment. 'OneOf' funding_instruments or funding_option_id to be present
|
||||
*
|
||||
* @deprecated Instead use setFundingOptionId
|
||||
*
|
||||
* @param string $funding_option_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setFunding_option_id($funding_option_id)
|
||||
{
|
||||
$this->funding_option_id = $funding_option_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Id of user selected funding option for the payment. 'OneOf' funding_instruments or funding_option_id to be present
|
||||
* @deprecated Instead use getFundingOptionId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFunding_option_id()
|
||||
{
|
||||
return $this->funding_option_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information related to the Payer.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\PayerInfo $payer_info
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerInfo($payer_info)
|
||||
{
|
||||
$this->payer_info = $payer_info;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payer Info
|
||||
* Information related to the Payer.
|
||||
*
|
||||
* @return \PayPal\Api\PayerInfo
|
||||
*/
|
||||
@@ -151,27 +216,22 @@ class Payer extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* Information related to the Payer.
|
||||
*
|
||||
* @deprecated Instead use setPayerInfo
|
||||
*
|
||||
* @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
|
||||
* Information related to the Payer.
|
||||
* @deprecated Instead use getPayerInfo
|
||||
*
|
||||
* @return \PayPal\Api\PayerInfo
|
||||
*/
|
||||
@@ -179,4 +239,5 @@ class Payer extends PPModel
|
||||
{
|
||||
return $this->payer_info;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,33 +8,42 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class PayerInfo
|
||||
*
|
||||
* @property string email
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* @property string payer_id
|
||||
* @property string phone
|
||||
* @property \PayPal\Api\Address shipping_address
|
||||
* A resource representing a information about Payer.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string email
|
||||
* @property string external_remember_me_id
|
||||
* @property string buyer_account_number
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* @property string payer_id
|
||||
* @property string phone
|
||||
* @property string phone_type
|
||||
* @property string birth_date
|
||||
* @property string tax_id
|
||||
* @property string tax_id_type
|
||||
* @property \PayPal\Api\Address billing_address
|
||||
* @property \PayPal\Api\ShippingAddress shipping_address
|
||||
*/
|
||||
class PayerInfo extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Email
|
||||
* Email address representing the Payer
|
||||
* Email address representing the Payer.
|
||||
*
|
||||
*
|
||||
* @param string $email
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Email
|
||||
* Email address representing the Payer
|
||||
* Email address representing the Payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -44,23 +53,119 @@ class PayerInfo extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set First Name
|
||||
* First Name of the Payer from their PayPal Account
|
||||
* External Remember Me id representing the Payer
|
||||
*
|
||||
*
|
||||
* @param string $external_remember_me_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternalRememberMeId($external_remember_me_id)
|
||||
{
|
||||
$this->external_remember_me_id = $external_remember_me_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* External Remember Me id representing the Payer
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalRememberMeId()
|
||||
{
|
||||
return $this->external_remember_me_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* External Remember Me id representing the Payer
|
||||
*
|
||||
* @deprecated Instead use setExternalRememberMeId
|
||||
*
|
||||
* @param string $external_remember_me_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternal_remember_me_id($external_remember_me_id)
|
||||
{
|
||||
$this->external_remember_me_id = $external_remember_me_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* External Remember Me id representing the Payer
|
||||
* @deprecated Instead use getExternalRememberMeId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternal_remember_me_id()
|
||||
{
|
||||
return $this->external_remember_me_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account Number representing the Payer
|
||||
*
|
||||
*
|
||||
* @param string $buyer_account_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBuyerAccountNumber($buyer_account_number)
|
||||
{
|
||||
$this->buyer_account_number = $buyer_account_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account Number representing the Payer
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBuyerAccountNumber()
|
||||
{
|
||||
return $this->buyer_account_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account Number representing the Payer
|
||||
*
|
||||
* @deprecated Instead use setBuyerAccountNumber
|
||||
*
|
||||
* @param string $buyer_account_number
|
||||
* @return $this
|
||||
*/
|
||||
public function setBuyer_account_number($buyer_account_number)
|
||||
{
|
||||
$this->buyer_account_number = $buyer_account_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account Number representing the Payer
|
||||
* @deprecated Instead use getBuyerAccountNumber
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBuyer_account_number()
|
||||
{
|
||||
return $this->buyer_account_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* First Name of the Payer.
|
||||
*
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirstName($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get First Name
|
||||
* First Name of the Payer from their PayPal Account
|
||||
* First Name of the Payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -70,27 +175,22 @@ class PayerInfo extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set First Name
|
||||
* First Name of the Payer from their PayPal Account
|
||||
* First Name of the Payer.
|
||||
*
|
||||
* @deprecated Instead use setFirstName
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
* @deprecated Use setFirstName
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirst_name($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get First Name
|
||||
* First Name of the Payer from their PayPal Account
|
||||
*
|
||||
* @deprecated Use getFirstName
|
||||
* First Name of the Payer.
|
||||
* @deprecated Instead use getFirstName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -100,23 +200,21 @@ class PayerInfo extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Last Name
|
||||
* Last Name of the Payer from their PayPal Account
|
||||
* Last Name of the Payer.
|
||||
*
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastName($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Last Name
|
||||
* Last Name of the Payer from their PayPal Account
|
||||
* Last Name of the Payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -126,27 +224,22 @@ class PayerInfo extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Last Name
|
||||
* Last Name of the Payer from their PayPal Account
|
||||
* Last Name of the Payer.
|
||||
*
|
||||
* @deprecated Instead use setLastName
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
* @deprecated Use setLastName
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLast_name($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Last Name
|
||||
* Last Name of the Payer from their PayPal Account
|
||||
*
|
||||
* @deprecated Use getLastName
|
||||
* Last Name of the Payer.
|
||||
* @deprecated Instead use getLastName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -156,23 +249,21 @@ class PayerInfo extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payer ID
|
||||
* PayPal assigned Payer ID
|
||||
* PayPal assigned Payer ID.
|
||||
*
|
||||
*
|
||||
* @param string $payer_id
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerId($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payer ID
|
||||
* PayPal assigned Payer ID
|
||||
* PayPal assigned Payer ID.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -182,27 +273,22 @@ class PayerInfo extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payer ID
|
||||
* PayPal assigned Payer ID
|
||||
* PayPal assigned Payer ID.
|
||||
*
|
||||
* @deprecated Instead use setPayerId
|
||||
*
|
||||
* @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
|
||||
* PayPal assigned Payer ID.
|
||||
* @deprecated Instead use getPayerId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -212,23 +298,21 @@ class PayerInfo extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Phone
|
||||
* Phone number representing the Payer
|
||||
* 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
|
||||
* Phone number representing the Payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -238,23 +322,266 @@ class PayerInfo extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shipping Address
|
||||
* Shipping address of the Payer from their PayPal Account
|
||||
* Phone type
|
||||
* Valid Values: ["HOME", "WORK", "MOBILE", "OTHER"]
|
||||
*
|
||||
* @param string $phone_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhoneType($phone_type)
|
||||
{
|
||||
$this->phone_type = $phone_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPhoneType()
|
||||
{
|
||||
return $this->phone_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone type
|
||||
*
|
||||
* @deprecated Instead use setPhoneType
|
||||
*
|
||||
* @param string $phone_type
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhone_type($phone_type)
|
||||
{
|
||||
$this->phone_type = $phone_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone type
|
||||
* @deprecated Instead use getPhoneType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone_type()
|
||||
{
|
||||
return $this->phone_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Birth date of the Payer in ISO8601 format (YYYY-MM-DD).
|
||||
*
|
||||
*
|
||||
* @param string $birth_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBirthDate($birth_date)
|
||||
{
|
||||
$this->birth_date = $birth_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Birth date of the Payer in ISO8601 format (YYYY-MM-DD).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBirthDate()
|
||||
{
|
||||
return $this->birth_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Birth date of the Payer in ISO8601 format (YYYY-MM-DD).
|
||||
*
|
||||
* @deprecated Instead use setBirthDate
|
||||
*
|
||||
* @param string $birth_date
|
||||
* @return $this
|
||||
*/
|
||||
public function setBirth_date($birth_date)
|
||||
{
|
||||
$this->birth_date = $birth_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Birth date of the Payer in ISO8601 format (YYYY-MM-DD).
|
||||
* @deprecated Instead use getBirthDate
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBirth_date()
|
||||
{
|
||||
return $this->birth_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payer's tax ID.
|
||||
*
|
||||
*
|
||||
* @param string $tax_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTaxId($tax_id)
|
||||
{
|
||||
$this->tax_id = $tax_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payer's tax ID.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTaxId()
|
||||
{
|
||||
return $this->tax_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payer's tax ID.
|
||||
*
|
||||
* @deprecated Instead use setTaxId
|
||||
*
|
||||
* @param string $tax_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setTax_id($tax_id)
|
||||
{
|
||||
$this->tax_id = $tax_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payer's tax ID.
|
||||
* @deprecated Instead use getTaxId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTax_id()
|
||||
{
|
||||
return $this->tax_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payer's tax ID type.
|
||||
* Valid Values: ["BR_CPF", "BR_CNPJ"]
|
||||
*
|
||||
* @param string $tax_id_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTaxIdType($tax_id_type)
|
||||
{
|
||||
$this->tax_id_type = $tax_id_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payer's tax ID type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTaxIdType()
|
||||
{
|
||||
return $this->tax_id_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payer's tax ID type.
|
||||
*
|
||||
* @deprecated Instead use setTaxIdType
|
||||
*
|
||||
* @param string $tax_id_type
|
||||
* @return $this
|
||||
*/
|
||||
public function setTax_id_type($tax_id_type)
|
||||
{
|
||||
$this->tax_id_type = $tax_id_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payer's tax ID type.
|
||||
* @deprecated Instead use getTaxIdType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTax_id_type()
|
||||
{
|
||||
return $this->tax_id_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing address of the Payer.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Address $billing_address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBillingAddress($billing_address)
|
||||
{
|
||||
$this->billing_address = $billing_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing address of the Payer.
|
||||
*
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
public function getBillingAddress()
|
||||
{
|
||||
return $this->billing_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing address of the Payer.
|
||||
*
|
||||
* @deprecated Instead use setBillingAddress
|
||||
*
|
||||
* @param \PayPal\Api\Address $billing_address
|
||||
* @return $this
|
||||
*/
|
||||
public function setBilling_address($billing_address)
|
||||
{
|
||||
$this->billing_address = $billing_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing address of the Payer.
|
||||
* @deprecated Instead use getBillingAddress
|
||||
*
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
public function getBilling_address()
|
||||
{
|
||||
return $this->billing_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obsolete. Use shipping address present in purchase unit.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\ShippingAddress $shipping_address
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShippingAddress($shipping_address)
|
||||
{
|
||||
$this->shipping_address = $shipping_address;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Shipping Address
|
||||
* Shipping address of the Payer from their PayPal Account
|
||||
* Obsolete. Use shipping address present in purchase unit.
|
||||
*
|
||||
* @return \PayPal\Api\ShippingAddress
|
||||
*/
|
||||
@@ -264,27 +591,22 @@ class PayerInfo extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shipping Address
|
||||
* Shipping address of the Payer from their PayPal Account
|
||||
* Obsolete. Use shipping address present in purchase unit.
|
||||
*
|
||||
* @deprecated Instead use setShippingAddress
|
||||
*
|
||||
* @param \PayPal\Api\ShippingAddress $shipping_address
|
||||
*
|
||||
* @deprecated Use setShippingAddress
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShipping_address($shipping_address)
|
||||
{
|
||||
$this->shipping_address = $shipping_address;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Shipping Address
|
||||
* Shipping address of the Payer from their PayPal Account
|
||||
*
|
||||
* @deprecated Use getShippingAddress
|
||||
* Obsolete. Use shipping address present in purchase unit.
|
||||
* @deprecated Instead use getShippingAddress
|
||||
*
|
||||
* @return \PayPal\Api\ShippingAddress
|
||||
*/
|
||||
@@ -292,4 +614,5 @@ class PayerInfo extends PPModel
|
||||
{
|
||||
return $this->shipping_address;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,33 +7,40 @@ use PayPal\Rest\ApiContext;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Api\PaymentHistory;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* Lets you create, process and manage payments.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property string intent
|
||||
* @property \PayPal\Api\Payer payer
|
||||
* @property \PayPal\Api\object cart
|
||||
* @property \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
|
||||
* OAuth Credentials to use for this call
|
||||
*
|
||||
* @var \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
protected static $credential;
|
||||
|
||||
/**
|
||||
* Set Credential
|
||||
*
|
||||
* @param $credential
|
||||
* Sets Credential
|
||||
*
|
||||
* @deprecated Pass ApiContext to create/get methods instead
|
||||
* @param \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
public static function setCredential($credential)
|
||||
{
|
||||
@@ -41,23 +48,21 @@ class Payment extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ID
|
||||
* Identifier of the payment resource created
|
||||
* Identifier of the payment resource created.
|
||||
*
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ID
|
||||
* Identifier of the payment resource created
|
||||
* Identifier of the payment resource created.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -67,23 +72,21 @@ class Payment extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
*
|
||||
* @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
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -93,27 +96,22 @@ class Payment extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @deprecated Instead use setCreateTime
|
||||
*
|
||||
* @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
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
* @deprecated Instead use getCreateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -123,23 +121,21 @@ class Payment extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
*
|
||||
* @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
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -149,27 +145,22 @@ class Payment extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* @deprecated Instead use setUpdateTime
|
||||
*
|
||||
* @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
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
* @deprecated Instead use getUpdateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -179,23 +170,21 @@ class Payment extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Intent
|
||||
* Intent of the payment - Sale or Authorization or Order
|
||||
* Intent of the payment - Sale or Authorization or Order.
|
||||
* Valid Values: ["sale", "authorize", "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
|
||||
* Intent of the payment - Sale or Authorization or Order.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -205,23 +194,21 @@ class Payment extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payer
|
||||
* Source of the funds for this payment represented by a PayPal account or a direct credit card
|
||||
* 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
|
||||
* Source of the funds for this payment represented by a PayPal account or a direct credit card.
|
||||
*
|
||||
* @return \PayPal\Api\Payer
|
||||
*/
|
||||
@@ -231,25 +218,47 @@ class Payment extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Transactions
|
||||
* Cart for which the payment is done.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\object $cart
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCart($cart)
|
||||
{
|
||||
$this->cart = $cart;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cart for which the payment is done.
|
||||
*
|
||||
* @return \PayPal\Api\object
|
||||
*/
|
||||
public function getCart()
|
||||
{
|
||||
return $this->cart;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @param \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
|
||||
* @return \PayPal\Api\Transaction[]
|
||||
*/
|
||||
public function getTransactions()
|
||||
{
|
||||
@@ -257,23 +266,21 @@ class Payment extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set State
|
||||
* State of the payment
|
||||
* state of the payment
|
||||
* Valid Values: ["created", "approved", "failed", "canceled", "expired"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get State
|
||||
* State of the payment
|
||||
* state of the payment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -283,23 +290,21 @@ class Payment extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Redirect URLs
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel 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
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls.
|
||||
*
|
||||
* @return \PayPal\Api\RedirectUrls
|
||||
*/
|
||||
@@ -309,27 +314,22 @@ class Payment extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Redirect URLs
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls.
|
||||
*
|
||||
* @deprecated Instead use setRedirectUrls
|
||||
*
|
||||
* @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
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls.
|
||||
* @deprecated Instead use getRedirectUrls
|
||||
*
|
||||
* @return \PayPal\Api\RedirectUrls
|
||||
*/
|
||||
@@ -339,154 +339,122 @@ class Payment extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Links
|
||||
* Sets Links
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create
|
||||
* Creates (and processes) a new Payment Resource.
|
||||
*
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
*
|
||||
* @return $this
|
||||
* @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();
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get
|
||||
*
|
||||
* @param int $paymentId
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
* 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
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function get($paymentId, $apiContext = null)
|
||||
{
|
||||
if (($paymentId == null) || (strlen($paymentId) <= 0)) {
|
||||
throw new \InvalidArgumentException("paymentId cannot be null or empty");
|
||||
}
|
||||
ArgumentValidator::validate($paymentId, 'paymentId');
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @param \Paypal\Api\PaymentExecution $paymentExecution
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
* 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
|
||||
* @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");
|
||||
}
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($paymentExecution, 'paymentExecution');
|
||||
|
||||
$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;
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* All
|
||||
*
|
||||
* @param array $params
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
* 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
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function all($params, $apiContext = null)
|
||||
{
|
||||
if (($params == null)) {
|
||||
throw new \InvalidArgumentException("params cannot be null or empty");
|
||||
}
|
||||
ArgumentValidator::validate($params, 'params');
|
||||
|
||||
$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,
|
||||
'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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
618
lib/PayPal/Api/PaymentCard.php
Normal file
618
lib/PayPal/Api/PaymentCard.php
Normal file
@@ -0,0 +1,618 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class PaymentCard
|
||||
*
|
||||
* A resource representing a payment card that can be used to fund a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string number
|
||||
* @property string type
|
||||
* @property int expire_month
|
||||
* @property int expire_year
|
||||
* @property int start_month
|
||||
* @property int start_year
|
||||
* @property int cvv2
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* @property \PayPal\Api\Address billing_address
|
||||
* @property string external_customer_id
|
||||
* @property string status
|
||||
* @property string valid_until
|
||||
* @property \PayPal\Api\Links links
|
||||
*/
|
||||
class PaymentCard extends PPModel
|
||||
{
|
||||
/**
|
||||
* ID of the credit card being saved for later use.
|
||||
*
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the credit card being saved for later use.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card number.
|
||||
*
|
||||
*
|
||||
* @param string $number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNumber($number)
|
||||
{
|
||||
$this->number = $number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card number.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNumber()
|
||||
{
|
||||
return $this->number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the Card.
|
||||
* Valid Values: ["VISA", "AMEX", "SOLO", "JCB", "STAR", "DELTA", "DISCOVER", "SWITCH", "MAESTRO", "CB_NATIONALE", "CONFINOGA", "COFIDIS", "ELECTRON", "CETELEM", "CHINA_UNION_PAY", "MASTERCARD"]
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the Card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 digit card expiry month.
|
||||
*
|
||||
*
|
||||
* @param int $expire_month
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireMonth($expire_month)
|
||||
{
|
||||
$this->expire_month = $expire_month;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 digit card expiry month.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpireMonth()
|
||||
{
|
||||
return $this->expire_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 digit card expiry month.
|
||||
*
|
||||
* @deprecated Instead use setExpireMonth
|
||||
*
|
||||
* @param int $expire_month
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpire_month($expire_month)
|
||||
{
|
||||
$this->expire_month = $expire_month;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 digit card expiry month.
|
||||
* @deprecated Instead use getExpireMonth
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpire_month()
|
||||
{
|
||||
return $this->expire_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card expiry year
|
||||
*
|
||||
*
|
||||
* @param int $expire_year
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireYear($expire_year)
|
||||
{
|
||||
$this->expire_year = $expire_year;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card expiry year
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpireYear()
|
||||
{
|
||||
return $this->expire_year;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card expiry year
|
||||
*
|
||||
* @deprecated Instead use setExpireYear
|
||||
*
|
||||
* @param int $expire_year
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpire_year($expire_year)
|
||||
{
|
||||
$this->expire_year = $expire_year;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card expiry year
|
||||
* @deprecated Instead use getExpireYear
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpire_year()
|
||||
{
|
||||
return $this->expire_year;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 digit card start month.
|
||||
*
|
||||
*
|
||||
* @param int $start_month
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStartMonth($start_month)
|
||||
{
|
||||
$this->start_month = $start_month;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 digit card start month.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getStartMonth()
|
||||
{
|
||||
return $this->start_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 digit card start month.
|
||||
*
|
||||
* @deprecated Instead use setStartMonth
|
||||
*
|
||||
* @param int $start_month
|
||||
* @return $this
|
||||
*/
|
||||
public function setStart_month($start_month)
|
||||
{
|
||||
$this->start_month = $start_month;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 digit card start month.
|
||||
* @deprecated Instead use getStartMonth
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getStart_month()
|
||||
{
|
||||
return $this->start_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card start year.
|
||||
*
|
||||
*
|
||||
* @param int $start_year
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStartYear($start_year)
|
||||
{
|
||||
$this->start_year = $start_year;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card start year.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getStartYear()
|
||||
{
|
||||
return $this->start_year;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card start year.
|
||||
*
|
||||
* @deprecated Instead use setStartYear
|
||||
*
|
||||
* @param int $start_year
|
||||
* @return $this
|
||||
*/
|
||||
public function setStart_year($start_year)
|
||||
{
|
||||
$this->start_year = $start_year;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card start year.
|
||||
* @deprecated Instead use getStartYear
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getStart_year()
|
||||
{
|
||||
return $this->start_year;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card validation code. Only supported when making a Payment but not when saving a payment card for future use.
|
||||
*
|
||||
*
|
||||
* @param int $cvv2
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCvv2($cvv2)
|
||||
{
|
||||
$this->cvv2 = $cvv2;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card validation code. Only supported when making a Payment but not when saving a payment card for future use.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCvv2()
|
||||
{
|
||||
return $this->cvv2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card holder's first name.
|
||||
*
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirstName($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card holder's first name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName()
|
||||
{
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card holder's first name.
|
||||
*
|
||||
* @deprecated Instead use setFirstName
|
||||
*
|
||||
* @param string $first_name
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirst_name($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card holder's first name.
|
||||
* @deprecated Instead use getFirstName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirst_name()
|
||||
{
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card holder's last name.
|
||||
*
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastName($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card holder's last name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName()
|
||||
{
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card holder's last name.
|
||||
*
|
||||
* @deprecated Instead use setLastName
|
||||
*
|
||||
* @param string $last_name
|
||||
* @return $this
|
||||
*/
|
||||
public function setLast_name($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Card holder's last name.
|
||||
* @deprecated Instead use getLastName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLast_name()
|
||||
{
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing Address associated with this card.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Address $billing_address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBillingAddress($billing_address)
|
||||
{
|
||||
$this->billing_address = $billing_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing Address associated with this card.
|
||||
*
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
public function getBillingAddress()
|
||||
{
|
||||
return $this->billing_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing Address associated with this card.
|
||||
*
|
||||
* @deprecated Instead use setBillingAddress
|
||||
*
|
||||
* @param \PayPal\Api\Address $billing_address
|
||||
* @return $this
|
||||
*/
|
||||
public function setBilling_address($billing_address)
|
||||
{
|
||||
$this->billing_address = $billing_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing Address associated with this card.
|
||||
* @deprecated Instead use getBillingAddress
|
||||
*
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
public function getBilling_address()
|
||||
{
|
||||
return $this->billing_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier of the customer to whom this card account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault.
|
||||
*
|
||||
*
|
||||
* @param string $external_customer_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternalCustomerId($external_customer_id)
|
||||
{
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier of the customer to whom this card account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalCustomerId()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier of the customer to whom this card account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault.
|
||||
*
|
||||
* @deprecated Instead use setExternalCustomerId
|
||||
*
|
||||
* @param string $external_customer_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternal_customer_id($external_customer_id)
|
||||
{
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier of the customer to whom this card account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault.
|
||||
* @deprecated Instead use getExternalCustomerId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternal_customer_id()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the funding instrument.
|
||||
* Valid Values: ["EXPIRED", "ACTIVE"]
|
||||
*
|
||||
* @param string $status
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStatus($status)
|
||||
{
|
||||
$this->status = $status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the funding instrument.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until this resource can be used fund a payment.
|
||||
*
|
||||
*
|
||||
* @param string $valid_until
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValidUntil($valid_until)
|
||||
{
|
||||
$this->valid_until = $valid_until;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until this resource can be used fund a payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValidUntil()
|
||||
{
|
||||
return $this->valid_until;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until this resource can be used fund a payment.
|
||||
*
|
||||
* @deprecated Instead use setValidUntil
|
||||
*
|
||||
* @param string $valid_until
|
||||
* @return $this
|
||||
*/
|
||||
public function setValid_until($valid_until)
|
||||
{
|
||||
$this->valid_until = $valid_until;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until this resource can be used fund a payment.
|
||||
* @deprecated Instead use getValidUntil
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValid_until()
|
||||
{
|
||||
return $this->valid_until;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
}
|
||||
268
lib/PayPal/Api/PaymentCardToken.php
Normal file
268
lib/PayPal/Api/PaymentCardToken.php
Normal file
@@ -0,0 +1,268 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class PaymentCardToken
|
||||
*
|
||||
* A resource representing a payment card that can be used to fund a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string payment_card_id
|
||||
* @property string external_customer_id
|
||||
* @property string last4
|
||||
* @property string type
|
||||
* @property int expire_month
|
||||
* @property int expire_year
|
||||
*/
|
||||
class PaymentCardToken extends PPModel
|
||||
{
|
||||
/**
|
||||
* ID of a previously saved Payment Card resource.
|
||||
*
|
||||
*
|
||||
* @param string $payment_card_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentCardId($payment_card_id)
|
||||
{
|
||||
$this->payment_card_id = $payment_card_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a previously saved Payment Card resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentCardId()
|
||||
{
|
||||
return $this->payment_card_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a previously saved Payment Card resource.
|
||||
*
|
||||
* @deprecated Instead use setPaymentCardId
|
||||
*
|
||||
* @param string $payment_card_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayment_card_id($payment_card_id)
|
||||
{
|
||||
$this->payment_card_id = $payment_card_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a previously saved Payment Card resource.
|
||||
* @deprecated Instead use getPaymentCardId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayment_card_id()
|
||||
{
|
||||
return $this->payment_card_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this payment card.
|
||||
*
|
||||
*
|
||||
* @param string $external_customer_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternalCustomerId($external_customer_id)
|
||||
{
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this payment card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalCustomerId()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this payment card.
|
||||
*
|
||||
* @deprecated Instead use setExternalCustomerId
|
||||
*
|
||||
* @param string $external_customer_id
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternal_customer_id($external_customer_id)
|
||||
{
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this payment card.
|
||||
* @deprecated Instead use getExternalCustomerId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternal_customer_id()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last 4 digits of the card number from the saved card.
|
||||
*
|
||||
*
|
||||
* @param string $last4
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLast4($last4)
|
||||
{
|
||||
$this->last4 = $last4;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last 4 digits of the card number from the saved card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLast4()
|
||||
{
|
||||
return $this->last4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the Card.
|
||||
* Valid Values: ["VISA", "AMEX", "SOLO", "JCB", "STAR", "DELTA", "DISCOVER", "SWITCH", "MAESTRO", "CB_NATIONALE", "CONFINOGA", "COFIDIS", "ELECTRON", "CETELEM", "CHINA_UNION_PAY", "MASTERCARD"]
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the Card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* card expiry 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* card expiry month from the saved card with value 1 - 12
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpireMonth()
|
||||
{
|
||||
return $this->expire_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* card expiry month from the saved card with value 1 - 12
|
||||
*
|
||||
* @deprecated Instead use setExpireMonth
|
||||
*
|
||||
* @param int $expire_month
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpire_month($expire_month)
|
||||
{
|
||||
$this->expire_month = $expire_month;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* card expiry month from the saved card with value 1 - 12
|
||||
* @deprecated Instead use getExpireMonth
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpire_month()
|
||||
{
|
||||
return $this->expire_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card expiry year from the saved card
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpireYear()
|
||||
{
|
||||
return $this->expire_year;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card expiry year from the saved card
|
||||
*
|
||||
* @deprecated Instead use setExpireYear
|
||||
*
|
||||
* @param int $expire_year
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpire_year($expire_year)
|
||||
{
|
||||
$this->expire_year = $expire_year;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card expiry year from the saved card
|
||||
* @deprecated Instead use getExpireYear
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpire_year()
|
||||
{
|
||||
return $this->expire_year;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,29 +8,31 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class PaymentExecution
|
||||
*
|
||||
* @property string payer_id
|
||||
* Let's you execute a PayPal Account based Payment resource with the payer_id obtained from web approval url.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string payer_id
|
||||
* @property \PayPal\Api\Transactions transactions
|
||||
*/
|
||||
class PaymentExecution extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Payer ID
|
||||
* PayPal assigned Payer ID returned in the approval return url
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payer ID
|
||||
* PayPal assigned Payer ID returned in the approval return url
|
||||
* PayPal assigned Payer ID returned in the approval return url.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -40,27 +42,22 @@ class PaymentExecution extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payer ID
|
||||
* PayPal assigned Payer ID returned in the approval return url
|
||||
* PayPal assigned Payer ID returned in the approval return url.
|
||||
*
|
||||
* @deprecated Instead use setPayerId
|
||||
*
|
||||
* @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 returned in the approval return url
|
||||
*
|
||||
* @deprecated Use getPayerId
|
||||
* PayPal assigned Payer ID returned in the approval return url.
|
||||
* @deprecated Instead use getPayerId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -70,11 +67,11 @@ class PaymentExecution extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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)
|
||||
@@ -84,13 +81,13 @@ class PaymentExecution extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* 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
|
||||
* @return \PayPal\Api\Transactions[]
|
||||
*/
|
||||
public function getTransactions()
|
||||
{
|
||||
return $this->transactions;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,32 +8,34 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class PaymentHistory
|
||||
*
|
||||
* A list of Payment Resources
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Payment payments
|
||||
* @property int count
|
||||
* @property string next_id
|
||||
* @property int count
|
||||
* @property string next_id
|
||||
*/
|
||||
class PaymentHistory extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Payments
|
||||
* A list of Payment resources
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Payment $payments
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayments($payments)
|
||||
{
|
||||
$this->payments = $payments;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payments
|
||||
* A list of Payment resources
|
||||
*
|
||||
* @return \PayPal\Api\Payment
|
||||
* @return \PayPal\Api\Payment[]
|
||||
*/
|
||||
public function getPayments()
|
||||
{
|
||||
@@ -41,12 +43,11 @@ class PaymentHistory extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Count
|
||||
* Number of items returned in each range of results
|
||||
* Note that the last results range could have fewer items than the requested number of items
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
*
|
||||
*
|
||||
* @param int $count
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCount($count)
|
||||
@@ -56,9 +57,7 @@ class PaymentHistory extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Count
|
||||
* Number of items returned in each range of results
|
||||
* Note that the last results range could have fewer items than the requested number of items
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@@ -68,11 +67,11 @@ class PaymentHistory extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Next ID
|
||||
* Identifier of the next element to get the next range of results
|
||||
* Identifier of the next element to get the next range of results.
|
||||
*
|
||||
*
|
||||
* @param string $next_id
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNextId($next_id)
|
||||
@@ -82,8 +81,7 @@ class PaymentHistory extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Next ID
|
||||
* Identifier of the next element to get the next range of results
|
||||
* Identifier of the next element to get the next range of results.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -93,27 +91,22 @@ class PaymentHistory extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Next ID
|
||||
* Identifier of the next element to get the next range of results
|
||||
* Identifier of the next element to get the next range of results.
|
||||
*
|
||||
* @deprecated Instead use setNextId
|
||||
*
|
||||
* @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
|
||||
* Identifier of the next element to get the next range of results.
|
||||
* @deprecated Instead use getNextId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -121,4 +114,5 @@ class PaymentHistory extends PPModel
|
||||
{
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
68
lib/PayPal/Api/PaymentOptions.php
Normal file
68
lib/PayPal/Api/PaymentOptions.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class PaymentOptions
|
||||
*
|
||||
* Payment options requested for this purchase unit
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string allowed_payment_method
|
||||
*/
|
||||
class PaymentOptions extends PPModel
|
||||
{
|
||||
/**
|
||||
* Payment method requested for this purchase unit
|
||||
* Valid Values: ["UNRESTRICTED", "INSTANT_FUNDING_SOURCE", "IMMEDIATE_PAY"]
|
||||
*
|
||||
* @param string $allowed_payment_method
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAllowedPaymentMethod($allowed_payment_method)
|
||||
{
|
||||
$this->allowed_payment_method = $allowed_payment_method;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment method requested for this purchase unit
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAllowedPaymentMethod()
|
||||
{
|
||||
return $this->allowed_payment_method;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment method requested for this purchase unit
|
||||
*
|
||||
* @deprecated Instead use setAllowedPaymentMethod
|
||||
*
|
||||
* @param string $allowed_payment_method
|
||||
* @return $this
|
||||
*/
|
||||
public function setAllowed_payment_method($allowed_payment_method)
|
||||
{
|
||||
$this->allowed_payment_method = $allowed_payment_method;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment method requested for this purchase unit
|
||||
* @deprecated Instead use getAllowedPaymentMethod
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAllowed_payment_method()
|
||||
{
|
||||
return $this->allowed_payment_method;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Phone
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string country_code
|
||||
* @property string national_number
|
||||
* @property string extension
|
||||
*/
|
||||
class Phone extends PPModel
|
||||
{
|
||||
/**
|
||||
* Country code (in E.164 format). Assume length is n.
|
||||
* Country code (from in E.164 format)
|
||||
*
|
||||
*
|
||||
* @param string $country_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCountryCode($country_code)
|
||||
{
|
||||
@@ -18,7 +33,7 @@ class Phone extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Country code (in E.164 format). Assume length is n.
|
||||
* Country code (from in E.164 format)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -28,10 +43,12 @@ class Phone extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Country code (in E.164 format). Assume length is n.
|
||||
* Country code (from in E.164 format)
|
||||
*
|
||||
* @deprecated Instead use setCountryCode
|
||||
*
|
||||
* @param string $country_code
|
||||
* @deprecated. Instead use setCountryCode
|
||||
* @return $this
|
||||
*/
|
||||
public function setCountry_code($country_code)
|
||||
{
|
||||
@@ -40,10 +57,10 @@ class Phone extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Country code (in E.164 format). Assume length is n.
|
||||
* Country code (from in E.164 format)
|
||||
* @deprecated Instead use getCountryCode
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getCountryCode
|
||||
*/
|
||||
public function getCountry_code()
|
||||
{
|
||||
@@ -51,9 +68,12 @@ class Phone extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* In-country phone number (in E.164 format). Maximum (15 - n) digits.
|
||||
* In-country phone number (from in E.164 format)
|
||||
*
|
||||
*
|
||||
* @param string $national_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNationalNumber($national_number)
|
||||
{
|
||||
@@ -62,7 +82,7 @@ class Phone extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* In-country phone number (in E.164 format). Maximum (15 - n) digits.
|
||||
* In-country phone number (from in E.164 format)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -72,10 +92,12 @@ class Phone extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* In-country phone number (in E.164 format). Maximum (15 - n) digits.
|
||||
* In-country phone number (from in E.164 format)
|
||||
*
|
||||
* @deprecated Instead use setNationalNumber
|
||||
*
|
||||
* @param string $national_number
|
||||
* @deprecated. Instead use setNationalNumber
|
||||
* @return $this
|
||||
*/
|
||||
public function setNational_number($national_number)
|
||||
{
|
||||
@@ -84,14 +106,38 @@ class Phone extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* In-country phone number (in E.164 format). Maximum (15 - n) digits.
|
||||
* In-country phone number (from in E.164 format)
|
||||
* @deprecated Instead use getNationalNumber
|
||||
*
|
||||
* @return string
|
||||
* @deprecated. Instead use getNationalNumber
|
||||
*/
|
||||
public function getNational_number()
|
||||
{
|
||||
return $this->national_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone extension
|
||||
*
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExtension($extension)
|
||||
{
|
||||
$this->extension = $extension;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone extension
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExtension()
|
||||
{
|
||||
return $this->extension;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,37 +4,37 @@ namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Validation\UrlValidator;
|
||||
|
||||
/**
|
||||
* Class RedirectUrls
|
||||
*
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string return_url
|
||||
* @property string cancel_url
|
||||
*/
|
||||
class RedirectUrls extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Return URL
|
||||
* Url where the payer would be redirected to after approving the payment
|
||||
* Url where the payer would be redirected to after approving the payment.
|
||||
*
|
||||
*
|
||||
* @param string $return_url
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setReturnUrl($return_url)
|
||||
{
|
||||
if (filter_var($return_url, FILTER_VALIDATE_URL) === false) {
|
||||
throw new \InvalidArgumentException("Return URL is not a fully qualified URL");
|
||||
}
|
||||
|
||||
UrlValidator::validate($return_url, "ReturnUrl");
|
||||
$this->return_url = $return_url;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Return URL
|
||||
* Url where the payer would be redirected to after approving the payment
|
||||
* Url where the payer would be redirected to after approving the payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -44,27 +44,22 @@ class RedirectUrls extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Return URL
|
||||
* Url where the payer would be redirected to after approving the payment
|
||||
* Url where the payer would be redirected to after approving the payment.
|
||||
*
|
||||
* @deprecated Instead use setReturnUrl
|
||||
*
|
||||
* @param string $return_url
|
||||
*
|
||||
* @deprecated Use setReturnUrl
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReturn_url($return_url)
|
||||
{
|
||||
$this->return_url = $return_url;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Return URL
|
||||
* Url where the payer would be redirected to after approving the payment
|
||||
*
|
||||
* @deprecated Use getReturnUrl
|
||||
* Url where the payer would be redirected to after approving the payment.
|
||||
* @deprecated Instead use getReturnUrl
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -74,26 +69,22 @@ class RedirectUrls extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Cancel URL
|
||||
* Url where the payer would be redirected to after canceling the payment
|
||||
* Url where the payer would be redirected to after canceling the payment.
|
||||
*
|
||||
*
|
||||
* @param string $cancel_url
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setCancelUrl($cancel_url)
|
||||
{
|
||||
if (filter_var($cancel_url, FILTER_VALIDATE_URL) === false) {
|
||||
throw new \InvalidArgumentException("Cancel URL is not a fully qualified URL");
|
||||
}
|
||||
UrlValidator::validate($cancel_url, "CancelUrl");
|
||||
$this->cancel_url = $cancel_url;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Cancel URL
|
||||
* Url where the payer would be redirected to after canceling the payment
|
||||
* Url where the payer would be redirected to after canceling the payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -103,27 +94,22 @@ class RedirectUrls extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Cancel URL
|
||||
* Url where the payer would be redirected to after canceling the payment
|
||||
* Url where the payer would be redirected to after canceling the payment.
|
||||
*
|
||||
* @deprecated Instead use setCancelUrl
|
||||
*
|
||||
* @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
|
||||
* Url where the payer would be redirected to after canceling the payment.
|
||||
* @deprecated Instead use getCancelUrl
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -131,4 +117,5 @@ class RedirectUrls extends PPModel
|
||||
{
|
||||
return $this->cancel_url;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,32 +6,40 @@ use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* Class Refund
|
||||
*
|
||||
* @property string id
|
||||
* @property string create_time
|
||||
* A refund transaction.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string create_time
|
||||
* @property string update_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
|
||||
* @property string state
|
||||
* @property string sale_id
|
||||
* @property string capture_id
|
||||
* @property string parent_payment
|
||||
* @property string description
|
||||
* @property \PayPal\Api\Links links
|
||||
*/
|
||||
class Refund extends PPModel implements IResource
|
||||
{
|
||||
/**
|
||||
* @var
|
||||
* OAuth Credentials to use for this call
|
||||
*
|
||||
* @var \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
private static $credential;
|
||||
protected static $credential;
|
||||
|
||||
/**
|
||||
* Set Credential
|
||||
*
|
||||
* @param $credential
|
||||
* Sets Credential
|
||||
*
|
||||
* @deprecated Pass ApiContext to create/get methods instead
|
||||
* @param \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
public static function setCredential($credential)
|
||||
{
|
||||
@@ -39,23 +47,21 @@ class Refund extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ID
|
||||
* Identifier of the refund transaction
|
||||
* Identifier of the refund transaction in UTC ISO8601 format.
|
||||
*
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ID
|
||||
* Identifier of the refund transaction
|
||||
* Identifier of the refund transaction in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -65,23 +71,21 @@ class Refund extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
*
|
||||
* @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
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -91,27 +95,22 @@ class Refund extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @deprecated Instead use setCreateTime
|
||||
*
|
||||
* @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
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
* @deprecated Instead use getCreateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -121,25 +120,70 @@ class Refund extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Amount
|
||||
* Details including both refunded amount (to Payer) and refunded fee (to Payee)
|
||||
* If amount is not specified, it's assumed to be full refund
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* @deprecated Instead use setUpdateTime
|
||||
*
|
||||
* @param string $update_time
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdate_time($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
* @deprecated Instead use getUpdateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdate_time()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Details including both refunded amount (to Payer) and refunded fee (to Payee).If amount is not specified, it's assumed to be full refund.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Amount
|
||||
* Details including both refunded amount (to Payer) and refunded fee (to Payee)
|
||||
* If amount is not specified, it's assumed to be full refund
|
||||
* Details including both refunded amount (to Payer) and refunded fee (to Payee).If amount is not specified, it's assumed to be full refund.
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
@@ -149,23 +193,21 @@ class Refund extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set State
|
||||
* State of the refund transaction
|
||||
* State of the refund transaction.
|
||||
* Valid Values: ["pending", "completed", "failed"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get State
|
||||
* State of the refund transaction
|
||||
* State of the refund transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -175,23 +217,21 @@ class Refund extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Sale ID
|
||||
* ID of the Sale transaction being refunded
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Sale ID
|
||||
* ID of the Sale transaction being refunded
|
||||
* ID of the Sale transaction being refunded.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -201,27 +241,22 @@ class Refund extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Sale ID
|
||||
* ID of the Sale transaction being refunded
|
||||
* ID of the Sale transaction being refunded.
|
||||
*
|
||||
* @deprecated Instead use setSaleId
|
||||
*
|
||||
* @param string $sale_id
|
||||
*
|
||||
* @deprecated Use setSaleId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSale_id($sale_id)
|
||||
{
|
||||
$this->sale_id = $sale_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Sale ID
|
||||
* ID of the Sale transaction being refunded
|
||||
*
|
||||
* @deprecated Use getSaleId
|
||||
* ID of the Sale transaction being refunded.
|
||||
* @deprecated Instead use getSaleId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -231,23 +266,21 @@ class Refund extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Capture ID
|
||||
* ID of the Capture transaction being refunded
|
||||
* ID of the Capture transaction being refunded.
|
||||
*
|
||||
*
|
||||
* @param string $capture_id
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCaptureId($capture_id)
|
||||
{
|
||||
$this->capture_id = $capture_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Capture ID
|
||||
* ID of the Capture transaction being refunded
|
||||
* ID of the Capture transaction being refunded.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -257,27 +290,22 @@ class Refund extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Capture ID
|
||||
* ID of the Capture transaction being refunded
|
||||
* ID of the Capture transaction being refunded.
|
||||
*
|
||||
* @deprecated Instead use setCaptureId
|
||||
*
|
||||
* @param string $capture_id
|
||||
*
|
||||
* @deprecated Use setCaptureId
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCapture_id($capture_id)
|
||||
{
|
||||
$this->capture_id = $capture_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Capture ID
|
||||
* ID of the Capture transaction being refunded
|
||||
*
|
||||
* @deprecated Use getCaptureId
|
||||
* ID of the Capture transaction being refunded.
|
||||
* @deprecated Instead use getCaptureId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -287,23 +315,21 @@ class Refund extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentPayment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -313,27 +339,22 @@ class Refund extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
* @deprecated Instead use setParentPayment
|
||||
*
|
||||
* @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
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @deprecated Instead use getParentPayment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -343,23 +364,47 @@ class Refund extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Links
|
||||
* Description of what is being refunded for.
|
||||
*
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of what is being refunded for.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
@@ -367,32 +412,25 @@ class Refund extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Get
|
||||
*
|
||||
* @param $refundId
|
||||
* @param null $apiContext
|
||||
* Obtain the Refund transaction resource for the given identifier.
|
||||
*
|
||||
* @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 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");
|
||||
}
|
||||
ArgumentValidator::validate($refundId, 'refundId');
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,19 +8,24 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class RelatedResources
|
||||
*
|
||||
* @property \PayPal\Api\Sale sale
|
||||
* Each one representing a financial transaction (Sale, Authorization, Capture, Refund) related to the payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Sale sale
|
||||
* @property \PayPal\Api\Authorization authorization
|
||||
* @property \PayPal\Api\Capture capture
|
||||
* @property \PayPal\Api\Refund refund
|
||||
* @property \PayPal\Api\Order order
|
||||
* @property \PayPal\Api\Capture capture
|
||||
* @property \PayPal\Api\Refund refund
|
||||
*/
|
||||
class RelatedResources extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Sale
|
||||
* A sale transaction
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Sale $sale
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSale($sale)
|
||||
@@ -30,7 +35,6 @@ class RelatedResources extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Sale
|
||||
* A sale transaction
|
||||
*
|
||||
* @return \PayPal\Api\Sale
|
||||
@@ -41,11 +45,11 @@ class RelatedResources extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Authorization
|
||||
* An authorization transaction
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Authorization $authorization
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAuthorization($authorization)
|
||||
@@ -55,7 +59,6 @@ class RelatedResources extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Authorization
|
||||
* An authorization transaction
|
||||
*
|
||||
* @return \PayPal\Api\Authorization
|
||||
@@ -66,11 +69,35 @@ class RelatedResources extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Capture
|
||||
* An order transaction
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Order $order
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOrder($order)
|
||||
{
|
||||
$this->order = $order;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An order transaction
|
||||
*
|
||||
* @return \PayPal\Api\Order
|
||||
*/
|
||||
public function getOrder()
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
|
||||
/**
|
||||
* A capture transaction
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Capture $capture
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCapture($capture)
|
||||
@@ -80,7 +107,6 @@ class RelatedResources extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Capture
|
||||
* A capture transaction
|
||||
*
|
||||
* @return \PayPal\Api\Capture
|
||||
@@ -91,11 +117,11 @@ class RelatedResources extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Refund
|
||||
* A refund transaction
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Refund $refund
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRefund($refund)
|
||||
@@ -105,7 +131,6 @@ class RelatedResources extends PPModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Refund
|
||||
* A refund transaction
|
||||
*
|
||||
* @return \PayPal\Api\Refund
|
||||
@@ -115,27 +140,4 @@ class RelatedResources extends PPModel
|
||||
return $this->refund;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Order
|
||||
*
|
||||
* @param \PayPal\Api\Order $order
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOrder($order)
|
||||
{
|
||||
$this->order = $order;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Order
|
||||
*
|
||||
* @return \PayPal\Api\Order
|
||||
*/
|
||||
public function getOrder()
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,31 +7,43 @@ use PayPal\Rest\ApiContext;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Api\Refund;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* Class Sale
|
||||
*
|
||||
* @property string id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* A sale transaction.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @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
|
||||
* @property string payment_mode
|
||||
* @property string pending_reason
|
||||
* @property string state
|
||||
* @property string reason_code
|
||||
* @property string protection_eligibility
|
||||
* @property string protection_eligibility_type
|
||||
* @property string clearing_time
|
||||
* @property string parent_payment
|
||||
* @property \PayPal\Api\Links links
|
||||
*/
|
||||
class Sale extends PPModel implements IResource
|
||||
{
|
||||
/**
|
||||
* @var
|
||||
* OAuth Credentials to use for this call
|
||||
*
|
||||
* @var \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
private static $credential;
|
||||
protected static $credential;
|
||||
|
||||
/**
|
||||
* Set Credential
|
||||
*
|
||||
* @param $credential
|
||||
* Sets Credential
|
||||
*
|
||||
* @deprecated Pass ApiContext to create/get methods instead
|
||||
* @param \PayPal\Auth\OAuthTokenCredential $credential
|
||||
*/
|
||||
public static function setCredential($credential)
|
||||
{
|
||||
@@ -39,23 +51,21 @@ class Sale extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ID
|
||||
* Identifier of the authorization transaction
|
||||
* Identifier of the authorization transaction.
|
||||
*
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ID
|
||||
* Identifier of the authorization transaction
|
||||
* Identifier of the authorization transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -65,23 +75,21 @@ class Sale extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
* 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
|
||||
* Time the resource was created.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -91,27 +99,22 @@ class Sale extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Create Time
|
||||
* Time the resource was created
|
||||
* Time the resource was created.
|
||||
*
|
||||
* @deprecated Instead use setCreateTime
|
||||
*
|
||||
* @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
|
||||
* Time the resource was created.
|
||||
* @deprecated Instead use getCreateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -121,23 +124,21 @@ class Sale extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
* 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
|
||||
* Time the resource was last updated.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -147,27 +148,22 @@ class Sale extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Update Time
|
||||
* Time the resource was last updated
|
||||
* Time the resource was last updated.
|
||||
*
|
||||
* @deprecated Instead use setUpdateTime
|
||||
*
|
||||
* @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
|
||||
* Time the resource was last updated.
|
||||
* @deprecated Instead use getUpdateTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -177,23 +173,21 @@ class Sale extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Amount
|
||||
* Amount being collected
|
||||
* Amount being collected.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Amount
|
||||
* Amount being collected
|
||||
* Amount being collected.
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
@@ -203,23 +197,119 @@ class Sale extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set State
|
||||
* State of the sale transaction
|
||||
* specifies payment mode of the transaction
|
||||
* Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
|
||||
*
|
||||
* @param string $payment_mode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentMode($payment_mode)
|
||||
{
|
||||
$this->payment_mode = $payment_mode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* specifies payment mode of the transaction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentMode()
|
||||
{
|
||||
return $this->payment_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* specifies payment mode of the transaction
|
||||
*
|
||||
* @deprecated Instead use setPaymentMode
|
||||
*
|
||||
* @param string $payment_mode
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayment_mode($payment_mode)
|
||||
{
|
||||
$this->payment_mode = $payment_mode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* specifies payment mode of the transaction
|
||||
* @deprecated Instead use getPaymentMode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayment_mode()
|
||||
{
|
||||
return $this->payment_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason of Pending transaction.
|
||||
*
|
||||
*
|
||||
* @param string $pending_reason
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPendingReason($pending_reason)
|
||||
{
|
||||
$this->pending_reason = $pending_reason;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason of Pending transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPendingReason()
|
||||
{
|
||||
return $this->pending_reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason of Pending transaction.
|
||||
*
|
||||
* @deprecated Instead use setPendingReason
|
||||
*
|
||||
* @param string $pending_reason
|
||||
* @return $this
|
||||
*/
|
||||
public function setPending_reason($pending_reason)
|
||||
{
|
||||
$this->pending_reason = $pending_reason;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason of Pending transaction.
|
||||
* @deprecated Instead use getPendingReason
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPending_reason()
|
||||
{
|
||||
return $this->pending_reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the sale transaction.
|
||||
* Valid Values: ["pending", "completed", "refunded", "partially_refunded"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get State
|
||||
* State of the sale transaction
|
||||
* State of the sale transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -229,23 +319,217 @@ class Sale extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
* Reason code for the transaction state being Pending or Reversed.
|
||||
* Valid Values: ["CHARGEBACK", "GUARANTEE", "BUYER_COMPLAINT", "REFUND", "UNCONFIRMED_SHIPPING_ADDRESS", "ECHECK", "INTERNATIONAL_WITHDRAWAL", "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION", "PAYMENT_REVIEW", "REGULATORY_REVIEW", "UNILATERAL", "VERIFICATION_REQUIRED"]
|
||||
*
|
||||
* @param string $reason_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReasonCode($reason_code)
|
||||
{
|
||||
$this->reason_code = $reason_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReasonCode()
|
||||
{
|
||||
return $this->reason_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed.
|
||||
*
|
||||
* @deprecated Instead use setReasonCode
|
||||
*
|
||||
* @param string $reason_code
|
||||
* @return $this
|
||||
*/
|
||||
public function setReason_code($reason_code)
|
||||
{
|
||||
$this->reason_code = $reason_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed.
|
||||
* @deprecated Instead use getReasonCode
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReason_code()
|
||||
{
|
||||
return $this->reason_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility of the Payer
|
||||
* Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
|
||||
*
|
||||
* @param string $protection_eligibility
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtectionEligibility($protection_eligibility)
|
||||
{
|
||||
$this->protection_eligibility = $protection_eligibility;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility of the Payer
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtectionEligibility()
|
||||
{
|
||||
return $this->protection_eligibility;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility of the Payer
|
||||
*
|
||||
* @deprecated Instead use setProtectionEligibility
|
||||
*
|
||||
* @param string $protection_eligibility
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtection_eligibility($protection_eligibility)
|
||||
{
|
||||
$this->protection_eligibility = $protection_eligibility;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility of the Payer
|
||||
* @deprecated Instead use getProtectionEligibility
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtection_eligibility()
|
||||
{
|
||||
return $this->protection_eligibility;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility Type of the Payer
|
||||
* Valid Values: ["ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE", "INELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE"]
|
||||
*
|
||||
* @param string $protection_eligibility_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtectionEligibilityType($protection_eligibility_type)
|
||||
{
|
||||
$this->protection_eligibility_type = $protection_eligibility_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility Type of the Payer
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtectionEligibilityType()
|
||||
{
|
||||
return $this->protection_eligibility_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility Type of the Payer
|
||||
*
|
||||
* @deprecated Instead use setProtectionEligibilityType
|
||||
*
|
||||
* @param string $protection_eligibility_type
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtection_eligibility_type($protection_eligibility_type)
|
||||
{
|
||||
$this->protection_eligibility_type = $protection_eligibility_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protection Eligibility Type of the Payer
|
||||
* @deprecated Instead use getProtectionEligibilityType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtection_eligibility_type()
|
||||
{
|
||||
return $this->protection_eligibility_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expected clearing time for eCheck Transactions
|
||||
*
|
||||
*
|
||||
* @param string $clearing_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setClearingTime($clearing_time)
|
||||
{
|
||||
$this->clearing_time = $clearing_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expected clearing time for eCheck Transactions
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getClearingTime()
|
||||
{
|
||||
return $this->clearing_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expected clearing time for eCheck Transactions
|
||||
*
|
||||
* @deprecated Instead use setClearingTime
|
||||
*
|
||||
* @param string $clearing_time
|
||||
* @return $this
|
||||
*/
|
||||
public function setClearing_time($clearing_time)
|
||||
{
|
||||
$this->clearing_time = $clearing_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expected clearing time for eCheck Transactions
|
||||
* @deprecated Instead use getClearingTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getClearing_time()
|
||||
{
|
||||
return $this->clearing_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentPayment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -255,27 +539,22 @@ class Sale extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Payment
|
||||
* ID of the Payment resource that this transaction is based on
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
* @deprecated Instead use setParentPayment
|
||||
*
|
||||
* @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
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @deprecated Instead use getParentPayment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -285,23 +564,23 @@ class Sale extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Links
|
||||
* Sets Links
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Links
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
@@ -309,66 +588,48 @@ class Sale extends PPModel implements IResource
|
||||
}
|
||||
|
||||
/**
|
||||
* Get
|
||||
*
|
||||
* @param int $saleId
|
||||
* @param \PayPal\Rest\ApiContext|null $apiContext
|
||||
* Obtain the Sale transaction resource for the given identifier.
|
||||
*
|
||||
* @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 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");
|
||||
}
|
||||
ArgumentValidator::validate($saleId, 'saleId');
|
||||
|
||||
$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
|
||||
* Creates (and processes) a new Refund Transaction added as a related resource.
|
||||
*
|
||||
* @param Refund $refund
|
||||
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @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");
|
||||
}
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($refund, 'refund');
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,28 +8,56 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class ShippingAddress
|
||||
*
|
||||
* Extended Address object used as shipping address in a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string recipient_name
|
||||
* @property bool default_address
|
||||
*/
|
||||
class ShippingAddress extends Address
|
||||
class ShippingAddress extends Address
|
||||
{
|
||||
/**
|
||||
* Set Recipient Name
|
||||
* Name of the recipient at this address
|
||||
* Address ID assigned in PayPal system.
|
||||
*
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address ID assigned in PayPal system.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Recipient Name
|
||||
* Name of the recipient at this address
|
||||
* Name of the recipient at this address.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -39,27 +67,22 @@ class ShippingAddress extends Address
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Recipient Name
|
||||
* Name of the recipient at this address
|
||||
* Name of the recipient at this address.
|
||||
*
|
||||
* @deprecated Instead use setRecipientName
|
||||
*
|
||||
* @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
|
||||
* Name of the recipient at this address.
|
||||
* @deprecated Instead use getRecipientName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -67,4 +90,54 @@ class ShippingAddress extends Address
|
||||
{
|
||||
return $this->recipient_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default shipping address of the Payer.
|
||||
*
|
||||
*
|
||||
* @param bool $default_address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDefaultAddress($default_address)
|
||||
{
|
||||
$this->default_address = $default_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default shipping address of the Payer.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getDefaultAddress()
|
||||
{
|
||||
return $this->default_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default shipping address of the Payer.
|
||||
*
|
||||
* @deprecated Instead use setDefaultAddress
|
||||
*
|
||||
* @param bool $default_address
|
||||
* @return $this
|
||||
*/
|
||||
public function setDefault_address($default_address)
|
||||
{
|
||||
$this->default_address = $default_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default shipping address of the Payer.
|
||||
* @deprecated Instead use getDefaultAddress
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getDefault_address()
|
||||
{
|
||||
return $this->default_address;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,309 +8,36 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class Transaction
|
||||
*
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property \PayPal\Api\Payee payee
|
||||
* @property string description
|
||||
* @property \PayPal\Api\ItemList item_list
|
||||
* @property \PayPal\Api\RelatedResources related_resources
|
||||
* @property \PayPal\Api\Transaction transactions
|
||||
* @property string invoice_number
|
||||
* @property string custom
|
||||
* @property string soft_descriptor
|
||||
* A transaction defines the contract of a payment - what is the payment for and who is fulfilling it.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property self transactions
|
||||
*/
|
||||
class Transaction extends PPModel
|
||||
class Transaction extends TransactionBase
|
||||
{
|
||||
/**
|
||||
* Set Amount
|
||||
* Amount being collected
|
||||
* Additional transactions for complex payment scenarios.
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Amount
|
||||
* Amount being collected
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Payee
|
||||
* Recepient of the funds in this transaction
|
||||
*
|
||||
* @param \PayPal\Api\Payee $payee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayee($payee)
|
||||
{
|
||||
$this->payee = $payee;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Payee
|
||||
* Recepient of the funds in this transaction
|
||||
*
|
||||
* @return \PayPal\Api\Payee
|
||||
*/
|
||||
public function getPayee()
|
||||
{
|
||||
return $this->payee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Description
|
||||
* Description of what is being paid for
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Description
|
||||
* Description of what is being paid for
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Item List
|
||||
* List of items being paid for
|
||||
*
|
||||
* @param \PayPal\Api\ItemList $item_list
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setItemList($item_list)
|
||||
{
|
||||
$this->item_list = $item_list;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Item List
|
||||
* List of items being paid for
|
||||
*
|
||||
* @return \PayPal\Api\ItemList
|
||||
*/
|
||||
public function getItemList()
|
||||
{
|
||||
return $this->item_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Item List
|
||||
* List of items being paid for
|
||||
*
|
||||
* @param \PayPal\Api\ItemList $item_list
|
||||
*
|
||||
* @deprecated Use setItemList
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setItem_list($item_list)
|
||||
{
|
||||
$this->item_list = $item_list;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Item List
|
||||
* List of items being paid for
|
||||
*
|
||||
* @deprecated Use getItemList
|
||||
*
|
||||
* @return \PayPal\Api\ItemList
|
||||
*/
|
||||
public function getItem_list()
|
||||
{
|
||||
return $this->item_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Related Resources
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment
|
||||
*
|
||||
* @param \PayPal\Api\RelatedResources $related_resources
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRelatedResources($related_resources)
|
||||
{
|
||||
$this->related_resources = $related_resources;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Related Resources
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment
|
||||
*
|
||||
* @return \PayPal\Api\RelatedResources
|
||||
*/
|
||||
public function getRelatedResources()
|
||||
{
|
||||
return $this->related_resources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Related Resources
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment
|
||||
*
|
||||
* @param \PayPal\Api\RelatedResources $related_resources
|
||||
*
|
||||
* @deprecated Use setRelatedResources
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRelated_resources($related_resources)
|
||||
{
|
||||
$this->related_resources = $related_resources;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Related Resources
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment
|
||||
*
|
||||
* @deprecated Use getRelatedResources
|
||||
*
|
||||
* @return \PayPal\Api\RelatedResources
|
||||
*/
|
||||
public function getRelated_resources()
|
||||
{
|
||||
return $this->related_resources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set invoice number.
|
||||
* Invoice number used to track the payment. 256 characters max.
|
||||
*
|
||||
* @param string $invoiceNumber
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInvoiceNumber($invoiceNumber)
|
||||
{
|
||||
$this->invoice_number = $invoiceNumber;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get invoice number.
|
||||
* Invoice number used to track the payment. 256 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInvoiceNumber()
|
||||
{
|
||||
return $this->invoice_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set free-form field.
|
||||
* Free-form field for the use of clients. 256 characters max.
|
||||
*
|
||||
* @param string $custom
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCustom($custom)
|
||||
{
|
||||
$this->custom = $custom;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get free-form field.
|
||||
* Free-form field for the use of clients. 256 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCustom()
|
||||
{
|
||||
return $this->custom;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set soft descriptor.
|
||||
* Soft descriptor used when charging this funding source. 22 characters max.
|
||||
*
|
||||
* @param string $softDescriptor
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSoftDescriptor($softDescriptor)
|
||||
{
|
||||
$this->soft_descriptor = $softDescriptor;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get soft descriptor.
|
||||
* Soft descriptor used when charging this funding source. 22 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSoftDescriptor()
|
||||
{
|
||||
return $this->soft_descriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Transactions
|
||||
* Additional transactions for complex payment (Parallel and Chained) scenarios
|
||||
*
|
||||
* @param \PayPal\Api\self $transactions
|
||||
* @param self $transactions
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTransactions($transactions)
|
||||
{
|
||||
$this->transactions = $transactions;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Transactions
|
||||
* Additional transactions for complex payment (Parallel and Chained) scenarios
|
||||
* Additional transactions for complex payment scenarios.
|
||||
*
|
||||
* @return \PayPal\Api\self
|
||||
* @return self[]
|
||||
*/
|
||||
public function getTransactions()
|
||||
{
|
||||
return $this->transactions;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
68
lib/PayPal/Api/TransactionBase.php
Normal file
68
lib/PayPal/Api/TransactionBase.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class TransactionBase
|
||||
*
|
||||
* A transaction defines the contract of a payment - what is the payment for and who is fulfilling it.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\RelatedResources related_resources
|
||||
*/
|
||||
class TransactionBase extends CartBase
|
||||
{
|
||||
/**
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\RelatedResources $related_resources
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRelatedResources($related_resources)
|
||||
{
|
||||
$this->related_resources = $related_resources;
|
||||
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.
|
||||
*
|
||||
* @deprecated Instead use setRelatedResources
|
||||
*
|
||||
* @param \PayPal\Api\RelatedResources $related_resources
|
||||
* @return $this
|
||||
*/
|
||||
public function setRelated_resources($related_resources)
|
||||
{
|
||||
$this->related_resources = $related_resources;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment.
|
||||
* @deprecated Instead use getRelatedResources
|
||||
*
|
||||
* @return \PayPal\Api\RelatedResources
|
||||
*/
|
||||
public function getRelated_resources()
|
||||
{
|
||||
return $this->related_resources;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,26 +8,30 @@ use PayPal\Rest\ApiContext;
|
||||
/**
|
||||
* Class Transactions
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Amount amount
|
||||
*/
|
||||
class Transactions extends PPModel
|
||||
{
|
||||
/**
|
||||
* Set Amount
|
||||
* Amount being collected.
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Amount
|
||||
* Amount being collected.
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
@@ -35,4 +39,5 @@ class Transactions extends PPModel
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ class OAuthTokenCredential
|
||||
{
|
||||
$this->clientId = $clientId;
|
||||
$this->clientSecret = $clientSecret;
|
||||
$this->logger = PPLoggingManager::getInstance(__CLASS__);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,8 +86,6 @@ class OAuthTokenCredential
|
||||
*/
|
||||
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
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Common;
|
||||
use PayPal\Validation\ModelAccessorValidator;
|
||||
|
||||
/**
|
||||
* Generic Model class that all API domain classes extend
|
||||
@@ -12,6 +13,45 @@ class PPModel
|
||||
|
||||
private $_propMap = array();
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*
|
||||
* You can pass data as a json representation or array object. This argument eliminates the need
|
||||
* to do $obj->fromJson($data) later after creating the object.
|
||||
*
|
||||
* @param null $data
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function __construct($data = null)
|
||||
{
|
||||
switch (gettype($data)) {
|
||||
case "NULL":
|
||||
break;
|
||||
case "string":
|
||||
if (!$this->isJson($data)) {
|
||||
throw new \InvalidArgumentException("data should be either json or array representation of object");
|
||||
}
|
||||
$this->fromJson($data);
|
||||
break;
|
||||
case "array":
|
||||
$this->fromArray($data);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if the string provided is json representation or not.
|
||||
*
|
||||
* @param $string
|
||||
* @return bool
|
||||
*/
|
||||
private function isJson($string)
|
||||
{
|
||||
json_decode($string);
|
||||
return (json_last_error() == JSON_ERROR_NONE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic Get Method
|
||||
*
|
||||
@@ -20,7 +60,10 @@ class PPModel
|
||||
*/
|
||||
public function __get($key)
|
||||
{
|
||||
return $this->_propMap[$key];
|
||||
if ($this->__isset($key)) {
|
||||
return $this->_propMap[$key];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,9 +74,21 @@ class PPModel
|
||||
*/
|
||||
public function __set($key, $value)
|
||||
{
|
||||
ModelAccessorValidator::validate($this, $this->convertToCamelCase($key));
|
||||
$this->_propMap[$key] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the input key into a valid Setter Method Name
|
||||
*
|
||||
* @param $key
|
||||
* @return mixed
|
||||
*/
|
||||
private function convertToCamelCase($key)
|
||||
{
|
||||
return str_replace(' ', '', ucwords(str_replace(array('_', '-'), ' ', $key)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic isSet Method
|
||||
*
|
||||
|
||||
@@ -40,7 +40,7 @@ class PPReflectionUtil
|
||||
}
|
||||
|
||||
if (isset($param)) {
|
||||
$anno = explode(' ', $param);
|
||||
$anno = preg_split("/[\s\[\]]+/", $param);
|
||||
return $anno[0];
|
||||
} else {
|
||||
return 'string';
|
||||
|
||||
@@ -45,7 +45,7 @@ class PPHttpConnection
|
||||
throw new PPConfigurationException("Curl module is not available on this system");
|
||||
}
|
||||
$this->httpConfig = $httpConfig;
|
||||
$this->logger = new PPLoggingManager(__CLASS__, $config);
|
||||
$this->logger = PPLoggingManager::getInstance(__CLASS__);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -43,12 +43,33 @@ class PPLoggingManager
|
||||
private $loggerFile;
|
||||
|
||||
/**
|
||||
* @param $loggerName
|
||||
* @param array|null $config
|
||||
* Returns the singleton object
|
||||
*
|
||||
* @param string $loggerName
|
||||
* @return $this
|
||||
*/
|
||||
public function __construct($loggerName, $config = null)
|
||||
public static function getInstance($loggerName = __CLASS__)
|
||||
{
|
||||
$instance = new self();
|
||||
$instance->setLoggerName($loggerName);
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Logger Name. Generally defaulted to Logging Class
|
||||
*
|
||||
* @param string $loggerName
|
||||
*/
|
||||
public function setLoggerName($loggerName = __CLASS__)
|
||||
{
|
||||
$this->loggerName = $loggerName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$config = PPConfigManager::getInstance()->getConfigHashmap();
|
||||
|
||||
$this->isLoggingEnabled = (array_key_exists('log.LogEnabled', $config) && $config['log.LogEnabled'] == '1');
|
||||
@@ -83,7 +104,7 @@ class PPLoggingManager
|
||||
*/
|
||||
public function error($message)
|
||||
{
|
||||
$this->log($message, PPLoggingLevel::ERROR);
|
||||
$this->log('ERROR: ' . $message, PPLoggingLevel::ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,7 +114,7 @@ class PPLoggingManager
|
||||
*/
|
||||
public function warning($message)
|
||||
{
|
||||
$this->log($message, PPLoggingLevel::WARN);
|
||||
$this->log('WARNING: ' . $message, PPLoggingLevel::WARN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,7 +124,7 @@ class PPLoggingManager
|
||||
*/
|
||||
public function info($message)
|
||||
{
|
||||
$this->log($message, PPLoggingLevel::INFO);
|
||||
$this->log('INFO: ' . $message, PPLoggingLevel::INFO);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,7 +134,7 @@ class PPLoggingManager
|
||||
*/
|
||||
public function fine($message)
|
||||
{
|
||||
$this->log($message, PPLoggingLevel::FINE);
|
||||
$this->log('FINE: ' . $message, PPLoggingLevel::FINE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
171
lib/PayPal/Core/cacert.pem
Normal file
171
lib/PayPal/Core/cacert.pem
Normal file
@@ -0,0 +1,171 @@
|
||||
Verisign Class 3 Public Primary Certification Authority
|
||||
=======================================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx
|
||||
FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5
|
||||
IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow
|
||||
XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz
|
||||
IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA
|
||||
A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94
|
||||
f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol
|
||||
hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA
|
||||
TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah
|
||||
WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf
|
||||
Tqj/ZA1k
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
Verisign Class 3 Public Primary Certification Authority - G2
|
||||
============================================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT
|
||||
MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy
|
||||
eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln
|
||||
biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz
|
||||
dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT
|
||||
MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy
|
||||
eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln
|
||||
biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz
|
||||
dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO
|
||||
FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71
|
||||
lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB
|
||||
MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT
|
||||
1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD
|
||||
Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
|
||||
Verisign Class 3 Public Primary Certification Authority - G3
|
||||
============================================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV
|
||||
UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
|
||||
cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
|
||||
IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh
|
||||
dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw
|
||||
CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy
|
||||
dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv
|
||||
cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg
|
||||
Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
||||
ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1
|
||||
EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc
|
||||
cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw
|
||||
EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj
|
||||
055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA
|
||||
ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f
|
||||
j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC
|
||||
/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0
|
||||
xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa
|
||||
t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
Verisign Class 4 Public Primary Certification Authority - G3
|
||||
============================================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV
|
||||
UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
|
||||
cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
|
||||
IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh
|
||||
dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw
|
||||
CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy
|
||||
dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv
|
||||
cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg
|
||||
Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
||||
ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS
|
||||
tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM
|
||||
8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW
|
||||
Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX
|
||||
Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA
|
||||
j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt
|
||||
mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm
|
||||
fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd
|
||||
RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG
|
||||
UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg==
|
||||
-----END CERTIFICATE-----
|
||||
VeriSign Class 3 Public Primary Certification Authority - G5
|
||||
============================================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE
|
||||
BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
|
||||
ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
|
||||
IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp
|
||||
ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB
|
||||
yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
|
||||
biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh
|
||||
dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt
|
||||
YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
|
||||
ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz
|
||||
j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD
|
||||
Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/
|
||||
Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r
|
||||
fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/
|
||||
BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv
|
||||
Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy
|
||||
aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG
|
||||
SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+
|
||||
X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE
|
||||
KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC
|
||||
Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE
|
||||
ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq
|
||||
-----END CERTIFICATE-----
|
||||
VeriSign Universal Root Certification Authority
|
||||
===============================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
|
||||
BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
|
||||
ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
|
||||
IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u
|
||||
IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV
|
||||
UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
|
||||
cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
|
||||
IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0
|
||||
aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj
|
||||
1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP
|
||||
MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72
|
||||
9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I
|
||||
AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR
|
||||
tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G
|
||||
CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O
|
||||
a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud
|
||||
DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3
|
||||
Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx
|
||||
Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx
|
||||
P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P
|
||||
wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4
|
||||
mJO37M2CYfE45k+XmCpajQ==
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
VeriSign Class 3 Public Primary Certification Authority - G4
|
||||
============================================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC
|
||||
VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3
|
||||
b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz
|
||||
ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj
|
||||
YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL
|
||||
MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU
|
||||
cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo
|
||||
b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5
|
||||
IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8
|
||||
Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz
|
||||
rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB
|
||||
/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw
|
||||
HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u
|
||||
Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD
|
||||
A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx
|
||||
AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA==
|
||||
-----END CERTIFICATE-----
|
||||
Verisign Class 3 Public Primary Certification Authority
|
||||
=======================================================
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx
|
||||
FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5
|
||||
IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow
|
||||
XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz
|
||||
IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA
|
||||
A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94
|
||||
f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol
|
||||
hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky
|
||||
CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX
|
||||
bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/
|
||||
D/xwzoiQ
|
||||
-----END CERTIFICATE-----
|
||||
@@ -37,7 +37,7 @@ class PPRestCall
|
||||
public function __construct(\Paypal\Rest\ApiContext $apiContext)
|
||||
{
|
||||
$this->apiContext = $apiContext;
|
||||
$this->logger = new PPLoggingManager(__CLASS__, $apiContext->getConfig());
|
||||
$this->logger = PPLoggingManager::getInstance(__CLASS__);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,7 +70,7 @@ class PPRestCall
|
||||
}
|
||||
$connection = new PPHttpConnection($httpConfig, $config);
|
||||
$response = $connection->execute($data);
|
||||
$this->logger->fine($response);
|
||||
$this->logger->fine($response . PHP_EOL);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
37
lib/PayPal/Validation/ArgumentValidator.php
Normal file
37
lib/PayPal/Validation/ArgumentValidator.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Validation;
|
||||
|
||||
/**
|
||||
* Class ArgumentValidator
|
||||
*
|
||||
* @package PayPal\Validation
|
||||
*/
|
||||
class ArgumentValidator
|
||||
{
|
||||
|
||||
/**
|
||||
* Helper method for validating an argument that will be used by this API in any requests.
|
||||
*
|
||||
* @param $argument mixed The object to be validated
|
||||
* @param $argumentName string|null The name of the argument.
|
||||
* This will be placed in the exception message for easy reference
|
||||
*/
|
||||
public static function validate($argument, $argumentName = null)
|
||||
{
|
||||
if (
|
||||
$argument != null &&
|
||||
(
|
||||
(gettype($argument) == 'string' && $argument == '')
|
||||
||
|
||||
is_array($argument) && empty($argument)
|
||||
)
|
||||
) {
|
||||
//Throw an Exception for string or array
|
||||
throw new \InvalidArgumentException("$argumentName cannot be null or empty");
|
||||
} elseif ($argument == null) {
|
||||
//Generic Exception
|
||||
throw new \InvalidArgumentException("$argumentName cannot be null");
|
||||
}
|
||||
}
|
||||
}
|
||||
44
lib/PayPal/Validation/ModelAccessorValidator.php
Normal file
44
lib/PayPal/Validation/ModelAccessorValidator.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Validation;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Core\PPConfigManager;
|
||||
use PayPal\Core\PPLoggingManager;
|
||||
|
||||
/**
|
||||
* Class ModelAccessorValidator
|
||||
*
|
||||
* @package PayPal\Validation
|
||||
*/
|
||||
class ModelAccessorValidator
|
||||
{
|
||||
/**
|
||||
* Helper method for validating if the class contains accessor methods (getter and setter) for a given attribute
|
||||
*
|
||||
* @param PPModel $class An object of PPModel
|
||||
* @param string $attributeName Attribute name
|
||||
* @return bool
|
||||
*/
|
||||
public static function validate(PPModel $class, $attributeName)
|
||||
{
|
||||
$mode = PPConfigManager::getInstance()->get('validation.level');
|
||||
if ($mode != 'disabled') {
|
||||
//If the mode is disabled, bypass the validation
|
||||
foreach (array('set' . $attributeName, 'get' . $attributeName) as $methodName) {
|
||||
//Check if both getter and setter exists for given attribute
|
||||
if (!method_exists($class, $methodName)) {
|
||||
//Delegate the error based on the choice
|
||||
$className = is_object($class) ? get_class($class) : (string)$class;
|
||||
$errorMessage = "Missing Accessor: $className:$methodName. Please let us know by creating an issue at https://github.com/paypal/rest-api-sdk-php/issues";
|
||||
PPLoggingManager::getInstance(__CLASS__)->warning($errorMessage);
|
||||
if ($mode == 'strict') {
|
||||
trigger_error($errorMessage, E_USER_NOTICE);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
26
lib/PayPal/Validation/UrlValidator.php
Normal file
26
lib/PayPal/Validation/UrlValidator.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Validation;
|
||||
|
||||
/**
|
||||
* Class UrlValidator
|
||||
*
|
||||
* @package PayPal\Validation
|
||||
*/
|
||||
class UrlValidator
|
||||
{
|
||||
|
||||
/**
|
||||
* Helper method for validating URLs that will be used by this API in any requests.
|
||||
*
|
||||
* @param $url
|
||||
* @param string|null $urlName
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function validate($url, $urlName = null)
|
||||
{
|
||||
if (filter_var($url, FILTER_VALIDATE_URL) === false) {
|
||||
throw new \InvalidArgumentException("$urlName is not a fully qualified URL");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user