forked from LiveCarta/PayPal-PHP-SDK
updated stubs
This commit is contained in:
@@ -1,15 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Address extends Resource {
|
||||
|
||||
|
||||
class Address extends \PPModel {
|
||||
/**
|
||||
* Setter for line1
|
||||
* Line 1 of the Address (eg. number, street, etc).
|
||||
* @param string $line1
|
||||
*/
|
||||
public function setLine1($line1) {
|
||||
@@ -17,7 +12,7 @@ class Address extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for line1
|
||||
* Line 1 of the Address (eg. number, street, etc).
|
||||
* @return string
|
||||
*/
|
||||
public function getLine1() {
|
||||
@@ -25,7 +20,7 @@ class Address extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for line2
|
||||
* Optional line 2 of the Address (eg. suite, apt #, etc.).
|
||||
* @param string $line2
|
||||
*/
|
||||
public function setLine2($line2) {
|
||||
@@ -33,7 +28,7 @@ class Address extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for line2
|
||||
* Optional line 2 of the Address (eg. suite, apt #, etc.).
|
||||
* @return string
|
||||
*/
|
||||
public function getLine2() {
|
||||
@@ -41,7 +36,7 @@ class Address extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for city
|
||||
* City name.
|
||||
* @param string $city
|
||||
*/
|
||||
public function setCity($city) {
|
||||
@@ -49,7 +44,7 @@ class Address extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for city
|
||||
* City name.
|
||||
* @return string
|
||||
*/
|
||||
public function getCity() {
|
||||
@@ -57,7 +52,39 @@ class Address extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for state
|
||||
* 2 letter country code.
|
||||
* @param string $country_code
|
||||
*/
|
||||
public function setCountryCode($country_code) {
|
||||
$this->country_code = $country_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 letter country code.
|
||||
* @return string
|
||||
*/
|
||||
public function getCountryCode() {
|
||||
return $this->country_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code.
|
||||
* @param string $postal_code
|
||||
*/
|
||||
public function setPostalCode($postal_code) {
|
||||
$this->postal_code = $postal_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code.
|
||||
* @return string
|
||||
*/
|
||||
public function getPostalCode() {
|
||||
return $this->postal_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 letter code for US states, and the equivalent for other countries.
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
@@ -65,7 +92,7 @@ class Address extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for state
|
||||
* 2 letter code for US states, and the equivalent for other countries.
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
@@ -73,55 +100,7 @@ class Address extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for postal_code
|
||||
* @param string $postal_code
|
||||
*/
|
||||
public function setPostal_code($postal_code) {
|
||||
$this->postal_code = $postal_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for postal_code
|
||||
* @return string
|
||||
*/
|
||||
public function getPostal_code() {
|
||||
return $this->postal_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for country_code
|
||||
* @param string $country_code
|
||||
*/
|
||||
public function setCountry_code($country_code) {
|
||||
$this->country_code = $country_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for country_code
|
||||
* @return string
|
||||
*/
|
||||
public function getCountry_code() {
|
||||
return $this->country_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for type
|
||||
* @param string $type
|
||||
*/
|
||||
public function setType($type) {
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for type
|
||||
* @return string
|
||||
*/
|
||||
public function getType() {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for phone
|
||||
* Phone number in E.123 format.
|
||||
* @param string $phone
|
||||
*/
|
||||
public function setPhone($phone) {
|
||||
@@ -129,12 +108,11 @@ class Address extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for phone
|
||||
* Phone number in E.123 format.
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone() {
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,31 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Amount extends Resource {
|
||||
|
||||
|
||||
class Amount extends \PPModel {
|
||||
/**
|
||||
* Setter for total
|
||||
* @param string $total
|
||||
*/
|
||||
public function setTotal($total) {
|
||||
$this->total = $total;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for total
|
||||
* @return string
|
||||
*/
|
||||
public function getTotal() {
|
||||
return $this->total;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for currency
|
||||
* 3 letter currency code
|
||||
* @param string $currency
|
||||
*/
|
||||
public function setCurrency($currency) {
|
||||
@@ -33,7 +12,7 @@ class Amount extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for currency
|
||||
* 3 letter currency code
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency() {
|
||||
@@ -41,20 +20,35 @@ class Amount extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for details
|
||||
* @param PayPal\Api\AmountDetails $details
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total amount charged from the Payer account (or card) to Payee. In case of a refund, this is the refunded amount to the original Payer from Payee account.
|
||||
* @return string
|
||||
*/
|
||||
public function getTotal() {
|
||||
return $this->total;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional details of the payment amount.
|
||||
* @param PayPal\Api\Details $details
|
||||
*/
|
||||
public function setDetails($details) {
|
||||
$this->details = $details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for details
|
||||
* @return PayPal\Api\AmountDetails
|
||||
* Additional details of the payment amount.
|
||||
* @return PayPal\Api\Details
|
||||
*/
|
||||
public function getDetails() {
|
||||
return $this->details;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,15 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Rest\Call;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Authorization extends \PPModel implements IResource {
|
||||
|
||||
private static $credential;
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprected. Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
class Authorization extends Resource {
|
||||
|
||||
public static function setCredential($credential) {
|
||||
self::$credential = $credential;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for id
|
||||
* Identifier of the authorization transaction.
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
@@ -17,7 +26,7 @@ class Authorization extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for id
|
||||
* Identifier of the authorization transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
@@ -25,55 +34,39 @@ class Authorization extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for create_time
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
*/
|
||||
public function setCreate_time($create_time) {
|
||||
public function setCreateTime($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for create_time
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
*/
|
||||
public function getCreate_time() {
|
||||
public function getCreateTime() {
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for update_time
|
||||
* Time the resource was last updated.
|
||||
* @param string $update_time
|
||||
*/
|
||||
public function setUpdate_time($update_time) {
|
||||
public function setUpdateTime($update_time) {
|
||||
$this->update_time = $update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for update_time
|
||||
* Time the resource was last updated.
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdate_time() {
|
||||
public function getUpdateTime() {
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for state
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for state
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for amount
|
||||
* Amount being authorized for.
|
||||
* @param PayPal\Api\Amount $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
@@ -81,7 +74,7 @@ class Authorization extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for amount
|
||||
* Amount being authorized for.
|
||||
* @return PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount() {
|
||||
@@ -89,36 +82,130 @@ class Authorization extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for parent_payment
|
||||
* State of the authorization transaction.
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the authorization transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @param string $parent_payment
|
||||
*/
|
||||
public function setParent_payment($parent_payment) {
|
||||
public function setParentPayment($parent_payment) {
|
||||
$this->parent_payment = $parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for parent_payment
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @return string
|
||||
*/
|
||||
public function getParent_payment() {
|
||||
public function getParentPayment() {
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for links
|
||||
* @param PayPal\Api\Link $links
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until which funds may be captured against this resource.
|
||||
* @return string
|
||||
*/
|
||||
public function getValidUntil() {
|
||||
return $this->valid_until;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @array
|
||||
* @param PayPal\Api\Links $links
|
||||
*/
|
||||
public function setLinks($links) {
|
||||
$this->links = $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for links
|
||||
* @return PayPal\Api\Link
|
||||
*
|
||||
* @return PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks() {
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
|
||||
public static function get($authorizationId, $apiContext = null) {
|
||||
if (($authorizationId == null) || (strlen($authorizationId) <= 0)) {
|
||||
throw new \InvalidArgumentException("authorizationId cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/$authorizationId", "GET", $payLoad);
|
||||
$ret = new Authorization();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function capture($capture, $apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
if (($capture == null)) {
|
||||
throw new \InvalidArgumentException("capture cannot be null or empty");
|
||||
}
|
||||
$payLoad = $capture->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/capture", "POST", $payLoad);
|
||||
$ret = new Capture();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function void($apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/void", "POST", $payLoad);
|
||||
$ret = new Authorization();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function reauthorize($apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
$payLoad = $this->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/authorization/{$this->getId()}/reauthorize", "POST", $payLoad);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Rest\Call;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class Capture extends \PPModel implements IResource {
|
||||
|
||||
private static $credential;
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprected. Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
class Capture extends Resource {
|
||||
|
||||
public static function setCredential($credential) {
|
||||
self::$credential = $credential;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for id
|
||||
* Identifier of the Capture transaction.
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
@@ -17,7 +26,7 @@ class Capture extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for id
|
||||
* Identifier of the Capture transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
@@ -25,55 +34,39 @@ class Capture extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for create_time
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
*/
|
||||
public function setCreate_time($create_time) {
|
||||
public function setCreateTime($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for create_time
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
*/
|
||||
public function getCreate_time() {
|
||||
public function getCreateTime() {
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for update_time
|
||||
* Time the resource was last updated.
|
||||
* @param string $update_time
|
||||
*/
|
||||
public function setUpdate_time($update_time) {
|
||||
public function setUpdateTime($update_time) {
|
||||
$this->update_time = $update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for update_time
|
||||
* Time the resource was last updated.
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdate_time() {
|
||||
public function getUpdateTime() {
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for state
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for state
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for amount
|
||||
* Amount being captured. If no amount is specified, amount is used from the authorization being captured. If amount is same as the amount that's authorized for, the state of the authorization changes to captured. If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true.
|
||||
* @param PayPal\Api\Amount $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
@@ -81,7 +74,7 @@ class Capture extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for amount
|
||||
* Amount being captured. If no amount is specified, amount is used from the authorization being captured. If amount is same as the amount that's authorized for, the state of the authorization changes to captured. If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by seting the is_final_capture flag to true.
|
||||
* @return PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount() {
|
||||
@@ -89,68 +82,101 @@ class Capture extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for parent_payment
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument.
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsFinalCapture() {
|
||||
return $this->is_final_capture;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the capture transaction.
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the capture transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @param string $parent_payment
|
||||
*/
|
||||
public function setParent_payment($parent_payment) {
|
||||
public function setParentPayment($parent_payment) {
|
||||
$this->parent_payment = $parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for parent_payment
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @return string
|
||||
*/
|
||||
public function getParent_payment() {
|
||||
public function getParentPayment() {
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for authorization_id
|
||||
* @param string $authorization_id
|
||||
*/
|
||||
public function setAuthorization_id($authorization_id) {
|
||||
$this->authorization_id = $authorization_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for authorization_id
|
||||
* @return string
|
||||
*/
|
||||
public function getAuthorization_id() {
|
||||
return $this->authorization_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for description
|
||||
* @param string $description
|
||||
*/
|
||||
public function setDescription($description) {
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for description
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription() {
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for links
|
||||
* @param PayPal\Api\Link $links
|
||||
*
|
||||
* @array
|
||||
* @param PayPal\Api\Links $links
|
||||
*/
|
||||
public function setLinks($links) {
|
||||
$this->links = $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for links
|
||||
* @return PayPal\Api\Link
|
||||
*
|
||||
* @return PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks() {
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
|
||||
public static function get($captureId, $apiContext = null) {
|
||||
if (($captureId == null) || (strlen($captureId) <= 0)) {
|
||||
throw new \InvalidArgumentException("captureId cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/capture/$captureId", "GET", $payLoad);
|
||||
$ret = new Capture();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function refund($refund, $apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
if (($refund == null)) {
|
||||
throw new \InvalidArgumentException("refund cannot be null or empty");
|
||||
}
|
||||
$payLoad = $refund->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/capture/{$this->getId()}/refund", "POST", $payLoad);
|
||||
$ret = new Refund();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Rest\Call;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class CreditCard extends Resource implements IResource {
|
||||
class CreditCard extends \PPModel implements IResource {
|
||||
|
||||
private static $credential;
|
||||
|
||||
@@ -21,7 +18,7 @@ class CreditCard extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for id
|
||||
* ID of the credit card being saved for later use.
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
@@ -29,7 +26,7 @@ class CreditCard extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for id
|
||||
* ID of the credit card being saved for later use.
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
@@ -37,71 +34,7 @@ class CreditCard extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for valid_until
|
||||
* @param string $valid_until
|
||||
*/
|
||||
public function setValid_until($valid_until) {
|
||||
$this->valid_until = $valid_until;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for valid_until
|
||||
* @return string
|
||||
*/
|
||||
public function getValid_until() {
|
||||
return $this->valid_until;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for state
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for state
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for payer_id
|
||||
* @param string $payer_id
|
||||
*/
|
||||
public function setPayer_id($payer_id) {
|
||||
$this->payer_id = $payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for payer_id
|
||||
* @return string
|
||||
*/
|
||||
public function getPayer_id() {
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for type
|
||||
* @param string $type
|
||||
*/
|
||||
public function setType($type) {
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for type
|
||||
* @return string
|
||||
*/
|
||||
public function getType() {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for number
|
||||
* Card number.
|
||||
* @param string $number
|
||||
*/
|
||||
public function setNumber($number) {
|
||||
@@ -109,7 +42,7 @@ class CreditCard extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for number
|
||||
* Card number.
|
||||
* @return string
|
||||
*/
|
||||
public function getNumber() {
|
||||
@@ -117,39 +50,55 @@ class CreditCard extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for expire_month
|
||||
* @param string $expire_month
|
||||
* Type of the Card (eg. Visa, Mastercard, etc.).
|
||||
* @param string $type
|
||||
*/
|
||||
public function setExpire_month($expire_month) {
|
||||
public function setType($type) {
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the Card (eg. Visa, Mastercard, etc.).
|
||||
* @return string
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for expire_month
|
||||
* @return string
|
||||
* card expiry month with value 1 - 12.
|
||||
* @return integer
|
||||
*/
|
||||
public function getExpire_month() {
|
||||
public function getExpireMonth() {
|
||||
return $this->expire_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for expire_year
|
||||
* @param string $expire_year
|
||||
* 4 digit card expiry year
|
||||
* @param integer $expire_year
|
||||
*/
|
||||
public function setExpire_year($expire_year) {
|
||||
public function setExpireYear($expire_year) {
|
||||
$this->expire_year = $expire_year;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for expire_year
|
||||
* @return string
|
||||
* 4 digit card expiry year
|
||||
* @return integer
|
||||
*/
|
||||
public function getExpire_year() {
|
||||
public function getExpireYear() {
|
||||
return $this->expire_year;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for cvv2
|
||||
* 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) {
|
||||
@@ -157,7 +106,7 @@ class CreditCard extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for cvv2
|
||||
* Card validation code. Only supported when making a Payment but not when saving a credit card for future use.
|
||||
* @return string
|
||||
*/
|
||||
public function getCvv2() {
|
||||
@@ -165,113 +114,155 @@ class CreditCard extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for first_name
|
||||
* Card holder's first name.
|
||||
* @param string $first_name
|
||||
*/
|
||||
public function setFirst_name($first_name) {
|
||||
public function setFirstName($first_name) {
|
||||
$this->first_name = $first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for first_name
|
||||
* Card holder's first name.
|
||||
* @return string
|
||||
*/
|
||||
public function getFirst_name() {
|
||||
public function getFirstName() {
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for last_name
|
||||
* Card holder's last name.
|
||||
* @param string $last_name
|
||||
*/
|
||||
public function setLast_name($last_name) {
|
||||
public function setLastName($last_name) {
|
||||
$this->last_name = $last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for last_name
|
||||
* Card holder's last name.
|
||||
* @return string
|
||||
*/
|
||||
public function getLast_name() {
|
||||
public function getLastName() {
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for billing_address
|
||||
* Billing Address associated with this card.
|
||||
* @param PayPal\Api\Address $billing_address
|
||||
*/
|
||||
public function setBilling_address($billing_address) {
|
||||
public function setBillingAddress($billing_address) {
|
||||
$this->billing_address = $billing_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for billing_address
|
||||
* Billing Address associated with this card.
|
||||
* @return PayPal\Api\Address
|
||||
*/
|
||||
public function getBilling_address() {
|
||||
public function getBillingAddress() {
|
||||
return $this->billing_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for links
|
||||
* @param PayPal\Api\Link $links
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function getPayerId() {
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the funding instrument.
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the funding instrument.
|
||||
* @return string
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until this resource can be used fund a payment.
|
||||
* @return string
|
||||
*/
|
||||
public function getValidUntil() {
|
||||
return $this->valid_until;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @array
|
||||
* @param PayPal\Api\Links $links
|
||||
*/
|
||||
public function setLinks($links) {
|
||||
$this->links = $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for links
|
||||
* @return PayPal\Api\Link
|
||||
*
|
||||
* @return PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks() {
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @path /v1/vault/credit-card
|
||||
* @method POST
|
||||
|
||||
* @param PayPal\Rest\ApiContext $apiContext optional
|
||||
*/
|
||||
public function create($apiContext = null) {
|
||||
$payLoad = $this->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute( array('PayPal\Rest\RestHandler'),
|
||||
"/v1/vault/credit-card",
|
||||
"POST", $payLoad);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/vault/credit-card", "POST", $payLoad);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @path /v1/vault/credit-card/:credit-card-id
|
||||
* @method GET
|
||||
* @param string $creditcardid
|
||||
* @param PayPal\Rest\ApiContext $apiContext optional
|
||||
*/
|
||||
public static function get( $creditcardid, $apiContext=null) {
|
||||
if (($creditcardid == null) || (strlen($creditcardid) <= 0)) {
|
||||
throw new \InvalidArgumentException("creditcardid cannot be null or empty");
|
||||
public static function get($creditCardId, $apiContext = null) {
|
||||
if (($creditCardId == null) || (strlen($creditCardId) <= 0)) {
|
||||
throw new \InvalidArgumentException("creditCardId cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute( array('PayPal\Rest\RestHandler'),
|
||||
"/v1/vault/credit-card/$creditcardid",
|
||||
"GET", $payLoad);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/vault/credit-card/$creditCardId", "GET", $payLoad);
|
||||
$ret = new CreditCard();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function delete($apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/vault/credit-card/{$this->getId()}", "POST", $payLoad);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
55
lib/PayPal/Api/CreditCardHistory.php
Normal file
55
lib/PayPal/Api/CreditCardHistory.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
|
||||
class CreditCardHistory extends \PPModel {
|
||||
/**
|
||||
* A list of credit card resources
|
||||
* @array
|
||||
* @param PayPal\Api\CreditCard $credit-cards
|
||||
*/
|
||||
public function setCreditCards($credit-cards) {
|
||||
$this->credit-cards = $credit-cards;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of credit card resources
|
||||
* @return PayPal\Api\CreditCard
|
||||
*/
|
||||
public function getCreditCards() {
|
||||
return $this->credit-cards;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
* @param integer $count
|
||||
*/
|
||||
public function setCount($count) {
|
||||
$this->count = $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
* @return integer
|
||||
*/
|
||||
public function getCount() {
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
* @return string
|
||||
*/
|
||||
public function getNextId() {
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,44 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class CreditCardToken extends Resource {
|
||||
|
||||
|
||||
class CreditCardToken extends \PPModel {
|
||||
/**
|
||||
* Setter for credit_card_id
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API.
|
||||
* @param string $credit_card_id
|
||||
*/
|
||||
public function setCredit_card_id($credit_card_id) {
|
||||
public function setCreditCardId($credit_card_id) {
|
||||
$this->credit_card_id = $credit_card_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for credit_card_id
|
||||
* ID of a previously saved Credit Card resource using /vault/credit-card API.
|
||||
* @return string
|
||||
*/
|
||||
public function getCredit_card_id() {
|
||||
public function getCreditCardId() {
|
||||
return $this->credit_card_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for payer_id
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API.
|
||||
* @param string $payer_id
|
||||
*/
|
||||
public function setPayer_id($payer_id) {
|
||||
public function setPayerId($payer_id) {
|
||||
$this->payer_id = $payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for payer_id
|
||||
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API.
|
||||
* @return string
|
||||
*/
|
||||
public function getPayer_id() {
|
||||
public function getPayerId() {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last 4 digits of the card number from the saved card.
|
||||
* @return string
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the Card (eg. visa, mastercard, etc.) from the saved card. Please note that the values are always in lowercase and not meant to be used directly for display.
|
||||
* @return string
|
||||
*/
|
||||
public function getType() {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* card expiry month from the saved card with value 1 - 12
|
||||
* @return integer
|
||||
*/
|
||||
public function getExpireMonth() {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card expiry year from the saved card
|
||||
* @return integer
|
||||
*/
|
||||
public function getExpireYear() {
|
||||
return $this->expire_year;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class AmountDetails extends Resource {
|
||||
|
||||
|
||||
class Details extends \PPModel {
|
||||
/**
|
||||
* Setter for subtotal
|
||||
* @param string $subtotal
|
||||
*/
|
||||
public function setSubtotal($subtotal) {
|
||||
$this->subtotal = $subtotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for subtotal
|
||||
* @return string
|
||||
*/
|
||||
public function getSubtotal() {
|
||||
return $this->subtotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for tax
|
||||
* @param string $tax
|
||||
*/
|
||||
public function setTax($tax) {
|
||||
$this->tax = $tax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for tax
|
||||
* @return string
|
||||
*/
|
||||
public function getTax() {
|
||||
return $this->tax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for shipping
|
||||
* Amount being charged for shipping.
|
||||
* @param string $shipping
|
||||
*/
|
||||
public function setShipping($shipping) {
|
||||
@@ -49,7 +12,7 @@ class AmountDetails extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for shipping
|
||||
* Amount being charged for shipping.
|
||||
* @return string
|
||||
*/
|
||||
public function getShipping() {
|
||||
@@ -57,7 +20,39 @@ class AmountDetails extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for fee
|
||||
* Sub-total (amount) of items being paid for.
|
||||
* @param string $subtotal
|
||||
*/
|
||||
public function setSubtotal($subtotal) {
|
||||
$this->subtotal = $subtotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sub-total (amount) of items being paid for.
|
||||
* @return string
|
||||
*/
|
||||
public function getSubtotal() {
|
||||
return $this->subtotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as tax.
|
||||
* @param string $tax
|
||||
*/
|
||||
public function setTax($tax) {
|
||||
$this->tax = $tax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as tax.
|
||||
* @return string
|
||||
*/
|
||||
public function getTax() {
|
||||
return $this->tax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment.
|
||||
* @param string $fee
|
||||
*/
|
||||
public function setFee($fee) {
|
||||
@@ -65,12 +60,11 @@ class AmountDetails extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for fee
|
||||
* Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment.
|
||||
* @return string
|
||||
*/
|
||||
public function getFee() {
|
||||
return $this->fee;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,44 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class FundingInstrument extends Resource {
|
||||
|
||||
|
||||
class FundingInstrument extends \PPModel {
|
||||
/**
|
||||
* Setter for credit_card
|
||||
* Credit Card information.
|
||||
* @param PayPal\Api\CreditCard $credit_card
|
||||
*/
|
||||
public function setCredit_card($credit_card) {
|
||||
public function setCreditCard($credit_card) {
|
||||
$this->credit_card = $credit_card;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for credit_card
|
||||
* Credit Card information.
|
||||
* @return PayPal\Api\CreditCard
|
||||
*/
|
||||
public function getCredit_card() {
|
||||
public function getCreditCard() {
|
||||
return $this->credit_card;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for credit_card_token
|
||||
* Credit Card information.
|
||||
* @param PayPal\Api\CreditCardToken $credit_card_token
|
||||
*/
|
||||
public function setCredit_card_token($credit_card_token) {
|
||||
public function setCreditCardToken($credit_card_token) {
|
||||
$this->credit_card_token = $credit_card_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for credit_card_token
|
||||
* Credit Card information.
|
||||
* @return PayPal\Api\CreditCardToken
|
||||
*/
|
||||
public function getCredit_card_token() {
|
||||
public function getCreditCardToken() {
|
||||
return $this->credit_card_token;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
103
lib/PayPal/Api/HyperSchema.php
Normal file
103
lib/PayPal/Api/HyperSchema.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
|
||||
class HyperSchema extends \PPModel {
|
||||
/**
|
||||
*
|
||||
* @array
|
||||
* @param PayPal\Api\Links $links
|
||||
*/
|
||||
public function setLinks($links) {
|
||||
$this->links = $links;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks() {
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $fragmentResolution
|
||||
*/
|
||||
public function setFragmentResolution($fragmentResolution) {
|
||||
$this->fragmentResolution = $fragmentResolution;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFragmentResolution() {
|
||||
return $this->fragmentResolution;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param boolean $readonly
|
||||
*/
|
||||
public function setReadonly($readonly) {
|
||||
$this->readonly = $readonly;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getReadonly() {
|
||||
return $this->readonly;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $contentEncoding
|
||||
*/
|
||||
public function setContentEncoding($contentEncoding) {
|
||||
$this->contentEncoding = $contentEncoding;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getContentEncoding() {
|
||||
return $this->contentEncoding;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $pathStart
|
||||
*/
|
||||
public function setPathStart($pathStart) {
|
||||
$this->pathStart = $pathStart;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPathStart() {
|
||||
return $this->pathStart;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $mediaType
|
||||
*/
|
||||
public function setMediaType($mediaType) {
|
||||
$this->mediaType = $mediaType;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMediaType() {
|
||||
return $this->mediaType;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,79 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Item extends Resource {
|
||||
|
||||
|
||||
class Item extends \PPModel {
|
||||
/**
|
||||
* Setter for name
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for name
|
||||
* @return string
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for sku
|
||||
* @param string $sku
|
||||
*/
|
||||
public function setSku($sku) {
|
||||
$this->sku = $sku;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for sku
|
||||
* @return string
|
||||
*/
|
||||
public function getSku() {
|
||||
return $this->sku;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for price
|
||||
* @param string $price
|
||||
*/
|
||||
public function setPrice($price) {
|
||||
$this->price = $price;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for price
|
||||
* @return string
|
||||
*/
|
||||
public function getPrice() {
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for currency
|
||||
* @param string $currency
|
||||
*/
|
||||
public function setCurrency($currency) {
|
||||
$this->currency = $currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for currency
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency() {
|
||||
return $this->currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for quantity
|
||||
* Number of items.
|
||||
* @param string $quantity
|
||||
*/
|
||||
public function setQuantity($quantity) {
|
||||
@@ -81,12 +12,75 @@ class Item extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for quantity
|
||||
* Number of items.
|
||||
* @return string
|
||||
*/
|
||||
public function getQuantity() {
|
||||
return $this->quantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the item.
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the item.
|
||||
* @return string
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cost of the item.
|
||||
* @param string $price
|
||||
*/
|
||||
public function setPrice($price) {
|
||||
$this->price = $price;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cost of the item.
|
||||
* @return string
|
||||
*/
|
||||
public function getPrice() {
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3-letter Currency Code
|
||||
* @param string $currency
|
||||
*/
|
||||
public function setCurrency($currency) {
|
||||
$this->currency = $currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function setSku($sku) {
|
||||
$this->sku = $sku;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number or code to identify the item in your catalog/records.
|
||||
* @return string
|
||||
*/
|
||||
public function getSku() {
|
||||
return $this->sku;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ItemList extends Resource {
|
||||
|
||||
|
||||
class ItemList extends \PPModel {
|
||||
/**
|
||||
* Setter for items
|
||||
* List of items.
|
||||
* @array
|
||||
* @param PayPal\Api\Item $items
|
||||
*/
|
||||
public function setItems($items) {
|
||||
@@ -17,7 +13,7 @@ class ItemList extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for items
|
||||
* List of items.
|
||||
* @return PayPal\Api\Item
|
||||
*/
|
||||
public function getItems() {
|
||||
@@ -25,20 +21,19 @@ class ItemList extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for shipping_address
|
||||
* Shipping address.
|
||||
* @param PayPal\Api\ShippingAddress $shipping_address
|
||||
*/
|
||||
public function setShipping_address($shipping_address) {
|
||||
public function setShippingAddress($shipping_address) {
|
||||
$this->shipping_address = $shipping_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for shipping_address
|
||||
* Shipping address.
|
||||
* @return PayPal\Api\ShippingAddress
|
||||
*/
|
||||
public function getShipping_address() {
|
||||
public function getShippingAddress() {
|
||||
return $this->shipping_address;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Link extends Resource {
|
||||
|
||||
|
||||
/**
|
||||
* Setter for href
|
||||
* @param string $href
|
||||
*/
|
||||
public function setHref($href) {
|
||||
$this->href = $href;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for href
|
||||
* @return string
|
||||
*/
|
||||
public function getHref() {
|
||||
return $this->href;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for rel
|
||||
* @param string $rel
|
||||
*/
|
||||
public function setRel($rel) {
|
||||
$this->rel = $rel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for rel
|
||||
* @return string
|
||||
*/
|
||||
public function getRel() {
|
||||
return $this->rel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for method
|
||||
* @param string $method
|
||||
*/
|
||||
public function setMethod($method) {
|
||||
$this->method = $method;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for method
|
||||
* @return string
|
||||
*/
|
||||
public function getMethod() {
|
||||
return $this->method;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
102
lib/PayPal/Api/Links.php
Normal file
102
lib/PayPal/Api/Links.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
|
||||
class Links extends \PPModel {
|
||||
/**
|
||||
*
|
||||
* @param string $href
|
||||
*/
|
||||
public function setHref($href) {
|
||||
$this->href = $href;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHref() {
|
||||
return $this->href;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $rel
|
||||
*/
|
||||
public function setRel($rel) {
|
||||
$this->rel = $rel;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRel() {
|
||||
return $this->rel;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param PayPal\Api\HyperSchema $targetSchema
|
||||
*/
|
||||
public function setTargetSchema($targetSchema) {
|
||||
$this->targetSchema = $targetSchema;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return PayPal\Api\HyperSchema
|
||||
*/
|
||||
public function getTargetSchema() {
|
||||
return $this->targetSchema;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $method
|
||||
*/
|
||||
public function setMethod($method) {
|
||||
$this->method = $method;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMethod() {
|
||||
return $this->method;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $enctype
|
||||
*/
|
||||
public function setEnctype($enctype) {
|
||||
$this->enctype = $enctype;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEnctype() {
|
||||
return $this->enctype;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param PayPal\Api\HyperSchema $schema
|
||||
*/
|
||||
public function setSchema($schema) {
|
||||
$this->schema = $schema;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return PayPal\Api\HyperSchema
|
||||
*/
|
||||
public function getSchema() {
|
||||
return $this->schema;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Payee extends Resource {
|
||||
|
||||
|
||||
class Payee extends \PPModel {
|
||||
/**
|
||||
* Setter for merchant_id
|
||||
* @param string $merchant_id
|
||||
*/
|
||||
public function setMerchant_id($merchant_id) {
|
||||
$this->merchant_id = $merchant_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for merchant_id
|
||||
* @return string
|
||||
*/
|
||||
public function getMerchant_id() {
|
||||
return $this->merchant_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for email
|
||||
* Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
|
||||
* @param string $email
|
||||
*/
|
||||
public function setEmail($email) {
|
||||
@@ -33,7 +12,7 @@ class Payee extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for email
|
||||
* Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail() {
|
||||
@@ -41,7 +20,23 @@ class Payee extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for phone
|
||||
* Encrypted PayPal Account identifier for the Payee.
|
||||
* @param string $merchant_id
|
||||
*/
|
||||
public function setMerchantId($merchant_id) {
|
||||
$this->merchant_id = $merchant_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypted PayPal Account identifier for the Payee.
|
||||
* @return string
|
||||
*/
|
||||
public function getMerchantId() {
|
||||
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) {
|
||||
@@ -49,12 +44,11 @@ class Payee extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for phone
|
||||
* Phone number (in E.123 format) associated with the Payee's PayPal Account. If the provided phont number is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone() {
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,60 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Payer extends Resource {
|
||||
|
||||
|
||||
class Payer extends \PPModel {
|
||||
/**
|
||||
* Setter for payment_method
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card.
|
||||
* @param string $payment_method
|
||||
*/
|
||||
public function setPayment_method($payment_method) {
|
||||
public function setPaymentMethod($payment_method) {
|
||||
$this->payment_method = $payment_method;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for payment_method
|
||||
* Payment method being used - PayPal Wallet payment or Direct Credit card.
|
||||
* @return string
|
||||
*/
|
||||
public function getPayment_method() {
|
||||
public function getPaymentMethod() {
|
||||
return $this->payment_method;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for payer_info
|
||||
* @param PayPal\Api\PayerInfo $payer_info
|
||||
*/
|
||||
public function setPayer_info($payer_info) {
|
||||
$this->payer_info = $payer_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for payer_info
|
||||
* @return PayPal\Api\PayerInfo
|
||||
*/
|
||||
public function getPayer_info() {
|
||||
return $this->payer_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for 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
|
||||
*/
|
||||
public function setFunding_instruments($funding_instruments) {
|
||||
public function setFundingInstruments($funding_instruments) {
|
||||
$this->funding_instruments = $funding_instruments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for funding_instruments
|
||||
* List of funding instruments from where the funds of the current payment come from. Typically a credit card.
|
||||
* @return PayPal\Api\FundingInstrument
|
||||
*/
|
||||
public function getFunding_instruments() {
|
||||
public function getFundingInstruments() {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet.
|
||||
* @return PayPal\Api\PayerInfo
|
||||
*/
|
||||
public function getPayerInfo() {
|
||||
return $this->payer_info;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class PayerInfo extends Resource {
|
||||
|
||||
|
||||
class PayerInfo extends \PPModel {
|
||||
/**
|
||||
* Setter for email
|
||||
* Email address representing the Payer.
|
||||
* @param string $email
|
||||
*/
|
||||
public function setEmail($email) {
|
||||
@@ -17,7 +12,7 @@ class PayerInfo extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for email
|
||||
* Email address representing the Payer.
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail() {
|
||||
@@ -25,71 +20,55 @@ class PayerInfo extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for first_name
|
||||
* First Name of the Payer from their PayPal Account.
|
||||
* @param string $first_name
|
||||
*/
|
||||
public function setFirst_name($first_name) {
|
||||
public function setFirstName($first_name) {
|
||||
$this->first_name = $first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for first_name
|
||||
* First Name of the Payer from their PayPal Account.
|
||||
* @return string
|
||||
*/
|
||||
public function getFirst_name() {
|
||||
public function getFirstName() {
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for last_name
|
||||
* Last Name of the Payer from their PayPal Account.
|
||||
* @param string $last_name
|
||||
*/
|
||||
public function setLast_name($last_name) {
|
||||
public function setLastName($last_name) {
|
||||
$this->last_name = $last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for last_name
|
||||
* Last Name of the Payer from their PayPal Account.
|
||||
* @return string
|
||||
*/
|
||||
public function getLast_name() {
|
||||
public function getLastName() {
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for payer_id
|
||||
* PayPal assigned Payer ID.
|
||||
* @param string $payer_id
|
||||
*/
|
||||
public function setPayer_id($payer_id) {
|
||||
public function setPayerId($payer_id) {
|
||||
$this->payer_id = $payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for payer_id
|
||||
* PayPal assigned Payer ID.
|
||||
* @return string
|
||||
*/
|
||||
public function getPayer_id() {
|
||||
public function getPayerId() {
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for shipping_address
|
||||
* @param PayPal\Api\Address $shipping_address
|
||||
*/
|
||||
public function setShipping_address($shipping_address) {
|
||||
$this->shipping_address = $shipping_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for shipping_address
|
||||
* @return PayPal\Api\Address
|
||||
*/
|
||||
public function getShipping_address() {
|
||||
return $this->shipping_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for phone
|
||||
* Phone number representing the Payer.
|
||||
* @param string $phone
|
||||
*/
|
||||
public function setPhone($phone) {
|
||||
@@ -97,12 +76,27 @@ class PayerInfo extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for phone
|
||||
* Phone number representing the Payer.
|
||||
* @return string
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping address of the Payer from their PayPal Account.
|
||||
* @return PayPal\Api\Address
|
||||
*/
|
||||
public function getShippingAddress() {
|
||||
return $this->shipping_address;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Rest\Call;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Payment extends Resource implements IResource {
|
||||
class Payment extends \PPModel implements IResource {
|
||||
|
||||
private static $credential;
|
||||
|
||||
@@ -21,7 +18,7 @@ class Payment extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for id
|
||||
* Identifier of the payment resource created.
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
@@ -29,7 +26,7 @@ class Payment extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for id
|
||||
* Identifier of the payment resource created.
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
@@ -37,55 +34,39 @@ class Payment extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for create_time
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
*/
|
||||
public function setCreate_time($create_time) {
|
||||
public function setCreateTime($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for create_time
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
*/
|
||||
public function getCreate_time() {
|
||||
public function getCreateTime() {
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for update_time
|
||||
* Time the resource was last updated.
|
||||
* @param string $update_time
|
||||
*/
|
||||
public function setUpdate_time($update_time) {
|
||||
public function setUpdateTime($update_time) {
|
||||
$this->update_time = $update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for update_time
|
||||
* Time the resource was last updated.
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdate_time() {
|
||||
public function getUpdateTime() {
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for state
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for state
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for intent
|
||||
* Intent of the payment - Sale or Authorization or Order.
|
||||
* @param string $intent
|
||||
*/
|
||||
public function setIntent($intent) {
|
||||
@@ -93,7 +74,7 @@ class Payment extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for intent
|
||||
* Intent of the payment - Sale or Authorization or Order.
|
||||
* @return string
|
||||
*/
|
||||
public function getIntent() {
|
||||
@@ -101,7 +82,7 @@ class Payment extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for payer
|
||||
* 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) {
|
||||
@@ -109,7 +90,7 @@ class Payment extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for payer
|
||||
* Source of the funds for this payment represented by a PayPal account or a direct credit card.
|
||||
* @return PayPal\Api\Payer
|
||||
*/
|
||||
public function getPayer() {
|
||||
@@ -117,7 +98,8 @@ class Payment extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for transactions
|
||||
* A payment can have more than one transaction, with each transaction establishing a contract between the payer and a payee
|
||||
* @array
|
||||
* @param PayPal\Api\Transaction $transactions
|
||||
*/
|
||||
public function setTransactions($transactions) {
|
||||
@@ -125,7 +107,7 @@ class Payment extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for transactions
|
||||
* A payment can have more than one transaction, with each transaction establishing a contract between the payer and a payee
|
||||
* @return PayPal\Api\Transaction
|
||||
*/
|
||||
public function getTransactions() {
|
||||
@@ -133,139 +115,112 @@ class Payment extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for redirect_urls
|
||||
* state of the payment
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* state of the payment
|
||||
* @return string
|
||||
*/
|
||||
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 setRedirect_urls($redirect_urls) {
|
||||
public function setRedirectUrls($redirect_urls) {
|
||||
$this->redirect_urls = $redirect_urls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for redirect_urls
|
||||
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls.
|
||||
* @return PayPal\Api\RedirectUrls
|
||||
*/
|
||||
public function getRedirect_urls() {
|
||||
public function getRedirectUrls() {
|
||||
return $this->redirect_urls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for links
|
||||
* @param PayPal\Api\Link $links
|
||||
*
|
||||
* @array
|
||||
* @param PayPal\Api\Links $links
|
||||
*/
|
||||
public function setLinks($links) {
|
||||
$this->links = $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for links
|
||||
* @return PayPal\Api\Link
|
||||
*
|
||||
* @return PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks() {
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @path /v1/payments/payment
|
||||
* @method GET
|
||||
* @param array $params
|
||||
* array containing the query strings with the
|
||||
* following values as keys:
|
||||
* count,
|
||||
* start_id,
|
||||
* start_index,
|
||||
* start_time,
|
||||
* end_time,
|
||||
* payee_id,
|
||||
* sort_by,
|
||||
* sort_order,
|
||||
* All other keys in the map are ignored by the SDK
|
||||
* @param PayPal\Rest\ApiContext $apiContext optional
|
||||
*/
|
||||
public static function all($params, $apiContext=null) {
|
||||
$payLoad = "";
|
||||
$allowedParams = array('count' => 1, 'start_id' => 1, 'start_index' => 1, 'start_time' => 1, 'end_time' => 1, 'payee_id' => 1, 'sort_by' => 1, 'sort_order' => 1, );
|
||||
if($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute( array('PayPal\Rest\RestHandler'),
|
||||
"/v1/payments/payment?" . http_build_query(array_intersect_key($params, $allowedParams)),
|
||||
"GET", $payLoad);
|
||||
$ret = new PaymentHistory();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @path /v1/payments/payment
|
||||
* @method POST
|
||||
|
||||
* @param PayPal\Rest\ApiContext $apiContext optional
|
||||
*/
|
||||
public function create($apiContext = null) {
|
||||
$payLoad = $this->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute( array('PayPal\Rest\RestHandler'),
|
||||
"/v1/payments/payment",
|
||||
"POST", $payLoad);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment", "POST", $payLoad);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @path /v1/payments/payment/:payment-id
|
||||
* @method GET
|
||||
* @param string $paymentid
|
||||
* @param PayPal\Rest\ApiContext $apiContext optional
|
||||
*/
|
||||
public static function get( $paymentid, $apiContext=null) {
|
||||
if (($paymentid == null) || (strlen($paymentid) <= 0)) {
|
||||
throw new \InvalidArgumentException("paymentid cannot be null or empty");
|
||||
public static function get($paymentId, $apiContext = null) {
|
||||
if (($paymentId == null) || (strlen($paymentId) <= 0)) {
|
||||
throw new \InvalidArgumentException("paymentId cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute( array('PayPal\Rest\RestHandler'),
|
||||
"/v1/payments/payment/$paymentid",
|
||||
"GET", $payLoad);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment/$paymentId", "GET", $payLoad);
|
||||
$ret = new Payment();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @path /v1/payments/payment/:payment-id/execute
|
||||
* @method POST
|
||||
* @param PaymentExecution $payment_execution
|
||||
* @param PayPal\Rest\ApiContext $apiContext optional
|
||||
*/
|
||||
public function execute( $payment_execution, $apiContext=null) {
|
||||
if ($payment_execution == null) {
|
||||
throw new \InvalidArgumentException("payment_execution cannot be null");
|
||||
}
|
||||
public function execute($paymentExecution, $apiContext = null) {
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
$payLoad = $payment_execution->toJSON();
|
||||
if (($paymentExecution == null)) {
|
||||
throw new \InvalidArgumentException("paymentExecution cannot be null or empty");
|
||||
}
|
||||
$payLoad = $paymentExecution->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute( array('PayPal\Rest\RestHandler'),
|
||||
"/v1/payments/payment/{$this->getId()}/execute",
|
||||
"POST", $payLoad);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment/{$this->getId()}/execute", "POST", $payLoad);
|
||||
$ret = new Payment();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
public static function all($params, $apiContext = null) {
|
||||
if (($params == null)) {
|
||||
throw new \InvalidArgumentException("params cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
$allowedParams = array('count' => 1, 'start_id' => 1, 'start_index' => 1, 'start_time' => 1, 'end_time' => 1, 'payee_id' => 1, 'sort_by' => 1, 'sort_order' => 1, );
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/payment?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad);
|
||||
$ret = new PaymentHistory();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class PaymentExecution extends Resource {
|
||||
|
||||
|
||||
class PaymentExecution extends \PPModel {
|
||||
/**
|
||||
* Setter for payer_id
|
||||
* PayPal assigned Payer ID returned in the approval return url.
|
||||
* @param string $payer_id
|
||||
*/
|
||||
public function setPayer_id($payer_id) {
|
||||
public function setPayerId($payer_id) {
|
||||
$this->payer_id = $payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for payer_id
|
||||
* PayPal assigned Payer ID returned in the approval return url.
|
||||
* @return string
|
||||
*/
|
||||
public function getPayer_id() {
|
||||
public function getPayerId() {
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for transactions
|
||||
* @param PayPal\Api\Amount $transactions
|
||||
* If the amount needs to be updated after obtaining the PayPal Payer info (eg. shipping address), it can be updated using this element.
|
||||
* @array
|
||||
* @param PayPal\Api\Transactions $transactions
|
||||
*/
|
||||
public function setTransactions($transactions) {
|
||||
$this->transactions = $transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for transactions
|
||||
* @return PayPal\Api\Amount
|
||||
* If the amount needs to be updated after obtaining the PayPal Payer info (eg. shipping address), it can be updated using this element.
|
||||
* @return PayPal\Api\Transactions
|
||||
*/
|
||||
public function getTransactions() {
|
||||
return $this->transactions;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,15 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class PaymentHistory extends Resource {
|
||||
|
||||
|
||||
class PaymentHistory extends \PPModel {
|
||||
/**
|
||||
* Setter for payments
|
||||
* A list of Payment resources
|
||||
* @array
|
||||
* @param PayPal\Api\Payment $payments
|
||||
*/
|
||||
public function setPayments($payments) {
|
||||
@@ -17,7 +13,7 @@ class PaymentHistory extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for payments
|
||||
* A list of Payment resources
|
||||
* @return PayPal\Api\Payment
|
||||
*/
|
||||
public function getPayments() {
|
||||
@@ -25,7 +21,7 @@ class PaymentHistory extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for count
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
* @param integer $count
|
||||
*/
|
||||
public function setCount($count) {
|
||||
@@ -33,7 +29,7 @@ class PaymentHistory extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for count
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
* @return integer
|
||||
*/
|
||||
public function getCount() {
|
||||
@@ -41,20 +37,19 @@ class PaymentHistory extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for next_id
|
||||
* Identifier of the next element to get the next range of results.
|
||||
* @param string $next_id
|
||||
*/
|
||||
public function setNext_id($next_id) {
|
||||
public function setNextId($next_id) {
|
||||
$this->next_id = $next_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for next_id
|
||||
* Identifier of the next element to get the next range of results.
|
||||
* @return string
|
||||
*/
|
||||
public function getNext_id() {
|
||||
public function getNextId() {
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,44 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class RedirectUrls extends Resource {
|
||||
|
||||
|
||||
class RedirectUrls extends \PPModel {
|
||||
/**
|
||||
* Setter for return_url
|
||||
* Url where the payer would be redirected to after approving the payment.
|
||||
* @param string $return_url
|
||||
*/
|
||||
public function setReturn_url($return_url) {
|
||||
public function setReturnUrl($return_url) {
|
||||
$this->return_url = $return_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for return_url
|
||||
* Url where the payer would be redirected to after approving the payment.
|
||||
* @return string
|
||||
*/
|
||||
public function getReturn_url() {
|
||||
public function getReturnUrl() {
|
||||
return $this->return_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for cancel_url
|
||||
* Url where the payer would be redirected to after canceling the payment.
|
||||
* @param string $cancel_url
|
||||
*/
|
||||
public function setCancel_url($cancel_url) {
|
||||
public function setCancelUrl($cancel_url) {
|
||||
$this->cancel_url = $cancel_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for cancel_url
|
||||
* Url where the payer would be redirected to after canceling the payment.
|
||||
* @return string
|
||||
*/
|
||||
public function getCancel_url() {
|
||||
public function getCancelUrl() {
|
||||
return $this->cancel_url;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,27 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Rest\Call;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Refund extends Resource implements IResource {
|
||||
class Refund extends \PPModel implements IResource {
|
||||
|
||||
private static $credential;
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprected. Pass ApiContext to the get method instead
|
||||
* @deprected. Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
public static function setCredential($credential) {
|
||||
self::$credential = $credential;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for id
|
||||
* Identifier of the refund transaction.
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
@@ -29,7 +26,7 @@ class Refund extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for id
|
||||
* Identifier of the refund transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
@@ -37,55 +34,23 @@ class Refund extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for create_time
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
*/
|
||||
public function setCreate_time($create_time) {
|
||||
public function setCreateTime($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for create_time
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
*/
|
||||
public function getCreate_time() {
|
||||
public function getCreateTime() {
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for update_time
|
||||
* @param string $update_time
|
||||
*/
|
||||
public function setUpdate_time($update_time) {
|
||||
$this->update_time = $update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for update_time
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdate_time() {
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for state
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for state
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for amount
|
||||
* Details including both refunded amount (to Payer) and refunded fee (to Payee).If amount is not specified, it's assumed to be full refund.
|
||||
* @param PayPal\Api\Amount $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
@@ -93,7 +58,7 @@ class Refund extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for amount
|
||||
* Details including both refunded amount (to Payer) and refunded fee (to Payee).If amount is not specified, it's assumed to be full refund.
|
||||
* @return PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount() {
|
||||
@@ -101,110 +66,99 @@ class Refund extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for sale_id
|
||||
* State of the refund transaction.
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the refund transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Sale transaction being refunded.
|
||||
* @param string $sale_id
|
||||
*/
|
||||
public function setSale_id($sale_id) {
|
||||
public function setSaleId($sale_id) {
|
||||
$this->sale_id = $sale_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for sale_id
|
||||
* ID of the Sale transaction being refunded.
|
||||
* @return string
|
||||
*/
|
||||
public function getSale_id() {
|
||||
public function getSaleId() {
|
||||
return $this->sale_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for capture_id
|
||||
* ID of the Capture transaction being refunded.
|
||||
* @param string $capture_id
|
||||
*/
|
||||
public function setCapture_id($capture_id) {
|
||||
public function setCaptureId($capture_id) {
|
||||
$this->capture_id = $capture_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for capture_id
|
||||
* ID of the Capture transaction being refunded.
|
||||
* @return string
|
||||
*/
|
||||
public function getCapture_id() {
|
||||
public function getCaptureId() {
|
||||
return $this->capture_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for parent_payment
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @param string $parent_payment
|
||||
*/
|
||||
public function setParent_payment($parent_payment) {
|
||||
public function setParentPayment($parent_payment) {
|
||||
$this->parent_payment = $parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for parent_payment
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @return string
|
||||
*/
|
||||
public function getParent_payment() {
|
||||
public function getParentPayment() {
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for description
|
||||
* @param string $description
|
||||
*/
|
||||
public function setDescription($description) {
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for description
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription() {
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for links
|
||||
* @param PayPal\Api\Link $links
|
||||
*
|
||||
* @array
|
||||
* @param PayPal\Api\Links $links
|
||||
*/
|
||||
public function setLinks($links) {
|
||||
$this->links = $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for links
|
||||
* @return PayPal\Api\Link
|
||||
*
|
||||
* @return PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks() {
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @path /v1/payments/refund/:refund-id
|
||||
* @method GET
|
||||
* @param string $refundid
|
||||
* @param PayPal\Rest\ApiContext $apiContext optional
|
||||
*/
|
||||
public static function get( $refundid, $apiContext=null) {
|
||||
if (($refundid == null) || (strlen($refundid) <= 0)) {
|
||||
throw new \InvalidArgumentException("refundid cannot be null or empty");
|
||||
public static function get($refundId, $apiContext = null) {
|
||||
if (($refundId == null) || (strlen($refundId) <= 0)) {
|
||||
throw new \InvalidArgumentException("refundId cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute( array('PayPal\Rest\RestHandler'),
|
||||
"/v1/payments/refund/$refundid",
|
||||
"GET", $payLoad);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/refund/$refundId", "GET", $payLoad);
|
||||
$ret = new Refund();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class SubTransaction extends Resource {
|
||||
|
||||
|
||||
class RelatedResources extends \PPModel {
|
||||
/**
|
||||
* Setter for sale
|
||||
* A sale transaction
|
||||
* @param PayPal\Api\Sale $sale
|
||||
*/
|
||||
public function setSale($sale) {
|
||||
@@ -17,7 +12,7 @@ class SubTransaction extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for sale
|
||||
* A sale transaction
|
||||
* @return PayPal\Api\Sale
|
||||
*/
|
||||
public function getSale() {
|
||||
@@ -25,7 +20,7 @@ class SubTransaction extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for authorization
|
||||
* An authorization transaction
|
||||
* @param PayPal\Api\Authorization $authorization
|
||||
*/
|
||||
public function setAuthorization($authorization) {
|
||||
@@ -33,7 +28,7 @@ class SubTransaction extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for authorization
|
||||
* An authorization transaction
|
||||
* @return PayPal\Api\Authorization
|
||||
*/
|
||||
public function getAuthorization() {
|
||||
@@ -41,23 +36,7 @@ class SubTransaction extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for refund
|
||||
* @param PayPal\Api\Refund $refund
|
||||
*/
|
||||
public function setRefund($refund) {
|
||||
$this->refund = $refund;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for refund
|
||||
* @return PayPal\Api\Refund
|
||||
*/
|
||||
public function getRefund() {
|
||||
return $this->refund;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for capture
|
||||
* A capture transaction
|
||||
* @param PayPal\Api\Capture $capture
|
||||
*/
|
||||
public function setCapture($capture) {
|
||||
@@ -65,12 +44,27 @@ class SubTransaction extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for capture
|
||||
* A capture transaction
|
||||
* @return PayPal\Api\Capture
|
||||
*/
|
||||
public function getCapture() {
|
||||
return $this->capture;
|
||||
}
|
||||
|
||||
/**
|
||||
* A refund transaction
|
||||
* @param PayPal\Api\Refund $refund
|
||||
*/
|
||||
public function setRefund($refund) {
|
||||
$this->refund = $refund;
|
||||
}
|
||||
|
||||
/**
|
||||
* A refund transaction
|
||||
* @return PayPal\Api\Refund
|
||||
*/
|
||||
public function getRefund() {
|
||||
return $this->refund;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Resource extends \PPModel {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,27 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Rest\Call;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Sale extends Resource implements IResource {
|
||||
class Sale extends \PPModel implements IResource {
|
||||
|
||||
private static $credential;
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprected. Pass ApiContext to refund/get methods instead
|
||||
* @deprected. Pass ApiContext to create/get methods instead
|
||||
*/
|
||||
public static function setCredential($credential) {
|
||||
self::$credential = $credential;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for id
|
||||
* Identifier of the authorization transaction.
|
||||
* @param string $id
|
||||
*/
|
||||
public function setId($id) {
|
||||
@@ -29,7 +26,7 @@ class Sale extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for id
|
||||
* Identifier of the authorization transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getId() {
|
||||
@@ -37,55 +34,39 @@ class Sale extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for create_time
|
||||
* Time the resource was created.
|
||||
* @param string $create_time
|
||||
*/
|
||||
public function setCreate_time($create_time) {
|
||||
public function setCreateTime($create_time) {
|
||||
$this->create_time = $create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for create_time
|
||||
* Time the resource was created.
|
||||
* @return string
|
||||
*/
|
||||
public function getCreate_time() {
|
||||
public function getCreateTime() {
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for update_time
|
||||
* Time the resource was last updated.
|
||||
* @param string $update_time
|
||||
*/
|
||||
public function setUpdate_time($update_time) {
|
||||
public function setUpdateTime($update_time) {
|
||||
$this->update_time = $update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for update_time
|
||||
* Time the resource was last updated.
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdate_time() {
|
||||
public function getUpdateTime() {
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for state
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for state
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for amount
|
||||
* Amount being collected.
|
||||
* @param PayPal\Api\Amount $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
@@ -93,7 +74,7 @@ class Sale extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for amount
|
||||
* Amount being collected.
|
||||
* @return PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount() {
|
||||
@@ -101,87 +82,85 @@ class Sale extends Resource implements IResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for parent_payment
|
||||
* State of the sale transaction.
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the sale transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @param string $parent_payment
|
||||
*/
|
||||
public function setParent_payment($parent_payment) {
|
||||
public function setParentPayment($parent_payment) {
|
||||
$this->parent_payment = $parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for parent_payment
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
* @return string
|
||||
*/
|
||||
public function getParent_payment() {
|
||||
public function getParentPayment() {
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for links
|
||||
* @param PayPal\Api\Link $links
|
||||
*
|
||||
* @array
|
||||
* @param PayPal\Api\Links $links
|
||||
*/
|
||||
public function setLinks($links) {
|
||||
$this->links = $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for links
|
||||
* @return PayPal\Api\Link
|
||||
*
|
||||
* @return PayPal\Api\Links
|
||||
*/
|
||||
public function getLinks() {
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @path /v1/payments/sale/:sale-id
|
||||
* @method GET
|
||||
* @param string $saleid
|
||||
* @param PayPal\Rest\ApiContext $apiContext optional
|
||||
*/
|
||||
public static function get( $saleid, $apiContext=null) {
|
||||
if (($saleid == null) || (strlen($saleid) <= 0)) {
|
||||
throw new \InvalidArgumentException("saleid cannot be null or empty");
|
||||
public static function get($saleId, $apiContext = null) {
|
||||
if (($saleId == null) || (strlen($saleId) <= 0)) {
|
||||
throw new \InvalidArgumentException("saleId cannot be null or empty");
|
||||
}
|
||||
$payLoad = "";
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute( array('PayPal\Rest\RestHandler'),
|
||||
"/v1/payments/sale/$saleid",
|
||||
"GET", $payLoad);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/sale/$saleId", "GET", $payLoad);
|
||||
$ret = new Sale();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @path /v1/payments/sale/:sale-id/refund
|
||||
* @method POST
|
||||
* @param Refund $refund
|
||||
* @param PayPal\Rest\ApiContext $apiContext optional
|
||||
*/
|
||||
public function refund($refund, $apiContext = null) {
|
||||
if ($refund == null) {
|
||||
throw new \InvalidArgumentException("refund cannot be null");
|
||||
}
|
||||
if ($this->getId() == null) {
|
||||
throw new \InvalidArgumentException("Id cannot be null");
|
||||
}
|
||||
if (($refund == null)) {
|
||||
throw new \InvalidArgumentException("refund cannot be null or empty");
|
||||
}
|
||||
$payLoad = $refund->toJSON();
|
||||
if ($apiContext == null) {
|
||||
$apiContext = new ApiContext(self::$credential);
|
||||
}
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute( array('PayPal\Rest\RestHandler'),
|
||||
"/v1/payments/sale/{$this->getId()}/refund",
|
||||
"POST", $payLoad);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/sale/{$this->getId()}/refund", "POST", $payLoad);
|
||||
$ret = new Refund();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,28 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
class ShippingAddress extends Address {
|
||||
|
||||
|
||||
/**
|
||||
* Setter for recipient_name
|
||||
* Name of the recipient at this address.
|
||||
* @param string $recipient_name
|
||||
*/
|
||||
public function setRecipient_name($recipient_name) {
|
||||
public function setRecipientName($recipient_name) {
|
||||
$this->recipient_name = $recipient_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for recipient_name
|
||||
* Name of the recipient at this address.
|
||||
* @return string
|
||||
*/
|
||||
public function getRecipient_name() {
|
||||
public function getRecipientName() {
|
||||
return $this->recipient_name;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,15 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Transaction extends Resource {
|
||||
|
||||
|
||||
class Transaction extends \PPModel {
|
||||
/**
|
||||
* Setter for amount
|
||||
* Amount being collected.
|
||||
* @param PayPal\Api\Amount $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
@@ -17,7 +12,7 @@ class Transaction extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for amount
|
||||
* Amount being collected.
|
||||
* @return PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount() {
|
||||
@@ -25,7 +20,7 @@ class Transaction extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for payee
|
||||
* Recepient of the funds in this transaction.
|
||||
* @param PayPal\Api\Payee $payee
|
||||
*/
|
||||
public function setPayee($payee) {
|
||||
@@ -33,7 +28,7 @@ class Transaction extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for payee
|
||||
* Recepient of the funds in this transaction.
|
||||
* @return PayPal\Api\Payee
|
||||
*/
|
||||
public function getPayee() {
|
||||
@@ -41,7 +36,7 @@ class Transaction extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for description
|
||||
* Description of what is being paid for.
|
||||
* @param string $description
|
||||
*/
|
||||
public function setDescription($description) {
|
||||
@@ -49,7 +44,7 @@ class Transaction extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for description
|
||||
* Description of what is being paid for.
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription() {
|
||||
@@ -57,36 +52,53 @@ class Transaction extends Resource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for item_list
|
||||
* List of items being paid for.
|
||||
* @param PayPal\Api\ItemList $item_list
|
||||
*/
|
||||
public function setItem_list($item_list) {
|
||||
public function setItemList($item_list) {
|
||||
$this->item_list = $item_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for item_list
|
||||
* List of items being paid for.
|
||||
* @return PayPal\Api\ItemList
|
||||
*/
|
||||
public function getItem_list() {
|
||||
public function getItemList() {
|
||||
return $this->item_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for related_resources
|
||||
* @param PayPal\Api\SubTransaction $related_resources
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment.
|
||||
* @array
|
||||
* @param PayPal\Api\RelatedResources $related_resources
|
||||
*/
|
||||
public function setRelated_resources($related_resources) {
|
||||
public function setRelatedResources($related_resources) {
|
||||
$this->related_resources = $related_resources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for related_resources
|
||||
* @return PayPal\Api\SubTransaction
|
||||
* List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment.
|
||||
* @return PayPal\Api\RelatedResources
|
||||
*/
|
||||
public function getRelated_resources() {
|
||||
public function getRelatedResources() {
|
||||
return $this->related_resources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional transactions for complex payment (Parallel and Chained) scenarios.
|
||||
* @array
|
||||
* @param PayPal\Api\self $transactions
|
||||
*/
|
||||
public function setTransactions($transactions) {
|
||||
$this->transactions = $transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional transactions for complex payment (Parallel and Chained) scenarios.
|
||||
* @return PayPal\Api\self
|
||||
*/
|
||||
public function getTransactions() {
|
||||
return $this->transactions;
|
||||
}
|
||||
|
||||
}
|
||||
22
lib/PayPal/Api/Transactions.php
Normal file
22
lib/PayPal/Api/Transactions.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
|
||||
class Transactions extends \PPModel {
|
||||
/**
|
||||
* Amount being collected.
|
||||
* @param PayPal\Api\Amount $amount
|
||||
*/
|
||||
public function setAmount($amount) {
|
||||
$this->amount = $amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being collected.
|
||||
* @return PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount() {
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user