diff --git a/lib/PayPal/Api/Address.php b/lib/PayPal/Api/Address.php index aba5a706..56d95e85 100644 --- a/lib/PayPal/Api/Address.php +++ b/lib/PayPal/Api/Address.php @@ -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 * @@ -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 */ @@ -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; + } } diff --git a/lib/PayPal/Api/AlternatePayment.php b/lib/PayPal/Api/AlternatePayment.php index 0af3226e..7999c5f5 100644 --- a/lib/PayPal/Api/AlternatePayment.php +++ b/lib/PayPal/Api/AlternatePayment.php @@ -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 diff --git a/lib/PayPal/Api/Amount.php b/lib/PayPal/Api/Amount.php index 72217300..82fd6c8e 100644 --- a/lib/PayPal/Api/Amount.php +++ b/lib/PayPal/Api/Amount.php @@ -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 @@ -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) @@ -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) @@ -71,7 +71,7 @@ public function getTotal() * Additional details of the payment amount. * * @param \PayPal\Api\Details $details - * + * * @return $this */ public function setDetails($details) diff --git a/lib/PayPal/Api/Authorization.php b/lib/PayPal/Api/Authorization.php index 142d0604..5da9d458 100644 --- a/lib/PayPal/Api/Authorization.php +++ b/lib/PayPal/Api/Authorization.php @@ -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 @@ -13,21 +13,23 @@ * * @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 { @@ -35,7 +37,7 @@ class Authorization extends PayPalResourceModel * ID of the authorization transaction. * * @param string $id - * + * * @return $this */ public function setId($id) @@ -58,7 +60,7 @@ public function getId() * Amount being authorized. * * @param \PayPal\Api\Amount $amount - * + * * @return $this */ public function setAmount($amount) @@ -82,7 +84,7 @@ public function getAmount() * Valid Values: ["INSTANT_TRANSFER"] * * @param string $payment_mode - * + * * @return $this */ public function setPaymentMode($payment_mode) @@ -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) @@ -130,7 +132,7 @@ public function getState() * Valid Values: ["AUTHORIZATION"] * * @param string $reason_code - * + * * @return $this */ public function setReasonCode($reason_code) @@ -154,7 +156,7 @@ public function getReasonCode() * Valid Values: ["AUTHORIZATION"] * * @param string $pending_reason - * + * * @return $this */ public function setPendingReason($pending_reason) @@ -178,7 +180,7 @@ public function getPendingReason() * Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"] * * @param string $protection_eligibility - * + * * @return $this */ public function setProtectionEligibility($protection_eligibility) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) diff --git a/lib/PayPal/Api/BankAccount.php b/lib/PayPal/Api/BankAccount.php index 4a45f8d1..79803f7f 100644 --- a/lib/PayPal/Api/BankAccount.php +++ b/lib/PayPal/Api/BankAccount.php @@ -11,38 +11,37 @@ * * @package PayPal\Api * - * @property string account_number - * @property string account_number_type - * @property string routing_number - * @property string account_type - * @property string account_name - * @property string check_type - * @property string auth_type - * @property string auth_capture_timestamp - * @property string bank_name - * @property string country_code - * @property string first_name - * @property string last_name - * @property string birth_date + * @property string account_number + * @property string account_number_type + * @property string routing_number + * @property string account_type + * @property string account_name + * @property string check_type + * @property string auth_type + * @property string auth_capture_timestamp + * @property string bank_name + * @property string country_code + * @property string first_name + * @property string last_name + * @property string birth_date * @property \PayPal\Api\Address billing_address - * @property string state - * @property string confirmation_status - * @property string payer_id - * @property string external_customer_id - * @property string merchant_id - * @property string create_time - * @property string update_time - * @property string valid_until + * @property string state + * @property string confirmation_status + * @property string payer_id + * @property string external_customer_id + * @property string merchant_id + * @property string create_time + * @property string update_time + * @property string valid_until * @property \PayPal\Api\Links[] links */ class BankAccount extends PayPalModel { /** * ID of the bank account being saved for later use. - * * @deprecated Not publicly available * @param string $id - * + * * @return $this */ public function setId($id) @@ -53,7 +52,6 @@ public function setId($id) /** * ID of the bank account being saved for later use. - * * @deprecated Not publicly available * @return string */ @@ -66,7 +64,7 @@ public function getId() * Account number in either IBAN (max length 34) or BBAN (max length 17) format. * * @param string $account_number - * + * * @return $this */ public function setAccountNumber($account_number) @@ -90,7 +88,7 @@ public function getAccountNumber() * Valid Values: ["BBAN", "IBAN"] * * @param string $account_number_type - * + * * @return $this */ public function setAccountNumberType($account_number_type) @@ -113,7 +111,7 @@ public function getAccountNumberType() * Routing transit number (aka Bank Code) of the bank (typically for domestic use only - for international use, IBAN includes bank code). For more information refer to http://en.wikipedia.org/wiki/Bank_code. * * @param string $routing_number - * + * * @return $this */ public function setRoutingNumber($routing_number) @@ -137,7 +135,7 @@ public function getRoutingNumber() * Valid Values: ["CHECKING", "SAVINGS"] * * @param string $account_type - * + * * @return $this */ public function setAccountType($account_type) @@ -160,7 +158,7 @@ public function getAccountType() * A customer designated name. * * @param string $account_name - * + * * @return $this */ public function setAccountName($account_name) @@ -184,7 +182,7 @@ public function getAccountName() * Valid Values: ["PERSONAL", "COMPANY"] * * @param string $check_type - * + * * @return $this */ public function setCheckType($check_type) @@ -208,7 +206,7 @@ public function getCheckType() * Valid Values: ["CCD", "PPD", "TEL", "POP", "ARC", "RCK", "WEB"] * * @param string $auth_type - * + * * @return $this */ public function setAuthType($auth_type) @@ -231,7 +229,7 @@ public function getAuthType() * Time at which the authorization (or check) was captured. Use this field if the user authorization needs to be captured due to any privacy requirements. * * @param string $auth_capture_timestamp - * + * * @return $this */ public function setAuthCaptureTimestamp($auth_capture_timestamp) @@ -254,7 +252,7 @@ public function getAuthCaptureTimestamp() * Name of the bank. * * @param string $bank_name - * + * * @return $this */ public function setBankName($bank_name) @@ -277,7 +275,7 @@ public function getBankName() * 2 letter country code of the Bank. * * @param string $country_code - * + * * @return $this */ public function setCountryCode($country_code) @@ -300,7 +298,7 @@ public function getCountryCode() * Account holder's first name. * * @param string $first_name - * + * * @return $this */ public function setFirstName($first_name) @@ -323,7 +321,7 @@ public function getFirstName() * Account holder's last name. * * @param string $last_name - * + * * @return $this */ public function setLastName($last_name) @@ -346,7 +344,7 @@ public function getLastName() * Birth date of the bank account holder. * * @param string $birth_date - * + * * @return $this */ public function setBirthDate($birth_date) @@ -369,7 +367,7 @@ public function getBirthDate() * Billing address. * * @param \PayPal\Api\Address $billing_address - * + * * @return $this */ public function setBillingAddress($billing_address) @@ -393,7 +391,7 @@ public function getBillingAddress() * Valid Values: ["ACTIVE", "INACTIVE", "DELETED"] * * @param string $state - * + * * @return $this */ public function setState($state) @@ -417,7 +415,7 @@ public function getState() * Valid Values: ["UNCONFIRMED", "CONFIRMED"] * * @param string $confirmation_status - * + * * @return $this */ public function setConfirmationStatus($confirmation_status) @@ -440,7 +438,7 @@ public function getConfirmationStatus() * [DEPRECATED] Use external_customer_id instead. * * @param string $payer_id - * + * * @return $this */ public function setPayerId($payer_id) @@ -463,7 +461,7 @@ public function getPayerId() * A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault. * * @param string $external_customer_id - * + * * @return $this */ public function setExternalCustomerId($external_customer_id) @@ -483,10 +481,10 @@ public function getExternalCustomerId() } /** - * A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchnt. + * A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant. * * @param string $merchant_id - * + * * @return $this */ public function setMerchantId($merchant_id) @@ -496,7 +494,7 @@ public function setMerchantId($merchant_id) } /** - * A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchnt. + * A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant. * * @return string */ @@ -509,7 +507,7 @@ public function getMerchantId() * Time the resource was created. * * @param string $create_time - * + * * @return $this */ public function setCreateTime($create_time) @@ -532,7 +530,7 @@ public function getCreateTime() * Time the resource was last updated. * * @param string $update_time - * + * * @return $this */ public function setUpdateTime($update_time) @@ -555,7 +553,7 @@ public function getUpdateTime() * Date/Time until this resource can be used to fund a payment. * * @param string $valid_until - * + * * @return $this */ public function setValidUntil($valid_until) @@ -578,7 +576,7 @@ public function getValidUntil() * Sets Links * * @param \PayPal\Api\Links[] $links - * + * * @return $this */ public function setLinks($links) diff --git a/lib/PayPal/Api/Billing.php b/lib/PayPal/Api/Billing.php index 7b1bad69..727f907f 100644 --- a/lib/PayPal/Api/Billing.php +++ b/lib/PayPal/Api/Billing.php @@ -11,6 +11,8 @@ * * @package PayPal\Api * + * @deprecated Used internally only. + * * @property string billing_agreement_id */ class Billing extends PayPalModel diff --git a/lib/PayPal/Api/Capture.php b/lib/PayPal/Api/Capture.php index b3580a72..8358bfd7 100644 --- a/lib/PayPal/Api/Capture.php +++ b/lib/PayPal/Api/Capture.php @@ -3,8 +3,9 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; -use PayPal\Rest\ApiContext; +use PayPal\Transport\PayPalRestCall; use PayPal\Validation\ArgumentValidator; +use PayPal\Rest\ApiContext; /** * Class Capture @@ -13,23 +14,25 @@ * * @package PayPal\Api * - * @property string id - * @property \PayPal\Api\Amount amount - * @property bool is_final_capture - * @property string state - * @property string parent_payment + * @property string id + * @property \PayPal\Api\Amount amount + * @property bool is_final_capture + * @property string state + * @property string reason_code + * @property string parent_payment + * @property string invoice_number * @property \PayPal\Api\Currency transaction_fee - * @property string create_time - * @property string update_time - * @property \PayPal\Api\Links[] links + * @property string create_time + * @property string update_time + * @property \PayPal\Api\Links[] links */ class Capture extends PayPalResourceModel { /** - * ID of the capture transaction. + * The ID of the capture transaction. * * @param string $id - * + * * @return $this */ public function setId($id) @@ -39,7 +42,7 @@ public function setId($id) } /** - * ID of the capture transaction. + * The ID of the capture transaction. * * @return string */ @@ -49,10 +52,10 @@ public function getId() } /** - * Amount being captured. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`. + * The amount to capture. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`. * * @param \PayPal\Api\Amount $amount - * + * * @return $this */ public function setAmount($amount) @@ -62,7 +65,7 @@ public function setAmount($amount) } /** - * Amount being captured. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`. + * The amount to capture. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`. * * @return \PayPal\Api\Amount */ @@ -72,10 +75,10 @@ public function getAmount() } /** - * If set to `true`, all remaining funds held by the authorization will be released in the funding instrument. + * Indicates whether to release all remaining funds that the authorization holds in the funding instrument. Default is `false`. * * @param bool $is_final_capture - * + * * @return $this */ public function setIsFinalCapture($is_final_capture) @@ -85,7 +88,7 @@ public function setIsFinalCapture($is_final_capture) } /** - * If set to `true`, all remaining funds held by the authorization will be released in the funding instrument. + * Indicates whether to release all remaining funds that the authorization holds in the funding instrument. Default is `false`. * * @return bool */ @@ -95,11 +98,11 @@ public function getIsFinalCapture() } /** - * State of the capture. + * The state of the capture. * Valid Values: ["pending", "completed", "refunded", "partially_refunded"] * * @param string $state - * + * * @return $this */ public function setState($state) @@ -109,7 +112,7 @@ public function setState($state) } /** - * State of the capture. + * The state of the capture. * * @return string */ @@ -119,10 +122,34 @@ public function getState() } /** - * ID of the payment resource on which this transaction is based. + * The reason code that describes why the transaction state is pending or reversed. + * Valid Values: ["CHARGEBACK", "GUARANTEE", "BUYER_COMPLAINT", "REFUND", "UNCONFIRMED_SHIPPING_ADDRESS", "ECHECK", "INTERNATIONAL_WITHDRAWAL", "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION", "PAYMENT_REVIEW", "REGULATORY_REVIEW", "UNILATERAL", "VERIFICATION_REQUIRED", "TRANSACTION_APPROVED_AWAITING_FUNDING"] * - * @param string $parent_payment + * @param string $reason_code + * + * @return $this + */ + public function setReasonCode($reason_code) + { + $this->reason_code = $reason_code; + return $this; + } + + /** + * The reason code that describes why the transaction state is pending or reversed. + * + * @return string + */ + public function getReasonCode() + { + return $this->reason_code; + } + + /** + * The ID of the payment on which this transaction is based. * + * @param string $parent_payment + * * @return $this */ public function setParentPayment($parent_payment) @@ -132,7 +159,7 @@ public function setParentPayment($parent_payment) } /** - * ID of the payment resource on which this transaction is based. + * The ID of the payment on which this transaction is based. * * @return string */ @@ -142,10 +169,33 @@ public function getParentPayment() } /** - * Transaction fee applicable for this payment. + * The invoice number to track this payment. * - * @param \PayPal\Api\Currency $transaction_fee + * @param string $invoice_number + * + * @return $this + */ + public function setInvoiceNumber($invoice_number) + { + $this->invoice_number = $invoice_number; + return $this; + } + + /** + * The invoice number to track this payment. * + * @return string + */ + public function getInvoiceNumber() + { + return $this->invoice_number; + } + + /** + * The transaction fee for this payment. + * + * @param \PayPal\Api\Currency $transaction_fee + * * @return $this */ public function setTransactionFee($transaction_fee) @@ -155,7 +205,7 @@ public function setTransactionFee($transaction_fee) } /** - * Transaction fee applicable for this payment. + * The transaction fee for this payment. * * @return \PayPal\Api\Currency */ @@ -165,10 +215,10 @@ public function getTransactionFee() } /** - * Time of capture as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). + * The date and time of capture, 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) @@ -178,7 +228,7 @@ public function setCreateTime($create_time) } /** - * Time of capture as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). + * The date and time of capture, as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). * * @return string */ @@ -188,10 +238,10 @@ public function getCreateTime() } /** - * Time that the resource was last updated. + * The date and time when the resource was last updated. * * @param string $update_time - * + * * @return $this */ public function setUpdateTime($update_time) @@ -201,7 +251,7 @@ public function setUpdateTime($update_time) } /** - * Time that the resource was last updated. + * The date and time when the resource was last updated. * * @return string */ @@ -211,11 +261,11 @@ public function getUpdateTime() } /** - * Retrieve details about a captured payment by passing the capture_id in the request URI. + * Shows details for a captured payment, by ID. * - * @param string $captureId - * @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 $captureId + * @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 static function get($captureId, $apiContext = null, $restCall = null) @@ -238,6 +288,7 @@ public static function get($captureId, $apiContext = null, $restCall = null) /** * Refund a captured payment by passing the capture_id in the request URI. In addition, include an amount object in the body of the request JSON. * + * @deprecated Please use #refundCapturedPayment instead. * @param Refund $refund * @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 @@ -261,4 +312,30 @@ public function refund($refund, $apiContext = null, $restCall = null) return $ret; } + /** + * Refunds a captured payment, by ID. Include an `amount` object in the JSON request body. + * + * @param RefundRequest $refundRequest + * @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 DetailedRefund + */ + public function refundCapturedPayment($refundRequest, $apiContext = null, $restCall = null) + { + ArgumentValidator::validate($this->getId(), "Id"); + ArgumentValidator::validate($refundRequest, 'refundRequest'); + $payLoad = $refundRequest->toJSON(); + $json = self::executeCall( + "/v1/payments/capture/{$this->getId()}/refund", + "POST", + $payLoad, + null, + $apiContext, + $restCall + ); + $ret = new DetailedRefund(); + $ret->fromJson($json); + return $ret; + } + } diff --git a/lib/PayPal/Api/CarrierAccount.php b/lib/PayPal/Api/CarrierAccount.php index 2e7c8d79..7f245b04 100644 --- a/lib/PayPal/Api/CarrierAccount.php +++ b/lib/PayPal/Api/CarrierAccount.php @@ -7,7 +7,7 @@ /** * Class CarrierAccount * - * Payment Instrument that facilitates carrier billing + * Payment instrument that enables carrier billing. * * @package PayPal\Api * @@ -20,7 +20,7 @@ class CarrierAccount extends PayPalModel { /** - * ID that identifies the payer�s carrier account. Can be used in subsequent REST API calls, e.g. for making payments. + * The ID of the carrier account of the payer. Use in subsequent REST API calls. For example, to make payments. * * @param string $id * @@ -33,7 +33,7 @@ public function setId($id) } /** - * ID that identifies the payer�s carrier account. Can be used in subsequent REST API calls, e.g. for making payments. + * The ID of the carrier account of the payer. Use in subsequent REST API calls. For example, to make payments. * * @return string */ @@ -43,7 +43,7 @@ public function getId() } /** - * The payer�s phone number in E.164 format. + * The phone number of the payer, in E.164 format. * * @param string $phone_number * @@ -56,7 +56,7 @@ public function setPhoneNumber($phone_number) } /** - * The payer�s phone number in E.164 format. + * The phone number of the payer, in E.164 format. * * @return string */ @@ -66,7 +66,7 @@ public function getPhoneNumber() } /** - * User identifier as created by the merchant. + * The ID of the customer, as created by the merchant. * * @param string $external_customer_id * @@ -79,7 +79,7 @@ public function setExternalCustomerId($external_customer_id) } /** - * User identifier as created by the merchant. + * The ID of the customer, as created by the merchant. * * @return string */ @@ -89,7 +89,7 @@ public function getExternalCustomerId() } /** - * The method of obtaining the phone number (USER_PROVIDED or READ_FROM_DEVICE). + * The method used to obtain the phone number. Value is `READ_FROM_DEVICE` or `USER_PROVIDED`. * Valid Values: ["READ_FROM_DEVICE", "USER_PROVIDED"] * * @param string $phone_source @@ -103,7 +103,7 @@ public function setPhoneSource($phone_source) } /** - * The method of obtaining the phone number (USER_PROVIDED or READ_FROM_DEVICE). + * The method used to obtain the phone number. Value is `READ_FROM_DEVICE` or `USER_PROVIDED`. * * @return string */ @@ -113,7 +113,7 @@ public function getPhoneSource() } /** - * The country where the phone number is registered. Specified in 2-character IS0-3166-1 format. + * The ISO 3166-1 alpha-2 country code where the phone number is registered. * * @param \PayPal\Api\CountryCode $country_code * @@ -126,7 +126,7 @@ public function setCountryCode($country_code) } /** - * The country where the phone number is registered. Specified in 2-character IS0-3166-1 format. + * The ISO 3166-1 alpha-2 country code where the phone number is registered. * * @return \PayPal\Api\CountryCode */ diff --git a/lib/PayPal/Api/CarrierAccountToken.php b/lib/PayPal/Api/CarrierAccountToken.php index 1313f65c..9fc987b3 100644 --- a/lib/PayPal/Api/CarrierAccountToken.php +++ b/lib/PayPal/Api/CarrierAccountToken.php @@ -20,7 +20,7 @@ class CarrierAccountToken extends PayPalModel * ID of a previously saved carrier account resource. * * @param string $carrier_account_id - * + * * @return $this */ public function setCarrierAccountId($carrier_account_id) @@ -43,7 +43,7 @@ public function getCarrierAccountId() * The unique identifier of the payer used when saving this carrier account instrument. * * @param string $external_customer_id - * + * * @return $this */ public function setExternalCustomerId($external_customer_id) diff --git a/lib/PayPal/Api/CartBase.php b/lib/PayPal/Api/CartBase.php index 32aa8a59..eebd8305 100644 --- a/lib/PayPal/Api/CartBase.php +++ b/lib/PayPal/Api/CartBase.php @@ -12,17 +12,18 @@ * * @package PayPal\Api * - * @property string reference_id - * @property \PayPal\Api\Amount amount - * @property string description - * @property string note_to_payee - * @property string custom - * @property string invoice_number - * @property string soft_descriptor + * @property string reference_id + * @property \PayPal\Api\Amount amount + * @property \PayPal\Api\Payee payee + * @property string description + * @property string note_to_payee + * @property string custom + * @property string invoice_number + * @property string soft_descriptor * @property \PayPal\Api\PaymentOptions payment_options - * @property \PayPal\Api\ItemList item_list - * @property string notify_url - * @property string order_url + * @property \PayPal\Api\ItemList item_list + * @property string notify_url + * @property string order_url */ class CartBase extends PayPalModel { @@ -30,7 +31,7 @@ class CartBase extends PayPalModel * Merchant identifier to the purchase unit. Optional parameter * * @param string $reference_id - * + * * @return $this */ public function setReferenceId($reference_id) @@ -53,7 +54,7 @@ public function getReferenceId() * Amount being collected. * * @param \PayPal\Api\Amount $amount - * + * * @return $this */ public function setAmount($amount) @@ -75,9 +76,8 @@ public function getAmount() /** * Recipient of the funds in this transaction. * - * @deprecated Not publicly available * @param \PayPal\Api\Payee $payee - * + * * @return $this */ public function setPayee($payee) @@ -89,7 +89,6 @@ public function setPayee($payee) /** * Recipient of the funds in this transaction. * - * @deprecated Not publicly available * @return \PayPal\Api\Payee */ public function getPayee() @@ -98,10 +97,10 @@ public function getPayee() } /** - * Description of transaction. + * Description of what is being paid for. * * @param string $description - * + * * @return $this */ public function setDescription($description) @@ -111,7 +110,7 @@ public function setDescription($description) } /** - * Description of transaction. + * Description of what is being paid for. * * @return string */ @@ -124,7 +123,7 @@ public function getDescription() * Note to the recipient of the funds in this transaction. * * @param string $note_to_payee - * + * * @return $this */ public function setNoteToPayee($note_to_payee) @@ -144,10 +143,10 @@ public function getNoteToPayee() } /** - * Free-form field for the use of clients. Only supported when the `payment_method` is set to `paypal`. + * free-form field for the use of clients * * @param string $custom - * + * * @return $this */ public function setCustom($custom) @@ -157,7 +156,7 @@ public function setCustom($custom) } /** - * Free-form field for the use of clients. Only supported when the `payment_method` is set to `paypal`. + * free-form field for the use of clients * * @return string */ @@ -167,10 +166,10 @@ public function getCustom() } /** - * Invoice number used to track the payment. Only supported when the `payment_method` is set to `paypal`. + * invoice number to track this payment * * @param string $invoice_number - * + * * @return $this */ public function setInvoiceNumber($invoice_number) @@ -180,7 +179,7 @@ public function setInvoiceNumber($invoice_number) } /** - * Invoice number used to track the payment. Only supported when the `payment_method` is set to `paypal`. + * invoice number to track this payment * * @return string */ @@ -193,7 +192,7 @@ public function getInvoiceNumber() * Soft descriptor used when charging this funding source. If length exceeds max length, the value will be truncated * * @param string $soft_descriptor - * + * * @return $this */ public function setSoftDescriptor($soft_descriptor) @@ -214,10 +213,9 @@ public function getSoftDescriptor() /** * Soft descriptor city used when charging this funding source. If length exceeds max length, the value will be truncated. Only supported when the `payment_method` is set to `credit_card` - * * @deprecated Not publicly available * @param string $soft_descriptor_city - * + * * @return $this */ public function setSoftDescriptorCity($soft_descriptor_city) @@ -228,7 +226,6 @@ public function setSoftDescriptorCity($soft_descriptor_city) /** * Soft descriptor city used when charging this funding source. If length exceeds max length, the value will be truncated. Only supported when the `payment_method` is set to `credit_card` - * * @deprecated Not publicly available * @return string */ @@ -241,7 +238,7 @@ public function getSoftDescriptorCity() * Payment options requested for this purchase unit * * @param \PayPal\Api\PaymentOptions $payment_options - * + * * @return $this */ public function setPaymentOptions($payment_options) @@ -261,10 +258,10 @@ public function getPaymentOptions() } /** - * Items and related shipping address within a transaction. + * List of items being paid for. * * @param \PayPal\Api\ItemList $item_list - * + * * @return $this */ public function setItemList($item_list) @@ -274,7 +271,7 @@ public function setItemList($item_list) } /** - * Items and related shipping address within a transaction. + * List of items being paid for. * * @return \PayPal\Api\ItemList */ @@ -333,7 +330,6 @@ public function getOrderUrl() /** * List of external funding being applied to the purchase unit. Each external_funding unit should have a unique reference_id - * * @deprecated Not publicly available * @param \PayPal\Api\ExternalFunding[] $external_funding * @@ -347,7 +343,6 @@ public function setExternalFunding($external_funding) /** * List of external funding being applied to the purchase unit. Each external_funding unit should have a unique reference_id - * * @deprecated Not publicly available * @return \PayPal\Api\ExternalFunding[] */ @@ -358,7 +353,6 @@ public function getExternalFunding() /** * Append ExternalFunding to the list. - * * @deprecated Not publicly available * @param \PayPal\Api\ExternalFunding $externalFunding * @return $this @@ -376,7 +370,6 @@ public function addExternalFunding($externalFunding) /** * Remove ExternalFunding from the list. - * * @deprecated Not publicly available * @param \PayPal\Api\ExternalFunding $externalFunding * @return $this diff --git a/lib/PayPal/Api/CountryCode.php b/lib/PayPal/Api/CountryCode.php index 18b45ace..48ef51db 100644 --- a/lib/PayPal/Api/CountryCode.php +++ b/lib/PayPal/Api/CountryCode.php @@ -7,7 +7,7 @@ /** * Class CountryCode * - * Representation of a country code. + * The ISO 3166-1 alpha-2 country code. A complete list of valid codes is available at Wikipedia: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 In particular, note that the country code for Great Britain is GB, not UK as used in that country's top-level domain names. * * @package PayPal\Api * @@ -19,7 +19,7 @@ class CountryCode extends PayPalModel * ISO country code based on 2-character IS0-3166-1 codes. * * @param string $country_code - * + * * @return $this */ public function setCountryCode($country_code) diff --git a/lib/PayPal/Api/Credit.php b/lib/PayPal/Api/Credit.php index a37370d7..14fca8df 100644 --- a/lib/PayPal/Api/Credit.php +++ b/lib/PayPal/Api/Credit.php @@ -20,7 +20,7 @@ class Credit extends PayPalModel * Unique identifier of credit resource. * * @param string $id - * + * * @return $this */ public function setId($id) @@ -44,7 +44,7 @@ public function getId() * Valid Values: ["BILL_ME_LATER", "PAYPAL_EXTRAS_MASTERCARD", "EBAY_MASTERCARD", "PAYPAL_SMART_CONNECT"] * * @param string $type - * + * * @return $this */ public function setType($type) diff --git a/lib/PayPal/Api/CreditCard.php b/lib/PayPal/Api/CreditCard.php index 74e73fe4..ad00bb0b 100644 --- a/lib/PayPal/Api/CreditCard.php +++ b/lib/PayPal/Api/CreditCard.php @@ -331,7 +331,7 @@ public function getExternalCardId() } /** - * State of the funding instrument. + * State of the credit card funding instrument. * Valid Values: ["expired", "ok"] * * @param string $state diff --git a/lib/PayPal/Api/CreditCardToken.php b/lib/PayPal/Api/CreditCardToken.php index b43e1961..301e9ddf 100644 --- a/lib/PayPal/Api/CreditCardToken.php +++ b/lib/PayPal/Api/CreditCardToken.php @@ -15,8 +15,8 @@ * @property string payer_id * @property string last4 * @property string type - * @property int expire_month - * @property int expire_year + * @property int expire_month + * @property int expire_year */ class CreditCardToken extends PayPalModel { @@ -24,7 +24,7 @@ class CreditCardToken extends PayPalModel * ID of credit card previously stored using `/vault/credit-card`. * * @param string $credit_card_id - * + * * @return $this */ public function setCreditCardId($credit_card_id) @@ -47,7 +47,7 @@ public function getCreditCardId() * A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. **Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault.** * * @param string $payer_id - * + * * @return $this */ public function setPayerId($payer_id) @@ -70,7 +70,7 @@ public function getPayerId() * Last four digits of the stored credit card number. * * @param string $last4 - * + * * @return $this */ public function setLast4($last4) @@ -93,7 +93,7 @@ public function getLast4() * Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`. Values are presented in lowercase and not should not be used for display. * * @param string $type - * + * * @return $this */ public function setType($type) @@ -116,7 +116,7 @@ public function getType() * Expiration month with no leading zero. Acceptable values are 1 through 12. * * @param int $expire_month - * + * * @return $this */ public function setExpireMonth($expire_month) @@ -139,7 +139,7 @@ public function getExpireMonth() * 4-digit expiration year. * * @param int $expire_year - * + * * @return $this */ public function setExpireYear($expire_year) diff --git a/lib/PayPal/Api/Currency.php b/lib/PayPal/Api/Currency.php index d50fc666..eb53eb9b 100644 --- a/lib/PayPal/Api/Currency.php +++ b/lib/PayPal/Api/Currency.php @@ -19,7 +19,7 @@ class Currency extends PayPalModel { /** - * 3 letter currency code + * 3 letter currency code as defined by ISO 4217. * * @param string $currency * @@ -32,7 +32,7 @@ public function setCurrency($currency) } /** - * 3 letter currency code + * 3 letter currency code as defined by ISO 4217. * * @return string */ @@ -42,7 +42,7 @@ public function getCurrency() } /** - * amount upto 2 decimals represented as string + * amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code. * * @param string|double $value * @@ -57,7 +57,7 @@ public function setValue($value) } /** - * amount upto 2 decimals represented as string + * amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code. * * @return string */ diff --git a/lib/PayPal/Api/CurrencyConversion.php b/lib/PayPal/Api/CurrencyConversion.php index 3811277d..53479862 100644 --- a/lib/PayPal/Api/CurrencyConversion.php +++ b/lib/PayPal/Api/CurrencyConversion.php @@ -12,13 +12,13 @@ * * @package PayPal\Api * - * @property string conversion_date - * @property string from_currency - * @property string from_amount - * @property string to_currency - * @property string to_amount - * @property string conversion_type - * @property bool conversion_type_changeable + * @property string conversion_date + * @property string from_currency + * @property string from_amount + * @property string to_currency + * @property string to_amount + * @property string conversion_type + * @property bool conversion_type_changeable * @property \PayPal\Api\Links[] links */ class CurrencyConversion extends PayPalModel @@ -27,7 +27,7 @@ class CurrencyConversion extends PayPalModel * Date of validity for the conversion rate. * * @param string $conversion_date - * + * * @return $this */ public function setConversionDate($conversion_date) @@ -50,7 +50,7 @@ public function getConversionDate() * 3 letter currency code * * @param string $from_currency - * + * * @return $this */ public function setFromCurrency($from_currency) @@ -70,10 +70,10 @@ public function getFromCurrency() } /** - * Amount participating in currency conversion, set to 1 as default + * Amount participating in currency conversion, set to 1 as default * * @param string $from_amount - * + * * @return $this */ public function setFromAmount($from_amount) @@ -83,7 +83,7 @@ public function setFromAmount($from_amount) } /** - * Amount participating in currency conversion, set to 1 as default + * Amount participating in currency conversion, set to 1 as default * * @return string */ @@ -96,7 +96,7 @@ public function getFromAmount() * 3 letter currency code * * @param string $to_currency - * + * * @return $this */ public function setToCurrency($to_currency) @@ -119,7 +119,7 @@ public function getToCurrency() * Amount resulting from currency conversion. * * @param string $to_amount - * + * * @return $this */ public function setToAmount($to_amount) @@ -143,7 +143,7 @@ public function getToAmount() * Valid Values: ["PAYPAL", "VENDOR"] * * @param string $conversion_type - * + * * @return $this */ public function setConversionType($conversion_type) @@ -166,7 +166,7 @@ public function getConversionType() * Allow Payer to change conversion type. * * @param bool $conversion_type_changeable - * + * * @return $this */ public function setConversionTypeChangeable($conversion_type_changeable) @@ -188,7 +188,6 @@ public function getConversionTypeChangeable() /** * Base URL to web applications endpoint * Valid Values: ["https://www.paypal.com/{country_code}/webapps/xocspartaweb/webflow/sparta/proxwebflow", "https://www.paypal.com/{country_code}/proxflow"] - * * @deprecated Not publicly available * @param string $web_url * @throws \InvalidArgumentException @@ -203,7 +202,6 @@ public function setWebUrl($web_url) /** * Base URL to web applications endpoint - * * @deprecated Not publicly available * @return string */ @@ -216,7 +214,7 @@ public function getWebUrl() * Sets Links * * @param \PayPal\Api\Links[] $links - * + * * @return $this */ public function setLinks($links) diff --git a/lib/PayPal/Api/DetailedRefund.php b/lib/PayPal/Api/DetailedRefund.php new file mode 100644 index 00000000..e010a1db --- /dev/null +++ b/lib/PayPal/Api/DetailedRefund.php @@ -0,0 +1,160 @@ +custom = $custom; + return $this; + } + + /** + * free-form field for the use of clients + * + * @return string + */ + public function getCustom() + { + return $this->custom; + } + + /** + * Amount refunded to payer of the original transaction, in the current Refund call + * + * @param \PayPal\Api\Currency $refund_to_payer + * + * @return $this + */ + public function setRefundToPayer($refund_to_payer) + { + $this->refund_to_payer = $refund_to_payer; + return $this; + } + + /** + * Amount refunded to payer of the original transaction, in the current Refund call + * + * @return \PayPal\Api\Currency + */ + public function getRefundToPayer() + { + return $this->refund_to_payer; + } + + /** + * List of external funding that were refunded by the Refund call. Each external_funding unit should have a unique reference_id + * + * @param \PayPal\Api\ExternalFunding[] $refund_to_external_funding + * + * @return $this + */ + public function setRefundToExternalFunding($refund_to_external_funding) + { + $this->refund_to_external_funding = $refund_to_external_funding; + return $this; + } + + /** + * List of external funding that were refunded by the Refund call. Each external_funding unit should have a unique reference_id + * + * @return \PayPal\Api\ExternalFunding[] + */ + public function getRefundToExternalFunding() + { + return $this->refund_to_external_funding; + } + + /** + * Transaction fee refunded to original recipient of payment. + * + * @param \PayPal\Api\Currency $refund_from_transaction_fee + * + * @return $this + */ + public function setRefundFromTransactionFee($refund_from_transaction_fee) + { + $this->refund_from_transaction_fee = $refund_from_transaction_fee; + return $this; + } + + /** + * Transaction fee refunded to original recipient of payment. + * + * @return \PayPal\Api\Currency + */ + public function getRefundFromTransactionFee() + { + return $this->refund_from_transaction_fee; + } + + /** + * Amount subtracted from PayPal balance of the original recipient of payment, to make this refund. + * + * @param \PayPal\Api\Currency $refund_from_received_amount + * + * @return $this + */ + public function setRefundFromReceivedAmount($refund_from_received_amount) + { + $this->refund_from_received_amount = $refund_from_received_amount; + return $this; + } + + /** + * Amount subtracted from PayPal balance of the original recipient of payment, to make this refund. + * + * @return \PayPal\Api\Currency + */ + public function getRefundFromReceivedAmount() + { + return $this->refund_from_received_amount; + } + + /** + * Total amount refunded so far from the original purchase. Say, for example, a buyer makes $100 purchase, the buyer was refunded $20 a week ago and is refunded $30 in this transaction. The gross refund amount is $30 (in this transaction). The total refunded amount is $50. + * + * @param \PayPal\Api\Currency $total_refunded_amount + * + * @return $this + */ + public function setTotalRefundedAmount($total_refunded_amount) + { + $this->total_refunded_amount = $total_refunded_amount; + return $this; + } + + /** + * Total amount refunded so far from the original purchase. Say, for example, a buyer makes $100 purchase, the buyer was refunded $20 a week ago and is refunded $30 in this transaction. The gross refund amount is $30 (in this transaction). The total refunded amount is $50. + * + * @return \PayPal\Api\Currency + */ + public function getTotalRefundedAmount() + { + return $this->total_refunded_amount; + } + +} diff --git a/lib/PayPal/Api/Details.php b/lib/PayPal/Api/Details.php index a1964162..53212b7c 100644 --- a/lib/PayPal/Api/Details.php +++ b/lib/PayPal/Api/Details.php @@ -28,7 +28,7 @@ class Details extends PayPalModel * Amount of the subtotal of the items. **Required** if line items are specified. 10 characters max, with support for 2 decimal places. * * @param string|double $subtotal - * + * * @return $this */ public function setSubtotal($subtotal) @@ -53,7 +53,7 @@ public function getSubtotal() * Amount charged for shipping. 10 characters max with support for 2 decimal places. * * @param string|double $shipping - * + * * @return $this */ public function setShipping($shipping) @@ -78,7 +78,7 @@ public function getShipping() * Amount charged for tax. 10 characters max with support for 2 decimal places. * * @param string|double $tax - * + * * @return $this */ public function setTax($tax) @@ -103,7 +103,7 @@ public function getTax() * Amount being charged for the handling fee. Only supported when the `payment_method` is set to `paypal`. * * @param string|double $handling_fee - * + * * @return $this */ public function setHandlingFee($handling_fee) @@ -128,7 +128,7 @@ public function getHandlingFee() * Amount being discounted for the shipping fee. Only supported when the `payment_method` is set to `paypal`. * * @param string|double $shipping_discount - * + * * @return $this */ public function setShippingDiscount($shipping_discount) @@ -153,7 +153,7 @@ public function getShippingDiscount() * Amount being charged for the insurance fee. Only supported when the `payment_method` is set to `paypal`. * * @param string|double $insurance - * + * * @return $this */ public function setInsurance($insurance) @@ -178,7 +178,7 @@ public function getInsurance() * Amount being charged as gift wrap fee. * * @param string|double $gift_wrap - * + * * @return $this */ public function setGiftWrap($gift_wrap) @@ -203,7 +203,7 @@ public function getGiftWrap() * Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment. * * @param string|double $fee - * + * * @return $this */ public function setFee($fee) diff --git a/lib/PayPal/Api/Error.php b/lib/PayPal/Api/Error.php index f6ef8e19..574dddce 100644 --- a/lib/PayPal/Api/Error.php +++ b/lib/PayPal/Api/Error.php @@ -24,7 +24,7 @@ class Error extends PayPalModel * Human readable, unique name of the error. * * @param string $name - * + * * @return $this */ public function setName($name) @@ -97,7 +97,7 @@ public function getCode() * PayPal internal identifier used for correlation purposes. * * @param string $debug_id - * + * * @return $this */ public function setDebugId($debug_id) @@ -120,7 +120,7 @@ public function getDebugId() * Message describing the error. * * @param string $message - * + * * @return $this */ public function setMessage($message) @@ -143,7 +143,7 @@ public function getMessage() * URI for detailed information related to this error for the developer. * * @param string $information_link - * + * * @return $this */ public function setInformationLink($information_link) @@ -166,7 +166,7 @@ public function getInformationLink() * Additional details of the error * * @param \PayPal\Api\ErrorDetails[] $details - * + * * @return $this */ public function setDetails($details) diff --git a/lib/PayPal/Api/ErrorDetails.php b/lib/PayPal/Api/ErrorDetails.php index 38ed5d11..d120b0a1 100644 --- a/lib/PayPal/Api/ErrorDetails.php +++ b/lib/PayPal/Api/ErrorDetails.php @@ -64,10 +64,9 @@ public function getIssue() /** * Reference ID of the purchase_unit associated with this error - * * @deprecated Not publicly available * @param string $purchase_unit_reference_id - * + * * @return $this */ public function setPurchaseUnitReferenceId($purchase_unit_reference_id) @@ -78,7 +77,6 @@ public function setPurchaseUnitReferenceId($purchase_unit_reference_id) /** * Reference ID of the purchase_unit associated with this error - * * @deprecated Not publicly available * @return string */ @@ -89,10 +87,9 @@ public function getPurchaseUnitReferenceId() /** * PayPal internal error code. - * * @deprecated Not publicly available * @param string $code - * + * * @return $this */ public function setCode($code) @@ -103,7 +100,6 @@ public function setCode($code) /** * PayPal internal error code. - * * @deprecated Not publicly available * @return string */ diff --git a/lib/PayPal/Api/ExtendedBankAccount.php b/lib/PayPal/Api/ExtendedBankAccount.php index ce771b24..3206c9db 100644 --- a/lib/PayPal/Api/ExtendedBankAccount.php +++ b/lib/PayPal/Api/ExtendedBankAccount.php @@ -14,10 +14,9 @@ class ExtendedBankAccount extends BankAccount { /** * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). - * * @deprecated Not publicly available * @param string $mandate_reference_number - * + * * @return $this */ public function setMandateReferenceNumber($mandate_reference_number) @@ -28,7 +27,6 @@ public function setMandateReferenceNumber($mandate_reference_number) /** * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). - * * @deprecated Not publicly available * @return string */ diff --git a/lib/PayPal/Api/ExternalFunding.php b/lib/PayPal/Api/ExternalFunding.php index 67eb2b9c..e03335bc 100644 --- a/lib/PayPal/Api/ExternalFunding.php +++ b/lib/PayPal/Api/ExternalFunding.php @@ -16,6 +16,7 @@ * @property string funding_account_id * @property string display_text * @property \PayPal\Api\Amount amount + * @property string funding_instruction */ class ExternalFunding extends PayPalModel { @@ -134,4 +135,27 @@ public function getAmount() return $this->amount; } + /** + * Indicates that the Payment should be fully funded by External Funded Incentive + * Valid Values: ["FULLY_FUNDED"] + * + * @param string $funding_instruction + * + * @return $this + */ + public function setFundingInstruction($funding_instruction) + { + $this->funding_instruction = $funding_instruction; + return $this; + } + + /** + * Indicates that the Payment should be fully funded by External Funded Incentive + * + * @return string + */ + public function getFundingInstruction() + { + return $this->funding_instruction; + } } diff --git a/lib/PayPal/Api/FmfDetails.php b/lib/PayPal/Api/FmfDetails.php index 0d58cef2..c5681c8a 100644 --- a/lib/PayPal/Api/FmfDetails.php +++ b/lib/PayPal/Api/FmfDetails.php @@ -23,7 +23,7 @@ class FmfDetails extends PayPalModel * Valid Values: ["ACCEPT", "PENDING", "DENY", "REPORT"] * * @param string $filter_type - * + * * @return $this */ public function setFilterType($filter_type) @@ -47,7 +47,7 @@ public function getFilterType() * Valid Values: ["AVS_NO_MATCH", "AVS_PARTIAL_MATCH", "AVS_UNAVAILABLE_OR_UNSUPPORTED", "CARD_SECURITY_CODE_MISMATCH", "MAXIMUM_TRANSACTION_AMOUNT", "UNCONFIRMED_ADDRESS", "COUNTRY_MONITOR", "LARGE_ORDER_NUMBER", "BILLING_OR_SHIPPING_ADDRESS_MISMATCH", "RISKY_ZIP_CODE", "SUSPECTED_FREIGHT_FORWARDER_CHECK", "TOTAL_PURCHASE_PRICE_MINIMUM", "IP_ADDRESS_VELOCITY", "RISKY_EMAIL_ADDRESS_DOMAIN_CHECK", "RISKY_BANK_IDENTIFICATION_NUMBER_CHECK", "RISKY_IP_ADDRESS_RANGE", "PAYPAL_FRAUD_MODEL"] * * @param string $filter_id - * + * * @return $this */ public function setFilterId($filter_id) @@ -70,7 +70,7 @@ public function getFilterId() * Name of the filter * * @param string $name - * + * * @return $this */ public function setName($name) @@ -93,7 +93,7 @@ public function getName() * Description of the filter. * * @param string $description - * + * * @return $this */ public function setDescription($description) diff --git a/lib/PayPal/Api/FundingDetail.php b/lib/PayPal/Api/FundingDetail.php index 00bad314..66cc1f34 100644 --- a/lib/PayPal/Api/FundingDetail.php +++ b/lib/PayPal/Api/FundingDetail.php @@ -22,7 +22,7 @@ class FundingDetail extends PayPalModel * Expected clearing time * * @param string $clearing_time - * + * * @return $this */ public function setClearingTime($clearing_time) @@ -45,7 +45,7 @@ public function getClearingTime() * [DEPRECATED] Hold-off duration of the payment. payment_debit_date should be used instead. * * @param string $payment_hold_date - * + * * @return $this */ public function setPaymentHoldDate($payment_hold_date) @@ -68,7 +68,7 @@ public function getPaymentHoldDate() * Date when funds will be debited from the payer's account * * @param string $payment_debit_date - * + * * @return $this */ public function setPaymentDebitDate($payment_debit_date) @@ -89,10 +89,10 @@ public function getPaymentDebitDate() /** * Processing type of the payment card - * Valid Values: ["PINLESS_DEBIT"] + * Valid Values: ["CUP_SECURE", "PINLESS_DEBIT"] * * @param string $processing_type - * + * * @return $this */ public function setProcessingType($processing_type) diff --git a/lib/PayPal/Api/FundingInstrument.php b/lib/PayPal/Api/FundingInstrument.php index 8fbe0ac5..da311f41 100644 --- a/lib/PayPal/Api/FundingInstrument.php +++ b/lib/PayPal/Api/FundingInstrument.php @@ -11,9 +11,9 @@ * * @package PayPal\Api * - * @property \PayPal\Api\CreditCard credit_card + * @property \PayPal\Api\CreditCard credit_card * @property \PayPal\Api\CreditCardToken credit_card_token - * @property \PayPal\Api\Billing billing + * @property \PayPal\Api\Billing billing */ class FundingInstrument extends PayPalModel { @@ -34,7 +34,6 @@ public function setCreditCard($credit_card) * Credit Card instrument. * * @return \PayPal\Api\CreditCard - * */ public function getCreditCard() { @@ -89,7 +88,6 @@ public function getPaymentCard() /** * Bank Account information. - * * @deprecated Not publicly available * @param \PayPal\Api\ExtendedBankAccount $bank_account * @@ -103,7 +101,6 @@ public function setBankAccount($bank_account) /** * Bank Account information. - * * @deprecated Not publicly available * @return \PayPal\Api\ExtendedBankAccount */ @@ -114,7 +111,6 @@ public function getBankAccount() /** * Vaulted bank account instrument. - * * @deprecated Not publicly available * @param \PayPal\Api\BankToken $bank_account_token * @@ -128,7 +124,6 @@ public function setBankAccountToken($bank_account_token) /** * Vaulted bank account instrument. - * * @deprecated Not publicly available * @return \PayPal\Api\BankToken */ @@ -139,7 +134,6 @@ public function getBankAccountToken() /** * PayPal credit funding instrument. - * * @deprecated Not publicly available * @param \PayPal\Api\Credit $credit * @@ -153,7 +147,6 @@ public function setCredit($credit) /** * PayPal credit funding instrument. - * * @deprecated Not publicly available * @return \PayPal\Api\Credit */ @@ -164,7 +157,6 @@ public function getCredit() /** * Incentive funding instrument. - * * @deprecated Not publicly available * @param \PayPal\Api\Incentive $incentive * @@ -178,7 +170,6 @@ public function setIncentive($incentive) /** * Incentive funding instrument. - * * @deprecated Not publicly available * @return \PayPal\Api\Incentive */ @@ -189,7 +180,6 @@ public function getIncentive() /** * External funding instrument. - * * @deprecated Not publicly available * @param \PayPal\Api\ExternalFunding $external_funding * @@ -203,7 +193,6 @@ public function setExternalFunding($external_funding) /** * External funding instrument. - * * @deprecated Not publicly available * @return \PayPal\Api\ExternalFunding */ @@ -214,7 +203,6 @@ public function getExternalFunding() /** * Carrier account token instrument. - * * @deprecated Not publicly available * @param \PayPal\Api\CarrierAccountToken $carrier_account_token * @@ -228,7 +216,6 @@ public function setCarrierAccountToken($carrier_account_token) /** * Carrier account token instrument. - * * @deprecated Not publicly available * @return \PayPal\Api\CarrierAccountToken */ @@ -239,7 +226,6 @@ public function getCarrierAccountToken() /** * Carrier account instrument - * * @deprecated Not publicly available * @param \PayPal\Api\CarrierAccount $carrier_account * @@ -253,7 +239,6 @@ public function setCarrierAccount($carrier_account) /** * Carrier account instrument - * * @deprecated Not publicly available * @return \PayPal\Api\CarrierAccount */ @@ -264,7 +249,6 @@ public function getCarrierAccount() /** * Private Label Card funding instrument. These are store cards provided by merchants to drive business with value to customer with convenience and rewards. - * * @deprecated Not publicly available * @param \PayPal\Api\PrivateLabelCard $private_label_card * @@ -278,7 +262,6 @@ public function setPrivateLabelCard($private_label_card) /** * Private Label Card funding instrument. These are store cards provided by merchants to drive business with value to customer with convenience and rewards. - * * @deprecated Not publicly available * @return \PayPal\Api\PrivateLabelCard */ diff --git a/lib/PayPal/Api/FundingSource.php b/lib/PayPal/Api/FundingSource.php index 5b39be60..95f17992 100644 --- a/lib/PayPal/Api/FundingSource.php +++ b/lib/PayPal/Api/FundingSource.php @@ -11,25 +11,24 @@ * * @package PayPal\Api * - * @property string funding_mode - * @property string funding_instrument_type - * @property string soft_descriptor - * @property \PayPal\Api\Currency amount - * @property \PayPal\Api\Currency negative_balance_amount - * @property string legal_text - * @property \PayPal\Api\FundingDetail funding_detail - * @property string additional_text - * @property \PayPal\Api\FundingInstrument extends - * @property \PayPal\Api\Links[] links + * @property string funding_mode + * @property string funding_instrument_type + * @property string soft_descriptor + * @property \PayPal\Api\Currency amount + * @property \PayPal\Api\Currency negative_balance_amount + * @property string legal_text + * @property \PayPal\Api\FundingDetail funding_detail + * @property string additional_text + * @property \PayPal\Api\Links[] links */ -class FundingSource extends PayPalModel +class FundingSource extends FundingInstrument { /** * specifies funding mode of the instrument - * Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"] + * Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK", "PAY_UPON_INVOICE"] * * @param string $funding_mode - * + * * @return $this */ public function setFundingMode($funding_mode) @@ -50,10 +49,10 @@ public function getFundingMode() /** * Instrument type for this funding source - * Valid Values: ["BALANCE", "PAYMENT_CARD", "BANK_ACCOUNT", "CREDIT", "INCENTIVE"] + * Valid Values: ["BALANCE", "PAYMENT_CARD", "BANK_ACCOUNT", "CREDIT", "INCENTIVE", "EXTERNAL_FUNDING", "TAB"] * * @param string $funding_instrument_type - * + * * @return $this */ public function setFundingInstrumentType($funding_instrument_type) @@ -76,7 +75,7 @@ public function getFundingInstrumentType() * Soft descriptor used when charging this funding source. * * @param string $soft_descriptor - * + * * @return $this */ public function setSoftDescriptor($soft_descriptor) @@ -99,7 +98,7 @@ public function getSoftDescriptor() * Total anticipated amount of money to be pulled from instrument. * * @param \PayPal\Api\Currency $amount - * + * * @return $this */ public function setAmount($amount) @@ -119,33 +118,33 @@ public function getAmount() } /** - * Additional amount to be pulled from the instrument to recover a negative balance on the buyer - * - * @param \PayPal\Api\Currency $amount + * Additional amount to be pulled from the instrument to recover a negative balance on the buyer's account that is owed to PayPal. * + * @param \PayPal\Api\Currency $negative_balance_amount + * * @return $this */ - public function setNegativeBalanceAmount($amount) + public function setNegativeBalanceAmount($negative_balance_amount) { - $this->amount = $amount; + $this->negative_balance_amount = $negative_balance_amount; return $this; } /** - * Additional amount to be pulled from the instrument to recover a negative balance on the buyer + * Additional amount to be pulled from the instrument to recover a negative balance on the buyer's account that is owed to PayPal. * * @return \PayPal\Api\Currency */ public function getNegativeBalanceAmount() { - return $this->amount; + return $this->negative_balance_amount; } /** * Localized legal text relevant to funding source. * * @param string $legal_text - * + * * @return $this */ public function setLegalText($legal_text) @@ -168,7 +167,7 @@ public function getLegalText() * Additional detail of the funding. * * @param \PayPal\Api\FundingDetail $funding_detail - * + * * @return $this */ public function setFundingDetail($funding_detail) @@ -191,7 +190,7 @@ public function getFundingDetail() * Additional text relevant to funding source. * * @param string $additional_text - * + * * @return $this */ public function setAdditionalText($additional_text) @@ -215,6 +214,8 @@ public function getAdditionalText() * * @param \PayPal\Api\FundingInstrument $extends * + * @deprecated Unused + * * @return $this */ public function setExtends($extends) @@ -226,6 +227,8 @@ public function setExtends($extends) /** * Gets Extends * + * @deprecated Unused + * * @return \PayPal\Api\FundingInstrument */ public function getExtends() @@ -237,7 +240,7 @@ public function getExtends() * Sets Links * * @param \PayPal\Api\Links[] $links - * + * * @return $this */ public function setLinks($links) diff --git a/lib/PayPal/Api/Incentive.php b/lib/PayPal/Api/Incentive.php index 017a34df..7493a658 100644 --- a/lib/PayPal/Api/Incentive.php +++ b/lib/PayPal/Api/Incentive.php @@ -12,15 +12,15 @@ * * @package PayPal\Api * - * @property string id - * @property string code - * @property string name - * @property string description + * @property string id + * @property string code + * @property string name + * @property string description * @property \PayPal\Api\Currency minimum_purchase_amount - * @property string logo_image_url - * @property string expiry_date - * @property string type - * @property string terms + * @property string logo_image_url + * @property string expiry_date + * @property string type + * @property string terms */ class Incentive extends PayPalModel { @@ -28,7 +28,7 @@ class Incentive extends PayPalModel * Identifier of the instrument in PayPal Wallet * * @param string $id - * + * * @return $this */ public function setId($id) @@ -51,7 +51,7 @@ public function getId() * Code that identifies the incentive. * * @param string $code - * + * * @return $this */ public function setCode($code) @@ -74,7 +74,7 @@ public function getCode() * Name of the incentive. * * @param string $name - * + * * @return $this */ public function setName($name) @@ -97,7 +97,7 @@ public function getName() * Description of the incentive. * * @param string $description - * + * * @return $this */ public function setDescription($description) @@ -120,7 +120,7 @@ public function getDescription() * Indicates incentive is applicable for this minimum purchase amount. * * @param \PayPal\Api\Currency $minimum_purchase_amount - * + * * @return $this */ public function setMinimumPurchaseAmount($minimum_purchase_amount) @@ -167,7 +167,7 @@ public function getLogoImageUrl() * expiry date of the incentive. * * @param string $expiry_date - * + * * @return $this */ public function setExpiryDate($expiry_date) @@ -191,7 +191,7 @@ public function getExpiryDate() * Valid Values: ["COUPON", "GIFT_CARD", "MERCHANT_SPECIFIC_BALANCE", "VOUCHER"] * * @param string $type - * + * * @return $this */ public function setType($type) @@ -214,7 +214,7 @@ public function getType() * URI to the associated terms * * @param string $terms - * + * * @return $this */ public function setTerms($terms) diff --git a/lib/PayPal/Api/InstallmentOption.php b/lib/PayPal/Api/InstallmentOption.php index 43342b7b..58e1b924 100644 --- a/lib/PayPal/Api/InstallmentOption.php +++ b/lib/PayPal/Api/InstallmentOption.php @@ -11,9 +11,9 @@ * * @package PayPal\Api * - * @property int term - * @property \PayPal\Api\Currency monthly_payment - * @property \PayPal\Api\Currency discount_amount + * @property int term + * @property \PayPal\Api\Currency monthly_payment + * @property \PayPal\Api\Currency discount_amount * @property string discount_percentage */ class InstallmentOption extends PayPalModel @@ -22,7 +22,7 @@ class InstallmentOption extends PayPalModel * Number of installments * * @param int $term - * + * * @return $this */ public function setTerm($term) @@ -45,7 +45,7 @@ public function getTerm() * Monthly payment * * @param \PayPal\Api\Currency $monthly_payment - * + * * @return $this */ public function setMonthlyPayment($monthly_payment) @@ -68,7 +68,7 @@ public function getMonthlyPayment() * Discount amount applied to the payment, if any * * @param \PayPal\Api\Currency $discount_amount - * + * * @return $this */ public function setDiscountAmount($discount_amount) @@ -91,7 +91,7 @@ public function getDiscountAmount() * Discount percentage applied to the payment, if any * * @param string $discount_percentage - * + * * @return $this */ public function setDiscountPercentage($discount_percentage) diff --git a/lib/PayPal/Api/Item.php b/lib/PayPal/Api/Item.php index 4c647ab9..75056ba0 100644 --- a/lib/PayPal/Api/Item.php +++ b/lib/PayPal/Api/Item.php @@ -22,7 +22,6 @@ * @property string currency * @property string tax * @property string url - * @property string category */ class Item extends PayPalModel { @@ -30,7 +29,7 @@ class Item extends PayPalModel * Stock keeping unit corresponding (SKU) to item. * * @param string $sku - * + * * @return $this */ public function setSku($sku) @@ -53,7 +52,7 @@ public function getSku() * Item name. 127 characters max. * * @param string $name - * + * * @return $this */ public function setName($name) @@ -76,7 +75,7 @@ public function getName() * Description of the item. Only supported when the `payment_method` is set to `paypal`. * * @param string $description - * + * * @return $this */ public function setDescription($description) @@ -99,7 +98,7 @@ public function getDescription() * Number of a particular item. 10 characters max. * * @param string $quantity - * + * * @return $this */ public function setQuantity($quantity) @@ -122,7 +121,7 @@ public function getQuantity() * Item cost. 10 characters max. * * @param string|double $price - * + * * @return $this */ public function setPrice($price) @@ -147,7 +146,7 @@ public function getPrice() * 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). * * @param string $currency - * + * * @return $this */ public function setCurrency($currency) @@ -170,7 +169,7 @@ public function getCurrency() * Tax of the item. Only supported when the `payment_method` is set to `paypal`. * * @param string|double $tax - * + * * @return $this */ public function setTax($tax) @@ -218,9 +217,9 @@ public function getUrl() /** * Category type of the item. * Valid Values: ["DIGITAL", "PHYSICAL"] - * + * @deprecated Not publicly available * @param string $category - * + * * @return $this */ public function setCategory($category) @@ -231,7 +230,7 @@ public function setCategory($category) /** * Category type of the item. - * + * @deprecated Not publicly available * @return string */ public function getCategory() @@ -241,10 +240,9 @@ public function getCategory() /** * Weight of the item. - * * @deprecated Not publicly available * @param \PayPal\Api\Measurement $weight - * + * * @return $this */ public function setWeight($weight) @@ -255,7 +253,6 @@ public function setWeight($weight) /** * Weight of the item. - * * @deprecated Not publicly available * @return \PayPal\Api\Measurement */ @@ -266,10 +263,9 @@ public function getWeight() /** * Length of the item. - * * @deprecated Not publicly available * @param \PayPal\Api\Measurement $length - * + * * @return $this */ public function setLength($length) @@ -280,7 +276,6 @@ public function setLength($length) /** * Length of the item. - * * @deprecated Not publicly available * @return \PayPal\Api\Measurement */ @@ -291,10 +286,9 @@ public function getLength() /** * Height of the item. - * * @deprecated Not publicly available * @param \PayPal\Api\Measurement $height - * + * * @return $this */ public function setHeight($height) @@ -305,7 +299,6 @@ public function setHeight($height) /** * Height of the item. - * * @deprecated Not publicly available * @return \PayPal\Api\Measurement */ @@ -316,10 +309,9 @@ public function getHeight() /** * Width of the item. - * * @deprecated Not publicly available * @param \PayPal\Api\Measurement $width - * + * * @return $this */ public function setWidth($width) @@ -330,7 +322,6 @@ public function setWidth($width) /** * Width of the item. - * * @deprecated Not publicly available * @return \PayPal\Api\Measurement */ @@ -341,10 +332,9 @@ public function getWidth() /** * Set of optional data used for PayPal risk determination. - * * @deprecated Not publicly available * @param \PayPal\Api\NameValuePair[] $supplementary_data - * + * * @return $this */ public function setSupplementaryData($supplementary_data) @@ -355,7 +345,6 @@ public function setSupplementaryData($supplementary_data) /** * Set of optional data used for PayPal risk determination. - * * @deprecated Not publicly available * @return \PayPal\Api\NameValuePair[] */ @@ -366,7 +355,6 @@ public function getSupplementaryData() /** * Append SupplementaryData to the list. - * * @deprecated Not publicly available * @param \PayPal\Api\NameValuePair $nameValuePair * @return $this @@ -384,7 +372,6 @@ public function addSupplementaryData($nameValuePair) /** * Remove SupplementaryData from the list. - * * @deprecated Not publicly available * @param \PayPal\Api\NameValuePair $nameValuePair * @return $this @@ -398,10 +385,9 @@ public function removeSupplementaryData($nameValuePair) /** * Set of optional data used for PayPal post-transaction notifications. - * * @deprecated Not publicly available * @param \PayPal\Api\NameValuePair[] $postback_data - * + * * @return $this */ public function setPostbackData($postback_data) @@ -412,7 +398,6 @@ public function setPostbackData($postback_data) /** * Set of optional data used for PayPal post-transaction notifications. - * * @deprecated Not publicly available * @return \PayPal\Api\NameValuePair[] */ @@ -423,7 +408,6 @@ public function getPostbackData() /** * Append PostbackData to the list. - * * @deprecated Not publicly available * @param \PayPal\Api\NameValuePair $nameValuePair * @return $this @@ -441,7 +425,6 @@ public function addPostbackData($nameValuePair) /** * Remove PostbackData from the list. - * * @deprecated Not publicly available * @param \PayPal\Api\NameValuePair $nameValuePair * @return $this diff --git a/lib/PayPal/Api/ItemList.php b/lib/PayPal/Api/ItemList.php index 3b674add..262047ab 100644 --- a/lib/PayPal/Api/ItemList.php +++ b/lib/PayPal/Api/ItemList.php @@ -7,14 +7,14 @@ /** * Class ItemList * - * Items and related shipping address within a transaction. + * List of items being paid for. * * @package PayPal\Api * - * @property \PayPal\Api\Item[] items + * @property \PayPal\Api\Item[] items * @property \PayPal\Api\ShippingAddress shipping_address - * @property string shipping_method - * @property string shipping_phone_number + * @property string shipping_method + * @property string shipping_phone_number */ class ItemList extends PayPalModel { @@ -22,7 +22,7 @@ class ItemList extends PayPalModel * List of items. * * @param \PayPal\Api\Item[] $items - * + * * @return $this */ public function setItems($items) @@ -72,10 +72,10 @@ public function removeItem($item) } /** - * Shipping address, if different than the payer address. + * Shipping address. * * @param \PayPal\Api\ShippingAddress $shipping_address - * + * * @return $this */ public function setShippingAddress($shipping_address) @@ -85,7 +85,7 @@ public function setShippingAddress($shipping_address) } /** - * Shipping address, if different than the payer address. + * Shipping address. * * @return \PayPal\Api\ShippingAddress */ @@ -98,7 +98,7 @@ public function getShippingAddress() * Shipping method used for this payment like USPSParcel etc. * * @param string $shipping_method - * + * * @return $this */ public function setShippingMethod($shipping_method) @@ -121,7 +121,7 @@ public function getShippingMethod() * Allows merchant's to share payer’s contact number with PayPal for the current payment. Final contact number of payer associated with the transaction might be same as shipping_phone_number or different based on Payer’s action on PayPal. The phone number must be represented in its canonical international format, as defined by the E.164 numbering plan * * @param string $shipping_phone_number - * + * * @return $this */ public function setShippingPhoneNumber($shipping_phone_number) diff --git a/lib/PayPal/Api/Order.php b/lib/PayPal/Api/Order.php index f611ff7d..13312cc0 100644 --- a/lib/PayPal/Api/Order.php +++ b/lib/PayPal/Api/Order.php @@ -3,8 +3,8 @@ namespace PayPal\Api; use PayPal\Common\PayPalResourceModel; -use PayPal\Rest\ApiContext; use PayPal\Validation\ArgumentValidator; +use PayPal\Rest\ApiContext; /** * Class Order @@ -13,20 +13,20 @@ * * @package PayPal\Api * - * @property string id - * @property string purchase_unit_reference_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 parent_payment + * @property string id + * @property string reference_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 parent_payment * @property \PayPal\Api\FmfDetails fmf_details - * @property string create_time - * @property string update_time - * @property \PayPal\Api\Links[] links + * @property string create_time + * @property string update_time + * @property \PayPal\Api\Links[] links */ class Order extends PayPalResourceModel { @@ -34,7 +34,7 @@ class Order extends PayPalResourceModel * Identifier of the order transaction. * * @param string $id - * + * * @return $this */ public function setId($id) @@ -56,6 +56,8 @@ public function getId() /** * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base. * + * @deprecated Use #setReferenceId instead + * * @param string $purchase_unit_reference_id * * @return $this @@ -68,6 +70,7 @@ public function setPurchaseUnitReferenceId($purchase_unit_reference_id) /** * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base. + * @deprecated Use #getReferenceId instead * * @return string */ @@ -76,11 +79,34 @@ public function getPurchaseUnitReferenceId() return $this->purchase_unit_reference_id; } + /** + * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base. + * + * @param string $reference_id + * + * @return $this + */ + public function setReferenceId($reference_id) + { + $this->reference_id = $reference_id; + return $this; + } + + /** + * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base. + * + * @return string + */ + public function getReferenceId() + { + return $this->reference_id; + } + /** * Amount being collected. * * @param \PayPal\Api\Amount $amount - * + * * @return $this */ public function setAmount($amount) @@ -104,7 +130,7 @@ public function getAmount() * Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"] * * @param string $payment_mode - * + * * @return $this */ public function setPaymentMode($payment_mode) @@ -125,10 +151,10 @@ public function getPaymentMode() /** * State of the order transaction. - * Valid Values: ["pending", "completed", "refunded", "partially_refunded", "voided"] + * Valid Values: ["pending", "completed", "voided", "authorized", "captured"] * * @param string $state - * + * * @return $this */ public function setState($state) @@ -148,11 +174,11 @@ public function getState() } /** - * Reason code for the transaction state being Pending or Reversed. Only supported when the `payment_method` is set to `paypal`. + * Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually. Only supported when the `payment_method` is set to `paypal`. * Valid Values: ["PAYER_SHIPPING_UNCONFIRMED", "MULTI_CURRENCY", "RISK_REVIEW", "REGULATORY_REVIEW", "VERIFICATION_REQUIRED", "ORDER", "OTHER"] * * @param string $reason_code - * + * * @return $this */ public function setReasonCode($reason_code) @@ -162,7 +188,7 @@ public function setReasonCode($reason_code) } /** - * Reason code for the transaction state being Pending or Reversed. Only supported when the `payment_method` is set to `paypal`. + * Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually. Only supported when the `payment_method` is set to `paypal`. * * @return string */ @@ -172,11 +198,11 @@ public function getReasonCode() } /** - * [DEPRECATED] Reason the transaction is in pending state. Use reason_code field above instead. + * [DEPRECATED] Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead. * Valid Values: ["payer_shipping_unconfirmed", "multi_currency", "risk_review", "regulatory_review", "verification_required", "order", "other"] * * @param string $pending_reason - * + * * @return $this */ public function setPendingReason($pending_reason) @@ -186,7 +212,7 @@ public function setPendingReason($pending_reason) } /** - * @deprecated [DEPRECATED] Reason the transaction is in pending state. Use reason_code field above instead. + * @deprecated [DEPRECATED] Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead. * * @return string */ @@ -200,7 +226,7 @@ public function getPendingReason() * Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"] * * @param string $protection_eligibility - * + * * @return $this */ public function setProtectionEligibility($protection_eligibility) @@ -224,7 +250,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) @@ -247,7 +273,7 @@ public function getProtectionEligibilityType() * ID of the Payment resource that this transaction is based on. * * @param string $parent_payment - * + * * @return $this */ public function setParentPayment($parent_payment) @@ -270,7 +296,7 @@ public function getParentPayment() * Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action. * * @param \PayPal\Api\FmfDetails $fmf_details - * + * * @return $this */ public function setFmfDetails($fmf_details) @@ -293,7 +319,7 @@ public function getFmfDetails() * Time the resource was created in UTC ISO8601 format. * * @param string $create_time - * + * * @return $this */ public function setCreateTime($create_time) @@ -316,7 +342,7 @@ public function getCreateTime() * Time the resource was last updated in UTC ISO8601 format. * * @param string $update_time - * + * * @return $this */ public function setUpdateTime($update_time) @@ -336,11 +362,11 @@ public function getUpdateTime() } /** - * Retrieve details about an order by passing the order_id in the request URI. + * Shows details for an order, by ID. * - * @param string $orderId - * @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 $orderId + * @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 Order */ public static function get($orderId, $apiContext = null, $restCall = null) @@ -361,11 +387,11 @@ public static function get($orderId, $apiContext = null, $restCall = null) } /** - * Capture a payment. In addition, include the amount of the payment and indicate whether this is a final capture for the given authorization in the body of the request JSON. + * Captures a payment for an order, by ID. To use this call, the original payment call must specify an intent of `order`. In the JSON request body, include the payment amount and indicate whether this capture is the final capture for the authorization. * - * @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) @@ -387,10 +413,10 @@ public function capture($capture, $apiContext = null, $restCall = null) } /** - * Void (cancel) an order by passing the order_id in the request URI. Note that an order cannot be voided if payment has already been partially or fully captured. + * Voids, or cancels, an order, by ID. You cannot void an order if a payment has already been partially or fully captured. * - * @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 Order */ public function void($apiContext = null, $restCall = null) @@ -410,11 +436,11 @@ public function void($apiContext = null, $restCall = null) } /** - * Authorize an order by passing the order_id in the request URI. In addition, include an amount object in the body of the request JSON. + * Authorizes an order, by ID. Include an `amount` object in the JSON request body. * * @param Authorization $authorization Authorization Object with Amount value to be authorized - * @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 authorize($authorization, $apiContext = null, $restCall = null) diff --git a/lib/PayPal/Api/Patch.php b/lib/PayPal/Api/Patch.php index bd9a1685..68a6fa85 100644 --- a/lib/PayPal/Api/Patch.php +++ b/lib/PayPal/Api/Patch.php @@ -7,7 +7,7 @@ /** * Class Patch * - * A JSON Patch object used for doing partial updates to resources. + * A JSON patch object that you can use to apply partial updates to resources. * * @package PayPal\Api * @@ -43,7 +43,7 @@ public function getOp() } /** - * string containing a JSON-Pointer value that references a location within the target document (the target location) where the operation is performed. + * A JSON pointer that references a location in the target document where the operation is performed. A `string` value. * * @param string $path * @@ -56,7 +56,7 @@ public function setPath($path) } /** - * string containing a JSON-Pointer value that references a location within the target document (the target location) where the operation is performed. + * A JSON pointer that references a location in the target document where the operation is performed. A `string` value. * * @return string */ @@ -68,7 +68,7 @@ public function getPath() /** * New value to apply based on the operation. * - * @param string $value + * @param mixed $value * * @return $this */ @@ -81,7 +81,7 @@ public function setValue($value) /** * New value to apply based on the operation. * - * @return string + * @return mixed */ public function getValue() { diff --git a/lib/PayPal/Api/PatchRequest.php b/lib/PayPal/Api/PatchRequest.php index effc1058..2f446868 100644 --- a/lib/PayPal/Api/PatchRequest.php +++ b/lib/PayPal/Api/PatchRequest.php @@ -7,7 +7,7 @@ /** * Class PatchRequest * - * Request object used for a JSON Patch. + * A JSON patch request. * * @package PayPal\Api * diff --git a/lib/PayPal/Api/Payee.php b/lib/PayPal/Api/Payee.php index c0fde8f7..22594b99 100644 --- a/lib/PayPal/Api/Payee.php +++ b/lib/PayPal/Api/Payee.php @@ -17,10 +17,10 @@ class Payee extends PayPalModel { /** - * Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements. + * Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receive PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements. * * @param string $email - * + * * @return $this */ public function setEmail($email) @@ -30,7 +30,7 @@ public function setEmail($email) } /** - * Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements. + * Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receive PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements. * * @return string */ @@ -43,7 +43,7 @@ public function getEmail() * Encrypted PayPal account identifier for the Payee. * * @param string $merchant_id - * + * * @return $this */ public function setMerchantId($merchant_id) @@ -64,10 +64,9 @@ public function getMerchantId() /** * First Name of the Payee. - * * @deprecated Not publicly available * @param string $first_name - * + * * @return $this */ public function setFirstName($first_name) @@ -78,7 +77,6 @@ public function setFirstName($first_name) /** * First Name of the Payee. - * * @deprecated Not publicly available * @return string */ @@ -89,10 +87,9 @@ public function getFirstName() /** * Last Name of the Payee. - * * @deprecated Not publicly available * @param string $last_name - * + * * @return $this */ public function setLastName($last_name) @@ -103,7 +100,6 @@ public function setLastName($last_name) /** * Last Name of the Payee. - * * @deprecated Not publicly available * @return string */ @@ -114,10 +110,9 @@ public function getLastName() /** * Unencrypted PayPal account Number of the Payee - * * @deprecated Not publicly available * @param string $account_number - * + * * @return $this */ public function setAccountNumber($account_number) @@ -128,7 +123,6 @@ public function setAccountNumber($account_number) /** * Unencrypted PayPal account Number of the Payee - * * @deprecated Not publicly available * @return string */ @@ -138,11 +132,10 @@ public function getAccountNumber() } /** - * Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet. - * + * Information related to the Payee. * @deprecated Not publicly available * @param \PayPal\Api\Phone $phone - * + * * @return $this */ public function setPhone($phone) @@ -152,8 +145,7 @@ public function setPhone($phone) } /** - * Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet. - * + * Information related to the Payee. * @deprecated Not publicly available * @return \PayPal\Api\Phone */ diff --git a/lib/PayPal/Api/Payer.php b/lib/PayPal/Api/Payer.php index 860d0950..6d9a37bf 100644 --- a/lib/PayPal/Api/Payer.php +++ b/lib/PayPal/Api/Payer.php @@ -11,11 +11,11 @@ * * @package PayPal\Api * - * @property string payment_method - * @property string status + * @property string payment_method + * @property string status * @property \PayPal\Api\FundingInstrument[] funding_instruments - * @property string funding_option_id - * @property \PayPal\Api\PayerInfo payer_info + * @property string external_selected_funding_instrument_type + * @property \PayPal\Api\PayerInfo payer_info */ class Payer extends PayPalModel { @@ -24,7 +24,7 @@ class Payer extends PayPalModel * Valid Values: ["credit_card", "bank", "paypal", "pay_upon_invoice", "carrier", "alternate_payment"] * * @param string $payment_method - * + * * @return $this */ public function setPaymentMethod($payment_method) @@ -48,7 +48,7 @@ public function getPaymentMethod() * Valid Values: ["VERIFIED", "UNVERIFIED"] * * @param string $status - * + * * @return $this */ public function setStatus($status) @@ -70,10 +70,9 @@ public function getStatus() /** * Type of account relationship payer has with PayPal. * Valid Values: ["BUSINESS", "PERSONAL", "PREMIER"] - * * @deprecated Not publicly available * @param string $account_type - * + * * @return $this */ public function setAccountType($account_type) @@ -84,7 +83,6 @@ public function setAccountType($account_type) /** * Type of account relationship payer has with PayPal. - * * @deprecated Not publicly available * @return string */ @@ -95,10 +93,9 @@ public function getAccountType() /** * Duration since the payer established account relationship with PayPal in days. - * * @deprecated Not publicly available * @param string $account_age - * + * * @return $this */ public function setAccountAge($account_age) @@ -109,7 +106,6 @@ public function setAccountAge($account_age) /** * Duration since the payer established account relationship with PayPal in days. - * * @deprecated Not publicly available * @return string */ @@ -122,7 +118,7 @@ public function getAccountAge() * List of funding instruments to fund the payment. 'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed. * * @param \PayPal\Api\FundingInstrument[] $funding_instruments - * + * * @return $this */ public function setFundingInstruments($funding_instruments) @@ -173,9 +169,9 @@ public function removeFundingInstrument($fundingInstrument) /** * Id of user selected funding option for the payment.'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed. - * + * @deprecated Not publicly available * @param string $funding_option_id - * + * * @return $this */ public function setFundingOptionId($funding_option_id) @@ -186,7 +182,7 @@ public function setFundingOptionId($funding_option_id) /** * Id of user selected funding option for the payment.'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed. - * + * @deprecated Not publicly available * @return string */ public function getFundingOptionId() @@ -195,11 +191,10 @@ public function getFundingOptionId() } /** - * Default funding option available for the payment - * + * Default funding option available for the payment * @deprecated Not publicly available * @param \PayPal\Api\FundingOption $funding_option - * + * * @return $this */ public function setFundingOption($funding_option) @@ -209,8 +204,7 @@ public function setFundingOption($funding_option) } /** - * Default funding option available for the payment - * + * Default funding option available for the payment * @deprecated Not publicly available * @return \PayPal\Api\FundingOption */ @@ -220,11 +214,34 @@ public function getFundingOption() } /** - * Funding option related to default funding option. + * Instrument type pre-selected by the user outside of PayPal and passed along the payment creation. This param is used in cases such as PayPal Credit Second Button + * Valid Values: ["CREDIT", "PAY_UPON_INVOICE"] * + * @param string $external_selected_funding_instrument_type + * + * @return $this + */ + public function setExternalSelectedFundingInstrumentType($external_selected_funding_instrument_type) + { + $this->external_selected_funding_instrument_type = $external_selected_funding_instrument_type; + return $this; + } + + /** + * Instrument type pre-selected by the user outside of PayPal and passed along the payment creation. This param is used in cases such as PayPal Credit Second Button + * + * @return string + */ + public function getExternalSelectedFundingInstrumentType() + { + return $this->external_selected_funding_instrument_type; + } + + /** + * Funding option related to default funding option. * @deprecated Not publicly available * @param \PayPal\Api\FundingOption $related_funding_option - * + * * @return $this */ public function setRelatedFundingOption($related_funding_option) @@ -235,7 +252,6 @@ public function setRelatedFundingOption($related_funding_option) /** * Funding option related to default funding option. - * * @deprecated Not publicly available * @return \PayPal\Api\FundingOption */ @@ -245,10 +261,10 @@ public function getRelatedFundingOption() } /** - * Information related to the Payer. + * Information related to the Payer. * * @param \PayPal\Api\PayerInfo $payer_info - * + * * @return $this */ public function setPayerInfo($payer_info) @@ -258,7 +274,7 @@ public function setPayerInfo($payer_info) } /** - * Information related to the Payer. + * Information related to the Payer. * * @return \PayPal\Api\PayerInfo */ diff --git a/lib/PayPal/Api/PayerInfo.php b/lib/PayPal/Api/PayerInfo.php index 39cbfda4..ae70c65a 100644 --- a/lib/PayPal/Api/PayerInfo.php +++ b/lib/PayPal/Api/PayerInfo.php @@ -11,22 +11,22 @@ * * @package PayPal\Api * - * @property string email - * @property string external_remember_me_id - * @property string salutation - * @property string first_name - * @property string middle_name - * @property string last_name - * @property string suffix - * @property string payer_id - * @property string phone - * @property string phone_type - * @property string birth_date - * @property string tax_id - * @property string tax_id_type - * @property string country_code - * @property \PayPal\Api\Address billing_address - * @property \PayPal\Api\ShippingAddress shipping_address + * @property string email + * @property string external_remember_me_id + * @property string buyer_account_number + * @property string salutation + * @property string first_name + * @property string middle_name + * @property string last_name + * @property string suffix + * @property string payer_id + * @property string phone + * @property string phone_type + * @property string birth_date + * @property string tax_id + * @property string tax_id_type + * @property string country_code + * @property \PayPal\Api\Address billing_address */ class PayerInfo extends PayPalModel { @@ -34,7 +34,7 @@ class PayerInfo extends PayPalModel * Email address representing the payer. 127 characters max. * * @param string $email - * + * * @return $this */ public function setEmail($email) @@ -57,7 +57,7 @@ public function getEmail() * External Remember Me id representing the payer * * @param string $external_remember_me_id - * + * * @return $this */ public function setExternalRememberMeId($external_remember_me_id) @@ -79,7 +79,7 @@ public function getExternalRememberMeId() /** * Account Number representing the Payer * - * @deprecated Not publicly available + * @deprecated Use #setBuyerAccountNumberInstead * @param string $account_number * * @return $this @@ -93,6 +93,8 @@ public function setAccountNumber($account_number) /** * Account Number representing the Payer * + * @deprecated Use #getBuyerAccountNumberInstead + * * @deprecated Not publicly available * @return string */ @@ -101,11 +103,34 @@ public function getAccountNumber() return $this->account_number; } + /** + * Account Number representing the Payer + * + * @param string $buyer_account_number + * + * @return $this + */ + public function setBuyerAccountNumber($buyer_account_number) + { + $this->buyer_account_number = $buyer_account_number; + return $this; + } + + /** + * Account Number representing the Payer + * + * @return string + */ + public function getBuyerAccountNumber() + { + return $this->buyer_account_number; + } + /** * Salutation of the payer. * * @param string $salutation - * + * * @return $this */ public function setSalutation($salutation) @@ -128,7 +153,7 @@ public function getSalutation() * First name of the payer. * * @param string $first_name - * + * * @return $this */ public function setFirstName($first_name) @@ -151,7 +176,7 @@ public function getFirstName() * Middle name of the payer. * * @param string $middle_name - * + * * @return $this */ public function setMiddleName($middle_name) @@ -174,7 +199,7 @@ public function getMiddleName() * Last name of the payer. * * @param string $last_name - * + * * @return $this */ public function setLastName($last_name) @@ -197,7 +222,7 @@ public function getLastName() * Suffix of the payer. * * @param string $suffix - * + * * @return $this */ public function setSuffix($suffix) @@ -220,7 +245,7 @@ public function getSuffix() * PayPal assigned encrypted Payer ID. * * @param string $payer_id - * + * * @return $this */ public function setPayerId($payer_id) @@ -243,7 +268,7 @@ public function getPayerId() * Phone number representing the payer. 20 characters max. * * @param string $phone - * + * * @return $this */ public function setPhone($phone) @@ -267,7 +292,7 @@ public function getPhone() * Valid Values: ["HOME", "WORK", "MOBILE", "OTHER"] * * @param string $phone_type - * + * * @return $this */ public function setPhoneType($phone_type) @@ -290,7 +315,7 @@ public function getPhoneType() * Birth date of the Payer in ISO8601 format (yyyy-mm-dd). * * @param string $birth_date - * + * * @return $this */ public function setBirthDate($birth_date) @@ -313,7 +338,7 @@ public function getBirthDate() * Payer’s tax ID. Only supported when the `payment_method` is set to `paypal`. * * @param string $tax_id - * + * * @return $this */ public function setTaxId($tax_id) @@ -337,7 +362,7 @@ public function getTaxId() * Valid Values: ["BR_CPF", "BR_CNPJ"] * * @param string $tax_id_type - * + * * @return $this */ public function setTaxIdType($tax_id_type) @@ -360,7 +385,7 @@ public function getTaxIdType() * Two-letter registered country code of the payer to identify the buyer country. * * @param string $country_code - * + * * @return $this */ public function setCountryCode($country_code) @@ -383,7 +408,7 @@ public function getCountryCode() * Billing address of the Payer. * * @param \PayPal\Api\Address $billing_address - * + * * @return $this */ public function setBillingAddress($billing_address) @@ -403,10 +428,10 @@ public function getBillingAddress() } /** - * Shipping address of payer PayPal account. + * @deprecated [DEPRECATED] Use shipping address present in purchase unit or at root level of checkout Session. * * @param \PayPal\Api\ShippingAddress $shipping_address - * + * * @return $this */ public function setShippingAddress($shipping_address) @@ -416,7 +441,7 @@ public function setShippingAddress($shipping_address) } /** - * Shipping address of payer PayPal account. + * @deprecated [DEPRECATED] Use shipping address present in purchase unit or at root level of checkout Session. * * @return \PayPal\Api\ShippingAddress */ diff --git a/lib/PayPal/Api/Payment.php b/lib/PayPal/Api/Payment.php index 13229d5f..c0747ae7 100644 --- a/lib/PayPal/Api/Payment.php +++ b/lib/PayPal/Api/Payment.php @@ -4,9 +4,8 @@ use PayPal\Common\PayPalResourceModel; use PayPal\Core\PayPalConstants; -use PayPal\Rest\ApiContext; -use PayPal\Transport\PayPalRestCall; use PayPal\Validation\ArgumentValidator; +use PayPal\Rest\ApiContext; /** * Class Payment @@ -15,30 +14,27 @@ * * @package PayPal\Api * - * @property string id - * @property string intent - * @property \PayPal\Api\Payer payer - * @property \PayPal\Api\PotentialPayerInfo potential_payer_info - * @property \PayPal\Api\Payee payee - * @property \PayPal\Api\Transaction[] transactions - * @property string[] billing_agreement_tokens - * @property \PayPal\Api\PaymentInstruction payment_instruction - * @property string state - * @property string experience_profile_id - * @property string note_to_payer - * @property \PayPal\Api\RedirectUrls redirect_urls - * @property string failure_reason - * @property string create_time - * @property string update_time - * @property \PayPal\Api\Links[] links + * @property string id + * @property string intent + * @property \PayPal\Api\Payer payer + * @property \PayPal\Api\Transaction[] transactions + * @property string state + * @property string experience_profile_id + * @property string note_to_payer + * @property \PayPal\Api\Payee $payee + * @property \PayPal\Api\RedirectUrls redirect_urls + * @property string failure_reason + * @property string create_time + * @property string update_time + * @property \PayPal\Api\Links[] links */ class Payment extends PayPalResourceModel { /** - * ID of the created payment, the 'transaction ID' + * Identifier of the payment resource created. * * @param string $id - * + * * @return $this */ public function setId($id) @@ -48,7 +44,7 @@ public function setId($id) } /** - * ID of the created payment, the 'transaction ID' + * Identifier of the payment resource created. * * @return string */ @@ -62,7 +58,7 @@ public function getId() * Valid Values: ["sale", "authorize", "order"] * * @param string $intent - * + * * @return $this */ public function setIntent($intent) @@ -85,7 +81,7 @@ public function getIntent() * Source of the funds for this payment represented by a PayPal account or a direct credit card. * * @param \PayPal\Api\Payer $payer - * + * * @return $this */ public function setPayer($payer) @@ -106,9 +102,9 @@ public function getPayer() /** * Information that the merchant knows about the payer. This information is not definitive and only serves as a hint to the UI or any pre-processing logic. - * + * @deprecated Not publicly available * @param \PayPal\Api\PotentialPayerInfo $potential_payer_info - * + * * @return $this */ public function setPotentialPayerInfo($potential_payer_info) @@ -119,7 +115,7 @@ public function setPotentialPayerInfo($potential_payer_info) /** * Information that the merchant knows about the payer. This information is not definitive and only serves as a hint to the UI or any pre-processing logic. - * + * @deprecated Not publicly available * @return \PayPal\Api\PotentialPayerInfo */ public function getPotentialPayerInfo() @@ -128,10 +124,9 @@ public function getPotentialPayerInfo() } /** - * Receiver of funds for this payment. **Readonly for PayPal external REST payments.** - * + * Receiver of funds for this payment. * @param \PayPal\Api\Payee $payee - * + * * @return $this */ public function setPayee($payee) @@ -141,8 +136,7 @@ public function setPayee($payee) } /** - * Receiver of funds for this payment. **Readonly for PayPal external REST payments.** - * + * Receiver of funds for this payment. * @return \PayPal\Api\Payee */ public function getPayee() @@ -152,10 +146,9 @@ public function getPayee() /** * ID of the cart to execute the payment. - * * @deprecated Not publicly available * @param string $cart - * + * * @return $this */ public function setCart($cart) @@ -166,7 +159,6 @@ public function setCart($cart) /** * ID of the cart to execute the payment. - * * @deprecated Not publicly available * @return string */ @@ -179,7 +171,7 @@ public function getCart() * Transactional details including the amount and item details. * * @param \PayPal\Api\Transaction[] $transactions - * + * * @return $this */ public function setTransactions($transactions) @@ -230,10 +222,9 @@ public function removeTransaction($transaction) /** * Applicable for advanced payments like multi seller payment (MSP) to support partial failures - * * @deprecated Not publicly available * @param \PayPal\Api\Error[] $failed_transactions - * + * * @return $this */ public function setFailedTransactions($failed_transactions) @@ -244,7 +235,6 @@ public function setFailedTransactions($failed_transactions) /** * Applicable for advanced payments like multi seller payment (MSP) to support partial failures - * * @deprecated Not publicly available * @return \PayPal\Api\Error[] */ @@ -255,7 +245,6 @@ public function getFailedTransactions() /** * Append FailedTransactions to the list. - * * @deprecated Not publicly available * @param \PayPal\Api\Error $error * @return $this @@ -273,7 +262,6 @@ public function addFailedTransaction($error) /** * Remove FailedTransactions from the list. - * * @deprecated Not publicly available * @param \PayPal\Api\Error $error * @return $this @@ -287,9 +275,9 @@ public function removeFailedTransaction($error) /** * Collection of PayPal generated billing agreement tokens. - * + * @deprecated Not publicly available * @param string[] $billing_agreement_tokens - * + * * @return $this */ public function setBillingAgreementTokens($billing_agreement_tokens) @@ -300,7 +288,7 @@ public function setBillingAgreementTokens($billing_agreement_tokens) /** * Collection of PayPal generated billing agreement tokens. - * + * @deprecated Not publicly available * @return string[] */ public function getBillingAgreementTokens() @@ -310,7 +298,7 @@ public function getBillingAgreementTokens() /** * Append BillingAgreementTokens to the list. - * + * @deprecated Not publicly available * @param string $billingAgreementToken * @return $this */ @@ -327,7 +315,7 @@ public function addBillingAgreementToken($billingAgreementToken) /** * Remove BillingAgreementTokens from the list. - * + * @deprecated Not publicly available * @param string $billingAgreementToken * @return $this */ @@ -340,10 +328,9 @@ public function removeBillingAgreementToken($billingAgreementToken) /** * Credit financing offered to payer on PayPal side. Returned in payment after payer opts-in - * * @deprecated Not publicly available * @param \PayPal\Api\CreditFinancingOffered $credit_financing_offered - * + * * @return $this */ public function setCreditFinancingOffered($credit_financing_offered) @@ -354,7 +341,6 @@ public function setCreditFinancingOffered($credit_financing_offered) /** * Credit financing offered to payer on PayPal side. Returned in payment after payer opts-in - * * @deprecated Not publicly available * @return \PayPal\Api\CreditFinancingOffered */ @@ -365,9 +351,9 @@ public function getCreditFinancingOffered() /** * Instructions for the payer to complete this payment. - * + * @deprecated Not publicly available * @param \PayPal\Api\PaymentInstruction $payment_instruction - * + * * @return $this */ public function setPaymentInstruction($payment_instruction) @@ -378,7 +364,7 @@ public function setPaymentInstruction($payment_instruction) /** * Instructions for the payer to complete this payment. - * + * @deprecated Not publicly available * @return \PayPal\Api\PaymentInstruction */ public function getPaymentInstruction() @@ -387,11 +373,11 @@ public function getPaymentInstruction() } /** - * Payment state. + * The state of the payment, authorization, or order transaction. The value is:
created
. The transaction was successfully created.approved
. The buyer approved the transaction.failed
. The transaction request failed.created
. The transaction was successfully created.approved
. The buyer approved the transaction.failed
. The transaction request failed.A resource representing a Payer's funding instrument. For direct credit card payments, set the CreditCard field on this object.
This sample code demonstrate how you can process +a direct credit card payment. Please note that direct +credit card payment and related features using the +REST API is restricted in some countries. +API used: /v1/payments/payment
A resource representing a payment card that can be +used to fund a payment.
A resource representing a Payer's funding instrument. +For direct credit card payments, set the CreditCard +field on this object.
A resource representing a Payer that funds a payment +For direct credit card payments, set payment method +to 'credit_card' and add an array of funding instruments.
(Optional) Lets you specify item wise +information
Use this optional field to set additional +payment information such as tax, shipping +charges etc.
Lets you specify a payment amount. +You can also specify additional details +such as shipping, tax.
Specify a payee with that user's email or merchant id +Merchant Id can be found at https://www.paypal.com/businessprofile/settings/
A transaction defines the contract of a +payment - what is the payment for and who +is fulfilling it.
A Payment Resource; create one using +the above types and intent set to sale 'sale'
For Sample Purposes Only.
Create a payment by calling the payment->create() method
+with a valid ApiContext (See bootstrap.php for more on ApiContext
)
+The return object contains the state.
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
Create a refund object indicating -refund amount and call the refund method
Create a new apiContext object so we send a new PayPal-Request-Id (idempotency) header for this resource
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
$bodyReceived = file_get_contents('php://input');