forked from LiveCarta/PayPal-PHP-SDK
updated stubs
This commit is contained in:
@@ -1,210 +1,164 @@
|
||||
<?php
|
||||
|
||||
<?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) {
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for id
|
||||
* Identifier of the refund transaction.
|
||||
* @return string
|
||||
*/
|
||||
*/
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
$this->amount = $amount;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setter for sale_id
|
||||
* @param string $sale_id
|
||||
*/
|
||||
public function setSale_id($sale_id) {
|
||||
$this->sale_id = $sale_id;
|
||||
}
|
||||
|
||||
* State of the refund transaction.
|
||||
* @param string $state
|
||||
*/
|
||||
public function setState($state) {
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for sale_id
|
||||
* State of the refund transaction.
|
||||
* @return string
|
||||
*/
|
||||
public function getSale_id() {
|
||||
*/
|
||||
public function getState() {
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Sale transaction being refunded.
|
||||
* @param string $sale_id
|
||||
*/
|
||||
public function setSaleId($sale_id) {
|
||||
$this->sale_id = $sale_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Sale transaction being refunded.
|
||||
* @return string
|
||||
*/
|
||||
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) {
|
||||
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);
|
||||
$call = new \PPRestCall($apiContext);
|
||||
$json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/payments/refund/$refundId", "GET", $payLoad);
|
||||
$ret = new Refund();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user