diff --git a/composer.json b/composer.json index 50cb3b2..d1d4f8d 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "php": ">=5.3.0", "ext-curl": "*", "ext-json": "*", - "paypal/sdk-core-php": "1.4.*" + "paypal/sdk-core-php": "2.4.*" }, "require-dev": { "phpunit/phpunit": "3.7.*" diff --git a/lib/PayPal/Api/Address.php b/lib/PayPal/Api/Address.php index e7a208e..fa9300e 100644 --- a/lib/PayPal/Api/Address.php +++ b/lib/PayPal/Api/Address.php @@ -1,16 +1,18 @@ line1 = $line1; - } - + return $this; + } + /** * Line 1 of the Address (eg. number, street, etc). * @return string @@ -18,15 +20,17 @@ class Address extends \PPModel { public function getLine1() { return $this->line1; } - + + /** * Optional line 2 of the Address (eg. suite, apt #, etc.). * @param string $line2 */ public function setLine2($line2) { $this->line2 = $line2; - } - + return $this; + } + /** * Optional line 2 of the Address (eg. suite, apt #, etc.). * @return string @@ -34,15 +38,17 @@ class Address extends \PPModel { public function getLine2() { return $this->line2; } - + + /** * City name. * @param string $city */ public function setCity($city) { $this->city = $city; - } - + return $this; + } + /** * City name. * @return string @@ -50,15 +56,17 @@ class Address extends \PPModel { public function getCity() { return $this->city; } - + + /** * 2 letter country code. * @param string $country_code */ public function setCountryCode($country_code) { $this->country_code = $country_code; - } - + return $this; + } + /** * 2 letter country code. * @return string @@ -66,15 +74,34 @@ class Address extends \PPModel { public function getCountryCode() { return $this->country_code; } - + + /** + * 2 letter country code. + * @param string $country_code + * @deprecated. Instead use setCountryCode + */ + public function setCountry_code($country_code) { + $this->country_code = $country_code; + return $this; + } + /** + * 2 letter country code. + * @return string + * @deprecated. Instead use getCountryCode + */ + public function getCountry_code() { + return $this->country_code; + } + /** * Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code. * @param string $postal_code */ public function setPostalCode($postal_code) { $this->postal_code = $postal_code; - } - + return $this; + } + /** * 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 @@ -82,15 +109,34 @@ class Address extends \PPModel { public function getPostalCode() { return $this->postal_code; } - + + /** + * Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code. + * @param string $postal_code + * @deprecated. Instead use setPostalCode + */ + public function setPostal_code($postal_code) { + $this->postal_code = $postal_code; + return $this; + } + /** + * Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code. + * @return string + * @deprecated. Instead use getPostalCode + */ + public function getPostal_code() { + return $this->postal_code; + } + /** * 2 letter code for US states, and the equivalent for other countries. * @param string $state */ public function setState($state) { $this->state = $state; - } - + return $this; + } + /** * 2 letter code for US states, and the equivalent for other countries. * @return string @@ -98,15 +144,17 @@ class Address extends \PPModel { public function getState() { return $this->state; } - + + /** * Phone number in E.123 format. * @param string $phone */ public function setPhone($phone) { $this->phone = $phone; - } - + return $this; + } + /** * Phone number in E.123 format. * @return string @@ -114,5 +162,6 @@ class Address extends \PPModel { public function getPhone() { return $this->phone; } - + + } diff --git a/lib/PayPal/Api/Amount.php b/lib/PayPal/Api/Amount.php index 04f09dc..8c7cfe2 100644 --- a/lib/PayPal/Api/Amount.php +++ b/lib/PayPal/Api/Amount.php @@ -1,16 +1,18 @@ currency = $currency; - } - + return $this; + } + /** * 3 letter currency code * @return string @@ -18,15 +20,17 @@ class Amount extends \PPModel { public function getCurrency() { return $this->currency; } - + + /** * Total amount charged from the Payer account (or card) to Payee. In case of a refund, this is the refunded amount to the original Payer from Payee account. * @param string $total */ public function setTotal($total) { $this->total = $total; - } - + return $this; + } + /** * 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 @@ -34,15 +38,17 @@ class Amount extends \PPModel { public function getTotal() { return $this->total; } - + + /** * Additional details of the payment amount. * @param PayPal\Api\Details $details */ public function setDetails($details) { $this->details = $details; - } - + return $this; + } + /** * Additional details of the payment amount. * @return PayPal\Api\Details @@ -50,5 +56,6 @@ class Amount extends \PPModel { public function getDetails() { return $this->details; } - + + } diff --git a/lib/PayPal/Api/Authorization.php b/lib/PayPal/Api/Authorization.php index 17862a8..9fc4b6d 100644 --- a/lib/PayPal/Api/Authorization.php +++ b/lib/PayPal/Api/Authorization.php @@ -1,30 +1,35 @@ id = $id; - } - + return $this; + } + /** * Identifier of the authorization transaction. * @return string @@ -32,15 +37,17 @@ class Authorization extends \PPModel implements IResource { public function getId() { return $this->id; } - + + /** * Time the resource was created. * @param string $create_time */ public function setCreateTime($create_time) { $this->create_time = $create_time; - } - + return $this; + } + /** * Time the resource was created. * @return string @@ -48,15 +55,34 @@ class Authorization extends \PPModel implements IResource { public function getCreateTime() { return $this->create_time; } - + + /** + * Time the resource was created. + * @param string $create_time + * @deprecated. Instead use setCreateTime + */ + public function setCreate_time($create_time) { + $this->create_time = $create_time; + return $this; + } + /** + * Time the resource was created. + * @return string + * @deprecated. Instead use getCreateTime + */ + public function getCreate_time() { + return $this->create_time; + } + /** * Time the resource was last updated. * @param string $update_time */ public function setUpdateTime($update_time) { $this->update_time = $update_time; - } - + return $this; + } + /** * Time the resource was last updated. * @return string @@ -64,15 +90,34 @@ class Authorization extends \PPModel implements IResource { public function getUpdateTime() { return $this->update_time; } - + + /** + * Time the resource was last updated. + * @param string $update_time + * @deprecated. Instead use setUpdateTime + */ + public function setUpdate_time($update_time) { + $this->update_time = $update_time; + return $this; + } + /** + * Time the resource was last updated. + * @return string + * @deprecated. Instead use getUpdateTime + */ + public function getUpdate_time() { + return $this->update_time; + } + /** * Amount being authorized for. * @param PayPal\Api\Amount $amount */ public function setAmount($amount) { $this->amount = $amount; - } - + return $this; + } + /** * Amount being authorized for. * @return PayPal\Api\Amount @@ -80,15 +125,17 @@ class Authorization extends \PPModel implements IResource { public function getAmount() { return $this->amount; } - + + /** * State of the authorization transaction. * @param string $state */ public function setState($state) { $this->state = $state; - } - + return $this; + } + /** * State of the authorization transaction. * @return string @@ -96,15 +143,17 @@ class Authorization extends \PPModel implements IResource { public function getState() { return $this->state; } - + + /** * ID of the Payment resource that this transaction is based on. * @param string $parent_payment */ public function setParentPayment($parent_payment) { $this->parent_payment = $parent_payment; - } - + return $this; + } + /** * ID of the Payment resource that this transaction is based on. * @return string @@ -112,15 +161,34 @@ class Authorization extends \PPModel implements IResource { public function getParentPayment() { return $this->parent_payment; } - + + /** + * ID of the Payment resource that this transaction is based on. + * @param string $parent_payment + * @deprecated. Instead use setParentPayment + */ + public function setParent_payment($parent_payment) { + $this->parent_payment = $parent_payment; + return $this; + } + /** + * ID of the Payment resource that this transaction is based on. + * @return string + * @deprecated. Instead use getParentPayment + */ + public function getParent_payment() { + return $this->parent_payment; + } + /** * Date/Time until which funds may be captured against this resource. * @param string $valid_until */ public function setValidUntil($valid_until) { $this->valid_until = $valid_until; - } - + return $this; + } + /** * Date/Time until which funds may be captured against this resource. * @return string @@ -128,7 +196,25 @@ class Authorization extends \PPModel implements IResource { public function getValidUntil() { return $this->valid_until; } - + + /** + * Date/Time until which funds may be captured against this resource. + * @param string $valid_until + * @deprecated. Instead use setValidUntil + */ + public function setValid_until($valid_until) { + $this->valid_until = $valid_until; + return $this; + } + /** + * Date/Time until which funds may be captured against this resource. + * @return string + * @deprecated. Instead use getValidUntil + */ + public function getValid_until() { + return $this->valid_until; + } + /** * * @array @@ -136,8 +222,9 @@ class Authorization extends \PPModel implements IResource { */ public function setLinks($links) { $this->links = $links; - } - + return $this; + } + /** * * @return PayPal\Api\Links @@ -145,7 +232,8 @@ class Authorization extends \PPModel implements IResource { public function getLinks() { return $this->links; } - + + public static function get($authorizationId, $apiContext = null) { if (($authorizationId == null) || (strlen($authorizationId) <= 0)) { @@ -155,7 +243,7 @@ class Authorization extends \PPModel implements IResource { if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $call = new PPRestCall($apiContext); $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/$authorizationId", "GET", $payLoad); $ret = new Authorization(); $ret->fromJson($json); @@ -173,7 +261,7 @@ class Authorization extends \PPModel implements IResource { if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $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); @@ -188,7 +276,7 @@ class Authorization extends \PPModel implements IResource { if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $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); @@ -203,7 +291,7 @@ class Authorization extends \PPModel implements IResource { if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $call = new PPRestCall($apiContext); $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/reauthorize", "POST", $payLoad); $this->fromJson($json); return $this; diff --git a/lib/PayPal/Api/Capture.php b/lib/PayPal/Api/Capture.php index 96d3186..773f952 100644 --- a/lib/PayPal/Api/Capture.php +++ b/lib/PayPal/Api/Capture.php @@ -1,30 +1,35 @@ id = $id; - } - + return $this; + } + /** * Identifier of the Capture transaction. * @return string @@ -32,15 +37,17 @@ class Capture extends \PPModel implements IResource { public function getId() { return $this->id; } - + + /** * Time the resource was created. * @param string $create_time */ public function setCreateTime($create_time) { $this->create_time = $create_time; - } - + return $this; + } + /** * Time the resource was created. * @return string @@ -48,15 +55,34 @@ class Capture extends \PPModel implements IResource { public function getCreateTime() { return $this->create_time; } - + + /** + * Time the resource was created. + * @param string $create_time + * @deprecated. Instead use setCreateTime + */ + public function setCreate_time($create_time) { + $this->create_time = $create_time; + return $this; + } + /** + * Time the resource was created. + * @return string + * @deprecated. Instead use getCreateTime + */ + public function getCreate_time() { + return $this->create_time; + } + /** * Time the resource was last updated. * @param string $update_time */ public function setUpdateTime($update_time) { $this->update_time = $update_time; - } - + return $this; + } + /** * Time the resource was last updated. * @return string @@ -64,15 +90,34 @@ class Capture extends \PPModel implements IResource { public function getUpdateTime() { return $this->update_time; } - + + /** + * Time the resource was last updated. + * @param string $update_time + * @deprecated. Instead use setUpdateTime + */ + public function setUpdate_time($update_time) { + $this->update_time = $update_time; + return $this; + } + /** + * Time the resource was last updated. + * @return string + * @deprecated. Instead use getUpdateTime + */ + public function getUpdate_time() { + return $this->update_time; + } + /** * Amount being captured. If no amount is specified, amount is used from the authorization being captured. If amount is same as the amount that's authorized for, the state of the authorization changes to captured. If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true. * @param PayPal\Api\Amount $amount */ public function setAmount($amount) { $this->amount = $amount; - } - + return $this; + } + /** * Amount being captured. If no amount is specified, amount is used from the authorization being captured. If amount is same as the amount that's authorized for, the state of the authorization changes to captured. If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true. * @return PayPal\Api\Amount @@ -80,15 +125,17 @@ class Capture extends \PPModel implements IResource { public function getAmount() { return $this->amount; } - + + /** * whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument. * @param boolean $is_final_capture */ public function setIsFinalCapture($is_final_capture) { $this->is_final_capture = $is_final_capture; - } - + return $this; + } + /** * whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument. * @return boolean @@ -96,15 +143,34 @@ class Capture extends \PPModel implements IResource { public function getIsFinalCapture() { return $this->is_final_capture; } - + + /** + * whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument. + * @param boolean $is_final_capture + * @deprecated. Instead use setIsFinalCapture + */ + public function setIs_final_capture($is_final_capture) { + $this->is_final_capture = $is_final_capture; + return $this; + } + /** + * whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument. + * @return boolean + * @deprecated. Instead use getIsFinalCapture + */ + public function getIs_final_capture() { + return $this->is_final_capture; + } + /** * State of the capture transaction. * @param string $state */ public function setState($state) { $this->state = $state; - } - + return $this; + } + /** * State of the capture transaction. * @return string @@ -112,15 +178,17 @@ class Capture extends \PPModel implements IResource { public function getState() { return $this->state; } - + + /** * ID of the Payment resource that this transaction is based on. * @param string $parent_payment */ public function setParentPayment($parent_payment) { $this->parent_payment = $parent_payment; - } - + return $this; + } + /** * ID of the Payment resource that this transaction is based on. * @return string @@ -128,7 +196,25 @@ class Capture extends \PPModel implements IResource { public function getParentPayment() { return $this->parent_payment; } - + + /** + * ID of the Payment resource that this transaction is based on. + * @param string $parent_payment + * @deprecated. Instead use setParentPayment + */ + public function setParent_payment($parent_payment) { + $this->parent_payment = $parent_payment; + return $this; + } + /** + * ID of the Payment resource that this transaction is based on. + * @return string + * @deprecated. Instead use getParentPayment + */ + public function getParent_payment() { + return $this->parent_payment; + } + /** * * @array @@ -136,8 +222,9 @@ class Capture extends \PPModel implements IResource { */ public function setLinks($links) { $this->links = $links; - } - + return $this; + } + /** * * @return PayPal\Api\Links @@ -145,7 +232,8 @@ class Capture extends \PPModel implements IResource { public function getLinks() { return $this->links; } - + + public static function get($captureId, $apiContext = null) { if (($captureId == null) || (strlen($captureId) <= 0)) { @@ -155,7 +243,7 @@ class Capture extends \PPModel implements IResource { if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $call = new PPRestCall($apiContext); $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/capture/$captureId", "GET", $payLoad); $ret = new Capture(); $ret->fromJson($json); @@ -173,7 +261,7 @@ class Capture extends \PPModel implements IResource { if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $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); diff --git a/lib/PayPal/Api/CreditCard.php b/lib/PayPal/Api/CreditCard.php index 8c2582f..cd0ee91 100644 --- a/lib/PayPal/Api/CreditCard.php +++ b/lib/PayPal/Api/CreditCard.php @@ -1,30 +1,34 @@ id = $id; - } - + return $this; + } + /** * ID of the credit card being saved for later use. * @return string @@ -32,15 +36,17 @@ class CreditCard extends \PPModel implements IResource { public function getId() { return $this->id; } - + + /** * Card number. * @param string $number */ public function setNumber($number) { $this->number = $number; - } - + return $this; + } + /** * Card number. * @return string @@ -48,15 +54,17 @@ class CreditCard extends \PPModel implements IResource { public function getNumber() { return $this->number; } - + + /** * Type of the Card (eg. Visa, Mastercard, etc.). * @param string $type */ public function setType($type) { $this->type = $type; - } - + return $this; + } + /** * Type of the Card (eg. Visa, Mastercard, etc.). * @return string @@ -64,15 +72,17 @@ class CreditCard extends \PPModel implements IResource { public function getType() { return $this->type; } - + + /** * card expiry month with value 1 - 12. * @param integer $expire_month */ public function setExpireMonth($expire_month) { $this->expire_month = $expire_month; - } - + return $this; + } + /** * card expiry month with value 1 - 12. * @return integer @@ -80,15 +90,34 @@ class CreditCard extends \PPModel implements IResource { public function getExpireMonth() { return $this->expire_month; } - + + /** + * card expiry month with value 1 - 12. + * @param integer $expire_month + * @deprecated. Instead use setExpireMonth + */ + public function setExpire_month($expire_month) { + $this->expire_month = $expire_month; + return $this; + } + /** + * card expiry month with value 1 - 12. + * @return integer + * @deprecated. Instead use getExpireMonth + */ + public function getExpire_month() { + return $this->expire_month; + } + /** * 4 digit card expiry year * @param integer $expire_year */ public function setExpireYear($expire_year) { $this->expire_year = $expire_year; - } - + return $this; + } + /** * 4 digit card expiry year * @return integer @@ -96,15 +125,34 @@ class CreditCard extends \PPModel implements IResource { public function getExpireYear() { return $this->expire_year; } - + + /** + * 4 digit card expiry year + * @param integer $expire_year + * @deprecated. Instead use setExpireYear + */ + public function setExpire_year($expire_year) { + $this->expire_year = $expire_year; + return $this; + } + /** + * 4 digit card expiry year + * @return integer + * @deprecated. Instead use getExpireYear + */ + public function getExpire_year() { + return $this->expire_year; + } + /** * Card validation code. Only supported when making a Payment but not when saving a credit card for future use. * @param string $cvv2 */ public function setCvv2($cvv2) { $this->cvv2 = $cvv2; - } - + return $this; + } + /** * Card validation code. Only supported when making a Payment but not when saving a credit card for future use. * @return string @@ -112,15 +160,17 @@ class CreditCard extends \PPModel implements IResource { public function getCvv2() { return $this->cvv2; } - + + /** * Card holder's first name. * @param string $first_name */ public function setFirstName($first_name) { $this->first_name = $first_name; - } - + return $this; + } + /** * Card holder's first name. * @return string @@ -128,15 +178,34 @@ class CreditCard extends \PPModel implements IResource { public function getFirstName() { return $this->first_name; } - + + /** + * Card holder's first name. + * @param string $first_name + * @deprecated. Instead use setFirstName + */ + public function setFirst_name($first_name) { + $this->first_name = $first_name; + return $this; + } + /** + * Card holder's first name. + * @return string + * @deprecated. Instead use getFirstName + */ + public function getFirst_name() { + return $this->first_name; + } + /** * Card holder's last name. * @param string $last_name */ public function setLastName($last_name) { $this->last_name = $last_name; - } - + return $this; + } + /** * Card holder's last name. * @return string @@ -144,15 +213,34 @@ class CreditCard extends \PPModel implements IResource { public function getLastName() { return $this->last_name; } - + + /** + * Card holder's last name. + * @param string $last_name + * @deprecated. Instead use setLastName + */ + public function setLast_name($last_name) { + $this->last_name = $last_name; + return $this; + } + /** + * Card holder's last name. + * @return string + * @deprecated. Instead use getLastName + */ + public function getLast_name() { + return $this->last_name; + } + /** * Billing Address associated with this card. * @param PayPal\Api\Address $billing_address */ public function setBillingAddress($billing_address) { $this->billing_address = $billing_address; - } - + return $this; + } + /** * Billing Address associated with this card. * @return PayPal\Api\Address @@ -160,15 +248,34 @@ class CreditCard extends \PPModel implements IResource { public function getBillingAddress() { return $this->billing_address; } - + + /** + * Billing Address associated with this card. + * @param PayPal\Api\Address $billing_address + * @deprecated. Instead use setBillingAddress + */ + public function setBilling_address($billing_address) { + $this->billing_address = $billing_address; + return $this; + } + /** + * Billing Address associated with this card. + * @return PayPal\Api\Address + * @deprecated. Instead use getBillingAddress + */ + public function getBilling_address() { + return $this->billing_address; + } + /** * 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 */ public function setPayerId($payer_id) { $this->payer_id = $payer_id; - } - + return $this; + } + /** * A unique identifier of the payer generated and provided by the facilitator. This is required when creating or using a tokenized funding instrument. * @return string @@ -176,15 +283,34 @@ class CreditCard extends \PPModel implements IResource { public function getPayerId() { return $this->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 + * @deprecated. Instead use setPayerId + */ + public function setPayer_id($payer_id) { + $this->payer_id = $payer_id; + return $this; + } + /** + * A unique identifier of the payer generated and provided by the facilitator. This is required when creating or using a tokenized funding instrument. + * @return string + * @deprecated. Instead use getPayerId + */ + public function getPayer_id() { + return $this->payer_id; + } + /** * State of the funding instrument. * @param string $state */ public function setState($state) { $this->state = $state; - } - + return $this; + } + /** * State of the funding instrument. * @return string @@ -192,15 +318,17 @@ class CreditCard extends \PPModel implements IResource { public function getState() { return $this->state; } - + + /** * Date/Time until this resource can be used fund a payment. * @param string $valid_until */ 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 @@ -208,7 +336,25 @@ class CreditCard extends \PPModel implements IResource { public function getValidUntil() { return $this->valid_until; } - + + /** + * Date/Time until this resource can be used fund a payment. + * @param string $valid_until + * @deprecated. Instead use setValidUntil + */ + public function setValid_until($valid_until) { + $this->valid_until = $valid_until; + return $this; + } + /** + * Date/Time until this resource can be used fund a payment. + * @return string + * @deprecated. Instead use getValidUntil + */ + public function getValid_until() { + return $this->valid_until; + } + /** * * @array @@ -216,8 +362,9 @@ class CreditCard extends \PPModel implements IResource { */ public function setLinks($links) { $this->links = $links; - } - + return $this; + } + /** * * @return PayPal\Api\Links @@ -225,14 +372,15 @@ class CreditCard extends \PPModel implements IResource { public function getLinks() { return $this->links; } - + + public function create($apiContext = null) { $payLoad = $this->toJSON(); if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $call = new PPRestCall($apiContext); $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/vault/credit-card", "POST", $payLoad); $this->fromJson($json); return $this; @@ -246,7 +394,7 @@ class CreditCard extends \PPModel implements IResource { if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $call = new PPRestCall($apiContext); $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/vault/credit-card/$creditCardId", "GET", $payLoad); $ret = new CreditCard(); $ret->fromJson($json); @@ -261,8 +409,8 @@ class CreditCard extends \PPModel implements IResource { 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()}", "POST", $payLoad); + $call = new PPRestCall($apiContext); + $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/vault/credit-card/{$this->getId()}", "DELETE", $payLoad); return true; } } diff --git a/lib/PayPal/Api/CreditCardHistory.php b/lib/PayPal/Api/CreditCardHistory.php index 22059e1..896dd69 100644 --- a/lib/PayPal/Api/CreditCardHistory.php +++ b/lib/PayPal/Api/CreditCardHistory.php @@ -1,17 +1,19 @@ credit-cards = $credit-cards; - } - + public function setCreditCards($credit_cards) { + $this->credit_cards = $credit_cards; + return $this; + } + /** * A list of credit card resources * @return PayPal\Api\CreditCard @@ -19,15 +21,35 @@ class CreditCardHistory extends \PPModel { public function getCreditCards() { return $this->credit-cards; } - + + /** + * A list of credit card resources + * @array + * @param PayPal\Api\CreditCard $credit-cards + * @deprecated. Instead use setCreditCards + */ + public function setCredit_cards($credit_cards) { + $this->credit_cards = $credit_cards; + return $this; + } + /** + * A list of credit card resources + * @return PayPal\Api\CreditCard + * @deprecated. Instead use getCreditCards + */ + public function getCredit_cards() { + return $this->credit-cards; + } + /** * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. * @param integer $count */ public function setCount($count) { $this->count = $count; - } - + return $this; + } + /** * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. * @return integer @@ -35,15 +57,17 @@ class CreditCardHistory extends \PPModel { public function getCount() { return $this->count; } - + + /** * Identifier of the next element to get the next range of results. * @param string $next_id */ public function setNextId($next_id) { $this->next_id = $next_id; - } - + return $this; + } + /** * Identifier of the next element to get the next range of results. * @return string @@ -51,5 +75,23 @@ class CreditCardHistory extends \PPModel { public function getNextId() { return $this->next_id; } - + + /** + * Identifier of the next element to get the next range of results. + * @param string $next_id + * @deprecated. Instead use setNextId + */ + public function setNext_id($next_id) { + $this->next_id = $next_id; + return $this; + } + /** + * Identifier of the next element to get the next range of results. + * @return string + * @deprecated. Instead use getNextId + */ + public function getNext_id() { + return $this->next_id; + } + } diff --git a/lib/PayPal/Api/CreditCardToken.php b/lib/PayPal/Api/CreditCardToken.php index 0f748e5..13430dd 100644 --- a/lib/PayPal/Api/CreditCardToken.php +++ b/lib/PayPal/Api/CreditCardToken.php @@ -1,16 +1,18 @@ credit_card_id = $credit_card_id; - } - + return $this; + } + /** * ID of a previously saved Credit Card resource using /vault/credit-card API. * @return string @@ -18,15 +20,34 @@ class CreditCardToken extends \PPModel { public function getCreditCardId() { return $this->credit_card_id; } - + + /** + * ID of a previously saved Credit Card resource using /vault/credit-card API. + * @param string $credit_card_id + * @deprecated. Instead use setCreditCardId + */ + public function setCredit_card_id($credit_card_id) { + $this->credit_card_id = $credit_card_id; + return $this; + } + /** + * ID of a previously saved Credit Card resource using /vault/credit-card API. + * @return string + * @deprecated. Instead use getCreditCardId + */ + public function getCredit_card_id() { + return $this->credit_card_id; + } + /** * The unique identifier of the payer used when saving this credit card using /vault/credit-card API. * @param string $payer_id */ public function setPayerId($payer_id) { $this->payer_id = $payer_id; - } - + return $this; + } + /** * The unique identifier of the payer used when saving this credit card using /vault/credit-card API. * @return string @@ -34,15 +55,34 @@ class CreditCardToken extends \PPModel { public function getPayerId() { return $this->payer_id; } - + + /** + * The unique identifier of the payer used when saving this credit card using /vault/credit-card API. + * @param string $payer_id + * @deprecated. Instead use setPayerId + */ + public function setPayer_id($payer_id) { + $this->payer_id = $payer_id; + return $this; + } + /** + * The unique identifier of the payer used when saving this credit card using /vault/credit-card API. + * @return string + * @deprecated. Instead use getPayerId + */ + public function getPayer_id() { + return $this->payer_id; + } + /** * Last 4 digits of the card number from the saved card. * @param string $last4 */ public function setLast4($last4) { $this->last4 = $last4; - } - + return $this; + } + /** * Last 4 digits of the card number from the saved card. * @return string @@ -50,15 +90,17 @@ class CreditCardToken extends \PPModel { public function getLast4() { return $this->last4; } - + + /** * Type of the Card (eg. visa, mastercard, etc.) from the saved card. Please note that the values are always in lowercase and not meant to be used directly for display. * @param string $type */ public function setType($type) { $this->type = $type; - } - + return $this; + } + /** * 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 @@ -66,15 +108,17 @@ class CreditCardToken extends \PPModel { public function getType() { return $this->type; } - + + /** * card expiry month from the saved card with value 1 - 12 * @param integer $expire_month */ public function setExpireMonth($expire_month) { $this->expire_month = $expire_month; - } - + return $this; + } + /** * card expiry month from the saved card with value 1 - 12 * @return integer @@ -82,15 +126,34 @@ class CreditCardToken extends \PPModel { public function getExpireMonth() { return $this->expire_month; } - + + /** + * card expiry month from the saved card with value 1 - 12 + * @param integer $expire_month + * @deprecated. Instead use setExpireMonth + */ + public function setExpire_month($expire_month) { + $this->expire_month = $expire_month; + return $this; + } + /** + * card expiry month from the saved card with value 1 - 12 + * @return integer + * @deprecated. Instead use getExpireMonth + */ + public function getExpire_month() { + return $this->expire_month; + } + /** * 4 digit card expiry year from the saved card * @param integer $expire_year */ public function setExpireYear($expire_year) { $this->expire_year = $expire_year; - } - + return $this; + } + /** * 4 digit card expiry year from the saved card * @return integer @@ -98,5 +161,23 @@ class CreditCardToken extends \PPModel { public function getExpireYear() { return $this->expire_year; } - + + /** + * 4 digit card expiry year from the saved card + * @param integer $expire_year + * @deprecated. Instead use setExpireYear + */ + public function setExpire_year($expire_year) { + $this->expire_year = $expire_year; + return $this; + } + /** + * 4 digit card expiry year from the saved card + * @return integer + * @deprecated. Instead use getExpireYear + */ + public function getExpire_year() { + return $this->expire_year; + } + } diff --git a/lib/PayPal/Api/Details.php b/lib/PayPal/Api/Details.php index e13bf4c..ab38367 100644 --- a/lib/PayPal/Api/Details.php +++ b/lib/PayPal/Api/Details.php @@ -1,16 +1,18 @@ shipping = $shipping; - } - + return $this; + } + /** * Amount being charged for shipping. * @return string @@ -18,15 +20,17 @@ class Details extends \PPModel { public function getShipping() { return $this->shipping; } - + + /** * Sub-total (amount) of items being paid for. * @param string $subtotal */ public function setSubtotal($subtotal) { $this->subtotal = $subtotal; - } - + return $this; + } + /** * Sub-total (amount) of items being paid for. * @return string @@ -34,15 +38,17 @@ class Details extends \PPModel { public function getSubtotal() { return $this->subtotal; } - + + /** * Amount being charged as tax. * @param string $tax */ public function setTax($tax) { $this->tax = $tax; - } - + return $this; + } + /** * Amount being charged as tax. * @return string @@ -50,15 +56,17 @@ class Details extends \PPModel { public function getTax() { return $this->tax; } - + + /** * Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment. * @param string $fee */ public function setFee($fee) { $this->fee = $fee; - } - + return $this; + } + /** * Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment. * @return string @@ -66,5 +74,6 @@ class Details extends \PPModel { public function getFee() { return $this->fee; } - + + } diff --git a/lib/PayPal/Api/FundingInstrument.php b/lib/PayPal/Api/FundingInstrument.php index 8728794..6800675 100644 --- a/lib/PayPal/Api/FundingInstrument.php +++ b/lib/PayPal/Api/FundingInstrument.php @@ -1,16 +1,18 @@ credit_card = $credit_card; - } - + return $this; + } + /** * Credit Card information. * @return PayPal\Api\CreditCard @@ -18,15 +20,34 @@ class FundingInstrument extends \PPModel { public function getCreditCard() { return $this->credit_card; } - + + /** + * Credit Card information. + * @param PayPal\Api\CreditCard $credit_card + * @deprecated. Instead use setCreditCard + */ + public function setCredit_card($credit_card) { + $this->credit_card = $credit_card; + return $this; + } + /** + * Credit Card information. + * @return PayPal\Api\CreditCard + * @deprecated. Instead use getCreditCard + */ + public function getCredit_card() { + return $this->credit_card; + } + /** * Credit Card information. * @param PayPal\Api\CreditCardToken $credit_card_token */ public function setCreditCardToken($credit_card_token) { $this->credit_card_token = $credit_card_token; - } - + return $this; + } + /** * Credit Card information. * @return PayPal\Api\CreditCardToken @@ -34,5 +55,23 @@ class FundingInstrument extends \PPModel { public function getCreditCardToken() { return $this->credit_card_token; } - + + /** + * Credit Card information. + * @param PayPal\Api\CreditCardToken $credit_card_token + * @deprecated. Instead use setCreditCardToken + */ + public function setCredit_card_token($credit_card_token) { + $this->credit_card_token = $credit_card_token; + return $this; + } + /** + * Credit Card information. + * @return PayPal\Api\CreditCardToken + * @deprecated. Instead use getCreditCardToken + */ + public function getCredit_card_token() { + return $this->credit_card_token; + } + } diff --git a/lib/PayPal/Api/HyperSchema.php b/lib/PayPal/Api/HyperSchema.php index b3323e3..a09ee92 100644 --- a/lib/PayPal/Api/HyperSchema.php +++ b/lib/PayPal/Api/HyperSchema.php @@ -1,8 +1,9 @@ links = $links; - } - + return $this; + } + /** * * @return PayPal\Api\Links @@ -19,15 +21,17 @@ class HyperSchema extends \PPModel { public function getLinks() { return $this->links; } - + + /** * * @param string $fragmentResolution */ public function setFragmentResolution($fragmentResolution) { $this->fragmentResolution = $fragmentResolution; - } - + return $this; + } + /** * * @return string @@ -35,15 +39,17 @@ class HyperSchema extends \PPModel { public function getFragmentResolution() { return $this->fragmentResolution; } - + + /** * * @param boolean $readonly */ public function setReadonly($readonly) { $this->readonly = $readonly; - } - + return $this; + } + /** * * @return boolean @@ -51,15 +57,17 @@ class HyperSchema extends \PPModel { public function getReadonly() { return $this->readonly; } - + + /** * * @param string $contentEncoding */ public function setContentEncoding($contentEncoding) { $this->contentEncoding = $contentEncoding; - } - + return $this; + } + /** * * @return string @@ -67,15 +75,17 @@ class HyperSchema extends \PPModel { public function getContentEncoding() { return $this->contentEncoding; } - + + /** * * @param string $pathStart */ public function setPathStart($pathStart) { $this->pathStart = $pathStart; - } - + return $this; + } + /** * * @return string @@ -83,15 +93,17 @@ class HyperSchema extends \PPModel { public function getPathStart() { return $this->pathStart; } - + + /** * * @param string $mediaType */ public function setMediaType($mediaType) { $this->mediaType = $mediaType; - } - + return $this; + } + /** * * @return string @@ -99,5 +111,6 @@ class HyperSchema extends \PPModel { public function getMediaType() { return $this->mediaType; } - + + } diff --git a/lib/PayPal/Api/Item.php b/lib/PayPal/Api/Item.php index 5d41685..4a40632 100644 --- a/lib/PayPal/Api/Item.php +++ b/lib/PayPal/Api/Item.php @@ -1,16 +1,18 @@ quantity = $quantity; - } - + return $this; + } + /** * Number of items. * @return string @@ -18,15 +20,17 @@ class Item extends \PPModel { public function getQuantity() { return $this->quantity; } - + + /** * Name of the item. * @param string $name */ public function setName($name) { $this->name = $name; - } - + return $this; + } + /** * Name of the item. * @return string @@ -34,15 +38,17 @@ class Item extends \PPModel { public function getName() { return $this->name; } - + + /** * Cost of the item. * @param string $price */ public function setPrice($price) { $this->price = $price; - } - + return $this; + } + /** * Cost of the item. * @return string @@ -50,15 +56,17 @@ class Item extends \PPModel { public function getPrice() { return $this->price; } - + + /** * 3-letter Currency Code * @param string $currency */ public function setCurrency($currency) { $this->currency = $currency; - } - + return $this; + } + /** * 3-letter Currency Code * @return string @@ -66,15 +74,17 @@ class Item extends \PPModel { public function getCurrency() { return $this->currency; } - + + /** * Number or code to identify the item in your catalog/records. * @param string $sku */ public function setSku($sku) { $this->sku = $sku; - } - + return $this; + } + /** * Number or code to identify the item in your catalog/records. * @return string @@ -82,5 +92,6 @@ class Item extends \PPModel { public function getSku() { return $this->sku; } - + + } diff --git a/lib/PayPal/Api/ItemList.php b/lib/PayPal/Api/ItemList.php index 1181c0b..ea38da6 100644 --- a/lib/PayPal/Api/ItemList.php +++ b/lib/PayPal/Api/ItemList.php @@ -1,8 +1,9 @@ items = $items; - } - + return $this; + } + /** * List of items. * @return PayPal\Api\Item @@ -19,15 +21,17 @@ class ItemList extends \PPModel { public function getItems() { return $this->items; } - + + /** * Shipping address. * @param PayPal\Api\ShippingAddress $shipping_address */ public function setShippingAddress($shipping_address) { $this->shipping_address = $shipping_address; - } - + return $this; + } + /** * Shipping address. * @return PayPal\Api\ShippingAddress @@ -35,5 +39,23 @@ class ItemList extends \PPModel { public function getShippingAddress() { return $this->shipping_address; } - + + /** + * Shipping address. + * @param PayPal\Api\ShippingAddress $shipping_address + * @deprecated. Instead use setShippingAddress + */ + public function setShipping_address($shipping_address) { + $this->shipping_address = $shipping_address; + return $this; + } + /** + * Shipping address. + * @return PayPal\Api\ShippingAddress + * @deprecated. Instead use getShippingAddress + */ + public function getShipping_address() { + return $this->shipping_address; + } + } diff --git a/lib/PayPal/Api/Links.php b/lib/PayPal/Api/Links.php index 3f2408d..9cbd85e 100644 --- a/lib/PayPal/Api/Links.php +++ b/lib/PayPal/Api/Links.php @@ -1,16 +1,18 @@ href = $href; - } - + return $this; + } + /** * * @return string @@ -18,15 +20,17 @@ class Links extends \PPModel { public function getHref() { return $this->href; } - + + /** * * @param string $rel */ public function setRel($rel) { $this->rel = $rel; - } - + return $this; + } + /** * * @return string @@ -34,15 +38,17 @@ class Links extends \PPModel { public function getRel() { return $this->rel; } - + + /** * * @param PayPal\Api\HyperSchema $targetSchema */ public function setTargetSchema($targetSchema) { $this->targetSchema = $targetSchema; - } - + return $this; + } + /** * * @return PayPal\Api\HyperSchema @@ -50,15 +56,17 @@ class Links extends \PPModel { public function getTargetSchema() { return $this->targetSchema; } - + + /** * * @param string $method */ public function setMethod($method) { $this->method = $method; - } - + return $this; + } + /** * * @return string @@ -66,15 +74,17 @@ class Links extends \PPModel { public function getMethod() { return $this->method; } - + + /** * * @param string $enctype */ public function setEnctype($enctype) { $this->enctype = $enctype; - } - + return $this; + } + /** * * @return string @@ -82,15 +92,17 @@ class Links extends \PPModel { public function getEnctype() { return $this->enctype; } - + + /** * * @param PayPal\Api\HyperSchema $schema */ public function setSchema($schema) { $this->schema = $schema; - } - + return $this; + } + /** * * @return PayPal\Api\HyperSchema @@ -98,5 +110,6 @@ class Links extends \PPModel { public function getSchema() { return $this->schema; } - + + } diff --git a/lib/PayPal/Api/Payee.php b/lib/PayPal/Api/Payee.php index 18188b1..d0ccea3 100644 --- a/lib/PayPal/Api/Payee.php +++ b/lib/PayPal/Api/Payee.php @@ -1,16 +1,18 @@ email = $email; - } - + return $this; + } + /** * Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements. * @return string @@ -18,15 +20,17 @@ class Payee extends \PPModel { public function getEmail() { return $this->email; } - + + /** * Encrypted PayPal Account identifier for the Payee. * @param string $merchant_id */ public function setMerchantId($merchant_id) { $this->merchant_id = $merchant_id; - } - + return $this; + } + /** * Encrypted PayPal Account identifier for the Payee. * @return string @@ -34,15 +38,34 @@ class Payee extends \PPModel { public function getMerchantId() { return $this->merchant_id; } - + + /** + * Encrypted PayPal Account identifier for the Payee. + * @param string $merchant_id + * @deprecated. Instead use setMerchantId + */ + public function setMerchant_id($merchant_id) { + $this->merchant_id = $merchant_id; + return $this; + } + /** + * Encrypted PayPal Account identifier for the Payee. + * @return string + * @deprecated. Instead use getMerchantId + */ + public function getMerchant_id() { + return $this->merchant_id; + } + /** * Phone number (in E.123 format) associated with the Payee's PayPal Account. If the provided phont number is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements. * @param string $phone */ public function setPhone($phone) { $this->phone = $phone; - } - + return $this; + } + /** * Phone number (in E.123 format) associated with the Payee's PayPal Account. If the provided phont number is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements. * @return string @@ -50,5 +73,6 @@ class Payee extends \PPModel { public function getPhone() { return $this->phone; } - + + } diff --git a/lib/PayPal/Api/Payer.php b/lib/PayPal/Api/Payer.php index 16d91e8..d21d238 100644 --- a/lib/PayPal/Api/Payer.php +++ b/lib/PayPal/Api/Payer.php @@ -1,16 +1,18 @@ payment_method = $payment_method; - } - + return $this; + } + /** * Payment method being used - PayPal Wallet payment or Direct Credit card. * @return string @@ -18,7 +20,25 @@ class Payer extends \PPModel { public function getPaymentMethod() { return $this->payment_method; } - + + /** + * Payment method being used - PayPal Wallet payment or Direct Credit card. + * @param string $payment_method + * @deprecated. Instead use setPaymentMethod + */ + public function setPayment_method($payment_method) { + $this->payment_method = $payment_method; + return $this; + } + /** + * Payment method being used - PayPal Wallet payment or Direct Credit card. + * @return string + * @deprecated. Instead use getPaymentMethod + */ + public function getPayment_method() { + return $this->payment_method; + } + /** * List of funding instruments from where the funds of the current payment come from. Typically a credit card. * @array @@ -26,8 +46,9 @@ class Payer extends \PPModel { */ public function setFundingInstruments($funding_instruments) { $this->funding_instruments = $funding_instruments; - } - + return $this; + } + /** * List of funding instruments from where the funds of the current payment come from. Typically a credit card. * @return PayPal\Api\FundingInstrument @@ -35,15 +56,35 @@ class Payer extends \PPModel { public function getFundingInstruments() { return $this->funding_instruments; } - + + /** + * List of funding instruments from where the funds of the current payment come from. Typically a credit card. + * @array + * @param PayPal\Api\FundingInstrument $funding_instruments + * @deprecated. Instead use setFundingInstruments + */ + public function setFunding_instruments($funding_instruments) { + $this->funding_instruments = $funding_instruments; + return $this; + } + /** + * List of funding instruments from where the funds of the current payment come from. Typically a credit card. + * @return PayPal\Api\FundingInstrument + * @deprecated. Instead use getFundingInstruments + */ + public function getFunding_instruments() { + return $this->funding_instruments; + } + /** * Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet. * @param PayPal\Api\PayerInfo $payer_info */ public function setPayerInfo($payer_info) { $this->payer_info = $payer_info; - } - + return $this; + } + /** * Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet. * @return PayPal\Api\PayerInfo @@ -51,5 +92,23 @@ class Payer extends \PPModel { public function getPayerInfo() { return $this->payer_info; } - + + /** + * Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet. + * @param PayPal\Api\PayerInfo $payer_info + * @deprecated. Instead use setPayerInfo + */ + public function setPayer_info($payer_info) { + $this->payer_info = $payer_info; + return $this; + } + /** + * Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet. + * @return PayPal\Api\PayerInfo + * @deprecated. Instead use getPayerInfo + */ + public function getPayer_info() { + return $this->payer_info; + } + } diff --git a/lib/PayPal/Api/PayerInfo.php b/lib/PayPal/Api/PayerInfo.php index 3c9ef9d..a9ff596 100644 --- a/lib/PayPal/Api/PayerInfo.php +++ b/lib/PayPal/Api/PayerInfo.php @@ -1,16 +1,18 @@ email = $email; - } - + return $this; + } + /** * Email address representing the Payer. * @return string @@ -18,15 +20,17 @@ class PayerInfo extends \PPModel { public function getEmail() { return $this->email; } - + + /** * First Name of the Payer from their PayPal Account. * @param string $first_name */ public function setFirstName($first_name) { $this->first_name = $first_name; - } - + return $this; + } + /** * First Name of the Payer from their PayPal Account. * @return string @@ -34,15 +38,34 @@ class PayerInfo extends \PPModel { public function getFirstName() { return $this->first_name; } - + + /** + * First Name of the Payer from their PayPal Account. + * @param string $first_name + * @deprecated. Instead use setFirstName + */ + public function setFirst_name($first_name) { + $this->first_name = $first_name; + return $this; + } + /** + * First Name of the Payer from their PayPal Account. + * @return string + * @deprecated. Instead use getFirstName + */ + public function getFirst_name() { + return $this->first_name; + } + /** * Last Name of the Payer from their PayPal Account. * @param string $last_name */ public function setLastName($last_name) { $this->last_name = $last_name; - } - + return $this; + } + /** * Last Name of the Payer from their PayPal Account. * @return string @@ -50,15 +73,34 @@ class PayerInfo extends \PPModel { public function getLastName() { return $this->last_name; } - + + /** + * Last Name of the Payer from their PayPal Account. + * @param string $last_name + * @deprecated. Instead use setLastName + */ + public function setLast_name($last_name) { + $this->last_name = $last_name; + return $this; + } + /** + * Last Name of the Payer from their PayPal Account. + * @return string + * @deprecated. Instead use getLastName + */ + public function getLast_name() { + return $this->last_name; + } + /** * PayPal assigned Payer ID. * @param string $payer_id */ public function setPayerId($payer_id) { $this->payer_id = $payer_id; - } - + return $this; + } + /** * PayPal assigned Payer ID. * @return string @@ -66,15 +108,34 @@ class PayerInfo extends \PPModel { public function getPayerId() { return $this->payer_id; } - + + /** + * PayPal assigned Payer ID. + * @param string $payer_id + * @deprecated. Instead use setPayerId + */ + public function setPayer_id($payer_id) { + $this->payer_id = $payer_id; + return $this; + } + /** + * PayPal assigned Payer ID. + * @return string + * @deprecated. Instead use getPayerId + */ + public function getPayer_id() { + return $this->payer_id; + } + /** * Phone number representing the Payer. * @param string $phone */ public function setPhone($phone) { $this->phone = $phone; - } - + return $this; + } + /** * Phone number representing the Payer. * @return string @@ -82,15 +143,17 @@ class PayerInfo extends \PPModel { public function getPhone() { return $this->phone; } - + + /** * Shipping address of the Payer from their PayPal Account. * @param PayPal\Api\Address $shipping_address */ public function setShippingAddress($shipping_address) { $this->shipping_address = $shipping_address; - } - + return $this; + } + /** * Shipping address of the Payer from their PayPal Account. * @return PayPal\Api\Address @@ -98,5 +161,23 @@ class PayerInfo extends \PPModel { public function getShippingAddress() { return $this->shipping_address; } - + + /** + * Shipping address of the Payer from their PayPal Account. + * @param PayPal\Api\Address $shipping_address + * @deprecated. Instead use setShippingAddress + */ + public function setShipping_address($shipping_address) { + $this->shipping_address = $shipping_address; + return $this; + } + /** + * Shipping address of the Payer from their PayPal Account. + * @return PayPal\Api\Address + * @deprecated. Instead use getShippingAddress + */ + public function getShipping_address() { + return $this->shipping_address; + } + } diff --git a/lib/PayPal/Api/Payment.php b/lib/PayPal/Api/Payment.php index eaef50b..cf223f0 100644 --- a/lib/PayPal/Api/Payment.php +++ b/lib/PayPal/Api/Payment.php @@ -1,30 +1,35 @@ id = $id; - } - + return $this; + } + /** * Identifier of the payment resource created. * @return string @@ -32,15 +37,17 @@ class Payment extends \PPModel implements IResource { public function getId() { return $this->id; } - + + /** * Time the resource was created. * @param string $create_time */ public function setCreateTime($create_time) { $this->create_time = $create_time; - } - + return $this; + } + /** * Time the resource was created. * @return string @@ -48,15 +55,34 @@ class Payment extends \PPModel implements IResource { public function getCreateTime() { return $this->create_time; } - + + /** + * Time the resource was created. + * @param string $create_time + * @deprecated. Instead use setCreateTime + */ + public function setCreate_time($create_time) { + $this->create_time = $create_time; + return $this; + } + /** + * Time the resource was created. + * @return string + * @deprecated. Instead use getCreateTime + */ + public function getCreate_time() { + return $this->create_time; + } + /** * Time the resource was last updated. * @param string $update_time */ public function setUpdateTime($update_time) { $this->update_time = $update_time; - } - + return $this; + } + /** * Time the resource was last updated. * @return string @@ -64,15 +90,34 @@ class Payment extends \PPModel implements IResource { public function getUpdateTime() { return $this->update_time; } - + + /** + * Time the resource was last updated. + * @param string $update_time + * @deprecated. Instead use setUpdateTime + */ + public function setUpdate_time($update_time) { + $this->update_time = $update_time; + return $this; + } + /** + * Time the resource was last updated. + * @return string + * @deprecated. Instead use getUpdateTime + */ + public function getUpdate_time() { + return $this->update_time; + } + /** * Intent of the payment - Sale or Authorization or Order. * @param string $intent */ public function setIntent($intent) { $this->intent = $intent; - } - + return $this; + } + /** * Intent of the payment - Sale or Authorization or Order. * @return string @@ -80,15 +125,17 @@ class Payment extends \PPModel implements IResource { public function getIntent() { return $this->intent; } - + + /** * Source of the funds for this payment represented by a PayPal account or a direct credit card. * @param PayPal\Api\Payer $payer */ public function setPayer($payer) { $this->payer = $payer; - } - + return $this; + } + /** * Source of the funds for this payment represented by a PayPal account or a direct credit card. * @return PayPal\Api\Payer @@ -96,7 +143,8 @@ class Payment extends \PPModel implements IResource { public function getPayer() { return $this->payer; } - + + /** * A payment can have more than one transaction, with each transaction establishing a contract between the payer and a payee * @array @@ -104,8 +152,9 @@ class Payment extends \PPModel implements IResource { */ public function setTransactions($transactions) { $this->transactions = $transactions; - } - + return $this; + } + /** * A payment can have more than one transaction, with each transaction establishing a contract between the payer and a payee * @return PayPal\Api\Transaction @@ -113,15 +162,17 @@ class Payment extends \PPModel implements IResource { public function getTransactions() { return $this->transactions; } - + + /** * state of the payment * @param string $state */ public function setState($state) { $this->state = $state; - } - + return $this; + } + /** * state of the payment * @return string @@ -129,15 +180,17 @@ class Payment extends \PPModel implements IResource { public function getState() { return $this->state; } - + + /** * Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls. * @param PayPal\Api\RedirectUrls $redirect_urls */ public function setRedirectUrls($redirect_urls) { $this->redirect_urls = $redirect_urls; - } - + return $this; + } + /** * Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls. * @return PayPal\Api\RedirectUrls @@ -145,7 +198,25 @@ class Payment extends \PPModel implements IResource { public function getRedirectUrls() { return $this->redirect_urls; } - + + /** + * Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls. + * @param PayPal\Api\RedirectUrls $redirect_urls + * @deprecated. Instead use setRedirectUrls + */ + public function setRedirect_urls($redirect_urls) { + $this->redirect_urls = $redirect_urls; + return $this; + } + /** + * Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls. + * @return PayPal\Api\RedirectUrls + * @deprecated. Instead use getRedirectUrls + */ + public function getRedirect_urls() { + return $this->redirect_urls; + } + /** * * @array @@ -153,8 +224,9 @@ class Payment extends \PPModel implements IResource { */ public function setLinks($links) { $this->links = $links; - } - + return $this; + } + /** * * @return PayPal\Api\Links @@ -162,14 +234,15 @@ class Payment extends \PPModel implements IResource { public function getLinks() { return $this->links; } - + + public function create($apiContext = null) { $payLoad = $this->toJSON(); if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $call = new PPRestCall($apiContext); $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment", "POST", $payLoad); $this->fromJson($json); return $this; @@ -183,7 +256,7 @@ class Payment extends \PPModel implements IResource { if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $call = new PPRestCall($apiContext); $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment/$paymentId", "GET", $payLoad); $ret = new Payment(); $ret->fromJson($json); @@ -201,7 +274,7 @@ class Payment extends \PPModel implements IResource { if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $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); @@ -217,7 +290,7 @@ class Payment extends \PPModel implements IResource { if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $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); diff --git a/lib/PayPal/Api/PaymentExecution.php b/lib/PayPal/Api/PaymentExecution.php index 785d1e6..b7048eb 100644 --- a/lib/PayPal/Api/PaymentExecution.php +++ b/lib/PayPal/Api/PaymentExecution.php @@ -1,16 +1,18 @@ payer_id = $payer_id; - } - + return $this; + } + /** * PayPal assigned Payer ID returned in the approval return url. * @return string @@ -18,7 +20,25 @@ class PaymentExecution extends \PPModel { public function getPayerId() { return $this->payer_id; } - + + /** + * PayPal assigned Payer ID returned in the approval return url. + * @param string $payer_id + * @deprecated. Instead use setPayerId + */ + public function setPayer_id($payer_id) { + $this->payer_id = $payer_id; + return $this; + } + /** + * PayPal assigned Payer ID returned in the approval return url. + * @return string + * @deprecated. Instead use getPayerId + */ + public function getPayer_id() { + return $this->payer_id; + } + /** * If the amount needs to be updated after obtaining the PayPal Payer info (eg. shipping address), it can be updated using this element. * @array @@ -26,8 +46,9 @@ class PaymentExecution extends \PPModel { */ public function setTransactions($transactions) { $this->transactions = $transactions; - } - + return $this; + } + /** * If the amount needs to be updated after obtaining the PayPal Payer info (eg. shipping address), it can be updated using this element. * @return PayPal\Api\Transactions @@ -35,5 +56,6 @@ class PaymentExecution extends \PPModel { public function getTransactions() { return $this->transactions; } - + + } diff --git a/lib/PayPal/Api/PaymentHistory.php b/lib/PayPal/Api/PaymentHistory.php index 1b3f1df..e9f28af 100644 --- a/lib/PayPal/Api/PaymentHistory.php +++ b/lib/PayPal/Api/PaymentHistory.php @@ -1,8 +1,9 @@ payments = $payments; - } - + return $this; + } + /** * A list of Payment resources * @return PayPal\Api\Payment @@ -19,15 +21,17 @@ class PaymentHistory extends \PPModel { public function getPayments() { return $this->payments; } - + + /** * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. * @param integer $count */ public function setCount($count) { $this->count = $count; - } - + return $this; + } + /** * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. * @return integer @@ -35,15 +39,17 @@ class PaymentHistory extends \PPModel { public function getCount() { return $this->count; } - + + /** * Identifier of the next element to get the next range of results. * @param string $next_id */ public function setNextId($next_id) { $this->next_id = $next_id; - } - + return $this; + } + /** * Identifier of the next element to get the next range of results. * @return string @@ -51,5 +57,23 @@ class PaymentHistory extends \PPModel { public function getNextId() { return $this->next_id; } - + + /** + * Identifier of the next element to get the next range of results. + * @param string $next_id + * @deprecated. Instead use setNextId + */ + public function setNext_id($next_id) { + $this->next_id = $next_id; + return $this; + } + /** + * Identifier of the next element to get the next range of results. + * @return string + * @deprecated. Instead use getNextId + */ + public function getNext_id() { + return $this->next_id; + } + } diff --git a/lib/PayPal/Api/RedirectUrls.php b/lib/PayPal/Api/RedirectUrls.php index 902f7c7..c954b49 100644 --- a/lib/PayPal/Api/RedirectUrls.php +++ b/lib/PayPal/Api/RedirectUrls.php @@ -1,16 +1,18 @@ return_url = $return_url; - } - + return $this; + } + /** * Url where the payer would be redirected to after approving the payment. * @return string @@ -18,15 +20,34 @@ class RedirectUrls extends \PPModel { public function getReturnUrl() { return $this->return_url; } - + + /** + * Url where the payer would be redirected to after approving the payment. + * @param string $return_url + * @deprecated. Instead use setReturnUrl + */ + public function setReturn_url($return_url) { + $this->return_url = $return_url; + return $this; + } + /** + * Url where the payer would be redirected to after approving the payment. + * @return string + * @deprecated. Instead use getReturnUrl + */ + public function getReturn_url() { + return $this->return_url; + } + /** * Url where the payer would be redirected to after canceling the payment. * @param string $cancel_url */ public function setCancelUrl($cancel_url) { $this->cancel_url = $cancel_url; - } - + return $this; + } + /** * Url where the payer would be redirected to after canceling the payment. * @return string @@ -34,5 +55,23 @@ class RedirectUrls extends \PPModel { public function getCancelUrl() { return $this->cancel_url; } - + + /** + * Url where the payer would be redirected to after canceling the payment. + * @param string $cancel_url + * @deprecated. Instead use setCancelUrl + */ + public function setCancel_url($cancel_url) { + $this->cancel_url = $cancel_url; + return $this; + } + /** + * Url where the payer would be redirected to after canceling the payment. + * @return string + * @deprecated. Instead use getCancelUrl + */ + public function getCancel_url() { + return $this->cancel_url; + } + } diff --git a/lib/PayPal/Api/Refund.php b/lib/PayPal/Api/Refund.php index 8728688..095200a 100644 --- a/lib/PayPal/Api/Refund.php +++ b/lib/PayPal/Api/Refund.php @@ -1,30 +1,34 @@ id = $id; - } - + return $this; + } + /** * Identifier of the refund transaction. * @return string @@ -32,15 +36,17 @@ class Refund extends \PPModel implements IResource { public function getId() { return $this->id; } - + + /** * Time the resource was created. * @param string $create_time */ public function setCreateTime($create_time) { $this->create_time = $create_time; - } - + return $this; + } + /** * Time the resource was created. * @return string @@ -48,15 +54,34 @@ class Refund extends \PPModel implements IResource { public function getCreateTime() { return $this->create_time; } - + + /** + * Time the resource was created. + * @param string $create_time + * @deprecated. Instead use setCreateTime + */ + public function setCreate_time($create_time) { + $this->create_time = $create_time; + return $this; + } + /** + * Time the resource was created. + * @return string + * @deprecated. Instead use getCreateTime + */ + public function getCreate_time() { + return $this->create_time; + } + /** * Details including both refunded amount (to Payer) and refunded fee (to Payee).If amount is not specified, it's assumed to be full refund. * @param PayPal\Api\Amount $amount */ public function setAmount($amount) { $this->amount = $amount; - } - + return $this; + } + /** * Details including both refunded amount (to Payer) and refunded fee (to Payee).If amount is not specified, it's assumed to be full refund. * @return PayPal\Api\Amount @@ -64,15 +89,17 @@ class Refund extends \PPModel implements IResource { public function getAmount() { return $this->amount; } - + + /** * State of the refund transaction. * @param string $state */ public function setState($state) { $this->state = $state; - } - + return $this; + } + /** * State of the refund transaction. * @return string @@ -80,15 +107,17 @@ class Refund extends \PPModel implements IResource { public function getState() { return $this->state; } - + + /** * ID of the Sale transaction being refunded. * @param string $sale_id */ public function setSaleId($sale_id) { $this->sale_id = $sale_id; - } - + return $this; + } + /** * ID of the Sale transaction being refunded. * @return string @@ -96,15 +125,34 @@ class Refund extends \PPModel implements IResource { public function getSaleId() { return $this->sale_id; } - + + /** + * ID of the Sale transaction being refunded. + * @param string $sale_id + * @deprecated. Instead use setSaleId + */ + public function setSale_id($sale_id) { + $this->sale_id = $sale_id; + return $this; + } + /** + * ID of the Sale transaction being refunded. + * @return string + * @deprecated. Instead use getSaleId + */ + public function getSale_id() { + return $this->sale_id; + } + /** * ID of the Capture transaction being refunded. * @param string $capture_id */ public function setCaptureId($capture_id) { $this->capture_id = $capture_id; - } - + return $this; + } + /** * ID of the Capture transaction being refunded. * @return string @@ -112,15 +160,34 @@ class Refund extends \PPModel implements IResource { public function getCaptureId() { return $this->capture_id; } - + + /** + * ID of the Capture transaction being refunded. + * @param string $capture_id + * @deprecated. Instead use setCaptureId + */ + public function setCapture_id($capture_id) { + $this->capture_id = $capture_id; + return $this; + } + /** + * ID of the Capture transaction being refunded. + * @return string + * @deprecated. Instead use getCaptureId + */ + public function getCapture_id() { + return $this->capture_id; + } + /** * ID of the Payment resource that this transaction is based on. * @param string $parent_payment */ public function setParentPayment($parent_payment) { $this->parent_payment = $parent_payment; - } - + return $this; + } + /** * ID of the Payment resource that this transaction is based on. * @return string @@ -128,7 +195,25 @@ class Refund extends \PPModel implements IResource { public function getParentPayment() { return $this->parent_payment; } - + + /** + * ID of the Payment resource that this transaction is based on. + * @param string $parent_payment + * @deprecated. Instead use setParentPayment + */ + public function setParent_payment($parent_payment) { + $this->parent_payment = $parent_payment; + return $this; + } + /** + * ID of the Payment resource that this transaction is based on. + * @return string + * @deprecated. Instead use getParentPayment + */ + public function getParent_payment() { + return $this->parent_payment; + } + /** * * @array @@ -136,8 +221,9 @@ class Refund extends \PPModel implements IResource { */ public function setLinks($links) { $this->links = $links; - } - + return $this; + } + /** * * @return PayPal\Api\Links @@ -145,7 +231,8 @@ class Refund extends \PPModel implements IResource { public function getLinks() { return $this->links; } - + + public static function get($refundId, $apiContext = null) { if (($refundId == null) || (strlen($refundId) <= 0)) { @@ -155,7 +242,7 @@ class Refund extends \PPModel implements IResource { if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $call = new PPRestCall($apiContext); $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/refund/$refundId", "GET", $payLoad); $ret = new Refund(); $ret->fromJson($json); diff --git a/lib/PayPal/Api/RelatedResources.php b/lib/PayPal/Api/RelatedResources.php index f8e4fef..7e97776 100644 --- a/lib/PayPal/Api/RelatedResources.php +++ b/lib/PayPal/Api/RelatedResources.php @@ -1,16 +1,18 @@ sale = $sale; - } - + return $this; + } + /** * A sale transaction * @return PayPal\Api\Sale @@ -18,15 +20,17 @@ class RelatedResources extends \PPModel { public function getSale() { return $this->sale; } - + + /** * An authorization transaction * @param PayPal\Api\Authorization $authorization */ public function setAuthorization($authorization) { $this->authorization = $authorization; - } - + return $this; + } + /** * An authorization transaction * @return PayPal\Api\Authorization @@ -34,15 +38,17 @@ class RelatedResources extends \PPModel { public function getAuthorization() { return $this->authorization; } - + + /** * A capture transaction * @param PayPal\Api\Capture $capture */ public function setCapture($capture) { $this->capture = $capture; - } - + return $this; + } + /** * A capture transaction * @return PayPal\Api\Capture @@ -50,15 +56,17 @@ class RelatedResources extends \PPModel { public function getCapture() { return $this->capture; } - + + /** * A refund transaction * @param PayPal\Api\Refund $refund */ public function setRefund($refund) { $this->refund = $refund; - } - + return $this; + } + /** * A refund transaction * @return PayPal\Api\Refund @@ -66,5 +74,6 @@ class RelatedResources extends \PPModel { public function getRefund() { return $this->refund; } - + + } diff --git a/lib/PayPal/Api/Sale.php b/lib/PayPal/Api/Sale.php index 31bea57..5fb1284 100644 --- a/lib/PayPal/Api/Sale.php +++ b/lib/PayPal/Api/Sale.php @@ -1,30 +1,35 @@ id = $id; - } - + return $this; + } + /** * Identifier of the authorization transaction. * @return string @@ -32,15 +37,17 @@ class Sale extends \PPModel implements IResource { public function getId() { return $this->id; } - + + /** * Time the resource was created. * @param string $create_time */ public function setCreateTime($create_time) { $this->create_time = $create_time; - } - + return $this; + } + /** * Time the resource was created. * @return string @@ -48,15 +55,34 @@ class Sale extends \PPModel implements IResource { public function getCreateTime() { return $this->create_time; } - + + /** + * Time the resource was created. + * @param string $create_time + * @deprecated. Instead use setCreateTime + */ + public function setCreate_time($create_time) { + $this->create_time = $create_time; + return $this; + } + /** + * Time the resource was created. + * @return string + * @deprecated. Instead use getCreateTime + */ + public function getCreate_time() { + return $this->create_time; + } + /** * Time the resource was last updated. * @param string $update_time */ public function setUpdateTime($update_time) { $this->update_time = $update_time; - } - + return $this; + } + /** * Time the resource was last updated. * @return string @@ -64,15 +90,34 @@ class Sale extends \PPModel implements IResource { public function getUpdateTime() { return $this->update_time; } - + + /** + * Time the resource was last updated. + * @param string $update_time + * @deprecated. Instead use setUpdateTime + */ + public function setUpdate_time($update_time) { + $this->update_time = $update_time; + return $this; + } + /** + * Time the resource was last updated. + * @return string + * @deprecated. Instead use getUpdateTime + */ + public function getUpdate_time() { + return $this->update_time; + } + /** * Amount being collected. * @param PayPal\Api\Amount $amount */ public function setAmount($amount) { $this->amount = $amount; - } - + return $this; + } + /** * Amount being collected. * @return PayPal\Api\Amount @@ -80,15 +125,17 @@ class Sale extends \PPModel implements IResource { public function getAmount() { return $this->amount; } - + + /** * State of the sale transaction. * @param string $state */ public function setState($state) { $this->state = $state; - } - + return $this; + } + /** * State of the sale transaction. * @return string @@ -96,15 +143,17 @@ class Sale extends \PPModel implements IResource { public function getState() { return $this->state; } - + + /** * ID of the Payment resource that this transaction is based on. * @param string $parent_payment */ public function setParentPayment($parent_payment) { $this->parent_payment = $parent_payment; - } - + return $this; + } + /** * ID of the Payment resource that this transaction is based on. * @return string @@ -112,7 +161,25 @@ class Sale extends \PPModel implements IResource { public function getParentPayment() { return $this->parent_payment; } - + + /** + * ID of the Payment resource that this transaction is based on. + * @param string $parent_payment + * @deprecated. Instead use setParentPayment + */ + public function setParent_payment($parent_payment) { + $this->parent_payment = $parent_payment; + return $this; + } + /** + * ID of the Payment resource that this transaction is based on. + * @return string + * @deprecated. Instead use getParentPayment + */ + public function getParent_payment() { + return $this->parent_payment; + } + /** * * @array @@ -120,8 +187,9 @@ class Sale extends \PPModel implements IResource { */ public function setLinks($links) { $this->links = $links; - } - + return $this; + } + /** * * @return PayPal\Api\Links @@ -129,7 +197,8 @@ class Sale extends \PPModel implements IResource { public function getLinks() { return $this->links; } - + + public static function get($saleId, $apiContext = null) { if (($saleId == null) || (strlen($saleId) <= 0)) { @@ -139,7 +208,7 @@ class Sale extends \PPModel implements IResource { if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $call = new PPRestCall($apiContext); $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/sale/$saleId", "GET", $payLoad); $ret = new Sale(); $ret->fromJson($json); @@ -157,7 +226,7 @@ class Sale extends \PPModel implements IResource { if ($apiContext == null) { $apiContext = new ApiContext(self::$credential); } - $call = new \PPRestCall($apiContext); + $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); diff --git a/lib/PayPal/Api/ShippingAddress.php b/lib/PayPal/Api/ShippingAddress.php index dc42e7f..a7f4de9 100644 --- a/lib/PayPal/Api/ShippingAddress.php +++ b/lib/PayPal/Api/ShippingAddress.php @@ -1,6 +1,7 @@ recipient_name = $recipient_name; - } - + return $this; + } + /** * Name of the recipient at this address. * @return string @@ -18,5 +20,23 @@ class ShippingAddress extends Address { public function getRecipientName() { return $this->recipient_name; } - + + /** + * Name of the recipient at this address. + * @param string $recipient_name + * @deprecated. Instead use setRecipientName + */ + public function setRecipient_name($recipient_name) { + $this->recipient_name = $recipient_name; + return $this; + } + /** + * Name of the recipient at this address. + * @return string + * @deprecated. Instead use getRecipientName + */ + public function getRecipient_name() { + return $this->recipient_name; + } + } diff --git a/lib/PayPal/Api/Transaction.php b/lib/PayPal/Api/Transaction.php index dd64b00..d8420aa 100644 --- a/lib/PayPal/Api/Transaction.php +++ b/lib/PayPal/Api/Transaction.php @@ -1,16 +1,18 @@ amount = $amount; - } - + return $this; + } + /** * Amount being collected. * @return PayPal\Api\Amount @@ -18,15 +20,17 @@ class Transaction extends \PPModel { public function getAmount() { return $this->amount; } - + + /** * Recepient of the funds in this transaction. * @param PayPal\Api\Payee $payee */ public function setPayee($payee) { $this->payee = $payee; - } - + return $this; + } + /** * Recepient of the funds in this transaction. * @return PayPal\Api\Payee @@ -34,15 +38,17 @@ class Transaction extends \PPModel { public function getPayee() { return $this->payee; } - + + /** * Description of what is being paid for. * @param string $description */ public function setDescription($description) { $this->description = $description; - } - + return $this; + } + /** * Description of what is being paid for. * @return string @@ -50,15 +56,17 @@ class Transaction extends \PPModel { public function getDescription() { return $this->description; } - + + /** * List of items being paid for. * @param PayPal\Api\ItemList $item_list */ public function setItemList($item_list) { $this->item_list = $item_list; - } - + return $this; + } + /** * List of items being paid for. * @return PayPal\Api\ItemList @@ -66,7 +74,25 @@ class Transaction extends \PPModel { public function getItemList() { return $this->item_list; } - + + /** + * List of items being paid for. + * @param PayPal\Api\ItemList $item_list + * @deprecated. Instead use setItemList + */ + public function setItem_list($item_list) { + $this->item_list = $item_list; + return $this; + } + /** + * List of items being paid for. + * @return PayPal\Api\ItemList + * @deprecated. Instead use getItemList + */ + public function getItem_list() { + return $this->item_list; + } + /** * List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment. * @array @@ -74,8 +100,9 @@ class Transaction extends \PPModel { */ 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 @@ -83,7 +110,26 @@ class Transaction extends \PPModel { public function getRelatedResources() { return $this->related_resources; } - + + /** + * List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment. + * @array + * @param PayPal\Api\RelatedResources $related_resources + * @deprecated. Instead use setRelatedResources + */ + public function setRelated_resources($related_resources) { + $this->related_resources = $related_resources; + return $this; + } + /** + * List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment. + * @return PayPal\Api\RelatedResources + * @deprecated. Instead use getRelatedResources + */ + public function getRelated_resources() { + return $this->related_resources; + } + /** * Additional transactions for complex payment (Parallel and Chained) scenarios. * @array @@ -91,8 +137,9 @@ class Transaction extends \PPModel { */ public function setTransactions($transactions) { $this->transactions = $transactions; - } - + return $this; + } + /** * Additional transactions for complex payment (Parallel and Chained) scenarios. * @return PayPal\Api\self @@ -100,5 +147,6 @@ class Transaction extends \PPModel { public function getTransactions() { return $this->transactions; } - + + } diff --git a/lib/PayPal/Api/Transactions.php b/lib/PayPal/Api/Transactions.php index 3a01e14..2219837 100644 --- a/lib/PayPal/Api/Transactions.php +++ b/lib/PayPal/Api/Transactions.php @@ -1,16 +1,18 @@ amount = $amount; - } - + return $this; + } + /** * Amount being collected. * @return PayPal\Api\Amount @@ -18,5 +20,6 @@ class Transactions extends \PPModel { public function getAmount() { return $this->amount; } - + + } diff --git a/lib/PayPal/Auth/OAuthTokenCredential.php b/lib/PayPal/Auth/OAuthTokenCredential.php index 022c05e..8b4d4e6 100644 --- a/lib/PayPal/Auth/OAuthTokenCredential.php +++ b/lib/PayPal/Auth/OAuthTokenCredential.php @@ -7,8 +7,12 @@ namespace PayPal\Auth; * */ use PayPal\Rest\RestHandler; - -use PayPal\Common\UserAgent; +use PayPal\Common\PPUserAgent; +use PayPal\Core\PPLoggingManager; +use PayPal\Core\PPConstants; +use PayPal\Core\PPHttpConfig; +use PayPal\Core\PPConnectionManager; +use PayPal\Exception\PPConfigurationException; class OAuthTokenCredential { @@ -57,7 +61,7 @@ class OAuthTokenCredential { */ public function getAccessToken($config) { - $this->logger = new \PPLoggingManager(__CLASS__, $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 @@ -81,14 +85,14 @@ class OAuthTokenCredential { $base64ClientID = base64_encode($this->clientId . ":" . $this->clientSecret); $headers = array( - "User-Agent" => \PPUserAgent::getValue(RestHandler::$sdkName, RestHandler::$sdkVersion), + "User-Agent" => PPUserAgent::getValue(RestHandler::$sdkName, RestHandler::$sdkVersion), "Authorization" => "Basic " . $base64ClientID, "Accept" => "*/*" ); $httpConfiguration = $this->getOAuthHttpConfiguration($config); $httpConfiguration->setHeaders($headers); - $connection = \PPConnectionManager::getInstance()->getConnection($httpConfiguration, $config); + $connection = PPConnectionManager::getInstance()->getConnection($httpConfiguration, $config); $res = $connection->execute("grant_type=client_credentials"); $jsonResponse = json_decode($res, true); if($jsonResponse == NULL || @@ -115,19 +119,19 @@ class OAuthTokenCredential { } else if (isset($config['mode'])) { switch (strtoupper($config['mode'])) { case 'SANDBOX': - $baseEndpoint = \PPConstants::REST_SANDBOX_ENDPOINT; + $baseEndpoint = PPConstants::REST_SANDBOX_ENDPOINT; break; case 'LIVE': - $baseEndpoint = \PPConstants::REST_LIVE_ENDPOINT; + $baseEndpoint = PPConstants::REST_LIVE_ENDPOINT; break; default: - throw new \PPConfigurationException('The mode config parameter must be set to either sandbox/live'); + throw new PPConfigurationException('The mode config parameter must be set to either sandbox/live'); } } else { - throw new \PPConfigurationException('You must set one of service.endpoint or mode parameters in your configuration'); + throw new PPConfigurationException('You must set one of service.endpoint or mode parameters in your configuration'); } $baseEndpoint = rtrim(trim($baseEndpoint), '/'); - return new \PPHttpConfig($baseEndpoint . "/v1/oauth2/token", "POST"); + return new PPHttpConfig($baseEndpoint . "/v1/oauth2/token", "POST"); } } diff --git a/lib/PayPal/Rest/ApiContext.php b/lib/PayPal/Rest/ApiContext.php index 8cf1ae9..a485897 100644 --- a/lib/PayPal/Rest/ApiContext.php +++ b/lib/PayPal/Rest/ApiContext.php @@ -1,12 +1,13 @@ getCredentialObject(); if(!is_array($credValues)) { - throw new \PPMissingCredentialException("Empty or invalid credentials passed"); + throw new PPMissingCredentialException("Empty or invalid credentials passed"); } $credential = new OAuthTokenCredential($credValues['clientId'], $credValues['clientSecret']); } if($credential == NULL || ! ($credential instanceof OAuthTokenCredential) ) { - throw new \PPInvalidCredentialException("Invalid credentials passed"); + throw new PPInvalidCredentialException("Invalid credentials passed"); } @@ -43,7 +50,7 @@ class RestHandler implements \IPPHandler { ); if(!array_key_exists("User-Agent", $httpConfig->getHeaders())) { - $httpConfig->addHeader("User-Agent", \PPUserAgent::getValue(self::$sdkName, self::$sdkVersion)); + $httpConfig->addHeader("User-Agent", PPUserAgent::getValue(self::$sdkName, self::$sdkVersion)); } if(!is_null($credential) && $credential instanceof OAuthTokenCredential) { $httpConfig->addHeader('Authorization', "Bearer " . $credential->getAccessToken($config)); @@ -60,10 +67,10 @@ class RestHandler implements \IPPHandler { } else if (isset($config['mode'])) { switch (strtoupper($config['mode'])) { case 'SANDBOX': - return \PPConstants::REST_SANDBOX_ENDPOINT; + return PPConstants::REST_SANDBOX_ENDPOINT; break; case 'LIVE': - return \PPConstants::REST_LIVE_ENDPOINT; + return PPConstants::REST_LIVE_ENDPOINT; break; default: throw new PPConfigurationException('The mode config parameter must be set to either sandbox/live'); diff --git a/sample/index.html b/sample/index.html index 280cc33..111b5a3 100644 --- a/sample/index.html +++ b/sample/index.html @@ -82,12 +82,47 @@
+ toArray());?> ++ Back + +