Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Update payments API to v1.9 #700

Merged
merged 2 commits into from
Oct 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions lib/PayPal/Api/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
* @package PayPal\Api
*
* @property string phone
* @property string type
*/
class Address extends BaseAddress
{
/**
* Phone number in E.123 format.
* Phone number in E.123 format. 50 characters max.
*
* @param string $phone
*
Expand All @@ -27,7 +28,7 @@ public function setPhone($phone)
}

/**
* Phone number in E.123 format.
* Phone number in E.123 format. 50 characters max.
*
* @return string
*/
Expand All @@ -36,4 +37,26 @@ public function getPhone()
return $this->phone;
}

/**
* Type of address (e.g., HOME_OR_WORK, GIFT etc).
*
* @param string $type
*
* @return $this
*/
public function setType($type)
{
$this->type = $type;
return $this;
}

/**
* Type of address (e.g., HOME_OR_WORK, GIFT etc).
*
* @return string
*/
public function getType()
{
return $this->type;
}
}
2 changes: 2 additions & 0 deletions lib/PayPal/Api/AlternatePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
*
* @package PayPal\Api
*
* @deprecated Used for limited release only.
*
* @property string alternate_payment_account_id
* @property string external_customer_id
* @property string alternate_payment_provider_id
Expand Down
10 changes: 5 additions & 5 deletions lib/PayPal/Api/Amount.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*
* @package PayPal\Api
*
* @property string currency
* @property string total
* @property string currency
* @property string total
* @property \PayPal\Api\Details details
*/
class Amount extends PayPalModel
Expand All @@ -23,7 +23,7 @@ class Amount extends PayPalModel
* 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). PayPal does not support all currencies.
*
* @param string $currency
*
*
* @return $this
*/
public function setCurrency($currency)
Expand All @@ -46,7 +46,7 @@ public function getCurrency()
* Total amount charged from the payer to the payee. In case of a refund, this is the refunded amount to the original payer from the payee. 10 characters max with support for 2 decimal places.
*
* @param string|double $total
*
*
* @return $this
*/
public function setTotal($total)
Expand All @@ -71,7 +71,7 @@ public function getTotal()
* Additional details of the payment amount.
*
* @param \PayPal\Api\Details $details
*
*
* @return $this
*/
public function setDetails($details)
Expand Down
130 changes: 89 additions & 41 deletions lib/PayPal/Api/Authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace PayPal\Api;

use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext;
use PayPal\Validation\ArgumentValidator;
use PayPal\Rest\ApiContext;

/**
* Class Authorization
Expand All @@ -13,29 +13,31 @@
*
* @package PayPal\Api
*
* @property string id
* @property \PayPal\Api\Amount amount
* @property string payment_mode
* @property string state
* @property string reason_code
* @property string pending_reason
* @property string protection_eligibility
* @property string protection_eligibility_type
* @property string id
* @property \PayPal\Api\Amount amount
* @property string payment_mode
* @property string state
* @property string reason_code
* @property string pending_reason
* @property string protection_eligibility
* @property string protection_eligibility_type
* @property \PayPal\Api\FmfDetails fmf_details
* @property string parent_payment
* @property string parent_payment
* @property \PayPal\Api\ProcessorResponse processor_response
* @property string valid_until
* @property string create_time
* @property string update_time
* @property \PayPal\Api\Links[] links
* @property string valid_until
* @property string create_time
* @property string update_time
* @property string reference_id
* @property string receipt_id
* @property \PayPal\Api\Links[] links
*/
class Authorization extends PayPalResourceModel
{
/**
* ID of the authorization transaction.
*
* @param string $id
*
*
* @return $this
*/
public function setId($id)
Expand All @@ -58,7 +60,7 @@ public function getId()
* Amount being authorized.
*
* @param \PayPal\Api\Amount $amount
*
*
* @return $this
*/
public function setAmount($amount)
Expand All @@ -82,7 +84,7 @@ public function getAmount()
* Valid Values: ["INSTANT_TRANSFER"]
*
* @param string $payment_mode
*
*
* @return $this
*/
public function setPaymentMode($payment_mode)
Expand All @@ -106,7 +108,7 @@ public function getPaymentMode()
* Valid Values: ["pending", "authorized", "partially_captured", "captured", "expired", "voided"]
*
* @param string $state
*
*
* @return $this
*/
public function setState($state)
Expand All @@ -130,7 +132,7 @@ public function getState()
* Valid Values: ["AUTHORIZATION"]
*
* @param string $reason_code
*
*
* @return $this
*/
public function setReasonCode($reason_code)
Expand All @@ -154,7 +156,7 @@ public function getReasonCode()
* Valid Values: ["AUTHORIZATION"]
*
* @param string $pending_reason
*
*
* @return $this
*/
public function setPendingReason($pending_reason)
Expand All @@ -178,7 +180,7 @@ public function getPendingReason()
* Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
*
* @param string $protection_eligibility
*
*
* @return $this
*/
public function setProtectionEligibility($protection_eligibility)
Expand All @@ -202,7 +204,7 @@ public function getProtectionEligibility()
* Valid Values: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"]
*
* @param string $protection_eligibility_type
*
*
* @return $this
*/
public function setProtectionEligibilityType($protection_eligibility_type)
Expand All @@ -225,7 +227,7 @@ public function getProtectionEligibilityType()
* Fraud Management Filter (FMF) details applied for the payment that could result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. See [Fraud Management Filters Summary](https://developer.paypal.com/docs/classic/fmf/integration-guide/FMFSummary/) for more information.
*
* @param \PayPal\Api\FmfDetails $fmf_details
*
*
* @return $this
*/
public function setFmfDetails($fmf_details)
Expand All @@ -248,7 +250,7 @@ public function getFmfDetails()
* ID of the Payment resource that this transaction is based on.
*
* @param string $parent_payment
*
*
* @return $this
*/
public function setParentPayment($parent_payment)
Expand Down Expand Up @@ -294,7 +296,7 @@ public function getProcessorResponse()
* Authorization expiration time and date as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
*
* @param string $valid_until
*
*
* @return $this
*/
public function setValidUntil($valid_until)
Expand All @@ -317,7 +319,7 @@ public function getValidUntil()
* Time of authorization as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
*
* @param string $create_time
*
*
* @return $this
*/
public function setCreateTime($create_time)
Expand All @@ -340,7 +342,7 @@ public function getCreateTime()
* Time that the resource was last updated.
*
* @param string $update_time
*
*
* @return $this
*/
public function setUpdateTime($update_time)
Expand All @@ -360,11 +362,57 @@ public function getUpdateTime()
}

/**
* Retrieve details about a previously created authorization by passing the authorization_id in the request URI.
* Identifier to the purchase or transaction unit corresponding to this authorization transaction.
*
* @param string $reference_id
*
* @return $this
*/
public function setReferenceId($reference_id)
{
$this->reference_id = $reference_id;
return $this;
}

/**
* Identifier to the purchase or transaction unit corresponding to this authorization transaction.
*
* @return string
*/
public function getReferenceId()
{
return $this->reference_id;
}

/**
* Receipt id is 16 digit number payment identification number returned for guest users to identify the payment.
*
* @param string $receipt_id
*
* @return $this
*/
public function setReceiptId($receipt_id)
{
$this->receipt_id = $receipt_id;
return $this;
}

/**
* Receipt id is 16 digit number payment identification number returned for guest users to identify the payment.
*
* @return string
*/
public function getReceiptId()
{
return $this->receipt_id;
}

/**
* Shows details for an authorization, by ID.
*
* @param string $authorizationId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @param string $authorizationId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Authorization
*/
public static function get($authorizationId, $apiContext = null, $restCall = null)
Expand All @@ -385,11 +433,11 @@ public static function get($authorizationId, $apiContext = null, $restCall = nul
}

/**
* Capture and process a previously created authorization by passing the authorization_id in the request URI. To use this request, the original payment call must have the intent set to authorize.
* Captures and processes an authorization, by ID. To use this call, the original payment call must specify an intent of `authorize`.
*
* @param Capture $capture
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @param Capture $capture
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Capture
*/
public function capture($capture, $apiContext = null, $restCall = null)
Expand All @@ -411,10 +459,10 @@ public function capture($capture, $apiContext = null, $restCall = null)
}

/**
* Void (cancel) a previously authorized payment by passing the authorization_id in the request URI. Note that a fully captured authorization cannot be voided.
* Voids, or cancels, an authorization, by ID. You cannot void a fully captured authorization.
*
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Authorization
*/
public function void($apiContext = null, $restCall = null)
Expand All @@ -434,10 +482,10 @@ public function void($apiContext = null, $restCall = null)
}

/**
* Reauthorize a PayPal account payment by passing the authorization_id in the request URI. You should reauthorize a payment after the initial 3-day honor period to ensure that funds are still available. Request supports only amount field
* Reauthorizes a PayPal account payment, by authorization ID. To ensure that funds are still available, reauthorize a payment after the initial three-day honor period. Supports only the `amount` request parameter.
*
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Authorization
*/
public function reauthorize($apiContext = null, $restCall = null)
Expand Down
Loading