Merge pull request #417 from paypal/payments-api-updates

Payments API Updates
This commit is contained in:
Jay
2015-10-08 16:02:02 -05:00
125 changed files with 6740 additions and 1794 deletions

View File

@@ -11,13 +11,13 @@ namespace PayPal\Api;
* *
* @property string phone * @property string phone
*/ */
class Address extends BaseAddress class Address extends BaseAddress
{ {
/** /**
* Phone number in E.123 format. * Phone number in E.123 format.
* *
* @param string $phone * @param string $phone
* *
* @return $this * @return $this
*/ */
public function setPhone($phone) public function setPhone($phone)

View File

@@ -0,0 +1,89 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class AlternatePayment
*
* A resource representing a alternate payment account that can be used to fund a payment.
*
* @package PayPal\Api
*
* @property string alternate_payment_account_id
* @property string external_customer_id
* @property string alternate_payment_provider_id
*/
class AlternatePayment extends PayPalModel
{
/**
* The unique identifier of the alternate payment account.
*
* @param string $alternate_payment_account_id
*
* @return $this
*/
public function setAlternatePaymentAccountId($alternate_payment_account_id)
{
$this->alternate_payment_account_id = $alternate_payment_account_id;
return $this;
}
/**
* The unique identifier of the alternate payment account.
*
* @return string
*/
public function getAlternatePaymentAccountId()
{
return $this->alternate_payment_account_id;
}
/**
* The unique identifier of the payer
*
* @param string $external_customer_id
*
* @return $this
*/
public function setExternalCustomerId($external_customer_id)
{
$this->external_customer_id = $external_customer_id;
return $this;
}
/**
* The unique identifier of the payer
*
* @return string
*/
public function getExternalCustomerId()
{
return $this->external_customer_id;
}
/**
* Alternate Payment provider id. This is an optional attribute needed only for certain alternate providers e.g Ideal
*
* @param string $alternate_payment_provider_id
*
* @return $this
*/
public function setAlternatePaymentProviderId($alternate_payment_provider_id)
{
$this->alternate_payment_provider_id = $alternate_payment_provider_id;
return $this;
}
/**
* Alternate Payment provider id. This is an optional attribute needed only for certain alternate providers e.g Ideal
*
* @return string
*/
public function getAlternatePaymentProviderId()
{
return $this->alternate_payment_provider_id;
}
}

View File

@@ -13,17 +13,17 @@ use PayPal\Validation\NumericValidator;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string currency * @property string currency
* @property string total * @property string total
* @property \PayPal\Api\Details details * @property \PayPal\Api\Details details
*/ */
class Amount extends PayPalModel class Amount extends PayPalModel
{ {
/** /**
* 3 letter currency code * 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 * @param string $currency
* *
* @return $this * @return $this
*/ */
public function setCurrency($currency) public function setCurrency($currency)
@@ -33,7 +33,7 @@ class Amount extends PayPalModel
} }
/** /**
* 3 letter currency code * 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). PayPal does not support all currencies.
* *
* @return string * @return string
*/ */
@@ -43,8 +43,7 @@ class Amount extends PayPalModel
} }
/** /**
* Total amount charged as part of this payment. * 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 * @param string|double $total
* *
@@ -59,7 +58,7 @@ class Amount extends PayPalModel
} }
/** /**
* Total amount charged as part of this payment. * 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.
* *
* @return string * @return string
*/ */
@@ -72,7 +71,7 @@ class Amount extends PayPalModel
* Additional details of the payment amount. * Additional details of the payment amount.
* *
* @param \PayPal\Api\Details $details * @param \PayPal\Api\Details $details
* *
* @return $this * @return $this
*/ */
public function setDetails($details) public function setDetails($details)

View File

@@ -4,7 +4,6 @@ namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel; use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext; use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator; use PayPal\Validation\ArgumentValidator;
/** /**
@@ -14,29 +13,29 @@ use PayPal\Validation\ArgumentValidator;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string id * @property string id
* @property string create_time * @property \PayPal\Api\Amount amount
* @property string update_time * @property string payment_mode
* @property \PayPal\Api\Amount amount * @property string state
* @property string payment_mode * @property string reason_code
* @property string state * @property string pending_reason
* @property string reason_code * @property string protection_eligibility
* @property string pending_reason * @property string protection_eligibility_type
* @property string protection_eligibility
* @property string protection_eligibility_type
* @property \PayPal\Api\FmfDetails fmf_details * @property \PayPal\Api\FmfDetails fmf_details
* @property string parent_payment * @property string parent_payment
* @property string clearing_time * @property \PayPal\Api\ProcessorResponse processor_response
* @property string valid_until * @property string valid_until
* @property \PayPal\Api\Links links * @property string create_time
* @property string update_time
* @property \PayPal\Api\Links[] links
*/ */
class Authorization extends PayPalResourceModel class Authorization extends PayPalResourceModel
{ {
/** /**
* Identifier of the authorization transaction. * ID of the authorization transaction.
* *
* @param string $id * @param string $id
* *
* @return $this * @return $this
*/ */
public function setId($id) public function setId($id)
@@ -46,7 +45,7 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Identifier of the authorization transaction. * ID of the authorization transaction.
* *
* @return string * @return string
*/ */
@@ -56,10 +55,10 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Amount being authorized for. * Amount being authorized.
* *
* @param \PayPal\Api\Amount $amount * @param \PayPal\Api\Amount $amount
* *
* @return $this * @return $this
*/ */
public function setAmount($amount) public function setAmount($amount)
@@ -69,7 +68,7 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Amount being authorized for. * Amount being authorized.
* *
* @return \PayPal\Api\Amount * @return \PayPal\Api\Amount
*/ */
@@ -79,11 +78,11 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* specifies payment mode of the transaction * Specifies the payment mode of the transaction.
* Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"] * Valid Values: ["INSTANT_TRANSFER"]
* *
* @param string $payment_mode * @param string $payment_mode
* *
* @return $this * @return $this
*/ */
public function setPaymentMode($payment_mode) public function setPaymentMode($payment_mode)
@@ -93,7 +92,7 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* specifies payment mode of the transaction * Specifies the payment mode of the transaction.
* *
* @return string * @return string
*/ */
@@ -103,11 +102,11 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* State of the authorization transaction. * State of the authorization.
* Valid Values: ["pending", "authorized", "partially_captured", "captured", "expired", "voided"] * Valid Values: ["pending", "authorized", "partially_captured", "captured", "expired", "voided"]
* *
* @param string $state * @param string $state
* *
* @return $this * @return $this
*/ */
public function setState($state) public function setState($state)
@@ -117,7 +116,7 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* State of the authorization transaction. * State of the authorization.
* *
* @return string * @return string
*/ */
@@ -127,11 +126,11 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Reason code for the transaction state being Pending. This field will replace pending_reason field eventually * Reason code, `AUTHORIZATION`, for a transaction state of `pending`.
* Valid Values: ["AUTHORIZATION"] * Valid Values: ["AUTHORIZATION"]
* *
* @param string $reason_code * @param string $reason_code
* *
* @return $this * @return $this
*/ */
public function setReasonCode($reason_code) public function setReasonCode($reason_code)
@@ -141,7 +140,7 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Reason code for the transaction state being Pending. This field will replace pending_reason field eventually * Reason code, `AUTHORIZATION`, for a transaction state of `pending`.
* *
* @return string * @return string
*/ */
@@ -153,9 +152,9 @@ class Authorization extends PayPalResourceModel
/** /**
* [DEPRECATED] Reason code for the transaction state being Pending.Obsolete. use reason_code field instead. * [DEPRECATED] Reason code for the transaction state being Pending.Obsolete. use reason_code field instead.
* Valid Values: ["AUTHORIZATION"] * Valid Values: ["AUTHORIZATION"]
* @deprecated Plese Use setReasonCode instead *
* @param string $pending_reason * @param string $pending_reason
* *
* @return $this * @return $this
*/ */
public function setPendingReason($pending_reason) public function setPendingReason($pending_reason)
@@ -165,8 +164,8 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* [DEPRECATED] Reason code for the transaction state being Pending.Obsolete. use reason_code field instead. * @deprecated [DEPRECATED] Reason code for the transaction state being Pending.Obsolete. use reason_code field instead.
* @deprecated Plese Use setReasonCode instead *
* @return string * @return string
*/ */
public function getPendingReason() public function getPendingReason()
@@ -175,11 +174,11 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Protection Eligibility of the Payer * The level of seller protection in force for the transaction. Only supported when the `payment_method` is set to `paypal`. Allowed values:<br> `ELIGIBLE`- Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received.<br> `PARTIALLY_ELIGIBLE`- Merchant is protected by PayPal's Seller Protection Policy for Item Not Received or Unauthorized Payments. Refer to `protection_eligibility_type` for specifics. <br> `INELIGIBLE`- Merchant is not protected under the Seller Protection Policy.
* Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"] * Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
* *
* @param string $protection_eligibility * @param string $protection_eligibility
* *
* @return $this * @return $this
*/ */
public function setProtectionEligibility($protection_eligibility) public function setProtectionEligibility($protection_eligibility)
@@ -189,7 +188,7 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Protection Eligibility of the Payer * The level of seller protection in force for the transaction. Only supported when the `payment_method` is set to `paypal`. Allowed values:<br> `ELIGIBLE`- Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received.<br> `PARTIALLY_ELIGIBLE`- Merchant is protected by PayPal's Seller Protection Policy for Item Not Received or Unauthorized Payments. Refer to `protection_eligibility_type` for specifics. <br> `INELIGIBLE`- Merchant is not protected under the Seller Protection Policy.
* *
* @return string * @return string
*/ */
@@ -199,11 +198,11 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Protection Eligibility Type of the Payer * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:<br> `ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.<br> `UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.<br> One or both of the allowed values can be returned.
* Valid Values: ["ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE", "INELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE"] * Valid Values: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"]
* *
* @param string $protection_eligibility_type * @param string $protection_eligibility_type
* *
* @return $this * @return $this
*/ */
public function setProtectionEligibilityType($protection_eligibility_type) public function setProtectionEligibilityType($protection_eligibility_type)
@@ -213,7 +212,7 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Protection Eligibility Type of the Payer * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:<br> `ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.<br> `UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.<br> One or both of the allowed values can be returned.
* *
* @return string * @return string
*/ */
@@ -223,10 +222,10 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action. * 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 * @param \PayPal\Api\FmfDetails $fmf_details
* *
* @return $this * @return $this
*/ */
public function setFmfDetails($fmf_details) public function setFmfDetails($fmf_details)
@@ -236,7 +235,7 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action. * 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.
* *
* @return \PayPal\Api\FmfDetails * @return \PayPal\Api\FmfDetails
*/ */
@@ -249,7 +248,7 @@ class Authorization extends PayPalResourceModel
* ID of the Payment resource that this transaction is based on. * ID of the Payment resource that this transaction is based on.
* *
* @param string $parent_payment * @param string $parent_payment
* *
* @return $this * @return $this
*/ */
public function setParentPayment($parent_payment) public function setParentPayment($parent_payment)
@@ -269,34 +268,33 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Expected clearing time for eCheck Transactions * Response codes returned by the processor concerning the submitted payment. Only supported when the `payment_method` is set to `credit_card`.
* *
* * @param \PayPal\Api\ProcessorResponse $processor_response
* @param string $clearing_time
* *
* @return $this * @return $this
*/ */
public function setClearingTime($clearing_time) public function setProcessorResponse($processor_response)
{ {
$this->clearing_time = $clearing_time; $this->processor_response = $processor_response;
return $this; return $this;
} }
/** /**
* Expected clearing time for eCheck Transactions * Response codes returned by the processor concerning the submitted payment. Only supported when the `payment_method` is set to `credit_card`.
* *
* @return string * @return \PayPal\Api\ProcessorResponse
*/ */
public function getClearingTime() public function getProcessorResponse()
{ {
return $this->clearing_time; return $this->processor_response;
} }
/** /**
* Date/Time until which funds may be captured against this resource in UTC ISO8601 format. * 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 * @param string $valid_until
* *
* @return $this * @return $this
*/ */
public function setValidUntil($valid_until) public function setValidUntil($valid_until)
@@ -306,7 +304,7 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Date/Time until which funds may be captured against this resource in UTC ISO8601 format. * Authorization expiration time and date as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
* *
* @return string * @return string
*/ */
@@ -316,10 +314,10 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Time the resource was created in UTC ISO8601 format. * Time of authorization as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
* *
* @param string $create_time * @param string $create_time
* *
* @return $this * @return $this
*/ */
public function setCreateTime($create_time) public function setCreateTime($create_time)
@@ -329,7 +327,7 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Time the resource was created in UTC ISO8601 format. * Time of authorization as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
* *
* @return string * @return string
*/ */
@@ -339,10 +337,10 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Time the resource was last updated in UTC ISO8601 format. * Time that the resource was last updated.
* *
* @param string $update_time * @param string $update_time
* *
* @return $this * @return $this
*/ */
public function setUpdateTime($update_time) public function setUpdateTime($update_time)
@@ -352,7 +350,7 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* Time the resource was last updated in UTC ISO8601 format. * Time that the resource was last updated.
* *
* @return string * @return string
*/ */
@@ -364,9 +362,9 @@ class Authorization extends PayPalResourceModel
/** /**
* Retrieve details about a previously created authorization by passing the authorization_id in the request URI. * Retrieve details about a previously created authorization by passing the authorization_id in the request URI.
* *
* @param string $authorizationId * @param string $authorizationId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Authorization * @return Authorization
*/ */
public static function get($authorizationId, $apiContext = null, $restCall = null) public static function get($authorizationId, $apiContext = null, $restCall = null)
@@ -389,9 +387,9 @@ class Authorization extends PayPalResourceModel
/** /**
* 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. * 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.
* *
* @param Capture $capture * @param Capture $capture
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Capture * @return Capture
*/ */
public function capture($capture, $apiContext = null, $restCall = null) public function capture($capture, $apiContext = null, $restCall = null)
@@ -415,8 +413,8 @@ class Authorization extends PayPalResourceModel
/** /**
* Void (cancel) a previously authorized payment by passing the authorization_id in the request URI. Note that a fully captured authorization cannot be voided. * Void (cancel) a previously authorized payment by passing the authorization_id in the request URI. Note that a fully captured authorization cannot be voided.
* *
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Authorization * @return Authorization
*/ */
public function void($apiContext = null, $restCall = null) public function void($apiContext = null, $restCall = null)
@@ -436,10 +434,10 @@ class Authorization extends PayPalResourceModel
} }
/** /**
* 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. * 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
* *
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Authorization * @return Authorization
*/ */
public function reauthorize($apiContext = null, $restCall = null) public function reauthorize($apiContext = null, $restCall = null)

View File

@@ -2,10 +2,7 @@
namespace PayPal\Api; namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel; use PayPal\Common\PayPalModel;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/** /**
* Class BankAccount * Class BankAccount
@@ -14,37 +11,38 @@ use PayPal\Validation\ArgumentValidator;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string id * @property string account_number
* @property string account_number * @property string account_number_type
* @property string account_number_type * @property string routing_number
* @property string routing_number * @property string account_type
* @property string account_type * @property string account_name
* @property string account_name * @property string check_type
* @property string check_type * @property string auth_type
* @property string auth_type * @property string auth_capture_timestamp
* @property string auth_capture_timestamp * @property string bank_name
* @property string bank_name * @property string country_code
* @property string country_code * @property string first_name
* @property string first_name * @property string last_name
* @property string last_name * @property string birth_date
* @property string birth_date
* @property \PayPal\Api\Address billing_address * @property \PayPal\Api\Address billing_address
* @property string state * @property string state
* @property string confirmation_status * @property string confirmation_status
* @property string payer_id * @property string payer_id
* @property string external_customer_id * @property string external_customer_id
* @property string merchant_id * @property string merchant_id
* @property string create_time * @property string create_time
* @property string update_time * @property string update_time
* @property string valid_until * @property string valid_until
* @property \PayPal\Api\Links[] links
*/ */
class BankAccount extends PayPalResourceModel class BankAccount extends PayPalModel
{ {
/** /**
* ID of the bank account being saved for later use. * ID of the bank account being saved for later use.
* *
* @deprecated Not publicly available
* @param string $id * @param string $id
* *
* @return $this * @return $this
*/ */
public function setId($id) public function setId($id)
@@ -56,6 +54,7 @@ class BankAccount extends PayPalResourceModel
/** /**
* ID of the bank account being saved for later use. * ID of the bank account being saved for later use.
* *
* @deprecated Not publicly available
* @return string * @return string
*/ */
public function getId() public function getId()
@@ -67,7 +66,7 @@ class BankAccount extends PayPalResourceModel
* Account number in either IBAN (max length 34) or BBAN (max length 17) format. * Account number in either IBAN (max length 34) or BBAN (max length 17) format.
* *
* @param string $account_number * @param string $account_number
* *
* @return $this * @return $this
*/ */
public function setAccountNumber($account_number) public function setAccountNumber($account_number)
@@ -91,7 +90,7 @@ class BankAccount extends PayPalResourceModel
* Valid Values: ["BBAN", "IBAN"] * Valid Values: ["BBAN", "IBAN"]
* *
* @param string $account_number_type * @param string $account_number_type
* *
* @return $this * @return $this
*/ */
public function setAccountNumberType($account_number_type) public function setAccountNumberType($account_number_type)
@@ -114,7 +113,7 @@ class BankAccount extends PayPalResourceModel
* 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. * 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 * @param string $routing_number
* *
* @return $this * @return $this
*/ */
public function setRoutingNumber($routing_number) public function setRoutingNumber($routing_number)
@@ -138,7 +137,7 @@ class BankAccount extends PayPalResourceModel
* Valid Values: ["CHECKING", "SAVINGS"] * Valid Values: ["CHECKING", "SAVINGS"]
* *
* @param string $account_type * @param string $account_type
* *
* @return $this * @return $this
*/ */
public function setAccountType($account_type) public function setAccountType($account_type)
@@ -161,7 +160,7 @@ class BankAccount extends PayPalResourceModel
* A customer designated name. * A customer designated name.
* *
* @param string $account_name * @param string $account_name
* *
* @return $this * @return $this
*/ */
public function setAccountName($account_name) public function setAccountName($account_name)
@@ -185,7 +184,7 @@ class BankAccount extends PayPalResourceModel
* Valid Values: ["PERSONAL", "COMPANY"] * Valid Values: ["PERSONAL", "COMPANY"]
* *
* @param string $check_type * @param string $check_type
* *
* @return $this * @return $this
*/ */
public function setCheckType($check_type) public function setCheckType($check_type)
@@ -209,7 +208,7 @@ class BankAccount extends PayPalResourceModel
* Valid Values: ["CCD", "PPD", "TEL", "POP", "ARC", "RCK", "WEB"] * Valid Values: ["CCD", "PPD", "TEL", "POP", "ARC", "RCK", "WEB"]
* *
* @param string $auth_type * @param string $auth_type
* *
* @return $this * @return $this
*/ */
public function setAuthType($auth_type) public function setAuthType($auth_type)
@@ -232,7 +231,7 @@ class BankAccount extends PayPalResourceModel
* 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. * 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 * @param string $auth_capture_timestamp
* *
* @return $this * @return $this
*/ */
public function setAuthCaptureTimestamp($auth_capture_timestamp) public function setAuthCaptureTimestamp($auth_capture_timestamp)
@@ -255,7 +254,7 @@ class BankAccount extends PayPalResourceModel
* Name of the bank. * Name of the bank.
* *
* @param string $bank_name * @param string $bank_name
* *
* @return $this * @return $this
*/ */
public function setBankName($bank_name) public function setBankName($bank_name)
@@ -278,7 +277,7 @@ class BankAccount extends PayPalResourceModel
* 2 letter country code of the Bank. * 2 letter country code of the Bank.
* *
* @param string $country_code * @param string $country_code
* *
* @return $this * @return $this
*/ */
public function setCountryCode($country_code) public function setCountryCode($country_code)
@@ -301,7 +300,7 @@ class BankAccount extends PayPalResourceModel
* Account holder's first name. * Account holder's first name.
* *
* @param string $first_name * @param string $first_name
* *
* @return $this * @return $this
*/ */
public function setFirstName($first_name) public function setFirstName($first_name)
@@ -324,7 +323,7 @@ class BankAccount extends PayPalResourceModel
* Account holder's last name. * Account holder's last name.
* *
* @param string $last_name * @param string $last_name
* *
* @return $this * @return $this
*/ */
public function setLastName($last_name) public function setLastName($last_name)
@@ -347,7 +346,7 @@ class BankAccount extends PayPalResourceModel
* Birth date of the bank account holder. * Birth date of the bank account holder.
* *
* @param string $birth_date * @param string $birth_date
* *
* @return $this * @return $this
*/ */
public function setBirthDate($birth_date) public function setBirthDate($birth_date)
@@ -370,7 +369,7 @@ class BankAccount extends PayPalResourceModel
* Billing address. * Billing address.
* *
* @param \PayPal\Api\Address $billing_address * @param \PayPal\Api\Address $billing_address
* *
* @return $this * @return $this
*/ */
public function setBillingAddress($billing_address) public function setBillingAddress($billing_address)
@@ -394,7 +393,7 @@ class BankAccount extends PayPalResourceModel
* Valid Values: ["ACTIVE", "INACTIVE", "DELETED"] * Valid Values: ["ACTIVE", "INACTIVE", "DELETED"]
* *
* @param string $state * @param string $state
* *
* @return $this * @return $this
*/ */
public function setState($state) public function setState($state)
@@ -418,7 +417,7 @@ class BankAccount extends PayPalResourceModel
* Valid Values: ["UNCONFIRMED", "CONFIRMED"] * Valid Values: ["UNCONFIRMED", "CONFIRMED"]
* *
* @param string $confirmation_status * @param string $confirmation_status
* *
* @return $this * @return $this
*/ */
public function setConfirmationStatus($confirmation_status) public function setConfirmationStatus($confirmation_status)
@@ -438,10 +437,10 @@ class BankAccount extends PayPalResourceModel
} }
/** /**
* Deprecated - Use external_customer_id instead. * [DEPRECATED] Use external_customer_id instead.
* *
* @param string $payer_id * @param string $payer_id
* *
* @return $this * @return $this
*/ */
public function setPayerId($payer_id) public function setPayerId($payer_id)
@@ -451,7 +450,7 @@ class BankAccount extends PayPalResourceModel
} }
/** /**
* Deprecated - Use external_customer_id instead. * @deprecated [DEPRECATED] Use external_customer_id instead.
* *
* @return string * @return string
*/ */
@@ -464,7 +463,7 @@ class BankAccount extends PayPalResourceModel
* 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. * 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 * @param string $external_customer_id
* *
* @return $this * @return $this
*/ */
public function setExternalCustomerId($external_customer_id) public function setExternalCustomerId($external_customer_id)
@@ -483,12 +482,11 @@ class BankAccount extends PayPalResourceModel
return $this->external_customer_id; return $this->external_customer_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 merchnt.
* *
* @param string $merchant_id * @param string $merchant_id
* *
* @return $this * @return $this
*/ */
public function setMerchantId($merchant_id) public function setMerchantId($merchant_id)
@@ -511,7 +509,7 @@ class BankAccount extends PayPalResourceModel
* Time the resource was created. * Time the resource was created.
* *
* @param string $create_time * @param string $create_time
* *
* @return $this * @return $this
*/ */
public function setCreateTime($create_time) public function setCreateTime($create_time)
@@ -534,7 +532,7 @@ class BankAccount extends PayPalResourceModel
* Time the resource was last updated. * Time the resource was last updated.
* *
* @param string $update_time * @param string $update_time
* *
* @return $this * @return $this
*/ */
public function setUpdateTime($update_time) public function setUpdateTime($update_time)
@@ -557,7 +555,7 @@ class BankAccount extends PayPalResourceModel
* Date/Time until this resource can be used to fund a payment. * Date/Time until this resource can be used to fund a payment.
* *
* @param string $valid_until * @param string $valid_until
* *
* @return $this * @return $this
*/ */
public function setValidUntil($valid_until) public function setValidUntil($valid_until)
@@ -577,97 +575,56 @@ class BankAccount extends PayPalResourceModel
} }
/** /**
* Creates a new Bank Account Resource. * Sets Links
* *
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @param \PayPal\Api\Links[] $links
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls *
* @return BankAccount * @return $this
*/ */
public function create($apiContext = null, $restCall = null) public function setLinks($links)
{ {
$payLoad = $this->toJSON(); $this->links = $links;
$json = self::executeCall(
"/v1/vault/bank-accounts",
"POST",
$payLoad,
null,
$apiContext,
$restCall
);
$this->fromJson($json);
return $this; return $this;
} }
/** /**
* Obtain the Bank Account resource for the given identifier. * Gets Links
* *
* @param string $bankAccountId * @return \PayPal\Api\Links[]
* @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 BankAccount
*/ */
public static function get($bankAccountId, $apiContext = null, $restCall = null) public function getLinks()
{ {
ArgumentValidator::validate($bankAccountId, 'bankAccountId'); return $this->links;
$payLoad = "";
$json = self::executeCall(
"/v1/vault/bank-accounts/$bankAccountId",
"GET",
$payLoad,
null,
$apiContext,
$restCall
);
$ret = new BankAccount();
$ret->fromJson($json);
return $ret;
} }
/** /**
* Delete the bank account resource for the given identifier. * Append Links to the list.
* *
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @param \PayPal\Api\Links $links
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls * @return $this
* @return bool
*/ */
public function delete($apiContext = null, $restCall = null) public function addLink($links)
{ {
ArgumentValidator::validate($this->getId(), "Id"); if (!$this->getLinks()) {
$payLoad = ""; return $this->setLinks(array($links));
self::executeCall( } else {
"/v1/vault/bank-accounts/{$this->getId()}", return $this->setLinks(
"DELETE", array_merge($this->getLinks(), array($links))
$payLoad, );
null, }
$apiContext,
$restCall
);
return true;
} }
/** /**
* Update information in a previously saved bank account. Only the modified fields need to be passed in the request. * Remove Links from the list.
* *
* @param PatchRequest $patchRequest * @param \PayPal\Api\Links $links
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @return $this
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return BankAccount
*/ */
public function update($patchRequest, $apiContext = null, $restCall = null) public function removeLink($links)
{ {
ArgumentValidator::validate($this->getId(), "Id"); return $this->setLinks(
ArgumentValidator::validate($patchRequest, 'patchRequest'); array_diff($this->getLinks(), array($links))
$payLoad = $patchRequest->toJSON();
$json = self::executeCall(
"/v1/vault/bank-accounts/{$this->getId()}",
"PATCH",
$payLoad,
null,
$apiContext,
$restCall
); );
$this->fromJson($json);
return $this;
} }
} }

View File

@@ -0,0 +1,41 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class Billing
*
* Billing instrument used to charge the payer.
*
* @package PayPal\Api
*
* @property string billing_agreement_id
*/
class Billing extends PayPalModel
{
/**
* Identifier of the instrument in PayPal Wallet
*
* @param string $billing_agreement_id
*
* @return $this
*/
public function setBillingAgreementId($billing_agreement_id)
{
$this->billing_agreement_id = $billing_agreement_id;
return $this;
}
/**
* Identifier of the instrument in PayPal Wallet
*
* @return string
*/
public function getBillingAgreementId()
{
return $this->billing_agreement_id;
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class BillingAgreementToken
*
* PayPal generated billing agreement token. It is a token returned by /v1/billing-agreements/agreement-token API end point.
*
* @package PayPal\Api
*
*/
class BillingAgreementToken extends PayPalModel
{
}

View File

@@ -4,7 +4,6 @@ namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel; use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext; use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator; use PayPal\Validation\ArgumentValidator;
/** /**
@@ -14,23 +13,23 @@ use PayPal\Validation\ArgumentValidator;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string id * @property string id
* @property string create_time * @property \PayPal\Api\Amount amount
* @property string update_time * @property bool is_final_capture
* @property \PayPal\Api\Amount amount * @property string state
* @property bool is_final_capture * @property string parent_payment
* @property string state
* @property string parent_payment
* @property \PayPal\Api\Currency transaction_fee * @property \PayPal\Api\Currency transaction_fee
* @property \PayPal\Api\Links[] links * @property string create_time
* @property string update_time
* @property \PayPal\Api\Links[] links
*/ */
class Capture extends PayPalResourceModel class Capture extends PayPalResourceModel
{ {
/** /**
* Identifier of the Capture transaction. * ID of the capture transaction.
* *
* @param string $id * @param string $id
* *
* @return $this * @return $this
*/ */
public function setId($id) public function setId($id)
@@ -40,7 +39,7 @@ class Capture extends PayPalResourceModel
} }
/** /**
* Identifier of the Capture transaction. * ID of the capture transaction.
* *
* @return string * @return string
*/ */
@@ -50,10 +49,10 @@ class Capture extends PayPalResourceModel
} }
/** /**
* Amount being captured. If no amount is specified, amount is used from the authorization being captured. If amount is same as the amount that's authorized for, the state of the authorization changes to captured. If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by setting the is_final_capture flag to true. * 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`.
* *
* @param \PayPal\Api\Amount $amount * @param \PayPal\Api\Amount $amount
* *
* @return $this * @return $this
*/ */
public function setAmount($amount) public function setAmount($amount)
@@ -63,7 +62,7 @@ class Capture extends PayPalResourceModel
} }
/** /**
* Amount being captured. If no amount is specified, amount is used from the authorization being captured. If amount is same as the amount that's authorized for, the state of the authorization changes to captured. If not, the state of the authorization changes to partially_captured. Alternatively, you could indicate a final capture by setting the is_final_capture flag to true. * 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`.
* *
* @return \PayPal\Api\Amount * @return \PayPal\Api\Amount
*/ */
@@ -73,10 +72,10 @@ class Capture extends PayPalResourceModel
} }
/** /**
* whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument. * If set to `true`, all remaining funds held by the authorization will be released in the funding instrument.
* *
* @param bool $is_final_capture * @param bool $is_final_capture
* *
* @return $this * @return $this
*/ */
public function setIsFinalCapture($is_final_capture) public function setIsFinalCapture($is_final_capture)
@@ -86,7 +85,7 @@ class Capture extends PayPalResourceModel
} }
/** /**
* whether this is a final capture for the given authorization or not. If it's final, all the remaining funds held by the authorization, will be released in the funding instrument. * If set to `true`, all remaining funds held by the authorization will be released in the funding instrument.
* *
* @return bool * @return bool
*/ */
@@ -96,11 +95,11 @@ class Capture extends PayPalResourceModel
} }
/** /**
* State of the capture transaction. * State of the capture.
* Valid Values: ["pending", "completed", "refunded", "partially_refunded"] * Valid Values: ["pending", "completed", "refunded", "partially_refunded"]
* *
* @param string $state * @param string $state
* *
* @return $this * @return $this
*/ */
public function setState($state) public function setState($state)
@@ -110,7 +109,7 @@ class Capture extends PayPalResourceModel
} }
/** /**
* State of the capture transaction. * State of the capture.
* *
* @return string * @return string
*/ */
@@ -120,10 +119,10 @@ class Capture extends PayPalResourceModel
} }
/** /**
* ID of the Payment resource that this transaction is based on. * ID of the payment resource on which this transaction is based.
* *
* @param string $parent_payment * @param string $parent_payment
* *
* @return $this * @return $this
*/ */
public function setParentPayment($parent_payment) public function setParentPayment($parent_payment)
@@ -133,7 +132,7 @@ class Capture extends PayPalResourceModel
} }
/** /**
* ID of the Payment resource that this transaction is based on. * ID of the payment resource on which this transaction is based.
* *
* @return string * @return string
*/ */
@@ -146,7 +145,7 @@ class Capture extends PayPalResourceModel
* Transaction fee applicable for this payment. * Transaction fee applicable for this payment.
* *
* @param \PayPal\Api\Currency $transaction_fee * @param \PayPal\Api\Currency $transaction_fee
* *
* @return $this * @return $this
*/ */
public function setTransactionFee($transaction_fee) public function setTransactionFee($transaction_fee)
@@ -166,10 +165,10 @@ class Capture extends PayPalResourceModel
} }
/** /**
* Time the resource was created in UTC ISO8601 format. * Time of capture as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
* *
* @param string $create_time * @param string $create_time
* *
* @return $this * @return $this
*/ */
public function setCreateTime($create_time) public function setCreateTime($create_time)
@@ -179,7 +178,7 @@ class Capture extends PayPalResourceModel
} }
/** /**
* Time the resource was created in UTC ISO8601 format. * Time of capture as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
* *
* @return string * @return string
*/ */
@@ -189,10 +188,10 @@ class Capture extends PayPalResourceModel
} }
/** /**
* Time the resource was last updated in UTC ISO8601 format. * Time that the resource was last updated.
* *
* @param string $update_time * @param string $update_time
* *
* @return $this * @return $this
*/ */
public function setUpdateTime($update_time) public function setUpdateTime($update_time)
@@ -202,7 +201,7 @@ class Capture extends PayPalResourceModel
} }
/** /**
* Time the resource was last updated in UTC ISO8601 format. * Time that the resource was last updated.
* *
* @return string * @return string
*/ */
@@ -214,9 +213,9 @@ class Capture extends PayPalResourceModel
/** /**
* Retrieve details about a captured payment by passing the capture_id in the request URI. * Retrieve details about a captured payment by passing the capture_id in the request URI.
* *
* @param string $captureId * @param string $captureId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Capture * @return Capture
*/ */
public static function get($captureId, $apiContext = null, $restCall = null) public static function get($captureId, $apiContext = null, $restCall = null)
@@ -239,9 +238,9 @@ class Capture extends PayPalResourceModel
/** /**
* 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. * 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.
* *
* @param Refund $refund * @param Refund $refund
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Refund * @return Refund
*/ */
public function refund($refund, $apiContext = null, $restCall = null) public function refund($refund, $apiContext = null, $restCall = null)

View File

@@ -0,0 +1,138 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class CarrierAccount
*
* Payment Instrument that facilitates carrier billing
*
* @package PayPal\Api
*
* @property string id
* @property string phone_number
* @property string external_customer_id
* @property string phone_source
* @property \PayPal\Api\CountryCode country_code
*/
class CarrierAccount extends PayPalModel
{
/**
* ID that identifies the payer<65>s carrier account. Can be used in subsequent REST API calls, e.g. for making payments.
*
* @param string $id
*
* @return $this
*/
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* ID that identifies the payer<65>s carrier account. Can be used in subsequent REST API calls, e.g. for making payments.
*
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* The payer<65>s phone number in E.164 format.
*
* @param string $phone_number
*
* @return $this
*/
public function setPhoneNumber($phone_number)
{
$this->phone_number = $phone_number;
return $this;
}
/**
* The payer<65>s phone number in E.164 format.
*
* @return string
*/
public function getPhoneNumber()
{
return $this->phone_number;
}
/**
* User identifier as created by the merchant.
*
* @param string $external_customer_id
*
* @return $this
*/
public function setExternalCustomerId($external_customer_id)
{
$this->external_customer_id = $external_customer_id;
return $this;
}
/**
* User identifier as created by the merchant.
*
* @return string
*/
public function getExternalCustomerId()
{
return $this->external_customer_id;
}
/**
* The method of obtaining the phone number (USER_PROVIDED or READ_FROM_DEVICE).
* Valid Values: ["READ_FROM_DEVICE", "USER_PROVIDED"]
*
* @param string $phone_source
*
* @return $this
*/
public function setPhoneSource($phone_source)
{
$this->phone_source = $phone_source;
return $this;
}
/**
* The method of obtaining the phone number (USER_PROVIDED or READ_FROM_DEVICE).
*
* @return string
*/
public function getPhoneSource()
{
return $this->phone_source;
}
/**
* The country where the phone number is registered. Specified in 2-character IS0-3166-1 format.
*
* @param \PayPal\Api\CountryCode $country_code
*
* @return $this
*/
public function setCountryCode($country_code)
{
$this->country_code = $country_code;
return $this;
}
/**
* The country where the phone number is registered. Specified in 2-character IS0-3166-1 format.
*
* @return \PayPal\Api\CountryCode
*/
public function getCountryCode()
{
return $this->country_code;
}
}

View File

@@ -40,10 +40,10 @@ class CarrierAccountToken extends PayPalModel
} }
/** /**
* ID of a previously saved carrier account resource. * The unique identifier of the payer used when saving this carrier account instrument.
*
* *
* @param string $external_customer_id * @param string $external_customer_id
*
* @return $this * @return $this
*/ */
public function setExternalCustomerId($external_customer_id) public function setExternalCustomerId($external_customer_id)

View File

@@ -12,25 +12,48 @@ use PayPal\Validation\UrlValidator;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property \PayPal\Api\Amount amount * @property string reference_id
* @property \PayPal\Api\Payee payee * @property \PayPal\Api\Amount amount
* @property string description * @property string description
* @property string note_to_payee * @property string note_to_payee
* @property string custom * @property string custom
* @property string invoice_number * @property string invoice_number
* @property string soft_descriptor * @property string soft_descriptor
* @property \PayPal\Api\PaymentOptions payment_options * @property \PayPal\Api\PaymentOptions payment_options
* @property \PayPal\Api\ItemList item_list * @property \PayPal\Api\ItemList item_list
* @property string notify_url * @property string notify_url
* @property string order_url * @property string order_url
*/ */
class CartBase extends PayPalModel class CartBase extends PayPalModel
{ {
/**
* Merchant identifier to the purchase unit. Optional parameter
*
* @param string $reference_id
*
* @return $this
*/
public function setReferenceId($reference_id)
{
$this->reference_id = $reference_id;
return $this;
}
/**
* Merchant identifier to the purchase unit. Optional parameter
*
* @return string
*/
public function getReferenceId()
{
return $this->reference_id;
}
/** /**
* Amount being collected. * Amount being collected.
* *
* @param \PayPal\Api\Amount $amount * @param \PayPal\Api\Amount $amount
* *
* @return $this * @return $this
*/ */
public function setAmount($amount) public function setAmount($amount)
@@ -52,8 +75,9 @@ class CartBase extends PayPalModel
/** /**
* Recipient of the funds in this transaction. * Recipient of the funds in this transaction.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\Payee $payee * @param \PayPal\Api\Payee $payee
* *
* @return $this * @return $this
*/ */
public function setPayee($payee) public function setPayee($payee)
@@ -65,6 +89,7 @@ class CartBase extends PayPalModel
/** /**
* Recipient of the funds in this transaction. * Recipient of the funds in this transaction.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\Payee * @return \PayPal\Api\Payee
*/ */
public function getPayee() public function getPayee()
@@ -73,10 +98,10 @@ class CartBase extends PayPalModel
} }
/** /**
* Description of what is being paid for. * Description of transaction.
* *
* @param string $description * @param string $description
* *
* @return $this * @return $this
*/ */
public function setDescription($description) public function setDescription($description)
@@ -86,7 +111,7 @@ class CartBase extends PayPalModel
} }
/** /**
* Description of what is being paid for. * Description of transaction.
* *
* @return string * @return string
*/ */
@@ -99,7 +124,7 @@ class CartBase extends PayPalModel
* Note to the recipient of the funds in this transaction. * Note to the recipient of the funds in this transaction.
* *
* @param string $note_to_payee * @param string $note_to_payee
* *
* @return $this * @return $this
*/ */
public function setNoteToPayee($note_to_payee) public function setNoteToPayee($note_to_payee)
@@ -119,11 +144,10 @@ class CartBase extends PayPalModel
} }
/** /**
* Note to the recipient of the funds in this transaction. * Free-form field for the use of clients. Only supported when the `payment_method` is set to `paypal`.
*
* *
* @param string $custom * @param string $custom
* *
* @return $this * @return $this
*/ */
public function setCustom($custom) public function setCustom($custom)
@@ -133,7 +157,7 @@ class CartBase extends PayPalModel
} }
/** /**
* free-form field for the use of clients * Free-form field for the use of clients. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -143,10 +167,10 @@ class CartBase extends PayPalModel
} }
/** /**
* invoice number to track this payment * Invoice number used to track the payment. Only supported when the `payment_method` is set to `paypal`.
* *
* @param string $invoice_number * @param string $invoice_number
* *
* @return $this * @return $this
*/ */
public function setInvoiceNumber($invoice_number) public function setInvoiceNumber($invoice_number)
@@ -156,7 +180,7 @@ class CartBase extends PayPalModel
} }
/** /**
* invoice number to track this payment * Invoice number used to track the payment. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -166,11 +190,10 @@ class CartBase extends PayPalModel
} }
/** /**
* Soft descriptor used when charging this funding source. * Soft descriptor used when charging this funding source. If length exceeds max length, the value will be truncated
*
* *
* @param string $soft_descriptor * @param string $soft_descriptor
* *
* @return $this * @return $this
*/ */
public function setSoftDescriptor($soft_descriptor) public function setSoftDescriptor($soft_descriptor)
@@ -180,7 +203,7 @@ class CartBase extends PayPalModel
} }
/** /**
* Soft descriptor used when charging this funding source. * Soft descriptor used when charging this funding source. If length exceeds max length, the value will be truncated
* *
* @return string * @return string
*/ */
@@ -189,12 +212,36 @@ class CartBase extends PayPalModel
return $this->soft_descriptor; return $this->soft_descriptor;
} }
/**
* 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)
{
$this->soft_descriptor_city = $soft_descriptor_city;
return $this;
}
/**
* 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
*/
public function getSoftDescriptorCity()
{
return $this->soft_descriptor_city;
}
/** /**
* Payment options requested for this purchase unit * Payment options requested for this purchase unit
* *
*
* @param \PayPal\Api\PaymentOptions $payment_options * @param \PayPal\Api\PaymentOptions $payment_options
* *
* @return $this * @return $this
*/ */
public function setPaymentOptions($payment_options) public function setPaymentOptions($payment_options)
@@ -214,10 +261,10 @@ class CartBase extends PayPalModel
} }
/** /**
* List of items being paid for. * Items and related shipping address within a transaction.
* *
* @param \PayPal\Api\ItemList $item_list * @param \PayPal\Api\ItemList $item_list
* *
* @return $this * @return $this
*/ */
public function setItemList($item_list) public function setItemList($item_list)
@@ -227,7 +274,7 @@ class CartBase extends PayPalModel
} }
/** /**
* List of items being paid for. * Items and related shipping address within a transaction.
* *
* @return \PayPal\Api\ItemList * @return \PayPal\Api\ItemList
*/ */
@@ -283,4 +330,62 @@ class CartBase extends PayPalModel
{ {
return $this->order_url; return $this->order_url;
} }
/**
* 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
*
* @return $this
*/
public function setExternalFunding($external_funding)
{
$this->external_funding = $external_funding;
return $this;
}
/**
* 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[]
*/
public function getExternalFunding()
{
return $this->external_funding;
}
/**
* Append ExternalFunding to the list.
*
* @deprecated Not publicly available
* @param \PayPal\Api\ExternalFunding $externalFunding
* @return $this
*/
public function addExternalFunding($externalFunding)
{
if (!$this->getExternalFunding()) {
return $this->setExternalFunding(array($externalFunding));
} else {
return $this->setExternalFunding(
array_merge($this->getExternalFunding(), array($externalFunding))
);
}
}
/**
* Remove ExternalFunding from the list.
*
* @deprecated Not publicly available
* @param \PayPal\Api\ExternalFunding $externalFunding
* @return $this
*/
public function removeExternalFunding($externalFunding)
{
return $this->setExternalFunding(
array_diff($this->getExternalFunding(), array($externalFunding))
);
}
} }

View File

@@ -0,0 +1,41 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class CountryCode
*
* Representation of a country code.
*
* @package PayPal\Api
*
* @property string country_code
*/
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)
{
$this->country_code = $country_code;
return $this;
}
/**
* ISO country code based on 2-character IS0-3166-1 codes.
*
* @return string
*/
public function getCountryCode()
{
return $this->country_code;
}
}

View File

@@ -2,8 +2,6 @@
namespace PayPal\Api; namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/** /**
* Class CreateProfileResponse * Class CreateProfileResponse
* *
@@ -13,7 +11,7 @@ use PayPal\Common\PayPalModel;
* *
* @property string id * @property string id
*/ */
class CreateProfileResponse extends PayPalModel class CreateProfileResponse extends WebProfile
{ {
/** /**
* ID of the payment web experience profile. * ID of the payment web experience profile.

View File

@@ -13,7 +13,6 @@ use PayPal\Common\PayPalModel;
* *
* @property string id * @property string id
* @property string type * @property string type
* @property string terms
*/ */
class Credit extends PayPalModel class Credit extends PayPalModel
{ {
@@ -21,7 +20,7 @@ class Credit extends PayPalModel
* Unique identifier of credit resource. * Unique identifier of credit resource.
* *
* @param string $id * @param string $id
* *
* @return $this * @return $this
*/ */
public function setId($id) public function setId($id)
@@ -41,11 +40,11 @@ class Credit extends PayPalModel
} }
/** /**
* Specifies the type of credit. * specifies type of credit
* Valid Values: ["BILL_ME_LATER", "PAYPAL_EXTRAS_MASTERCARD", "EBAY_MASTERCARD", "PAYPAL_SMART_CONNECT"] * Valid Values: ["BILL_ME_LATER", "PAYPAL_EXTRAS_MASTERCARD", "EBAY_MASTERCARD", "PAYPAL_SMART_CONNECT"]
* *
* @param string $type * @param string $type
* *
* @return $this * @return $this
*/ */
public function setType($type) public function setType($type)
@@ -55,7 +54,7 @@ class Credit extends PayPalModel
} }
/** /**
* Specifies the type of credit * specifies type of credit
* *
* @return string * @return string
*/ */
@@ -64,27 +63,4 @@ class Credit extends PayPalModel
return $this->type; return $this->type;
} }
/**
* URI to the associated terms.
*
* @param string $terms
*
* @return $this
*/
public function setTerms($terms)
{
$this->terms = $terms;
return $this;
}
/**
* URI to the associated terms.
*
* @return string
*/
public function getTerms()
{
return $this->terms;
}
} }

View File

@@ -10,36 +10,29 @@ use PayPal\Validation\ArgumentValidator;
/** /**
* Class CreditCard * Class CreditCard
* *
* A resource representing a credit card that can be used to fund a payment. * @package PayPal\Api
* *
* @package PayPal\Api * @property string number
* * @property string type
* @property string id * @property int expire_month
* @property string number * @property int expire_year
* @property string type * @property string cvv2
* @property int expire_month * @property string first_name
* @property int expire_year * @property string last_name
* @property string cvv2
* @property string first_name
* @property string last_name
* @property \PayPal\Api\Address billing_address * @property \PayPal\Api\Address billing_address
* @property string external_customer_id * @property string external_customer_id
* @property string merchant_id * @property string state
* @property string payer_id * @property string valid_until
* @property string external_card_id
* @property string state
* @property string create_time
* @property string update_time
* @property string valid_until
* @property \PayPal\Api\Links[] links * @property \PayPal\Api\Links[] links
*/ */
class CreditCard extends PayPalResourceModel class CreditCard extends PayPalResourceModel
{ {
/** /**
* ID of the credit card being saved for later use. * ID of the credit card. This ID is provided in the response when storing credit cards. **Required if using a stored credit card.**
* *
* @deprecated Not publicly available
* @param string $id * @param string $id
* *
* @return $this * @return $this
*/ */
public function setId($id) public function setId($id)
@@ -49,8 +42,9 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* ID of the credit card being saved for later use. * ID of the credit card. This ID is provided in the response when storing credit cards. **Required if using a stored credit card.**
* *
* @deprecated Not publicly available
* @return string * @return string
*/ */
public function getId() public function getId()
@@ -59,10 +53,10 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* Card number. * Credit card number. Numeric characters only with no spaces or punctuation. The string must conform with modulo and length required by each credit card type. *Redacted in responses.*
* *
* @param string $number * @param string $number
* *
* @return $this * @return $this
*/ */
public function setNumber($number) public function setNumber($number)
@@ -72,7 +66,7 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* Card number. * Credit card number. Numeric characters only with no spaces or punctuation. The string must conform with modulo and length required by each credit card type. *Redacted in responses.*
* *
* @return string * @return string
*/ */
@@ -82,11 +76,10 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* Type of the Card. Currently supporting Visa, Mastercard, Amex, Discover and Maestro * Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`
* Valid Values: ["visa", "mastercard", "amex", "discover", "maestro"]
* *
* @param string $type * @param string $type
* *
* @return $this * @return $this
*/ */
public function setType($type) public function setType($type)
@@ -96,7 +89,7 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* Type of the Card. Currently supporting Visa, Mastercard, Amex, Discover and Maestro * Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`
* *
* @return string * @return string
*/ */
@@ -106,10 +99,10 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* 2 digit card expiry month. * Expiration month with no leading zero. Acceptable values are 1 through 12.
* *
* @param int $expire_month * @param int $expire_month
* *
* @return $this * @return $this
*/ */
public function setExpireMonth($expire_month) public function setExpireMonth($expire_month)
@@ -119,7 +112,7 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* 2 digit card expiry month. * Expiration month with no leading zero. Acceptable values are 1 through 12.
* *
* @return int * @return int
*/ */
@@ -129,10 +122,10 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* 4 digit card expiry year * 4-digit expiration year.
* *
* @param int $expire_year * @param int $expire_year
* *
* @return $this * @return $this
*/ */
public function setExpireYear($expire_year) public function setExpireYear($expire_year)
@@ -142,7 +135,7 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* 4 digit card expiry year * 4-digit expiration year.
* *
* @return int * @return int
*/ */
@@ -152,10 +145,10 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* Card validation code. Only supported when making a Payment but not when saving a credit card for future use. * 3-4 digit card validation code.
* *
* @param string $cvv2 * @param string $cvv2
* *
* @return $this * @return $this
*/ */
public function setCvv2($cvv2) public function setCvv2($cvv2)
@@ -165,7 +158,7 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* Card validation code. Only supported when making a Payment but not when saving a credit card for future use. * 3-4 digit card validation code.
* *
* @return string * @return string
*/ */
@@ -175,10 +168,10 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* Card holder's first name. * Cardholder's first name.
* *
* @param string $first_name * @param string $first_name
* *
* @return $this * @return $this
*/ */
public function setFirstName($first_name) public function setFirstName($first_name)
@@ -188,7 +181,7 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* Card holder's first name. * Cardholder's first name.
* *
* @return string * @return string
*/ */
@@ -198,10 +191,10 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* Card holder's last name. * Cardholder's last name.
* *
* @param string $last_name * @param string $last_name
* *
* @return $this * @return $this
*/ */
public function setLastName($last_name) public function setLastName($last_name)
@@ -211,7 +204,7 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* Card holder's last name. * Cardholder's last name.
* *
* @return string * @return string
*/ */
@@ -224,7 +217,7 @@ class CreditCard extends PayPalResourceModel
* Billing Address associated with this card. * Billing Address associated with this card.
* *
* @param \PayPal\Api\Address $billing_address * @param \PayPal\Api\Address $billing_address
* *
* @return $this * @return $this
*/ */
public function setBillingAddress($billing_address) public function setBillingAddress($billing_address)
@@ -244,10 +237,10 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* 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. * A unique identifier of the customer to whom this bank account belongs. Generated and provided by the facilitator. **This is now used in favor of `payer_id` when creating or using a stored funding instrument in the vault.**
* *
* @param string $external_customer_id * @param string $external_customer_id
* *
* @return $this * @return $this
*/ */
public function setExternalCustomerId($external_customer_id) public function setExternalCustomerId($external_customer_id)
@@ -257,7 +250,7 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* 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. * A unique identifier of the customer to whom this bank account belongs. Generated and provided by the facilitator. **This is now used in favor of `payer_id` when creating or using a stored funding instrument in the vault.**
* *
* @return string * @return string
*/ */
@@ -270,7 +263,7 @@ class CreditCard extends PayPalResourceModel
* A user provided, optional convenvience field that functions as a unique identifier for the merchant on behalf of whom this credit card is being stored for. Note that this has no relation to PayPal merchant id * A user provided, optional convenvience field that functions as a unique identifier for the merchant on behalf of whom this credit card is being stored for. Note that this has no relation to PayPal merchant id
* *
* @param string $merchant_id * @param string $merchant_id
* *
* @return $this * @return $this
*/ */
public function setMerchantId($merchant_id) public function setMerchantId($merchant_id)
@@ -291,9 +284,10 @@ class CreditCard extends PayPalResourceModel
/** /**
* 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. * 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.
*
* @deprecated This is being deprecated in favor of the `external_customer_id` property. * @deprecated This is being deprecated in favor of the `external_customer_id` property.
* @param string $payer_id * @param string $payer_id
* *
* @return $this * @return $this
*/ */
public function setPayerId($payer_id) public function setPayerId($payer_id)
@@ -304,6 +298,7 @@ class CreditCard extends PayPalResourceModel
/** /**
* 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. * 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.
*
* @deprecated This is being deprecated in favor of the `external_customer_id` property. * @deprecated This is being deprecated in favor of the `external_customer_id` property.
* @return string * @return string
*/ */
@@ -316,7 +311,7 @@ class CreditCard extends PayPalResourceModel
* A unique identifier of the bank account resource. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant. * A unique identifier of the bank account resource. 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 $external_card_id * @param string $external_card_id
* *
* @return $this * @return $this
*/ */
public function setExternalCardId($external_card_id) public function setExternalCardId($external_card_id)
@@ -340,7 +335,7 @@ class CreditCard extends PayPalResourceModel
* Valid Values: ["expired", "ok"] * Valid Values: ["expired", "ok"]
* *
* @param string $state * @param string $state
* *
* @return $this * @return $this
*/ */
public function setState($state) public function setState($state)
@@ -350,7 +345,7 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* State of the funding instrument. * State of the credit card funding instrument.
* *
* @return string * @return string
*/ */
@@ -360,10 +355,10 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates creation time. * Funding instrument expiration date.
* *
* @param string $create_time * @param string $create_time
* *
* @return $this * @return $this
*/ */
public function setCreateTime($create_time) public function setCreateTime($create_time)
@@ -386,7 +381,7 @@ class CreditCard extends PayPalResourceModel
* Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the updation time. * Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the updation time.
* *
* @param string $update_time * @param string $update_time
* *
* @return $this * @return $this
*/ */
public function setUpdateTime($update_time) public function setUpdateTime($update_time)
@@ -409,7 +404,7 @@ class CreditCard extends PayPalResourceModel
* Date/Time until this resource can be used fund a payment. * Date/Time until this resource can be used fund a payment.
* *
* @param string $valid_until * @param string $valid_until
* *
* @return $this * @return $this
*/ */
public function setValidUntil($valid_until) public function setValidUntil($valid_until)
@@ -419,7 +414,7 @@ class CreditCard extends PayPalResourceModel
} }
/** /**
* Date/Time until this resource can be used fund a payment. * Funding instrument expiration date.
* *
* @return string * @return string
*/ */
@@ -431,8 +426,8 @@ class CreditCard extends PayPalResourceModel
/** /**
* Creates a new Credit Card Resource (aka Tokenize). * Creates a new Credit Card Resource (aka Tokenize).
* *
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return CreditCard * @return CreditCard
*/ */
public function create($apiContext = null, $restCall = null) public function create($apiContext = null, $restCall = null)
@@ -453,9 +448,9 @@ class CreditCard extends PayPalResourceModel
/** /**
* Obtain the Credit Card resource for the given identifier. * Obtain the Credit Card resource for the given identifier.
* *
* @param string $creditCardId * @param string $creditCardId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return CreditCard * @return CreditCard
*/ */
public static function get($creditCardId, $apiContext = null, $restCall = null) public static function get($creditCardId, $apiContext = null, $restCall = null)
@@ -478,8 +473,8 @@ class CreditCard extends PayPalResourceModel
/** /**
* Delete the Credit Card resource for the given identifier. * Delete the Credit Card resource for the given identifier.
* *
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return bool * @return bool
*/ */
public function delete($apiContext = null, $restCall = null) public function delete($apiContext = null, $restCall = null)
@@ -500,9 +495,9 @@ class CreditCard extends PayPalResourceModel
/** /**
* Update information in a previously saved card. Only the modified fields need to be passed in the request. * Update information in a previously saved card. Only the modified fields need to be passed in the request.
* *
* @param PatchRequest $patchRequest * @param PatchRequest $patchRequest
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return CreditCard * @return CreditCard
*/ */
public function update($patchRequest, $apiContext = null, $restCall = null) public function update($patchRequest, $apiContext = null, $restCall = null)
@@ -525,9 +520,9 @@ class CreditCard extends PayPalResourceModel
/** /**
* Retrieves a list of Credit Card resources. * Retrieves a list of Credit Card resources.
* *
* @param array $params * @param array $params
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return CreditCardList * @return CreditCardList
*/ */
public static function all($params, $apiContext = null, $restCall = null) public static function all($params, $apiContext = null, $restCall = null)
@@ -538,16 +533,16 @@ class CreditCard extends PayPalResourceModel
ArgumentValidator::validate($params, 'params'); ArgumentValidator::validate($params, 'params');
$payLoad = ""; $payLoad = "";
$allowedParams = array( $allowedParams = array(
'page_size' => 1, 'page_size' => 1,
'page' => 1, 'page' => 1,
'start_time' => 1, 'start_time' => 1,
'end_time' => 1, 'end_time' => 1,
'sort_order' => 1, 'sort_order' => 1,
'sort_by' => 1, 'sort_by' => 1,
'merchant_id' => 1, 'merchant_id' => 1,
'external_card_id' => 1, 'external_card_id' => 1,
'external_customer_id' => 1, 'external_customer_id' => 1,
); );
$json = self::executeCall( $json = self::executeCall(
"/v1/vault/credit-cards" . "?" . http_build_query(array_intersect_key($params, $allowedParams)), "/v1/vault/credit-cards" . "?" . http_build_query(array_intersect_key($params, $allowedParams)),
"GET", "GET",

View File

@@ -15,16 +15,16 @@ use PayPal\Common\PayPalModel;
* @property string payer_id * @property string payer_id
* @property string last4 * @property string last4
* @property string type * @property string type
* @property int expire_month * @property int expire_month
* @property int expire_year * @property int expire_year
*/ */
class CreditCardToken extends PayPalModel class CreditCardToken extends PayPalModel
{ {
/** /**
* ID of a previously saved Credit Card resource using /vault/credit-card API. * ID of credit card previously stored using `/vault/credit-card`.
* *
* @param string $credit_card_id * @param string $credit_card_id
* *
* @return $this * @return $this
*/ */
public function setCreditCardId($credit_card_id) public function setCreditCardId($credit_card_id)
@@ -34,7 +34,7 @@ class CreditCardToken extends PayPalModel
} }
/** /**
* ID of a previously saved Credit Card resource using /vault/credit-card API. * ID of credit card previously stored using `/vault/credit-card`.
* *
* @return string * @return string
*/ */
@@ -44,10 +44,10 @@ class CreditCardToken extends PayPalModel
} }
/** /**
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API. * 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 * @param string $payer_id
* *
* @return $this * @return $this
*/ */
public function setPayerId($payer_id) public function setPayerId($payer_id)
@@ -57,7 +57,7 @@ class CreditCardToken extends PayPalModel
} }
/** /**
* The unique identifier of the payer used when saving this credit card using /vault/credit-card API. * 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.**
* *
* @return string * @return string
*/ */
@@ -67,10 +67,10 @@ class CreditCardToken extends PayPalModel
} }
/** /**
* Last 4 digits of the card number from the saved card. * Last four digits of the stored credit card number.
* *
* @param string $last4 * @param string $last4
* *
* @return $this * @return $this
*/ */
public function setLast4($last4) public function setLast4($last4)
@@ -80,7 +80,7 @@ class CreditCardToken extends PayPalModel
} }
/** /**
* Last 4 digits of the card number from the saved card. * Last four digits of the stored credit card number.
* *
* @return string * @return string
*/ */
@@ -90,10 +90,10 @@ class CreditCardToken extends PayPalModel
} }
/** /**
* Type of the Card (eg. visa, mastercard, etc.) from the saved card. Please note that the values are always in lowercase and not meant to be used directly for display. * 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 * @param string $type
* *
* @return $this * @return $this
*/ */
public function setType($type) public function setType($type)
@@ -103,7 +103,7 @@ class CreditCardToken extends PayPalModel
} }
/** /**
* Type of the Card (eg. visa, mastercard, etc.) from the saved card. Please note that the values are always in lowercase and not meant to be used directly for display. * Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`. Values are presented in lowercase and not should not be used for display.
* *
* @return string * @return string
*/ */
@@ -113,10 +113,10 @@ class CreditCardToken extends PayPalModel
} }
/** /**
* card expiry month from the saved card with value 1 - 12 * Expiration month with no leading zero. Acceptable values are 1 through 12.
* *
* @param int $expire_month * @param int $expire_month
* *
* @return $this * @return $this
*/ */
public function setExpireMonth($expire_month) public function setExpireMonth($expire_month)
@@ -126,7 +126,7 @@ class CreditCardToken extends PayPalModel
} }
/** /**
* card expiry month from the saved card with value 1 - 12 * Expiration month with no leading zero. Acceptable values are 1 through 12.
* *
* @return int * @return int
*/ */
@@ -136,10 +136,10 @@ class CreditCardToken extends PayPalModel
} }
/** /**
* 4 digit card expiry year from the saved card * 4-digit expiration year.
* *
* @param int $expire_year * @param int $expire_year
* *
* @return $this * @return $this
*/ */
public function setExpireYear($expire_year) public function setExpireYear($expire_year)
@@ -149,7 +149,7 @@ class CreditCardToken extends PayPalModel
} }
/** /**
* 4 digit card expiry year from the saved card * 4-digit expiration year.
* *
* @return int * @return int
*/ */

View File

@@ -0,0 +1,161 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class CreditFinancingOffered
*
* Credit financing offered to customer on PayPal side with opt-in/opt-out status
*
* @package PayPal\Api
*
* @property \PayPal\Api\Currency total_cost
* @property \PayPal\Api\number term
* @property \PayPal\Api\Currency monthly_payment
* @property \PayPal\Api\Currency total_interest
* @property bool payer_acceptance
* @property bool cart_amount_immutable
*/
class CreditFinancingOffered extends PayPalModel
{
/**
* This is the estimated total payment amount including interest and fees the user will pay during the lifetime of the loan.
*
* @param \PayPal\Api\Currency $total_cost
*
* @return $this
*/
public function setTotalCost($total_cost)
{
$this->total_cost = $total_cost;
return $this;
}
/**
* This is the estimated total payment amount including interest and fees the user will pay during the lifetime of the loan.
*
* @return \PayPal\Api\Currency
*/
public function getTotalCost()
{
return $this->total_cost;
}
/**
* Length of financing terms in month
*
* @param \PayPal\Api\number $term
*
* @return $this
*/
public function setTerm($term)
{
$this->term = $term;
return $this;
}
/**
* Length of financing terms in month
*
* @return \PayPal\Api\number
*/
public function getTerm()
{
return $this->term;
}
/**
* This is the estimated amount per month that the customer will need to pay including fees and interest.
*
* @param \PayPal\Api\Currency $monthly_payment
*
* @return $this
*/
public function setMonthlyPayment($monthly_payment)
{
$this->monthly_payment = $monthly_payment;
return $this;
}
/**
* This is the estimated amount per month that the customer will need to pay including fees and interest.
*
* @return \PayPal\Api\Currency
*/
public function getMonthlyPayment()
{
return $this->monthly_payment;
}
/**
* Estimated interest or fees amount the payer will have to pay during the lifetime of the loan.
*
* @param \PayPal\Api\Currency $total_interest
*
* @return $this
*/
public function setTotalInterest($total_interest)
{
$this->total_interest = $total_interest;
return $this;
}
/**
* Estimated interest or fees amount the payer will have to pay during the lifetime of the loan.
*
* @return \PayPal\Api\Currency
*/
public function getTotalInterest()
{
return $this->total_interest;
}
/**
* Status on whether the customer ultimately was approved for and chose to make the payment using the approved installment credit.
*
* @param bool $payer_acceptance
*
* @return $this
*/
public function setPayerAcceptance($payer_acceptance)
{
$this->payer_acceptance = $payer_acceptance;
return $this;
}
/**
* Status on whether the customer ultimately was approved for and chose to make the payment using the approved installment credit.
*
* @return bool
*/
public function getPayerAcceptance()
{
return $this->payer_acceptance;
}
/**
* Indicates whether the cart amount is editable after payer's acceptance on PayPal side
*
* @param bool $cart_amount_immutable
*
* @return $this
*/
public function setCartAmountImmutable($cart_amount_immutable)
{
$this->cart_amount_immutable = $cart_amount_immutable;
return $this;
}
/**
* Indicates whether the cart amount is editable after payer's acceptance on PayPal side
*
* @return bool
*/
public function getCartAmountImmutable()
{
return $this->cart_amount_immutable;
}
}

View File

@@ -12,14 +12,13 @@ use PayPal\Validation\UrlValidator;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string conversion_date * @property string conversion_date
* @property string from_currency * @property string from_currency
* @property string from_amount * @property string from_amount
* @property string to_currency * @property string to_currency
* @property string to_amount * @property string to_amount
* @property string conversion_type * @property string conversion_type
* @property bool conversion_type_changeable * @property bool conversion_type_changeable
* @property string web_url
* @property \PayPal\Api\Links[] links * @property \PayPal\Api\Links[] links
*/ */
class CurrencyConversion extends PayPalModel class CurrencyConversion extends PayPalModel
@@ -28,7 +27,7 @@ class CurrencyConversion extends PayPalModel
* Date of validity for the conversion rate. * Date of validity for the conversion rate.
* *
* @param string $conversion_date * @param string $conversion_date
* *
* @return $this * @return $this
*/ */
public function setConversionDate($conversion_date) public function setConversionDate($conversion_date)
@@ -51,7 +50,7 @@ class CurrencyConversion extends PayPalModel
* 3 letter currency code * 3 letter currency code
* *
* @param string $from_currency * @param string $from_currency
* *
* @return $this * @return $this
*/ */
public function setFromCurrency($from_currency) public function setFromCurrency($from_currency)
@@ -71,10 +70,10 @@ class CurrencyConversion extends PayPalModel
} }
/** /**
* Amount participating in currency conversion, set to 1 as default * Amount participating in currency conversion, set to 1 as default
* *
* @param string $from_amount * @param string $from_amount
* *
* @return $this * @return $this
*/ */
public function setFromAmount($from_amount) public function setFromAmount($from_amount)
@@ -84,7 +83,7 @@ class CurrencyConversion extends PayPalModel
} }
/** /**
* Amount participating in currency conversion, set to 1 as default * Amount participating in currency conversion, set to 1 as default
* *
* @return string * @return string
*/ */
@@ -97,7 +96,7 @@ class CurrencyConversion extends PayPalModel
* 3 letter currency code * 3 letter currency code
* *
* @param string $to_currency * @param string $to_currency
* *
* @return $this * @return $this
*/ */
public function setToCurrency($to_currency) public function setToCurrency($to_currency)
@@ -120,7 +119,7 @@ class CurrencyConversion extends PayPalModel
* Amount resulting from currency conversion. * Amount resulting from currency conversion.
* *
* @param string $to_amount * @param string $to_amount
* *
* @return $this * @return $this
*/ */
public function setToAmount($to_amount) public function setToAmount($to_amount)
@@ -144,7 +143,7 @@ class CurrencyConversion extends PayPalModel
* Valid Values: ["PAYPAL", "VENDOR"] * Valid Values: ["PAYPAL", "VENDOR"]
* *
* @param string $conversion_type * @param string $conversion_type
* *
* @return $this * @return $this
*/ */
public function setConversionType($conversion_type) public function setConversionType($conversion_type)
@@ -167,7 +166,7 @@ class CurrencyConversion extends PayPalModel
* Allow Payer to change conversion type. * Allow Payer to change conversion type.
* *
* @param bool $conversion_type_changeable * @param bool $conversion_type_changeable
* *
* @return $this * @return $this
*/ */
public function setConversionTypeChangeable($conversion_type_changeable) public function setConversionTypeChangeable($conversion_type_changeable)
@@ -190,6 +189,7 @@ class CurrencyConversion extends PayPalModel
* Base URL to web applications endpoint * 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"] * 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 * @param string $web_url
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @return $this * @return $this
@@ -204,6 +204,7 @@ class CurrencyConversion extends PayPalModel
/** /**
* Base URL to web applications endpoint * Base URL to web applications endpoint
* *
* @deprecated Not publicly available
* @return string * @return string
*/ */
public function getWebUrl() public function getWebUrl()
@@ -215,7 +216,7 @@ class CurrencyConversion extends PayPalModel
* Sets Links * Sets Links
* *
* @param \PayPal\Api\Links[] $links * @param \PayPal\Api\Links[] $links
* *
* @return $this * @return $this
*/ */
public function setLinks($links) public function setLinks($links)

View File

@@ -25,10 +25,10 @@ use PayPal\Validation\NumericValidator;
class Details extends PayPalModel class Details extends PayPalModel
{ {
/** /**
* Sub-total (amount) of items being paid for. * 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 * @param string|double $subtotal
* *
* @return $this * @return $this
*/ */
public function setSubtotal($subtotal) public function setSubtotal($subtotal)
@@ -40,7 +40,7 @@ class Details extends PayPalModel
} }
/** /**
* Sub-total (amount) of items being paid for. * Amount of the subtotal of the items. **Required** if line items are specified. 10 characters max, with support for 2 decimal places.
* *
* @return string * @return string
*/ */
@@ -50,10 +50,10 @@ class Details extends PayPalModel
} }
/** /**
* Amount being charged for shipping. * Amount charged for shipping. 10 characters max with support for 2 decimal places.
* *
* @param string|double $shipping * @param string|double $shipping
* *
* @return $this * @return $this
*/ */
public function setShipping($shipping) public function setShipping($shipping)
@@ -65,7 +65,7 @@ class Details extends PayPalModel
} }
/** /**
* Amount being charged for shipping. * Amount charged for shipping. 10 characters max with support for 2 decimal places.
* *
* @return string * @return string
*/ */
@@ -75,10 +75,10 @@ class Details extends PayPalModel
} }
/** /**
* Amount being charged as tax. * Amount charged for tax. 10 characters max with support for 2 decimal places.
* *
* @param string|double $tax * @param string|double $tax
* *
* @return $this * @return $this
*/ */
public function setTax($tax) public function setTax($tax)
@@ -90,7 +90,7 @@ class Details extends PayPalModel
} }
/** /**
* Amount being charged as tax. * Amount charged for tax. 10 characters max with support for 2 decimal places.
* *
* @return string * @return string
*/ */
@@ -100,10 +100,10 @@ class Details extends PayPalModel
} }
/** /**
* Amount being charged as handling fee. * Amount being charged for the handling fee. Only supported when the `payment_method` is set to `paypal`.
*
* @param string|double $handling_fee
* *
* @param string $handling_fee
*
* @return $this * @return $this
*/ */
public function setHandlingFee($handling_fee) public function setHandlingFee($handling_fee)
@@ -115,7 +115,7 @@ class Details extends PayPalModel
} }
/** /**
* Amount being charged as handling fee. * Amount being charged for the handling fee. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -125,10 +125,10 @@ class Details extends PayPalModel
} }
/** /**
* Amount being charged as shipping discount. * Amount being discounted for the shipping fee. Only supported when the `payment_method` is set to `paypal`.
*
* @param string|double $shipping_discount
* *
* @param string $shipping_discount
*
* @return $this * @return $this
*/ */
public function setShippingDiscount($shipping_discount) public function setShippingDiscount($shipping_discount)
@@ -140,7 +140,7 @@ class Details extends PayPalModel
} }
/** /**
* Amount being charged as shipping discount. * Amount being discounted for the shipping fee. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -150,10 +150,10 @@ class Details extends PayPalModel
} }
/** /**
* Amount being charged as insurance. * Amount being charged for the insurance fee. Only supported when the `payment_method` is set to `paypal`.
* *
* @param string|double $insurance * @param string|double $insurance
* *
* @return $this * @return $this
*/ */
public function setInsurance($insurance) public function setInsurance($insurance)
@@ -165,7 +165,7 @@ class Details extends PayPalModel
} }
/** /**
* Amount being charged as insurance. * Amount being charged for the insurance fee. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -177,8 +177,8 @@ class Details extends PayPalModel
/** /**
* Amount being charged as gift wrap fee. * Amount being charged as gift wrap fee.
* *
* @param string $gift_wrap * @param string|double $gift_wrap
* *
* @return $this * @return $this
*/ */
public function setGiftWrap($gift_wrap) public function setGiftWrap($gift_wrap)
@@ -203,7 +203,7 @@ class Details extends PayPalModel
* Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment. * 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 * @param string|double $fee
* *
* @return $this * @return $this
*/ */
public function setFee($fee) public function setFee($fee)

View File

@@ -11,14 +11,12 @@ use PayPal\Common\PayPalModel;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string name * @property string name
* @property string purchase_unit_reference_id * @property string message
* @property string debug_id
* @property string message
* @property string code
* @property string information_link
* @property \PayPal\Api\ErrorDetails[] details * @property \PayPal\Api\ErrorDetails[] details
* @property \PayPal\Api\Links[] links * @property string information_link
* @property string debug_id
* @property \PayPal\Api\Links[] links
*/ */
class Error extends PayPalModel class Error extends PayPalModel
{ {
@@ -26,7 +24,7 @@ class Error extends PayPalModel
* Human readable, unique name of the error. * Human readable, unique name of the error.
* *
* @param string $name * @param string $name
* *
* @return $this * @return $this
*/ */
public function setName($name) public function setName($name)
@@ -48,8 +46,9 @@ class Error extends PayPalModel
/** /**
* Reference ID of the purchase_unit associated with this error * Reference ID of the purchase_unit associated with this error
* *
* @deprecated Not publicly available
* @param string $purchase_unit_reference_id * @param string $purchase_unit_reference_id
* *
* @return $this * @return $this
*/ */
public function setPurchaseUnitReferenceId($purchase_unit_reference_id) public function setPurchaseUnitReferenceId($purchase_unit_reference_id)
@@ -61,6 +60,7 @@ class Error extends PayPalModel
/** /**
* Reference ID of the purchase_unit associated with this error * Reference ID of the purchase_unit associated with this error
* *
* @deprecated Not publicly available
* @return string * @return string
*/ */
public function getPurchaseUnitReferenceId() public function getPurchaseUnitReferenceId()
@@ -68,34 +68,11 @@ class Error extends PayPalModel
return $this->purchase_unit_reference_id; return $this->purchase_unit_reference_id;
} }
/**
* PayPal internal identifier used for correlation purposes.
*
* @param string $debug_id
*
* @return $this
*/
public function setDebugId($debug_id)
{
$this->debug_id = $debug_id;
return $this;
}
/**
* PayPal internal identifier used for correlation purposes.
*
* @return string
*/
public function getDebugId()
{
return $this->debug_id;
}
/** /**
* Message describing the error. * Message describing the error.
* *
* @param string $message * @param string $message
* *
* @return $this * @return $this
*/ */
public function setMessage($message) public function setMessage($message)
@@ -117,8 +94,9 @@ class Error extends PayPalModel
/** /**
* PayPal internal error code. * PayPal internal error code.
* *
* @deprecated Not publicly available
* @param string $code * @param string $code
* *
* @return $this * @return $this
*/ */
public function setCode($code) public function setCode($code)
@@ -130,6 +108,7 @@ class Error extends PayPalModel
/** /**
* PayPal internal error code. * PayPal internal error code.
* *
* @deprecated Not publicly available
* @return string * @return string
*/ */
public function getCode() public function getCode()
@@ -137,34 +116,11 @@ class Error extends PayPalModel
return $this->code; return $this->code;
} }
/**
* URI for detailed information related to this error for the developer.
*
* @param string $information_link
*
* @return $this
*/
public function setInformationLink($information_link)
{
$this->information_link = $information_link;
return $this;
}
/**
* URI for detailed information related to this error for the developer.
*
* @return string
*/
public function getInformationLink()
{
return $this->information_link;
}
/** /**
* Additional details of the error * Additional details of the error
* *
* @param \PayPal\Api\ErrorDetails[] $details * @param \PayPal\Api\ErrorDetails[] $details
* *
* @return $this * @return $this
*/ */
public function setDetails($details) public function setDetails($details)
@@ -213,11 +169,107 @@ class Error extends PayPalModel
); );
} }
/**
* response codes returned from a payment processor such as avs, cvv, etc. Only supported when the `payment_method` is set to `credit_card`.
*
* @deprecated Not publicly available
* @param \PayPal\Api\ProcessorResponse $processor_response
*
* @return $this
*/
public function setProcessorResponse($processor_response)
{
$this->processor_response = $processor_response;
return $this;
}
/**
* response codes returned from a payment processor such as avs, cvv, etc. Only supported when the `payment_method` is set to `credit_card`.
*
* @deprecated Not publicly available
* @return \PayPal\Api\ProcessorResponse
*/
public function getProcessorResponse()
{
return $this->processor_response;
}
/**
* Fraud filter details. Only supported when the `payment_method` is set to `credit_card`
*
* @deprecated Not publicly available
* @param \PayPal\Api\FmfDetails $fmf_details
*
* @return $this
*/
public function setFmfDetails($fmf_details)
{
$this->fmf_details = $fmf_details;
return $this;
}
/**
* Fraud filter details. Only supported when the `payment_method` is set to `credit_card`
*
* @deprecated Not publicly available
* @return \PayPal\Api\FmfDetails
*/
public function getFmfDetails()
{
return $this->fmf_details;
}
/**
* URI for detailed information related to this error for the developer.
*
* @param string $information_link
*
* @return $this
*/
public function setInformationLink($information_link)
{
$this->information_link = $information_link;
return $this;
}
/**
* URI for detailed information related to this error for the developer.
*
* @return string
*/
public function getInformationLink()
{
return $this->information_link;
}
/**
* PayPal internal identifier used for correlation purposes.
*
* @param string $debug_id
*
* @return $this
*/
public function setDebugId($debug_id)
{
$this->debug_id = $debug_id;
return $this;
}
/**
* PayPal internal identifier used for correlation purposes.
*
* @return string
*/
public function getDebugId()
{
return $this->debug_id;
}
/** /**
* Sets Links * Sets Links
* *
* @param \PayPal\Api\Links[] $links * @param \PayPal\Api\Links[] $links
* *
* @return $this * @return $this
*/ */
public function setLinks($links) public function setLinks($links)

View File

@@ -13,8 +13,6 @@ use PayPal\Common\PayPalModel;
* *
* @property string field * @property string field
* @property string issue * @property string issue
* @property string purchase_unit_reference_id
* @property string code
*/ */
class ErrorDetails extends PayPalModel class ErrorDetails extends PayPalModel
{ {
@@ -22,7 +20,7 @@ class ErrorDetails extends PayPalModel
* Name of the field that caused the error. * Name of the field that caused the error.
* *
* @param string $field * @param string $field
* *
* @return $this * @return $this
*/ */
public function setField($field) public function setField($field)
@@ -45,7 +43,7 @@ class ErrorDetails extends PayPalModel
* Reason for the error. * Reason for the error.
* *
* @param string $issue * @param string $issue
* *
* @return $this * @return $this
*/ */
public function setIssue($issue) public function setIssue($issue)
@@ -67,8 +65,9 @@ class ErrorDetails extends PayPalModel
/** /**
* Reference ID of the purchase_unit associated with this error * Reference ID of the purchase_unit associated with this error
* *
* @deprecated Not publicly available
* @param string $purchase_unit_reference_id * @param string $purchase_unit_reference_id
* *
* @return $this * @return $this
*/ */
public function setPurchaseUnitReferenceId($purchase_unit_reference_id) public function setPurchaseUnitReferenceId($purchase_unit_reference_id)
@@ -80,6 +79,7 @@ class ErrorDetails extends PayPalModel
/** /**
* Reference ID of the purchase_unit associated with this error * Reference ID of the purchase_unit associated with this error
* *
* @deprecated Not publicly available
* @return string * @return string
*/ */
public function getPurchaseUnitReferenceId() public function getPurchaseUnitReferenceId()
@@ -90,8 +90,9 @@ class ErrorDetails extends PayPalModel
/** /**
* PayPal internal error code. * PayPal internal error code.
* *
* @deprecated Not publicly available
* @param string $code * @param string $code
* *
* @return $this * @return $this
*/ */
public function setCode($code) public function setCode($code)
@@ -103,6 +104,7 @@ class ErrorDetails extends PayPalModel
/** /**
* PayPal internal error code. * PayPal internal error code.
* *
* @deprecated Not publicly available
* @return string * @return string
*/ */
public function getCode() public function getCode()

View File

@@ -9,15 +9,15 @@ namespace PayPal\Api;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string mandate_reference_number
*/ */
class ExtendedBankAccount extends BankAccount class ExtendedBankAccount extends BankAccount
{ {
/** /**
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). * 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 * @param string $mandate_reference_number
* *
* @return $this * @return $this
*/ */
public function setMandateReferenceNumber($mandate_reference_number) public function setMandateReferenceNumber($mandate_reference_number)
@@ -29,6 +29,7 @@ class ExtendedBankAccount extends BankAccount
/** /**
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
* *
* @deprecated Not publicly available
* @return string * @return string
*/ */
public function getMandateReferenceNumber() public function getMandateReferenceNumber()

View File

@@ -0,0 +1,137 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class ExternalFunding
*
* A resource representing an external funding object.
*
* @package PayPal\Api
*
* @property string reference_id
* @property string code
* @property string funding_account_id
* @property string display_text
* @property \PayPal\Api\Amount amount
*/
class ExternalFunding extends PayPalModel
{
/**
* Unique identifier for the external funding
*
* @param string $reference_id
*
* @return $this
*/
public function setReferenceId($reference_id)
{
$this->reference_id = $reference_id;
return $this;
}
/**
* Unique identifier for the external funding
*
* @return string
*/
public function getReferenceId()
{
return $this->reference_id;
}
/**
* Generic identifier for the external funding
*
* @param string $code
*
* @return $this
*/
public function setCode($code)
{
$this->code = $code;
return $this;
}
/**
* Generic identifier for the external funding
*
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* Encrypted PayPal Account identifier for the funding account
*
* @param string $funding_account_id
*
* @return $this
*/
public function setFundingAccountId($funding_account_id)
{
$this->funding_account_id = $funding_account_id;
return $this;
}
/**
* Encrypted PayPal Account identifier for the funding account
*
* @return string
*/
public function getFundingAccountId()
{
return $this->funding_account_id;
}
/**
* Description of the external funding being applied
*
* @param string $display_text
*
* @return $this
*/
public function setDisplayText($display_text)
{
$this->display_text = $display_text;
return $this;
}
/**
* Description of the external funding being applied
*
* @return string
*/
public function getDisplayText()
{
return $this->display_text;
}
/**
* Amount being funded by the external funding account
*
* @param \PayPal\Api\Amount $amount
*
* @return $this
*/
public function setAmount($amount)
{
$this->amount = $amount;
return $this;
}
/**
* Amount being funded by the external funding account
*
* @return \PayPal\Api\Amount
*/
public function getAmount()
{
return $this->amount;
}
}

View File

@@ -23,7 +23,7 @@ class FmfDetails extends PayPalModel
* Valid Values: ["ACCEPT", "PENDING", "DENY", "REPORT"] * Valid Values: ["ACCEPT", "PENDING", "DENY", "REPORT"]
* *
* @param string $filter_type * @param string $filter_type
* *
* @return $this * @return $this
*/ */
public function setFilterType($filter_type) public function setFilterType($filter_type)
@@ -44,10 +44,10 @@ class FmfDetails extends PayPalModel
/** /**
* Filter Identifier. * Filter Identifier.
* 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_MATCH", "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"] * 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 * @param string $filter_id
* *
* @return $this * @return $this
*/ */
public function setFilterId($filter_id) public function setFilterId($filter_id)
@@ -70,7 +70,7 @@ class FmfDetails extends PayPalModel
* Name of the filter * Name of the filter
* *
* @param string $name * @param string $name
* *
* @return $this * @return $this
*/ */
public function setName($name) public function setName($name)
@@ -93,7 +93,7 @@ class FmfDetails extends PayPalModel
* Description of the filter. * Description of the filter.
* *
* @param string $description * @param string $description
* *
* @return $this * @return $this
*/ */
public function setDescription($description) public function setDescription($description)

View File

@@ -13,6 +13,8 @@ use PayPal\Common\PayPalModel;
* *
* @property string clearing_time * @property string clearing_time
* @property string payment_hold_date * @property string payment_hold_date
* @property string payment_debit_date
* @property string processing_type
*/ */
class FundingDetail extends PayPalModel class FundingDetail extends PayPalModel
{ {
@@ -20,7 +22,7 @@ class FundingDetail extends PayPalModel
* Expected clearing time * Expected clearing time
* *
* @param string $clearing_time * @param string $clearing_time
* *
* @return $this * @return $this
*/ */
public function setClearingTime($clearing_time) public function setClearingTime($clearing_time)
@@ -40,10 +42,10 @@ class FundingDetail extends PayPalModel
} }
/** /**
* Hold-off duration of the payment * [DEPRECATED] Hold-off duration of the payment. payment_debit_date should be used instead.
* *
* @param string $payment_hold_date * @param string $payment_hold_date
* *
* @return $this * @return $this
*/ */
public function setPaymentHoldDate($payment_hold_date) public function setPaymentHoldDate($payment_hold_date)
@@ -53,7 +55,7 @@ class FundingDetail extends PayPalModel
} }
/** /**
* Hold-off duration of the payment * @deprecated [DEPRECATED] Hold-off duration of the payment. payment_debit_date should be used instead.
* *
* @return string * @return string
*/ */
@@ -62,4 +64,51 @@ class FundingDetail extends PayPalModel
return $this->payment_hold_date; return $this->payment_hold_date;
} }
/**
* Date when funds will be debited from the payer's account
*
* @param string $payment_debit_date
*
* @return $this
*/
public function setPaymentDebitDate($payment_debit_date)
{
$this->payment_debit_date = $payment_debit_date;
return $this;
}
/**
* Date when funds will be debited from the payer's account
*
* @return string
*/
public function getPaymentDebitDate()
{
return $this->payment_debit_date;
}
/**
* Processing type of the payment card
* Valid Values: ["PINLESS_DEBIT"]
*
* @param string $processing_type
*
* @return $this
*/
public function setProcessingType($processing_type)
{
$this->processing_type = $processing_type;
return $this;
}
/**
* Processing type of the payment card
*
* @return string
*/
public function getProcessingType()
{
return $this->processing_type;
}
} }

View File

@@ -7,28 +7,21 @@ use PayPal\Common\PayPalModel;
/** /**
* Class FundingInstrument * Class FundingInstrument
* *
* A resource representing a Payer's funding instrument. * A resource representing a Payer's funding instrument. An instance of this schema is valid if and only if it is valid against exactly one of these supported properties
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property \PayPal\Api\CreditCard credit_card * @property \PayPal\Api\CreditCard credit_card
* @property \PayPal\Api\ExtendedBankAccount bank_account
* @property \PayPal\Api\CreditCardToken credit_card_token * @property \PayPal\Api\CreditCardToken credit_card_token
* @property \PayPal\Api\Incentive incentive * @property \PayPal\Api\Billing billing
* @property \PayPal\Api\PaymentCard payment_card
* @property \PayPal\Api\PaymentCardToken payment_card_token
* @property \PayPal\Api\BankToken bank_account_token
* @property \PayPal\Api\Credit credit
* @property \PayPal\Api\CarrierAccountToken carrier_account_token
*
*/ */
class FundingInstrument extends PayPalModel class FundingInstrument extends PayPalModel
{ {
/** /**
* Credit Card information. * Credit Card instrument.
* *
* @param \PayPal\Api\CreditCard $credit_card * @param \PayPal\Api\CreditCard $credit_card
* *
* @return $this * @return $this
*/ */
public function setCreditCard($credit_card) public function setCreditCard($credit_card)
@@ -38,7 +31,7 @@ class FundingInstrument extends PayPalModel
} }
/** /**
* Credit Card information. * Credit Card instrument.
* *
* @return \PayPal\Api\CreditCard * @return \PayPal\Api\CreditCard
*/ */
@@ -48,10 +41,10 @@ class FundingInstrument extends PayPalModel
} }
/** /**
* Credit Card information. * PayPal vaulted credit Card instrument.
* *
* @param \PayPal\Api\CreditCardToken $credit_card_token * @param \PayPal\Api\CreditCardToken $credit_card_token
* *
* @return $this * @return $this
*/ */
public function setCreditCardToken($credit_card_token) public function setCreditCardToken($credit_card_token)
@@ -61,7 +54,7 @@ class FundingInstrument extends PayPalModel
} }
/** /**
* Credit Card information. * PayPal vaulted credit Card instrument.
* *
* @return \PayPal\Api\CreditCardToken * @return \PayPal\Api\CreditCardToken
*/ */
@@ -73,8 +66,9 @@ class FundingInstrument extends PayPalModel
/** /**
* Payment Card information. * Payment Card information.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\PaymentCard $payment_card * @param \PayPal\Api\PaymentCard $payment_card
* *
* @return $this * @return $this
*/ */
public function setPaymentCard($payment_card) public function setPaymentCard($payment_card)
@@ -86,6 +80,7 @@ class FundingInstrument extends PayPalModel
/** /**
* Payment Card information. * Payment Card information.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\PaymentCard * @return \PayPal\Api\PaymentCard
*/ */
public function getPaymentCard() public function getPaymentCard()
@@ -93,34 +88,12 @@ class FundingInstrument extends PayPalModel
return $this->payment_card; return $this->payment_card;
} }
/**
* Payment card token information.
*
* @param \PayPal\Api\PaymentCardToken $payment_card_token
*
* @return $this
*/
public function setPaymentCardToken($payment_card_token)
{
$this->payment_card_token = $payment_card_token;
return $this;
}
/**
* Payment card token information.
*
* @return \PayPal\Api\PaymentCardToken
*/
public function getPaymentCardToken()
{
return $this->payment_card_token;
}
/** /**
* Bank Account information. * Bank Account information.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\ExtendedBankAccount $bank_account * @param \PayPal\Api\ExtendedBankAccount $bank_account
* *
* @return $this * @return $this
*/ */
public function setBankAccount($bank_account) public function setBankAccount($bank_account)
@@ -132,6 +105,7 @@ class FundingInstrument extends PayPalModel
/** /**
* Bank Account information. * Bank Account information.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\ExtendedBankAccount * @return \PayPal\Api\ExtendedBankAccount
*/ */
public function getBankAccount() public function getBankAccount()
@@ -140,10 +114,11 @@ class FundingInstrument extends PayPalModel
} }
/** /**
* Bank Account information. * Vaulted bank account instrument.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\BankToken $bank_account_token * @param \PayPal\Api\BankToken $bank_account_token
* *
* @return $this * @return $this
*/ */
public function setBankAccountToken($bank_account_token) public function setBankAccountToken($bank_account_token)
@@ -153,8 +128,9 @@ class FundingInstrument extends PayPalModel
} }
/** /**
* Bank Account information. * Vaulted bank account instrument.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\BankToken * @return \PayPal\Api\BankToken
*/ */
public function getBankAccountToken() public function getBankAccountToken()
@@ -163,10 +139,11 @@ class FundingInstrument extends PayPalModel
} }
/** /**
* Credit funding information. * PayPal credit funding instrument.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\Credit $credit * @param \PayPal\Api\Credit $credit
* *
* @return $this * @return $this
*/ */
public function setCredit($credit) public function setCredit($credit)
@@ -176,8 +153,9 @@ class FundingInstrument extends PayPalModel
} }
/** /**
* Credit funding information. * PayPal credit funding instrument.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\Credit * @return \PayPal\Api\Credit
*/ */
public function getCredit() public function getCredit()
@@ -186,8 +164,9 @@ class FundingInstrument extends PayPalModel
} }
/** /**
* Incentive funding information. * Incentive funding instrument.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\Incentive $incentive * @param \PayPal\Api\Incentive $incentive
* *
* @return $this * @return $this
@@ -199,8 +178,9 @@ class FundingInstrument extends PayPalModel
} }
/** /**
* Incentive funding information. * Incentive funding instrument.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\Incentive * @return \PayPal\Api\Incentive
*/ */
public function getIncentive() public function getIncentive()
@@ -209,8 +189,34 @@ class FundingInstrument extends PayPalModel
} }
/** /**
* Carrier account token information. * External funding instrument.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\ExternalFunding $external_funding
*
* @return $this
*/
public function setExternalFunding($external_funding)
{
$this->external_funding = $external_funding;
return $this;
}
/**
* External funding instrument.
*
* @deprecated Not publicly available
* @return \PayPal\Api\ExternalFunding
*/
public function getExternalFunding()
{
return $this->external_funding;
}
/**
* Carrier account token instrument.
*
* @deprecated Not publicly available
* @param \PayPal\Api\CarrierAccountToken $carrier_account_token * @param \PayPal\Api\CarrierAccountToken $carrier_account_token
* *
* @return $this * @return $this
@@ -222,8 +228,9 @@ class FundingInstrument extends PayPalModel
} }
/** /**
* Carrier account token information. * Carrier account token instrument.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\CarrierAccountToken * @return \PayPal\Api\CarrierAccountToken
*/ */
public function getCarrierAccountToken() public function getCarrierAccountToken()
@@ -231,4 +238,102 @@ class FundingInstrument extends PayPalModel
return $this->carrier_account_token; return $this->carrier_account_token;
} }
/**
* Carrier account instrument
*
* @deprecated Not publicly available
* @param \PayPal\Api\CarrierAccount $carrier_account
*
* @return $this
*/
public function setCarrierAccount($carrier_account)
{
$this->carrier_account = $carrier_account;
return $this;
}
/**
* Carrier account instrument
*
* @deprecated Not publicly available
* @return \PayPal\Api\CarrierAccount
*/
public function getCarrierAccount()
{
return $this->carrier_account;
}
/**
* 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
*
* @return $this
*/
public function setPrivateLabelCard($private_label_card)
{
$this->private_label_card = $private_label_card;
return $this;
}
/**
* 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
*/
public function getPrivateLabelCard()
{
return $this->private_label_card;
}
/**
* Billing instrument that references pre-approval information for the payment
*
* @param \PayPal\Api\Billing $billing
*
* @return $this
*/
public function setBilling($billing)
{
$this->billing = $billing;
return $this;
}
/**
* Billing instrument that references pre-approval information for the payment
*
* @return \PayPal\Api\Billing
*/
public function getBilling()
{
return $this->billing;
}
/**
* Alternate Payment information - Mostly regional payment providers. For e.g iDEAL in Netherlands
*
* @deprecated Not publicly available
* @param \PayPal\Api\AlternatePayment $alternate_payment
*
* @return $this
*/
public function setAlternatePayment($alternate_payment)
{
$this->alternate_payment = $alternate_payment;
return $this;
}
/**
* Alternate Payment information - Mostly regional payment providers. For e.g iDEAL in Netherlands
*
* @deprecated Not publicly available
* @return \PayPal\Api\AlternatePayment
*/
public function getAlternatePayment()
{
return $this->alternate_payment;
}
} }

View File

@@ -11,15 +11,16 @@ use PayPal\Common\PayPalModel;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string funding_mode * @property string funding_mode
* @property string funding_instrument_type * @property string funding_instrument_type
* @property string soft_descriptor * @property string soft_descriptor
* @property \PayPal\Api\Currency amount * @property \PayPal\Api\Currency amount
* @property string legal_text * @property \PayPal\Api\Currency negative_balance_amount
* @property \PayPal\Api\FundingDetail funding_detail * @property string legal_text
* @property string additional_text * @property \PayPal\Api\FundingDetail funding_detail
* @property string additional_text
* @property \PayPal\Api\FundingInstrument extends * @property \PayPal\Api\FundingInstrument extends
* @property \PayPal\Api\Links[] links * @property \PayPal\Api\Links[] links
*/ */
class FundingSource extends PayPalModel class FundingSource extends PayPalModel
{ {
@@ -28,7 +29,7 @@ class FundingSource extends PayPalModel
* Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"] * Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
* *
* @param string $funding_mode * @param string $funding_mode
* *
* @return $this * @return $this
*/ */
public function setFundingMode($funding_mode) public function setFundingMode($funding_mode)
@@ -52,7 +53,7 @@ class FundingSource extends PayPalModel
* Valid Values: ["BALANCE", "PAYMENT_CARD", "BANK_ACCOUNT", "CREDIT", "INCENTIVE"] * Valid Values: ["BALANCE", "PAYMENT_CARD", "BANK_ACCOUNT", "CREDIT", "INCENTIVE"]
* *
* @param string $funding_instrument_type * @param string $funding_instrument_type
* *
* @return $this * @return $this
*/ */
public function setFundingInstrumentType($funding_instrument_type) public function setFundingInstrumentType($funding_instrument_type)
@@ -75,7 +76,7 @@ class FundingSource extends PayPalModel
* Soft descriptor used when charging this funding source. * Soft descriptor used when charging this funding source.
* *
* @param string $soft_descriptor * @param string $soft_descriptor
* *
* @return $this * @return $this
*/ */
public function setSoftDescriptor($soft_descriptor) public function setSoftDescriptor($soft_descriptor)
@@ -98,7 +99,7 @@ class FundingSource extends PayPalModel
* Total anticipated amount of money to be pulled from instrument. * Total anticipated amount of money to be pulled from instrument.
* *
* @param \PayPal\Api\Currency $amount * @param \PayPal\Api\Currency $amount
* *
* @return $this * @return $this
*/ */
public function setAmount($amount) public function setAmount($amount)
@@ -117,11 +118,34 @@ class FundingSource extends PayPalModel
return $this->amount; return $this->amount;
} }
/**
* Additional amount to be pulled from the instrument to recover a negative balance on the buyer
*
* @param \PayPal\Api\Currency $amount
*
* @return $this
*/
public function setNegativeBalanceAmount($amount)
{
$this->amount = $amount;
return $this;
}
/**
* Additional amount to be pulled from the instrument to recover a negative balance on the buyer
*
* @return \PayPal\Api\Currency
*/
public function getNegativeBalanceAmount()
{
return $this->amount;
}
/** /**
* Localized legal text relevant to funding source. * Localized legal text relevant to funding source.
* *
* @param string $legal_text * @param string $legal_text
* *
* @return $this * @return $this
*/ */
public function setLegalText($legal_text) public function setLegalText($legal_text)
@@ -144,7 +168,7 @@ class FundingSource extends PayPalModel
* Additional detail of the funding. * Additional detail of the funding.
* *
* @param \PayPal\Api\FundingDetail $funding_detail * @param \PayPal\Api\FundingDetail $funding_detail
* *
* @return $this * @return $this
*/ */
public function setFundingDetail($funding_detail) public function setFundingDetail($funding_detail)
@@ -167,7 +191,7 @@ class FundingSource extends PayPalModel
* Additional text relevant to funding source. * Additional text relevant to funding source.
* *
* @param string $additional_text * @param string $additional_text
* *
* @return $this * @return $this
*/ */
public function setAdditionalText($additional_text) public function setAdditionalText($additional_text)
@@ -190,7 +214,7 @@ class FundingSource extends PayPalModel
* Sets Extends * Sets Extends
* *
* @param \PayPal\Api\FundingInstrument $extends * @param \PayPal\Api\FundingInstrument $extends
* *
* @return $this * @return $this
*/ */
public function setExtends($extends) public function setExtends($extends)
@@ -213,7 +237,7 @@ class FundingSource extends PayPalModel
* Sets Links * Sets Links
* *
* @param \PayPal\Api\Links[] $links * @param \PayPal\Api\Links[] $links
* *
* @return $this * @return $this
*/ */
public function setLinks($links) public function setLinks($links)

View File

@@ -12,15 +12,15 @@ use PayPal\Validation\UrlValidator;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string id * @property string id
* @property string code * @property string code
* @property string name * @property string name
* @property string description * @property string description
* @property \PayPal\Api\Currency minimum_purchase_amount * @property \PayPal\Api\Currency minimum_purchase_amount
* @property string logo_image_url * @property string logo_image_url
* @property string expiry_date * @property string expiry_date
* @property string type * @property string type
* @property string terms * @property string terms
*/ */
class Incentive extends PayPalModel class Incentive extends PayPalModel
{ {
@@ -28,7 +28,7 @@ class Incentive extends PayPalModel
* Identifier of the instrument in PayPal Wallet * Identifier of the instrument in PayPal Wallet
* *
* @param string $id * @param string $id
* *
* @return $this * @return $this
*/ */
public function setId($id) public function setId($id)
@@ -51,7 +51,7 @@ class Incentive extends PayPalModel
* Code that identifies the incentive. * Code that identifies the incentive.
* *
* @param string $code * @param string $code
* *
* @return $this * @return $this
*/ */
public function setCode($code) public function setCode($code)
@@ -74,7 +74,7 @@ class Incentive extends PayPalModel
* Name of the incentive. * Name of the incentive.
* *
* @param string $name * @param string $name
* *
* @return $this * @return $this
*/ */
public function setName($name) public function setName($name)
@@ -97,7 +97,7 @@ class Incentive extends PayPalModel
* Description of the incentive. * Description of the incentive.
* *
* @param string $description * @param string $description
* *
* @return $this * @return $this
*/ */
public function setDescription($description) public function setDescription($description)
@@ -120,7 +120,7 @@ class Incentive extends PayPalModel
* Indicates incentive is applicable for this minimum purchase amount. * Indicates incentive is applicable for this minimum purchase amount.
* *
* @param \PayPal\Api\Currency $minimum_purchase_amount * @param \PayPal\Api\Currency $minimum_purchase_amount
* *
* @return $this * @return $this
*/ */
public function setMinimumPurchaseAmount($minimum_purchase_amount) public function setMinimumPurchaseAmount($minimum_purchase_amount)
@@ -167,7 +167,7 @@ class Incentive extends PayPalModel
* expiry date of the incentive. * expiry date of the incentive.
* *
* @param string $expiry_date * @param string $expiry_date
* *
* @return $this * @return $this
*/ */
public function setExpiryDate($expiry_date) public function setExpiryDate($expiry_date)
@@ -188,10 +188,10 @@ class Incentive extends PayPalModel
/** /**
* Specifies type of incentive * Specifies type of incentive
* Valid Values: ["COUPON", "GIFT_CARD", "MERCHANT_SPECIFIC_BALANCE"] * Valid Values: ["COUPON", "GIFT_CARD", "MERCHANT_SPECIFIC_BALANCE", "VOUCHER"]
* *
* @param string $type * @param string $type
* *
* @return $this * @return $this
*/ */
public function setType($type) public function setType($type)
@@ -214,7 +214,7 @@ class Incentive extends PayPalModel
* URI to the associated terms * URI to the associated terms
* *
* @param string $terms * @param string $terms
* *
* @return $this * @return $this
*/ */
public function setTerms($terms) public function setTerms($terms)

View File

@@ -3,8 +3,6 @@
namespace PayPal\Api; namespace PayPal\Api;
use PayPal\Common\PayPalModel; use PayPal\Common\PayPalModel;
use PayPal\Converter\FormatConverter;
use PayPal\Validation\NumericValidator;
/** /**
* Class InstallmentOption * Class InstallmentOption
@@ -13,9 +11,9 @@ use PayPal\Validation\NumericValidator;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property int term * @property int term
* @property \PayPal\Api\Currency monthly_payment * @property \PayPal\Api\Currency monthly_payment
* @property \PayPal\Api\Currency discount_amount * @property \PayPal\Api\Currency discount_amount
* @property string discount_percentage * @property string discount_percentage
*/ */
class InstallmentOption extends PayPalModel class InstallmentOption extends PayPalModel
@@ -24,7 +22,7 @@ class InstallmentOption extends PayPalModel
* Number of installments * Number of installments
* *
* @param int $term * @param int $term
* *
* @return $this * @return $this
*/ */
public function setTerm($term) public function setTerm($term)
@@ -47,7 +45,7 @@ class InstallmentOption extends PayPalModel
* Monthly payment * Monthly payment
* *
* @param \PayPal\Api\Currency $monthly_payment * @param \PayPal\Api\Currency $monthly_payment
* *
* @return $this * @return $this
*/ */
public function setMonthlyPayment($monthly_payment) public function setMonthlyPayment($monthly_payment)
@@ -70,7 +68,7 @@ class InstallmentOption extends PayPalModel
* Discount amount applied to the payment, if any * Discount amount applied to the payment, if any
* *
* @param \PayPal\Api\Currency $discount_amount * @param \PayPal\Api\Currency $discount_amount
* *
* @return $this * @return $this
*/ */
public function setDiscountAmount($discount_amount) public function setDiscountAmount($discount_amount)
@@ -93,13 +91,11 @@ class InstallmentOption extends PayPalModel
* Discount percentage applied to the payment, if any * Discount percentage applied to the payment, if any
* *
* @param string $discount_percentage * @param string $discount_percentage
* *
* @return $this * @return $this
*/ */
public function setDiscountPercentage($discount_percentage) public function setDiscountPercentage($discount_percentage)
{ {
NumericValidator::validate($discount_percentage, "Discount Percentage");
$discount_percentage = FormatConverter::formatToPrice($discount_percentage);
$this->discount_percentage = $discount_percentage; $this->discount_percentage = $discount_percentage;
return $this; return $this;
} }
@@ -114,5 +110,4 @@ class InstallmentOption extends PayPalModel
return $this->discount_percentage; return $this->discount_percentage;
} }
} }

View File

@@ -10,56 +10,50 @@ use PayPal\Validation\UrlValidator;
/** /**
* Class Item * Class Item
* *
* An item being paid for. * Item details.
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string quantity * @property string sku
* @property string name * @property string name
* @property string description * @property string description
* @property string quantity
* @property string price * @property string price
* @property string tax
* @property string currency * @property string currency
* @property string sku * @property string tax
* @property string url * @property string url
* @property string category * @property string category
* @property \PayPal\Api\Measurement weight
* @property \PayPal\Api\Measurement length
* @property \PayPal\Api\Measurement height
* @property \PayPal\Api\Measurement width
* @property \PayPal\Api\NameValuePair[] supplementary_data
* @property \PayPal\Api\NameValuePair[] postback_data
*/ */
class Item extends PayPalModel class Item extends PayPalModel
{ {
/** /**
* Number of items. * Stock keeping unit corresponding (SKU) to item.
*
* @param string $sku
* *
* @param string $quantity
*
* @return $this * @return $this
*/ */
public function setQuantity($quantity) public function setSku($sku)
{ {
$this->quantity = $quantity; $this->sku = $sku;
return $this; return $this;
} }
/** /**
* Number of items. * Stock keeping unit corresponding (SKU) to item.
* *
* @return string * @return string
*/ */
public function getQuantity() public function getSku()
{ {
return $this->quantity; return $this->sku;
} }
/** /**
* Name of the item. * Item name. 127 characters max.
* *
* @param string $name * @param string $name
* *
* @return $this * @return $this
*/ */
public function setName($name) public function setName($name)
@@ -69,7 +63,7 @@ class Item extends PayPalModel
} }
/** /**
* Name of the item. * Item name. 127 characters max.
* *
* @return string * @return string
*/ */
@@ -79,10 +73,10 @@ class Item extends PayPalModel
} }
/** /**
* Description of the item. * Description of the item. Only supported when the `payment_method` is set to `paypal`.
* *
* @param string $description * @param string $description
* *
* @return $this * @return $this
*/ */
public function setDescription($description) public function setDescription($description)
@@ -92,7 +86,7 @@ class Item extends PayPalModel
} }
/** /**
* Description of the item. * Description of the item. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -102,10 +96,33 @@ class Item extends PayPalModel
} }
/** /**
* Cost of the item. * Number of a particular item. 10 characters max.
*
* @param string $quantity
*
* @return $this
*/
public function setQuantity($quantity)
{
$this->quantity = $quantity;
return $this;
}
/**
* Number of a particular item. 10 characters max.
*
* @return string
*/
public function getQuantity()
{
return $this->quantity;
}
/**
* Item cost. 10 characters max.
* *
* @param string|double $price * @param string|double $price
* *
* @return $this * @return $this
*/ */
public function setPrice($price) public function setPrice($price)
@@ -117,7 +134,7 @@ class Item extends PayPalModel
} }
/** /**
* Cost of the item. * Item cost. 10 characters max.
* *
* @return string * @return string
*/ */
@@ -127,10 +144,33 @@ class Item extends PayPalModel
} }
/** /**
* tax of the item. * 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)
{
$this->currency = $currency;
return $this;
}
/**
* 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/).
*
* @return string
*/
public function getCurrency()
{
return $this->currency;
}
/**
* Tax of the item. Only supported when the `payment_method` is set to `paypal`.
* *
* @param string|double $tax * @param string|double $tax
* *
* @return $this * @return $this
*/ */
public function setTax($tax) public function setTax($tax)
@@ -142,7 +182,7 @@ class Item extends PayPalModel
} }
/** /**
* tax of the item. * Tax of the item. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -151,52 +191,6 @@ class Item extends PayPalModel
return $this->tax; return $this->tax;
} }
/**
* 3-letter Currency Code
*
* @param string $currency
*
* @return $this
*/
public function setCurrency($currency)
{
$this->currency = $currency;
return $this;
}
/**
* 3-letter Currency Code
*
* @return string
*/
public function getCurrency()
{
return $this->currency;
}
/**
* Number or code to identify the item in your catalog/records.
*
* @param string $sku
*
* @return $this
*/
public function setSku($sku)
{
$this->sku = $sku;
return $this;
}
/**
* Number or code to identify the item in your catalog/records.
*
* @return string
*/
public function getSku()
{
return $this->sku;
}
/** /**
* URL linking to item information. Available to payer in transaction history. * URL linking to item information. Available to payer in transaction history.
* *
@@ -226,7 +220,7 @@ class Item extends PayPalModel
* Valid Values: ["DIGITAL", "PHYSICAL"] * Valid Values: ["DIGITAL", "PHYSICAL"]
* *
* @param string $category * @param string $category
* *
* @return $this * @return $this
*/ */
public function setCategory($category) public function setCategory($category)
@@ -248,8 +242,9 @@ class Item extends PayPalModel
/** /**
* Weight of the item. * Weight of the item.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\Measurement $weight * @param \PayPal\Api\Measurement $weight
* *
* @return $this * @return $this
*/ */
public function setWeight($weight) public function setWeight($weight)
@@ -261,6 +256,7 @@ class Item extends PayPalModel
/** /**
* Weight of the item. * Weight of the item.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\Measurement * @return \PayPal\Api\Measurement
*/ */
public function getWeight() public function getWeight()
@@ -271,8 +267,9 @@ class Item extends PayPalModel
/** /**
* Length of the item. * Length of the item.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\Measurement $length * @param \PayPal\Api\Measurement $length
* *
* @return $this * @return $this
*/ */
public function setLength($length) public function setLength($length)
@@ -284,6 +281,7 @@ class Item extends PayPalModel
/** /**
* Length of the item. * Length of the item.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\Measurement * @return \PayPal\Api\Measurement
*/ */
public function getLength() public function getLength()
@@ -294,8 +292,9 @@ class Item extends PayPalModel
/** /**
* Height of the item. * Height of the item.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\Measurement $height * @param \PayPal\Api\Measurement $height
* *
* @return $this * @return $this
*/ */
public function setHeight($height) public function setHeight($height)
@@ -307,6 +306,7 @@ class Item extends PayPalModel
/** /**
* Height of the item. * Height of the item.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\Measurement * @return \PayPal\Api\Measurement
*/ */
public function getHeight() public function getHeight()
@@ -317,8 +317,9 @@ class Item extends PayPalModel
/** /**
* Width of the item. * Width of the item.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\Measurement $width * @param \PayPal\Api\Measurement $width
* *
* @return $this * @return $this
*/ */
public function setWidth($width) public function setWidth($width)
@@ -330,6 +331,7 @@ class Item extends PayPalModel
/** /**
* Width of the item. * Width of the item.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\Measurement * @return \PayPal\Api\Measurement
*/ */
public function getWidth() public function getWidth()
@@ -340,8 +342,9 @@ class Item extends PayPalModel
/** /**
* Set of optional data used for PayPal risk determination. * Set of optional data used for PayPal risk determination.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\NameValuePair[] $supplementary_data * @param \PayPal\Api\NameValuePair[] $supplementary_data
* *
* @return $this * @return $this
*/ */
public function setSupplementaryData($supplementary_data) public function setSupplementaryData($supplementary_data)
@@ -353,6 +356,7 @@ class Item extends PayPalModel
/** /**
* Set of optional data used for PayPal risk determination. * Set of optional data used for PayPal risk determination.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\NameValuePair[] * @return \PayPal\Api\NameValuePair[]
*/ */
public function getSupplementaryData() public function getSupplementaryData()
@@ -363,6 +367,7 @@ class Item extends PayPalModel
/** /**
* Append SupplementaryData to the list. * Append SupplementaryData to the list.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\NameValuePair $nameValuePair * @param \PayPal\Api\NameValuePair $nameValuePair
* @return $this * @return $this
*/ */
@@ -380,6 +385,7 @@ class Item extends PayPalModel
/** /**
* Remove SupplementaryData from the list. * Remove SupplementaryData from the list.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\NameValuePair $nameValuePair * @param \PayPal\Api\NameValuePair $nameValuePair
* @return $this * @return $this
*/ */
@@ -393,8 +399,9 @@ class Item extends PayPalModel
/** /**
* Set of optional data used for PayPal post-transaction notifications. * Set of optional data used for PayPal post-transaction notifications.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\NameValuePair[] $postback_data * @param \PayPal\Api\NameValuePair[] $postback_data
* *
* @return $this * @return $this
*/ */
public function setPostbackData($postback_data) public function setPostbackData($postback_data)
@@ -406,6 +413,7 @@ class Item extends PayPalModel
/** /**
* Set of optional data used for PayPal post-transaction notifications. * Set of optional data used for PayPal post-transaction notifications.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\NameValuePair[] * @return \PayPal\Api\NameValuePair[]
*/ */
public function getPostbackData() public function getPostbackData()
@@ -416,6 +424,7 @@ class Item extends PayPalModel
/** /**
* Append PostbackData to the list. * Append PostbackData to the list.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\NameValuePair $nameValuePair * @param \PayPal\Api\NameValuePair $nameValuePair
* @return $this * @return $this
*/ */
@@ -433,6 +442,7 @@ class Item extends PayPalModel
/** /**
* Remove PostbackData from the list. * Remove PostbackData from the list.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\NameValuePair $nameValuePair * @param \PayPal\Api\NameValuePair $nameValuePair
* @return $this * @return $this
*/ */

View File

@@ -7,29 +7,22 @@ use PayPal\Common\PayPalModel;
/** /**
* Class ItemList * Class ItemList
* *
* List of items being paid for. * Items and related shipping address within a transaction.
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property \PayPal\Api\Item[] items * @property \PayPal\Api\Item[] items
* @property \PayPal\Api\ShippingAddress shipping_address * @property \PayPal\Api\ShippingAddress shipping_address
* @property string shipping_method * @property string shipping_method
* @property string shipping_phone_number
*/ */
class ItemList extends PayPalModel class ItemList extends PayPalModel
{ {
/**
* Is this list empty?
*/
public function isEmpty()
{
return empty($this->items);
}
/** /**
* List of items. * List of items.
* *
* @param \PayPal\Api\Item[] $items * @param \PayPal\Api\Item[] $items
* *
* @return $this * @return $this
*/ */
public function setItems($items) public function setItems($items)
@@ -79,10 +72,10 @@ class ItemList extends PayPalModel
} }
/** /**
* Shipping address. * Shipping address, if different than the payer address.
* *
* @param \PayPal\Api\ShippingAddress $shipping_address * @param \PayPal\Api\ShippingAddress $shipping_address
* *
* @return $this * @return $this
*/ */
public function setShippingAddress($shipping_address) public function setShippingAddress($shipping_address)
@@ -92,7 +85,7 @@ class ItemList extends PayPalModel
} }
/** /**
* Shipping address. * Shipping address, if different than the payer address.
* *
* @return \PayPal\Api\ShippingAddress * @return \PayPal\Api\ShippingAddress
*/ */
@@ -105,7 +98,7 @@ class ItemList extends PayPalModel
* Shipping method used for this payment like USPSParcel etc. * Shipping method used for this payment like USPSParcel etc.
* *
* @param string $shipping_method * @param string $shipping_method
* *
* @return $this * @return $this
*/ */
public function setShippingMethod($shipping_method) public function setShippingMethod($shipping_method)
@@ -124,4 +117,27 @@ class ItemList extends PayPalModel
return $this->shipping_method; return $this->shipping_method;
} }
/**
* Allows merchant's to share payers 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 Payers 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)
{
$this->shipping_phone_number = $shipping_phone_number;
return $this;
}
/**
* Allows merchant's to share payers 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 Payers action on PayPal. The phone number must be represented in its canonical international format, as defined by the E.164 numbering plan
*
* @return string
*/
public function getShippingPhoneNumber()
{
return $this->shipping_phone_number;
}
} }

View File

@@ -4,7 +4,6 @@ namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel; use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext; use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator; use PayPal\Validation\ArgumentValidator;
/** /**
@@ -14,19 +13,20 @@ use PayPal\Validation\ArgumentValidator;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string id * @property string id
* @property string purchase_unit_reference_id * @property string purchase_unit_reference_id
* @property \PayPal\Api\Amount amount * @property \PayPal\Api\Amount amount
* @property string payment_mode * @property string payment_mode
* @property string state * @property string state
* @property string reason_code * @property string reason_code
* @property string pending_reason * @property string pending_reason
* @property string protection_eligibility * @property string protection_eligibility
* @property string protection_eligibility_type * @property string protection_eligibility_type
* @property string parent_payment * @property string parent_payment
* @property \PayPal\Api\FmfDetails fmf_details * @property \PayPal\Api\FmfDetails fmf_details
* @property string create_time * @property string create_time
* @property string update_time * @property string update_time
* @property \PayPal\Api\Links[] links
*/ */
class Order extends PayPalResourceModel class Order extends PayPalResourceModel
{ {
@@ -34,7 +34,7 @@ class Order extends PayPalResourceModel
* Identifier of the order transaction. * Identifier of the order transaction.
* *
* @param string $id * @param string $id
* *
* @return $this * @return $this
*/ */
public function setId($id) public function setId($id)
@@ -57,7 +57,7 @@ class Order extends PayPalResourceModel
* Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base. * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
* *
* @param string $purchase_unit_reference_id * @param string $purchase_unit_reference_id
* *
* @return $this * @return $this
*/ */
public function setPurchaseUnitReferenceId($purchase_unit_reference_id) public function setPurchaseUnitReferenceId($purchase_unit_reference_id)
@@ -80,7 +80,7 @@ class Order extends PayPalResourceModel
* Amount being collected. * Amount being collected.
* *
* @param \PayPal\Api\Amount $amount * @param \PayPal\Api\Amount $amount
* *
* @return $this * @return $this
*/ */
public function setAmount($amount) public function setAmount($amount)
@@ -104,7 +104,7 @@ class Order extends PayPalResourceModel
* Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"] * Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
* *
* @param string $payment_mode * @param string $payment_mode
* *
* @return $this * @return $this
*/ */
public function setPaymentMode($payment_mode) public function setPaymentMode($payment_mode)
@@ -128,7 +128,7 @@ class Order extends PayPalResourceModel
* Valid Values: ["pending", "completed", "refunded", "partially_refunded", "voided"] * Valid Values: ["pending", "completed", "refunded", "partially_refunded", "voided"]
* *
* @param string $state * @param string $state
* *
* @return $this * @return $this
*/ */
public function setState($state) public function setState($state)
@@ -148,11 +148,11 @@ class Order extends PayPalResourceModel
} }
/** /**
* Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually * Reason code for the transaction state being Pending or Reversed. 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"] * Valid Values: ["PAYER_SHIPPING_UNCONFIRMED", "MULTI_CURRENCY", "RISK_REVIEW", "REGULATORY_REVIEW", "VERIFICATION_REQUIRED", "ORDER", "OTHER"]
* *
* @param string $reason_code * @param string $reason_code
* *
* @return $this * @return $this
*/ */
public function setReasonCode($reason_code) public function setReasonCode($reason_code)
@@ -162,7 +162,7 @@ class Order extends PayPalResourceModel
} }
/** /**
* Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually * Reason code for the transaction state being Pending or Reversed. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -172,11 +172,11 @@ class Order extends PayPalResourceModel
} }
/** /**
* Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead. * [DEPRECATED] Reason the transaction is in pending state. Use reason_code field above instead.
* Valid Values: ["payer_shipping_unconfirmed", "multi_currency", "risk_review", "regulatory_review", "verification_required", "order", "other"] * Valid Values: ["payer_shipping_unconfirmed", "multi_currency", "risk_review", "regulatory_review", "verification_required", "order", "other"]
* *
* @param string $pending_reason * @param string $pending_reason
* *
* @return $this * @return $this
*/ */
public function setPendingReason($pending_reason) public function setPendingReason($pending_reason)
@@ -186,7 +186,7 @@ class Order extends PayPalResourceModel
} }
/** /**
* Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead. * @deprecated [DEPRECATED] Reason the transaction is in pending state. Use reason_code field above instead.
* *
* @return string * @return string
*/ */
@@ -196,58 +196,58 @@ class Order extends PayPalResourceModel
} }
/** /**
* Protection Eligibility of the Payer * The level of seller protection in force for the transaction.
* Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"] * Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
* *
* @param string $protection_eligibility * @param string $protection_eligibility
* *
* @return $this * @return $this
*/ */
public function setProtectionEligibility($protection_eligibility) public function setProtectionEligibility($protection_eligibility)
{ {
$this->{"protection-eligibility"} = $protection_eligibility; $this->protection_eligibility = $protection_eligibility;
return $this; return $this;
} }
/** /**
* Protection Eligibility of the Payer * The level of seller protection in force for the transaction.
* *
* @return string * @return string
*/ */
public function getProtectionEligibility() public function getProtectionEligibility()
{ {
return $this->{"protection-eligibility"}; return $this->protection_eligibility;
} }
/** /**
* Protection Eligibility Type of the Payer * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:<br> `ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.<br> `UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.<br> One or both of the allowed values can be returned.
* Valid Values: ["ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE", "INELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE"] * Valid Values: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"]
* *
* @param string $protection_eligibility_type * @param string $protection_eligibility_type
* *
* @return $this * @return $this
*/ */
public function setProtectionEligibilityType($protection_eligibility_type) public function setProtectionEligibilityType($protection_eligibility_type)
{ {
$this->{"protection-eligibility_type"} = $protection_eligibility_type; $this->protection_eligibility_type = $protection_eligibility_type;
return $this; return $this;
} }
/** /**
* Protection Eligibility Type of the Payer * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:<br> `ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.<br> `UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.<br> One or both of the allowed values can be returned.
* *
* @return string * @return string
*/ */
public function getProtectionEligibilityType() public function getProtectionEligibilityType()
{ {
return $this->{"protection-eligibility_type"}; return $this->protection_eligibility_type;
} }
/** /**
* ID of the Payment resource that this transaction is based on. * ID of the Payment resource that this transaction is based on.
* *
* @param string $parent_payment * @param string $parent_payment
* *
* @return $this * @return $this
*/ */
public function setParentPayment($parent_payment) public function setParentPayment($parent_payment)
@@ -270,7 +270,7 @@ class Order extends PayPalResourceModel
* Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action. * Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action.
* *
* @param \PayPal\Api\FmfDetails $fmf_details * @param \PayPal\Api\FmfDetails $fmf_details
* *
* @return $this * @return $this
*/ */
public function setFmfDetails($fmf_details) public function setFmfDetails($fmf_details)
@@ -293,7 +293,7 @@ class Order extends PayPalResourceModel
* Time the resource was created in UTC ISO8601 format. * Time the resource was created in UTC ISO8601 format.
* *
* @param string $create_time * @param string $create_time
* *
* @return $this * @return $this
*/ */
public function setCreateTime($create_time) public function setCreateTime($create_time)
@@ -316,7 +316,7 @@ class Order extends PayPalResourceModel
* Time the resource was last updated in UTC ISO8601 format. * Time the resource was last updated in UTC ISO8601 format.
* *
* @param string $update_time * @param string $update_time
* *
* @return $this * @return $this
*/ */
public function setUpdateTime($update_time) public function setUpdateTime($update_time)
@@ -338,9 +338,9 @@ class Order extends PayPalResourceModel
/** /**
* Retrieve details about an order by passing the order_id in the request URI. * Retrieve details about an order by passing the order_id in the request URI.
* *
* @param string $orderId * @param string $orderId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Order * @return Order
*/ */
public static function get($orderId, $apiContext = null, $restCall = null) public static function get($orderId, $apiContext = null, $restCall = null)
@@ -361,11 +361,11 @@ class Order extends PayPalResourceModel
} }
/** /**
* Capture a payment on an order by passing the order_id in the request URI. 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. To issue this request, an original payment call must specify an intent of order. * 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.
* *
* @param Capture $capture * @param Capture $capture
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Capture * @return Capture
*/ */
public function capture($capture, $apiContext = null, $restCall = null) public function capture($capture, $apiContext = null, $restCall = null)
@@ -389,8 +389,8 @@ class Order extends PayPalResourceModel
/** /**
* 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. * 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.
* *
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Order * @return Order
*/ */
public function void($apiContext = null, $restCall = null) public function void($apiContext = null, $restCall = null)
@@ -413,8 +413,8 @@ class Order extends PayPalResourceModel
* 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. * 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.
* *
* @param Authorization $authorization Authorization Object with Amount value to be authorized * @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 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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Authorization * @return Authorization
*/ */
public function authorize($authorization, $apiContext = null, $restCall = null) public function authorize($authorization, $apiContext = null, $restCall = null)

View File

@@ -7,13 +7,13 @@ use PayPal\Common\PayPalModel;
/** /**
* Class Patch * Class Patch
* *
* A JSON Patch object used for doing partial updates to resources. * A JSON patch object used for applying partial updates to resources.
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string op * @property string op
* @property string path * @property string path
* @property mixed value * @property mixed value
* @property string from * @property string from
*/ */
class Patch extends PayPalModel class Patch extends PayPalModel
@@ -23,7 +23,7 @@ class Patch extends PayPalModel
* Valid Values: ["add", "remove", "replace", "move", "copy", "test"] * Valid Values: ["add", "remove", "replace", "move", "copy", "test"]
* *
* @param string $op * @param string $op
* *
* @return $this * @return $this
*/ */
public function setOp($op) public function setOp($op)
@@ -43,10 +43,10 @@ class Patch extends PayPalModel
} }
/** /**
* String containing a JSON-Pointer value that references a location within the target document where the operation is performed. * String containing a JSON Pointer value that references a location within the target document where the operation is performed.
* *
* @param string $path * @param string $path
* *
* @return $this * @return $this
*/ */
public function setPath($path) public function setPath($path)
@@ -56,7 +56,7 @@ class Patch extends PayPalModel
} }
/** /**
* String containing a JSON-Pointer value that references a location within the target document where the operation is performed. * String containing a JSON Pointer value that references a location within the target document where the operation is performed.
* *
* @return string * @return string
*/ */
@@ -69,7 +69,7 @@ class Patch extends PayPalModel
* New value to apply based on the operation. * New value to apply based on the operation.
* *
* @param mixed $value * @param mixed $value
* *
* @return $this * @return $this
*/ */
public function setValue($value) public function setValue($value)
@@ -89,10 +89,10 @@ class Patch extends PayPalModel
} }
/** /**
* A string containing a JSON Pointer value that references the location in the target document from which to move the value. Required for use where op=move. * A string containing a JSON Pointer value that references the location in the target document to move the value from.
* *
* @param string $from * @param string $from
* *
* @return $this * @return $this
*/ */
public function setFrom($from) public function setFrom($from)
@@ -102,7 +102,7 @@ class Patch extends PayPalModel
} }
/** /**
* A string containing a JSON Pointer value that references the location in the target document from which to move the value. Required for use where op=move. * A string containing a JSON Pointer value that references the location in the target document to move the value from.
* *
* @return string * @return string
*/ */

View File

@@ -7,22 +7,20 @@ use PayPal\Common\PayPalModel;
/** /**
* Class Payee * Class Payee
* *
* A resource representing a Payee that received the funds and fulfills the order. Only one of the following identifiers need to be supplied. * A resource representing a Payee who receives the funds and fulfills the order.
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string email * @property string email
* @property string merchant_id * @property string merchant_id
* @property \PayPal\Api\Phone phone
*/ */
class Payee extends PayPalModel 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 receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
*
* *
* @param string $email * @param string $email
* *
* @return $this * @return $this
*/ */
public function setEmail($email) public function setEmail($email)
@@ -42,11 +40,10 @@ class Payee extends PayPalModel
} }
/** /**
* Encrypted PayPal Account identifier for the Payee. * Encrypted PayPal account identifier for the Payee.
*
* *
* @param string $merchant_id * @param string $merchant_id
* *
* @return $this * @return $this
*/ */
public function setMerchantId($merchant_id) public function setMerchantId($merchant_id)
@@ -56,7 +53,7 @@ class Payee extends PayPalModel
} }
/** /**
* Encrypted PayPal Account identifier for the Payee. * Encrypted PayPal account identifier for the Payee.
* *
* @return string * @return string
*/ */
@@ -66,11 +63,86 @@ class Payee extends PayPalModel
} }
/** /**
* 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. * First Name of the Payee.
*
* *
* @deprecated Not publicly available
* @param string $first_name
*
* @return $this
*/
public function setFirstName($first_name)
{
$this->first_name = $first_name;
return $this;
}
/**
* First Name of the Payee.
*
* @deprecated Not publicly available
* @return string
*/
public function getFirstName()
{
return $this->first_name;
}
/**
* Last Name of the Payee.
*
* @deprecated Not publicly available
* @param string $last_name
*
* @return $this
*/
public function setLastName($last_name)
{
$this->last_name = $last_name;
return $this;
}
/**
* Last Name of the Payee.
*
* @deprecated Not publicly available
* @return string
*/
public function getLastName()
{
return $this->last_name;
}
/**
* Unencrypted PayPal account Number of the Payee
*
* @deprecated Not publicly available
* @param string $account_number
*
* @return $this
*/
public function setAccountNumber($account_number)
{
$this->account_number = $account_number;
return $this;
}
/**
* Unencrypted PayPal account Number of the Payee
*
* @deprecated Not publicly available
* @return string
*/
public function getAccountNumber()
{
return $this->account_number;
}
/**
* 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.
*
* @deprecated Not publicly available
* @param \PayPal\Api\Phone $phone * @param \PayPal\Api\Phone $phone
* *
* @return $this * @return $this
*/ */
public function setPhone($phone) public function setPhone($phone)
@@ -80,8 +152,9 @@ class Payee extends PayPalModel
} }
/** /**
* 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 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.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\Phone * @return \PayPal\Api\Phone
*/ */
public function getPhone() public function getPhone()

View File

@@ -11,24 +11,20 @@ use PayPal\Common\PayPalModel;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string payment_method * @property string payment_method
* @property string status * @property string status
* @property string account_type
* @property string account_age
* @property \PayPal\Api\FundingInstrument[] funding_instruments * @property \PayPal\Api\FundingInstrument[] funding_instruments
* @property string funding_option_id * @property string funding_option_id
* @property \PayPal\Api\FundingOption funding_option * @property \PayPal\Api\PayerInfo payer_info
* @property \PayPal\Api\FundingOption related_funding_option
* @property \PayPal\Api\PayerInfo payer_info
*/ */
class Payer extends PayPalModel class Payer extends PayPalModel
{ {
/** /**
* Payment method being used - PayPal Wallet payment, Bank Direct Debit or Direct Credit card. * Payment method being used - PayPal Wallet payment, Bank Direct Debit or Direct Credit card.
* Valid Values: ["credit_card", "bank", "paypal", "pay_upon_invoice", "carrier"] * Valid Values: ["credit_card", "bank", "paypal", "pay_upon_invoice", "carrier", "alternate_payment"]
* *
* @param string $payment_method * @param string $payment_method
* *
* @return $this * @return $this
*/ */
public function setPaymentMethod($payment_method) public function setPaymentMethod($payment_method)
@@ -52,7 +48,7 @@ class Payer extends PayPalModel
* Valid Values: ["VERIFIED", "UNVERIFIED"] * Valid Values: ["VERIFIED", "UNVERIFIED"]
* *
* @param string $status * @param string $status
* *
* @return $this * @return $this
*/ */
public function setStatus($status) public function setStatus($status)
@@ -75,8 +71,9 @@ class Payer extends PayPalModel
* Type of account relationship payer has with PayPal. * Type of account relationship payer has with PayPal.
* Valid Values: ["BUSINESS", "PERSONAL", "PREMIER"] * Valid Values: ["BUSINESS", "PERSONAL", "PREMIER"]
* *
* @deprecated Not publicly available
* @param string $account_type * @param string $account_type
* *
* @return $this * @return $this
*/ */
public function setAccountType($account_type) public function setAccountType($account_type)
@@ -88,6 +85,7 @@ class Payer extends PayPalModel
/** /**
* Type of account relationship payer has with PayPal. * Type of account relationship payer has with PayPal.
* *
* @deprecated Not publicly available
* @return string * @return string
*/ */
public function getAccountType() public function getAccountType()
@@ -98,8 +96,9 @@ class Payer extends PayPalModel
/** /**
* Duration since the payer established account relationship with PayPal in days. * Duration since the payer established account relationship with PayPal in days.
* *
* @deprecated Not publicly available
* @param string $account_age * @param string $account_age
* *
* @return $this * @return $this
*/ */
public function setAccountAge($account_age) public function setAccountAge($account_age)
@@ -111,6 +110,7 @@ class Payer extends PayPalModel
/** /**
* Duration since the payer established account relationship with PayPal in days. * Duration since the payer established account relationship with PayPal in days.
* *
* @deprecated Not publicly available
* @return string * @return string
*/ */
public function getAccountAge() public function getAccountAge()
@@ -119,10 +119,10 @@ class Payer extends PayPalModel
} }
/** /**
* List of funding instruments to fund the payment. * 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 * @param \PayPal\Api\FundingInstrument[] $funding_instruments
* *
* @return $this * @return $this
*/ */
public function setFundingInstruments($funding_instruments) public function setFundingInstruments($funding_instruments)
@@ -132,7 +132,7 @@ class Payer extends PayPalModel
} }
/** /**
* List of funding instruments to fund the payment. * 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.
* *
* @return \PayPal\Api\FundingInstrument[] * @return \PayPal\Api\FundingInstrument[]
*/ */
@@ -172,10 +172,10 @@ class Payer extends PayPalModel
} }
/** /**
* Id of user selected funding option for the payment. 'OneOf' funding_instruments or funding_option_id to be present * 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.
* *
* @param string $funding_option_id * @param string $funding_option_id
* *
* @return $this * @return $this
*/ */
public function setFundingOptionId($funding_option_id) public function setFundingOptionId($funding_option_id)
@@ -185,7 +185,7 @@ class Payer extends PayPalModel
} }
/** /**
* Id of user selected funding option for the payment. 'OneOf' funding_instruments or funding_option_id to be present * 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.
* *
* @return string * @return string
*/ */
@@ -195,10 +195,11 @@ class Payer extends PayPalModel
} }
/** /**
* Default funding option available for the payment * Default funding option available for the payment
* *
* @deprecated Not publicly available
* @param \PayPal\Api\FundingOption $funding_option * @param \PayPal\Api\FundingOption $funding_option
* *
* @return $this * @return $this
*/ */
public function setFundingOption($funding_option) public function setFundingOption($funding_option)
@@ -208,8 +209,9 @@ class Payer extends PayPalModel
} }
/** /**
* Default funding option available for the payment * Default funding option available for the payment
* *
* @deprecated Not publicly available
* @return \PayPal\Api\FundingOption * @return \PayPal\Api\FundingOption
*/ */
public function getFundingOption() public function getFundingOption()
@@ -220,8 +222,9 @@ class Payer extends PayPalModel
/** /**
* Funding option related to default funding option. * Funding option related to default funding option.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\FundingOption $related_funding_option * @param \PayPal\Api\FundingOption $related_funding_option
* *
* @return $this * @return $this
*/ */
public function setRelatedFundingOption($related_funding_option) public function setRelatedFundingOption($related_funding_option)
@@ -233,6 +236,7 @@ class Payer extends PayPalModel
/** /**
* Funding option related to default funding option. * Funding option related to default funding option.
* *
* @deprecated Not publicly available
* @return \PayPal\Api\FundingOption * @return \PayPal\Api\FundingOption
*/ */
public function getRelatedFundingOption() public function getRelatedFundingOption()
@@ -241,10 +245,10 @@ class Payer extends PayPalModel
} }
/** /**
* Information related to the Payer. * Information related to the Payer.
* *
* @param \PayPal\Api\PayerInfo $payer_info * @param \PayPal\Api\PayerInfo $payer_info
* *
* @return $this * @return $this
*/ */
public function setPayerInfo($payer_info) public function setPayerInfo($payer_info)
@@ -254,7 +258,7 @@ class Payer extends PayPalModel
} }
/** /**
* Information related to the Payer. * Information related to the Payer.
* *
* @return \PayPal\Api\PayerInfo * @return \PayPal\Api\PayerInfo
*/ */

View File

@@ -11,31 +11,30 @@ use PayPal\Common\PayPalModel;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string email * @property string email
* @property string external_remember_me_id * @property string external_remember_me_id
* @property string buyer_account_number * @property string salutation
* @property string salutation * @property string first_name
* @property string first_name * @property string middle_name
* @property string middle_name * @property string last_name
* @property string last_name * @property string suffix
* @property string suffix * @property string payer_id
* @property string payer_id * @property string phone
* @property string phone * @property string phone_type
* @property string phone_type * @property string birth_date
* @property string birth_date * @property string tax_id
* @property string tax_id * @property string tax_id_type
* @property string tax_id_type * @property string country_code
* @property string country_code * @property \PayPal\Api\Address billing_address
* @property \PayPal\Api\Address billing_address
* @property \PayPal\Api\ShippingAddress shipping_address * @property \PayPal\Api\ShippingAddress shipping_address
*/ */
class PayerInfo extends PayPalModel class PayerInfo extends PayPalModel
{ {
/** /**
* Email address representing the Payer. * Email address representing the payer. 127 characters max.
* *
* @param string $email * @param string $email
* *
* @return $this * @return $this
*/ */
public function setEmail($email) public function setEmail($email)
@@ -45,7 +44,7 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Email address representing the Payer. * Email address representing the payer. 127 characters max.
* *
* @return string * @return string
*/ */
@@ -55,10 +54,10 @@ class PayerInfo extends PayPalModel
} }
/** /**
* External Remember Me id representing the Payer * External Remember Me id representing the payer
* *
* @param string $external_remember_me_id * @param string $external_remember_me_id
* *
* @return $this * @return $this
*/ */
public function setExternalRememberMeId($external_remember_me_id) public function setExternalRememberMeId($external_remember_me_id)
@@ -68,7 +67,7 @@ class PayerInfo extends PayPalModel
} }
/** /**
* External Remember Me id representing the Payer * External Remember Me id representing the payer
* *
* @return string * @return string
*/ */
@@ -80,31 +79,33 @@ class PayerInfo extends PayPalModel
/** /**
* Account Number representing the Payer * Account Number representing the Payer
* *
* @param string $buyer_account_number * @deprecated Not publicly available
* * @param string $account_number
*
* @return $this * @return $this
*/ */
public function setBuyerAccountNumber($buyer_account_number) public function setAccountNumber($account_number)
{ {
$this->buyer_account_number = $buyer_account_number; $this->account_number = $account_number;
return $this; return $this;
} }
/** /**
* Account Number representing the Payer * Account Number representing the Payer
* *
* @deprecated Not publicly available
* @return string * @return string
*/ */
public function getBuyerAccountNumber() public function getAccountNumber()
{ {
return $this->buyer_account_number; return $this->account_number;
} }
/** /**
* Salutation of the Payer. * Salutation of the payer.
* *
* @param string $salutation * @param string $salutation
* *
* @return $this * @return $this
*/ */
public function setSalutation($salutation) public function setSalutation($salutation)
@@ -114,7 +115,7 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Salutation of the Payer. * Salutation of the payer.
* *
* @return string * @return string
*/ */
@@ -124,10 +125,10 @@ class PayerInfo extends PayPalModel
} }
/** /**
* First Name of the Payer. * First name of the payer.
* *
* @param string $first_name * @param string $first_name
* *
* @return $this * @return $this
*/ */
public function setFirstName($first_name) public function setFirstName($first_name)
@@ -137,7 +138,7 @@ class PayerInfo extends PayPalModel
} }
/** /**
* First Name of the Payer. * First name of the payer.
* *
* @return string * @return string
*/ */
@@ -147,10 +148,10 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Middle Name of the Payer. * Middle name of the payer.
* *
* @param string $middle_name * @param string $middle_name
* *
* @return $this * @return $this
*/ */
public function setMiddleName($middle_name) public function setMiddleName($middle_name)
@@ -160,7 +161,7 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Middle Name of the Payer. * Middle name of the payer.
* *
* @return string * @return string
*/ */
@@ -170,10 +171,10 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Last Name of the Payer. * Last name of the payer.
* *
* @param string $last_name * @param string $last_name
* *
* @return $this * @return $this
*/ */
public function setLastName($last_name) public function setLastName($last_name)
@@ -183,7 +184,7 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Last Name of the Payer. * Last name of the payer.
* *
* @return string * @return string
*/ */
@@ -193,10 +194,10 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Suffix of the Payer. * Suffix of the payer.
* *
* @param string $suffix * @param string $suffix
* *
* @return $this * @return $this
*/ */
public function setSuffix($suffix) public function setSuffix($suffix)
@@ -206,7 +207,7 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Suffix of the Payer. * Suffix of the payer.
* *
* @return string * @return string
*/ */
@@ -216,10 +217,10 @@ class PayerInfo extends PayPalModel
} }
/** /**
* PayPal assigned Payer ID. * PayPal assigned encrypted Payer ID.
* *
* @param string $payer_id * @param string $payer_id
* *
* @return $this * @return $this
*/ */
public function setPayerId($payer_id) public function setPayerId($payer_id)
@@ -229,7 +230,7 @@ class PayerInfo extends PayPalModel
} }
/** /**
* PayPal assigned Payer ID. * PayPal assigned encrypted Payer ID.
* *
* @return string * @return string
*/ */
@@ -239,10 +240,10 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Phone number representing the Payer. * Phone number representing the payer. 20 characters max.
* *
* @param string $phone * @param string $phone
* *
* @return $this * @return $this
*/ */
public function setPhone($phone) public function setPhone($phone)
@@ -252,7 +253,7 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Phone number representing the Payer. * Phone number representing the payer. 20 characters max.
* *
* @return string * @return string
*/ */
@@ -266,7 +267,7 @@ class PayerInfo extends PayPalModel
* Valid Values: ["HOME", "WORK", "MOBILE", "OTHER"] * Valid Values: ["HOME", "WORK", "MOBILE", "OTHER"]
* *
* @param string $phone_type * @param string $phone_type
* *
* @return $this * @return $this
*/ */
public function setPhoneType($phone_type) public function setPhoneType($phone_type)
@@ -289,7 +290,7 @@ class PayerInfo extends PayPalModel
* Birth date of the Payer in ISO8601 format (yyyy-mm-dd). * Birth date of the Payer in ISO8601 format (yyyy-mm-dd).
* *
* @param string $birth_date * @param string $birth_date
* *
* @return $this * @return $this
*/ */
public function setBirthDate($birth_date) public function setBirthDate($birth_date)
@@ -309,10 +310,10 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Payer's tax ID. * Payers tax ID. Only supported when the `payment_method` is set to `paypal`.
* *
* @param string $tax_id * @param string $tax_id
* *
* @return $this * @return $this
*/ */
public function setTaxId($tax_id) public function setTaxId($tax_id)
@@ -322,7 +323,7 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Payer's tax ID. * Payers tax ID. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -332,11 +333,11 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Payer's tax ID type. * Payers tax ID type. Allowed values: `BR_CPF` or `BR_CNPJ`. Only supported when the `payment_method` is set to `paypal`.
* Valid Values: ["BR_CPF", "BR_CNPJ"] * Valid Values: ["BR_CPF", "BR_CNPJ"]
* *
* @param string $tax_id_type * @param string $tax_id_type
* *
* @return $this * @return $this
*/ */
public function setTaxIdType($tax_id_type) public function setTaxIdType($tax_id_type)
@@ -346,7 +347,7 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Payer's tax ID type. * Payers tax ID type. Allowed values: `BR_CPF` or `BR_CNPJ`. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -356,10 +357,10 @@ class PayerInfo extends PayPalModel
} }
/** /**
* 2 letter registered country code of the payer to identify the buyer country * Two-letter registered country code of the payer to identify the buyer country.
* *
* @param string $country_code * @param string $country_code
* *
* @return $this * @return $this
*/ */
public function setCountryCode($country_code) public function setCountryCode($country_code)
@@ -369,7 +370,7 @@ class PayerInfo extends PayPalModel
} }
/** /**
* 2 letter registered country code of the payer to identify the buyer country * Two-letter registered country code of the payer to identify the buyer country.
* *
* @return string * @return string
*/ */
@@ -382,7 +383,7 @@ class PayerInfo extends PayPalModel
* Billing address of the Payer. * Billing address of the Payer.
* *
* @param \PayPal\Api\Address $billing_address * @param \PayPal\Api\Address $billing_address
* *
* @return $this * @return $this
*/ */
public function setBillingAddress($billing_address) public function setBillingAddress($billing_address)
@@ -402,10 +403,10 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Obsolete. Use shipping address present in purchase unit. * Shipping address of payer PayPal account.
* *
* @param \PayPal\Api\ShippingAddress $shipping_address * @param \PayPal\Api\ShippingAddress $shipping_address
* *
* @return $this * @return $this
*/ */
public function setShippingAddress($shipping_address) public function setShippingAddress($shipping_address)
@@ -415,7 +416,7 @@ class PayerInfo extends PayPalModel
} }
/** /**
* Obsolete. Use shipping address present in purchase unit. * Shipping address of payer PayPal account.
* *
* @return \PayPal\Api\ShippingAddress * @return \PayPal\Api\ShippingAddress
*/ */

View File

@@ -15,27 +15,30 @@ use PayPal\Validation\ArgumentValidator;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string id * @property string id
* @property string create_time * @property string intent
* @property string update_time * @property \PayPal\Api\Payer payer
* @property string intent * @property \PayPal\Api\PotentialPayerInfo potential_payer_info
* @property \PayPal\Api\Payer payer * @property \PayPal\Api\Payee payee
* @property \PayPal\Api\Payee payee * @property \PayPal\Api\Transaction[] transactions
* @property string cart * @property string[] billing_agreement_tokens
* @property \PayPal\Api\Transaction[] transactions * @property \PayPal\Api\PaymentInstruction payment_instruction
* @property \PayPal\Api\Error[] failed_transactions * @property string state
* @property \PayPal\Api\PaymentInstruction payment_instruction * @property string experience_profile_id
* @property string state * @property string note_to_payer
* @property \PayPal\Api\RedirectUrls redirect_urls * @property \PayPal\Api\RedirectUrls redirect_urls
* @property string experience_profile_id * @property string failure_reason
* @property string create_time
* @property string update_time
* @property \PayPal\Api\Links[] links
*/ */
class Payment extends PayPalResourceModel class Payment extends PayPalResourceModel
{ {
/** /**
* Identifier of the payment resource created. * ID of the created payment, the 'transaction ID'
* *
* @param string $id * @param string $id
* *
* @return $this * @return $this
*/ */
public function setId($id) public function setId($id)
@@ -45,7 +48,7 @@ class Payment extends PayPalResourceModel
} }
/** /**
* Identifier of the payment resource created. * ID of the created payment, the 'transaction ID'
* *
* @return string * @return string
*/ */
@@ -55,11 +58,11 @@ class Payment extends PayPalResourceModel
} }
/** /**
* Intent of the payment - Sale or Authorization or Order. * Payment intent.
* Valid Values: ["sale", "authorize", "order"] * Valid Values: ["sale", "authorize", "order"]
* *
* @param string $intent * @param string $intent
* *
* @return $this * @return $this
*/ */
public function setIntent($intent) public function setIntent($intent)
@@ -69,7 +72,7 @@ class Payment extends PayPalResourceModel
} }
/** /**
* Intent of the payment - Sale or Authorization or Order. * Payment intent.
* *
* @return string * @return string
*/ */
@@ -82,7 +85,7 @@ class Payment extends PayPalResourceModel
* Source of the funds for this payment represented by a PayPal account or a direct credit card. * Source of the funds for this payment represented by a PayPal account or a direct credit card.
* *
* @param \PayPal\Api\Payer $payer * @param \PayPal\Api\Payer $payer
* *
* @return $this * @return $this
*/ */
public function setPayer($payer) public function setPayer($payer)
@@ -102,10 +105,33 @@ class Payment extends PayPalResourceModel
} }
/** /**
* . * 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.
*
* @param \PayPal\Api\PotentialPayerInfo $potential_payer_info
*
* @return $this
*/
public function setPotentialPayerInfo($potential_payer_info)
{
$this->potential_payer_info = $potential_payer_info;
return $this;
}
/**
* 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.
*
* @return \PayPal\Api\PotentialPayerInfo
*/
public function getPotentialPayerInfo()
{
return $this->potential_payer_info;
}
/**
* Receiver of funds for this payment. **Readonly for PayPal external REST payments.**
* *
* @param \PayPal\Api\Payee $payee * @param \PayPal\Api\Payee $payee
* *
* @return $this * @return $this
*/ */
public function setPayee($payee) public function setPayee($payee)
@@ -115,7 +141,7 @@ class Payment extends PayPalResourceModel
} }
/** /**
* . * Receiver of funds for this payment. **Readonly for PayPal external REST payments.**
* *
* @return \PayPal\Api\Payee * @return \PayPal\Api\Payee
*/ */
@@ -127,8 +153,9 @@ class Payment extends PayPalResourceModel
/** /**
* ID of the cart to execute the payment. * ID of the cart to execute the payment.
* *
* @deprecated Not publicly available
* @param string $cart * @param string $cart
* *
* @return $this * @return $this
*/ */
public function setCart($cart) public function setCart($cart)
@@ -140,6 +167,7 @@ class Payment extends PayPalResourceModel
/** /**
* ID of the cart to execute the payment. * ID of the cart to execute the payment.
* *
* @deprecated Not publicly available
* @return string * @return string
*/ */
public function getCart() public function getCart()
@@ -148,10 +176,10 @@ class Payment extends PayPalResourceModel
} }
/** /**
* A payment can have more than one transaction, with each transaction establishing a contract between the payer and a payee * Transactional details including the amount and item details.
* *
* @param \PayPal\Api\Transaction[] $transactions * @param \PayPal\Api\Transaction[] $transactions
* *
* @return $this * @return $this
*/ */
public function setTransactions($transactions) public function setTransactions($transactions)
@@ -161,7 +189,7 @@ class Payment extends PayPalResourceModel
} }
/** /**
* A payment can have more than one transaction, with each transaction establishing a contract between the payer and a payee * Transactional details including the amount and item details.
* *
* @return \PayPal\Api\Transaction[] * @return \PayPal\Api\Transaction[]
*/ */
@@ -203,8 +231,9 @@ class Payment extends PayPalResourceModel
/** /**
* Applicable for advanced payments like multi seller payment (MSP) to support partial failures * Applicable for advanced payments like multi seller payment (MSP) to support partial failures
* *
* @deprecated Not publicly available
* @param \PayPal\Api\Error[] $failed_transactions * @param \PayPal\Api\Error[] $failed_transactions
* *
* @return $this * @return $this
*/ */
public function setFailedTransactions($failed_transactions) public function setFailedTransactions($failed_transactions)
@@ -216,6 +245,7 @@ class Payment extends PayPalResourceModel
/** /**
* Applicable for advanced payments like multi seller payment (MSP) to support partial failures * Applicable for advanced payments like multi seller payment (MSP) to support partial failures
* *
* @deprecated Not publicly available
* @return \PayPal\Api\Error[] * @return \PayPal\Api\Error[]
*/ */
public function getFailedTransactions() public function getFailedTransactions()
@@ -226,6 +256,7 @@ class Payment extends PayPalResourceModel
/** /**
* Append FailedTransactions to the list. * Append FailedTransactions to the list.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\Error $error * @param \PayPal\Api\Error $error
* @return $this * @return $this
*/ */
@@ -243,6 +274,7 @@ class Payment extends PayPalResourceModel
/** /**
* Remove FailedTransactions from the list. * Remove FailedTransactions from the list.
* *
* @deprecated Not publicly available
* @param \PayPal\Api\Error $error * @param \PayPal\Api\Error $error
* @return $this * @return $this
*/ */
@@ -254,10 +286,88 @@ class Payment extends PayPalResourceModel
} }
/** /**
* A payment instruction resource * Collection of PayPal generated billing agreement tokens.
*
* @param string[] $billing_agreement_tokens
*
* @return $this
*/
public function setBillingAgreementTokens($billing_agreement_tokens)
{
$this->billing_agreement_tokens = $billing_agreement_tokens;
return $this;
}
/**
* Collection of PayPal generated billing agreement tokens.
*
* @return string[]
*/
public function getBillingAgreementTokens()
{
return $this->billing_agreement_tokens;
}
/**
* Append BillingAgreementTokens to the list.
*
* @param string $billingAgreementToken
* @return $this
*/
public function addBillingAgreementToken($billingAgreementToken)
{
if (!$this->getBillingAgreementTokens()) {
return $this->setBillingAgreementTokens(array($billingAgreementToken));
} else {
return $this->setBillingAgreementTokens(
array_merge($this->getBillingAgreementTokens(), array($billingAgreementToken))
);
}
}
/**
* Remove BillingAgreementTokens from the list.
*
* @param string $billingAgreementToken
* @return $this
*/
public function removeBillingAgreementToken($billingAgreementToken)
{
return $this->setBillingAgreementTokens(
array_diff($this->getBillingAgreementTokens(), array($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)
{
$this->credit_financing_offered = $credit_financing_offered;
return $this;
}
/**
* Credit financing offered to payer on PayPal side. Returned in payment after payer opts-in
*
* @deprecated Not publicly available
* @return \PayPal\Api\CreditFinancingOffered
*/
public function getCreditFinancingOffered()
{
return $this->credit_financing_offered;
}
/**
* Instructions for the payer to complete this payment.
* *
* @param \PayPal\Api\PaymentInstruction $payment_instruction * @param \PayPal\Api\PaymentInstruction $payment_instruction
* *
* @return $this * @return $this
*/ */
public function setPaymentInstruction($payment_instruction) public function setPaymentInstruction($payment_instruction)
@@ -267,7 +377,7 @@ class Payment extends PayPalResourceModel
} }
/** /**
* A payment instruction resource * Instructions for the payer to complete this payment.
* *
* @return \PayPal\Api\PaymentInstruction * @return \PayPal\Api\PaymentInstruction
*/ */
@@ -277,11 +387,11 @@ class Payment extends PayPalResourceModel
} }
/** /**
* state of the payment * Payment state.
* Valid Values: ["created", "approved", "completed", "partially_completed", "failed", "canceled", "expired", "in_progress"] * Valid Values: ["created", "approved", "failed", "partially_completed", "in_progress"]
* *
* @param string $state * @param string $state
* *
* @return $this * @return $this
*/ */
public function setState($state) public function setState($state)
@@ -291,7 +401,7 @@ class Payment extends PayPalResourceModel
} }
/** /**
* state of the payment * Payment state.
* *
* @return string * @return string
*/ */
@@ -301,10 +411,10 @@ class Payment extends PayPalResourceModel
} }
/** /**
* Identifier for the payment experience. * PayPal generated identifier for the merchant's payment experience profile. Refer to [this](https://developer.paypal.com/webapps/developer/docs/api/#payment-experience) link to create experience profile ID.
* *
* @param string $experience_profile_id * @param string $experience_profile_id
* *
* @return $this * @return $this
*/ */
public function setExperienceProfileId($experience_profile_id) public function setExperienceProfileId($experience_profile_id)
@@ -314,7 +424,7 @@ class Payment extends PayPalResourceModel
} }
/** /**
* Identifier for the payment experience. * PayPal generated identifier for the merchant's payment experience profile. Refer to [this](https://developer.paypal.com/webapps/developer/docs/api/#payment-experience) link to create experience profile ID.
* *
* @return string * @return string
*/ */
@@ -324,10 +434,33 @@ class Payment extends PayPalResourceModel
} }
/** /**
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls. * free-form field for the use of clients to pass in a message to the payer
*
* @param string $note_to_payer
*
* @return $this
*/
public function setNoteToPayer($note_to_payer)
{
$this->note_to_payer = $note_to_payer;
return $this;
}
/**
* free-form field for the use of clients to pass in a message to the payer
*
* @return string
*/
public function getNoteToPayer()
{
return $this->note_to_payer;
}
/**
* Set of redirect URLs you provide only for PayPal-based payments.
* *
* @param \PayPal\Api\RedirectUrls $redirect_urls * @param \PayPal\Api\RedirectUrls $redirect_urls
* *
* @return $this * @return $this
*/ */
public function setRedirectUrls($redirect_urls) public function setRedirectUrls($redirect_urls)
@@ -337,7 +470,7 @@ class Payment extends PayPalResourceModel
} }
/** /**
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls. * Set of redirect URLs you provide only for PayPal-based payments.
* *
* @return \PayPal\Api\RedirectUrls * @return \PayPal\Api\RedirectUrls
*/ */
@@ -347,10 +480,34 @@ class Payment extends PayPalResourceModel
} }
/** /**
* Time the resource was created in UTC ISO8601 format. * Failure reason code returned when the payment failed for some valid reasons.
* Valid Values: ["UNABLE_TO_COMPLETE_TRANSACTION", "INVALID_PAYMENT_METHOD", "PAYER_CANNOT_PAY", "CANNOT_PAY_THIS_PAYEE", "REDIRECT_REQUIRED", "PAYEE_FILTER_RESTRICTIONS"]
*
* @param string $failure_reason
*
* @return $this
*/
public function setFailureReason($failure_reason)
{
$this->failure_reason = $failure_reason;
return $this;
}
/**
* Failure reason code returned when the payment failed for some valid reasons.
*
* @return string
*/
public function getFailureReason()
{
return $this->failure_reason;
}
/**
* Payment creation time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
* *
* @param string $create_time * @param string $create_time
* *
* @return $this * @return $this
*/ */
public function setCreateTime($create_time) public function setCreateTime($create_time)
@@ -360,7 +517,7 @@ class Payment extends PayPalResourceModel
} }
/** /**
* Time the resource was created in UTC ISO8601 format. * Payment creation time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
* *
* @return string * @return string
*/ */
@@ -370,10 +527,10 @@ class Payment extends PayPalResourceModel
} }
/** /**
* Time the resource was last updated in UTC ISO8601 format. * Payment update time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
* *
* @param string $update_time * @param string $update_time
* *
* @return $this * @return $this
*/ */
public function setUpdateTime($update_time) public function setUpdateTime($update_time)
@@ -383,7 +540,7 @@ class Payment extends PayPalResourceModel
} }
/** /**
* Time the resource was last updated in UTC ISO8601 format. * Payment update time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
* *
* @return string * @return string
*/ */
@@ -405,8 +562,8 @@ class Payment extends PayPalResourceModel
/** /**
* Create and process a payment by passing a payment object that includes the intent, payer, and transactions in the body of the request JSON. For PayPal payments, include redirect URLs in the payment object. * Create and process a payment by passing a payment object that includes the intent, payer, and transactions in the body of the request JSON. For PayPal payments, include redirect URLs in the payment object.
* *
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Payment * @return Payment
*/ */
public function create($apiContext = null, $restCall = null) public function create($apiContext = null, $restCall = null)
@@ -427,9 +584,9 @@ class Payment extends PayPalResourceModel
/** /**
* Look up a particular payment resource by passing the payment_id in the request URI. * Look up a particular payment resource by passing the payment_id in the request URI.
* *
* @param string $paymentId * @param string $paymentId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Payment * @return Payment
*/ */
public static function get($paymentId, $apiContext = null, $restCall = null) public static function get($paymentId, $apiContext = null, $restCall = null)
@@ -450,11 +607,11 @@ class Payment extends PayPalResourceModel
} }
/** /**
* Partially update a payment resource by by passing the payment_id in the request URI. In addition, pass a patch_request_object in the body of the request JSON that specifies the operation to perform, path of the target location, and new value to apply. Please note that it is not possible to use patch after execute has been called. * Use this call to partially update the payment resource for the given identifier. Allowed objects are amount, shipping_address, invoice_id and custom. Please note that it is not possible to use patch after execute has been called.
* *
* @param PatchRequest $patchRequest * @param PatchRequest $patchRequest
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return boolean * @return boolean
*/ */
public function update($patchRequest, $apiContext = null, $restCall = null) public function update($patchRequest, $apiContext = null, $restCall = null)
@@ -474,11 +631,11 @@ class Payment extends PayPalResourceModel
} }
/** /**
* Execute (complete) a PayPal payment that has been approved by the payer by passing the payment_id in the request URI. This request only works after a buyer has approved the payment using the provided PayPal approval URL. Optionally update transaction information when executing the payment by passing in one or more transactions. * Execute (complete) a PayPal payment that has been approved by the payer. Optionally update selective payment information when executing the payment.
* *
* @param PaymentExecution $paymentExecution * @param PaymentExecution $paymentExecution
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Payment * @return Payment
*/ */
public function execute($paymentExecution, $apiContext = null, $restCall = null) public function execute($paymentExecution, $apiContext = null, $restCall = null)
@@ -501,9 +658,9 @@ class Payment extends PayPalResourceModel
/** /**
* List payments in any state (created, approved, failed, etc.). Payments returned are the payments made to the merchant issuing the request. * List payments in any state (created, approved, failed, etc.). Payments returned are the payments made to the merchant issuing the request.
* *
* @param array $params * @param array $params
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return PaymentHistory * @return PaymentHistory
*/ */
public static function all($params, $apiContext = null, $restCall = null) public static function all($params, $apiContext = null, $restCall = null)

View File

@@ -11,21 +11,22 @@ use PayPal\Common\PayPalModel;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string id * @property string id
* @property string number * @property string number
* @property string type * @property string type
* @property int expire_month * @property string expire_month
* @property int expire_year * @property string expire_year
* @property string start_month * @property string start_month
* @property string start_year * @property string start_year
* @property string cvv2 * @property string cvv2
* @property string first_name * @property string first_name
* @property string last_name * @property string last_name
* @property string billing_country * @property string billing_country
* @property \PayPal\Api\Address billing_address * @property \PayPal\Api\Address billing_address
* @property string external_customer_id * @property string external_customer_id
* @property string status * @property string status
* @property string valid_until * @property string valid_until
* @property string issue_number
* @property \PayPal\Api\Links[] links * @property \PayPal\Api\Links[] links
*/ */
class PaymentCard extends PayPalModel class PaymentCard extends PayPalModel
@@ -34,7 +35,7 @@ class PaymentCard extends PayPalModel
* ID of the credit card being saved for later use. * ID of the credit card being saved for later use.
* *
* @param string $id * @param string $id
* *
* @return $this * @return $this
*/ */
public function setId($id) public function setId($id)
@@ -57,7 +58,7 @@ class PaymentCard extends PayPalModel
* Card number. * Card number.
* *
* @param string $number * @param string $number
* *
* @return $this * @return $this
*/ */
public function setNumber($number) public function setNumber($number)
@@ -81,7 +82,7 @@ class PaymentCard extends PayPalModel
* Valid Values: ["VISA", "AMEX", "SOLO", "JCB", "STAR", "DELTA", "DISCOVER", "SWITCH", "MAESTRO", "CB_NATIONALE", "CONFINOGA", "COFIDIS", "ELECTRON", "CETELEM", "CHINA_UNION_PAY", "MASTERCARD"] * Valid Values: ["VISA", "AMEX", "SOLO", "JCB", "STAR", "DELTA", "DISCOVER", "SWITCH", "MAESTRO", "CB_NATIONALE", "CONFINOGA", "COFIDIS", "ELECTRON", "CETELEM", "CHINA_UNION_PAY", "MASTERCARD"]
* *
* @param string $type * @param string $type
* *
* @return $this * @return $this
*/ */
public function setType($type) public function setType($type)
@@ -103,8 +104,8 @@ class PaymentCard extends PayPalModel
/** /**
* 2 digit card expiry month. * 2 digit card expiry month.
* *
* @param int $expire_month * @param string $expire_month
* *
* @return $this * @return $this
*/ */
public function setExpireMonth($expire_month) public function setExpireMonth($expire_month)
@@ -116,7 +117,7 @@ class PaymentCard extends PayPalModel
/** /**
* 2 digit card expiry month. * 2 digit card expiry month.
* *
* @return int * @return string
*/ */
public function getExpireMonth() public function getExpireMonth()
{ {
@@ -126,8 +127,8 @@ class PaymentCard extends PayPalModel
/** /**
* 4 digit card expiry year * 4 digit card expiry year
* *
* @param int $expire_year * @param string $expire_year
* *
* @return $this * @return $this
*/ */
public function setExpireYear($expire_year) public function setExpireYear($expire_year)
@@ -139,7 +140,7 @@ class PaymentCard extends PayPalModel
/** /**
* 4 digit card expiry year * 4 digit card expiry year
* *
* @return int * @return string
*/ */
public function getExpireYear() public function getExpireYear()
{ {
@@ -147,10 +148,10 @@ class PaymentCard extends PayPalModel
} }
/** /**
* 2 digit card start month. * 2 digit card start month. Needed for UK Maestro Card.
* *
* @param string $start_month * @param string $start_month
* *
* @return $this * @return $this
*/ */
public function setStartMonth($start_month) public function setStartMonth($start_month)
@@ -160,7 +161,7 @@ class PaymentCard extends PayPalModel
} }
/** /**
* 2 digit card start month. * 2 digit card start month. Needed for UK Maestro Card.
* *
* @return string * @return string
*/ */
@@ -170,10 +171,10 @@ class PaymentCard extends PayPalModel
} }
/** /**
* 4 digit card start year. * 4 digit card start year. Needed for UK Maestro Card.
* *
* @param string $start_year * @param string $start_year
* *
* @return $this * @return $this
*/ */
public function setStartYear($start_year) public function setStartYear($start_year)
@@ -183,7 +184,7 @@ class PaymentCard extends PayPalModel
} }
/** /**
* 4 digit card start year. * 4 digit card start year. Needed for UK Maestro Card.
* *
* @return string * @return string
*/ */
@@ -196,7 +197,7 @@ class PaymentCard extends PayPalModel
* Card validation code. Only supported when making a Payment but not when saving a payment card for future use. * Card validation code. Only supported when making a Payment but not when saving a payment card for future use.
* *
* @param string $cvv2 * @param string $cvv2
* *
* @return $this * @return $this
*/ */
public function setCvv2($cvv2) public function setCvv2($cvv2)
@@ -219,7 +220,7 @@ class PaymentCard extends PayPalModel
* Card holder's first name. * Card holder's first name.
* *
* @param string $first_name * @param string $first_name
* *
* @return $this * @return $this
*/ */
public function setFirstName($first_name) public function setFirstName($first_name)
@@ -242,7 +243,7 @@ class PaymentCard extends PayPalModel
* Card holder's last name. * Card holder's last name.
* *
* @param string $last_name * @param string $last_name
* *
* @return $this * @return $this
*/ */
public function setLastName($last_name) public function setLastName($last_name)
@@ -265,7 +266,7 @@ class PaymentCard extends PayPalModel
* 2 letter country code * 2 letter country code
* *
* @param string $billing_country * @param string $billing_country
* *
* @return $this * @return $this
*/ */
public function setBillingCountry($billing_country) public function setBillingCountry($billing_country)
@@ -288,7 +289,7 @@ class PaymentCard extends PayPalModel
* Billing Address associated with this card. * Billing Address associated with this card.
* *
* @param \PayPal\Api\Address $billing_address * @param \PayPal\Api\Address $billing_address
* *
* @return $this * @return $this
*/ */
public function setBillingAddress($billing_address) public function setBillingAddress($billing_address)
@@ -311,7 +312,7 @@ class PaymentCard extends PayPalModel
* A unique identifier of the customer to whom this card account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault. * A unique identifier of the customer to whom this card 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 * @param string $external_customer_id
* *
* @return $this * @return $this
*/ */
public function setExternalCustomerId($external_customer_id) public function setExternalCustomerId($external_customer_id)
@@ -335,7 +336,7 @@ class PaymentCard extends PayPalModel
* Valid Values: ["EXPIRED", "ACTIVE"] * Valid Values: ["EXPIRED", "ACTIVE"]
* *
* @param string $status * @param string $status
* *
* @return $this * @return $this
*/ */
public function setStatus($status) public function setStatus($status)
@@ -358,7 +359,7 @@ class PaymentCard extends PayPalModel
* Date/Time until this resource can be used fund a payment. * Date/Time until this resource can be used fund a payment.
* *
* @param string $valid_until * @param string $valid_until
* *
* @return $this * @return $this
*/ */
public function setValidUntil($valid_until) public function setValidUntil($valid_until)
@@ -377,11 +378,34 @@ class PaymentCard extends PayPalModel
return $this->valid_until; return $this->valid_until;
} }
/**
* 1-2 digit card issue number. Needed for UK Maestro Card.
*
* @param string $issue_number
*
* @return $this
*/
public function setIssueNumber($issue_number)
{
$this->issue_number = $issue_number;
return $this;
}
/**
* 1-2 digit card issue number. Needed for UK Maestro Card.
*
* @return string
*/
public function getIssueNumber()
{
return $this->issue_number;
}
/** /**
* Sets Links * Sets Links
* *
* @param \PayPal\Api\Links[] $links * @param \PayPal\Api\Links[] $links
* *
* @return $this * @return $this
*/ */
public function setLinks($links) public function setLinks($links)

View File

@@ -11,16 +11,17 @@ use PayPal\Common\PayPalModel;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string payer_id * @property string payer_id
* @property string carrier_account_id
* @property \PayPal\Api\Transaction[] transactions * @property \PayPal\Api\Transaction[] transactions
*/ */
class PaymentExecution extends PayPalModel class PaymentExecution extends PayPalModel
{ {
/** /**
* PayPal assigned Payer ID returned in the approval return url. * The ID of the Payer, passed in the `return_url` by PayPal.
* *
* @param string $payer_id * @param string $payer_id
* *
* @return $this * @return $this
*/ */
public function setPayerId($payer_id) public function setPayerId($payer_id)
@@ -30,7 +31,7 @@ class PaymentExecution extends PayPalModel
} }
/** /**
* PayPal assigned Payer ID returned in the approval return url. * The ID of the Payer, passed in the `return_url` by PayPal.
* *
* @return string * @return string
*/ */
@@ -40,10 +41,33 @@ class PaymentExecution extends PayPalModel
} }
/** /**
* Transaction information to be used at the time of execute payment. Only amount and shipping_address can be updated in execute payment * Carrier account id for a carrier billing payment. For a carrier billing payment, payer_id is not applicable.
*
* @param string $carrier_account_id
*
* @return $this
*/
public function setCarrierAccountId($carrier_account_id)
{
$this->carrier_account_id = $carrier_account_id;
return $this;
}
/**
* Carrier account id for a carrier billing payment. For a carrier billing payment, payer_id is not applicable.
*
* @return string
*/
public function getCarrierAccountId()
{
return $this->carrier_account_id;
}
/**
* Transactional details including the amount and item details.
* *
* @param \PayPal\Api\Transaction[] $transactions * @param \PayPal\Api\Transaction[] $transactions
* *
* @return $this * @return $this
*/ */
public function setTransactions($transactions) public function setTransactions($transactions)
@@ -53,7 +77,7 @@ class PaymentExecution extends PayPalModel
} }
/** /**
* Transaction information to be used at the time of execute payment. Only amount and shipping_address can be updated in execute payment * Transactional details including the amount and item details.
* *
* @return \PayPal\Api\Transaction[] * @return \PayPal\Api\Transaction[]
*/ */

View File

@@ -4,23 +4,22 @@ namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel; use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext; use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator; use PayPal\Validation\ArgumentValidator;
/** /**
* Class PaymentInstruction * Class PaymentInstruction
* *
* Object used to represent payment instruction. * Contain details of how and when the payment should be made to PayPal in cases of manual bank transfer.
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string reference_number * @property string reference_number
* @property string instruction_type * @property string instruction_type
* @property \PayPal\Api\RecipientBankingInstruction recipient_banking_instruction * @property \PayPal\Api\RecipientBankingInstruction recipient_banking_instruction
* @property \PayPal\Api\Currency amount * @property \PayPal\Api\Currency amount
* @property string payment_due_date * @property string payment_due_date
* @property string note * @property string note
* @property \PayPal\Api\Links[] links * @property \PayPal\Api\Links[] links
*/ */
class PaymentInstruction extends PayPalResourceModel class PaymentInstruction extends PayPalResourceModel
{ {
@@ -28,7 +27,7 @@ class PaymentInstruction extends PayPalResourceModel
* ID of payment instruction * ID of payment instruction
* *
* @param string $reference_number * @param string $reference_number
* *
* @return $this * @return $this
*/ */
public function setReferenceNumber($reference_number) public function setReferenceNumber($reference_number)
@@ -46,12 +45,13 @@ class PaymentInstruction extends PayPalResourceModel
{ {
return $this->reference_number; return $this->reference_number;
} }
/** /**
* Type of payment instruction * Type of payment instruction
* Valid Values: ["MANUAL_BANK_TRANSFER", "PAY_UPON_INVOICE"] * Valid Values: ["MANUAL_BANK_TRANSFER", "PAY_UPON_INVOICE"]
* *
* @param string $instruction_type * @param string $instruction_type
* *
* @return $this * @return $this
*/ */
public function setInstructionType($instruction_type) public function setInstructionType($instruction_type)
@@ -74,7 +74,7 @@ class PaymentInstruction extends PayPalResourceModel
* Recipient bank Details. * Recipient bank Details.
* *
* @param \PayPal\Api\RecipientBankingInstruction $recipient_banking_instruction * @param \PayPal\Api\RecipientBankingInstruction $recipient_banking_instruction
* *
* @return $this * @return $this
*/ */
public function setRecipientBankingInstruction($recipient_banking_instruction) public function setRecipientBankingInstruction($recipient_banking_instruction)
@@ -97,7 +97,7 @@ class PaymentInstruction extends PayPalResourceModel
* Amount to be transferred * Amount to be transferred
* *
* @param \PayPal\Api\Currency $amount * @param \PayPal\Api\Currency $amount
* *
* @return $this * @return $this
*/ */
public function setAmount($amount) public function setAmount($amount)
@@ -120,7 +120,7 @@ class PaymentInstruction extends PayPalResourceModel
* Date by which payment should be received * Date by which payment should be received
* *
* @param string $payment_due_date * @param string $payment_due_date
* *
* @return $this * @return $this
*/ */
public function setPaymentDueDate($payment_due_date) public function setPaymentDueDate($payment_due_date)
@@ -143,7 +143,7 @@ class PaymentInstruction extends PayPalResourceModel
* Additional text regarding payment handling * Additional text regarding payment handling
* *
* @param string $note * @param string $note
* *
* @return $this * @return $this
*/ */
public function setNote($note) public function setNote($note)
@@ -165,9 +165,9 @@ class PaymentInstruction extends PayPalResourceModel
/** /**
* Retrieve a payment instruction by passing the payment_id in the request URI. Use this request if you are implementing a solution that includes delayed payment like Pay Upon Invoice (PUI). * Retrieve a payment instruction by passing the payment_id in the request URI. Use this request if you are implementing a solution that includes delayed payment like Pay Upon Invoice (PUI).
* *
* @param string $paymentId * @param string $paymentId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return PaymentInstruction * @return PaymentInstruction
*/ */
public static function get($paymentId, $apiContext = null, $restCall = null) public static function get($paymentId, $apiContext = null, $restCall = null)

View File

@@ -16,11 +16,11 @@ use PayPal\Common\PayPalModel;
class PaymentOptions extends PayPalModel class PaymentOptions extends PayPalModel
{ {
/** /**
* Payment method requested for this purchase unit * Optional payment method type. If specified, the transaction will go through for only instant payment. Only for use with the paypal payment_method, not relevant for the credit_card payment_method.
* Valid Values: ["UNRESTRICTED", "INSTANT_FUNDING_SOURCE", "IMMEDIATE_PAY"] * Valid Values: ["UNRESTRICTED", "INSTANT_FUNDING_SOURCE", "IMMEDIATE_PAY"]
* *
* @param string $allowed_payment_method * @param string $allowed_payment_method
* *
* @return $this * @return $this
*/ */
public function setAllowedPaymentMethod($allowed_payment_method) public function setAllowedPaymentMethod($allowed_payment_method)
@@ -30,7 +30,7 @@ class PaymentOptions extends PayPalModel
} }
/** /**
* Payment method requested for this purchase unit * Optional payment method type. If specified, the transaction will go through for only instant payment. Only for use with the paypal payment_method, not relevant for the credit_card payment_method.
* *
* @return string * @return string
*/ */
@@ -39,4 +39,54 @@ class PaymentOptions extends PayPalModel
return $this->allowed_payment_method; return $this->allowed_payment_method;
} }
/**
* Indicator if this payment request is a recurring payment. Only supported when the `payment_method` is set to `credit_card`
*
* @deprecated Not publicly available
* @param bool $recurring_flag
*
* @return $this
*/
public function setRecurringFlag($recurring_flag)
{
$this->recurring_flag = $recurring_flag;
return $this;
}
/**
* Indicator if this payment request is a recurring payment. Only supported when the `payment_method` is set to `credit_card`
*
* @deprecated Not publicly available
* @return bool
*/
public function getRecurringFlag()
{
return $this->recurring_flag;
}
/**
* Indicator if fraud management filters (fmf) should be skipped for this transaction. Only supported when the `payment_method` is set to `credit_card`
*
* @deprecated Not publicly available
* @param bool $skip_fmf
*
* @return $this
*/
public function setSkipFmf($skip_fmf)
{
$this->skip_fmf = $skip_fmf;
return $this;
}
/**
* Indicator if fraud management filters (fmf) should be skipped for this transaction. Only supported when the `payment_method` is set to `credit_card`
*
* @deprecated Not publicly available
* @return bool
*/
public function getSkipFmf()
{
return $this->skip_fmf;
}
} }

View File

@@ -0,0 +1,112 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class PotentialPayerInfo
*
* A resource representing a information about a potential Payer.
*
* @package PayPal\Api
*
* @property string email
* @property string external_remember_me_id
* @property \PayPal\Api\Address billing_address
*/
class PotentialPayerInfo extends PayPalModel
{
/**
* Email address representing the potential payer.
*
* @param string $email
*
* @return $this
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Email address representing the potential payer.
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* ExternalRememberMe id representing the potential payer
*
* @param string $external_remember_me_id
*
* @return $this
*/
public function setExternalRememberMeId($external_remember_me_id)
{
$this->external_remember_me_id = $external_remember_me_id;
return $this;
}
/**
* ExternalRememberMe id representing the potential payer
*
* @return string
*/
public function getExternalRememberMeId()
{
return $this->external_remember_me_id;
}
/**
* Account Number representing the potential payer
* @deprecated Not publicly available
* @param string $account_number
*
* @return $this
*/
public function setAccountNumber($account_number)
{
$this->account_number = $account_number;
return $this;
}
/**
* Account Number representing the potential payer
* @deprecated Not publicly available
* @return string
*/
public function getAccountNumber()
{
return $this->account_number;
}
/**
* Billing address of the potential payer.
*
* @param \PayPal\Api\Address $billing_address
*
* @return $this
*/
public function setBillingAddress($billing_address)
{
$this->billing_address = $billing_address;
return $this;
}
/**
* Billing address of the potential payer.
*
* @return \PayPal\Api\Address
*/
public function getBillingAddress()
{
return $this->billing_address;
}
}

View File

@@ -0,0 +1,137 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class PrivateLabelCard
*
* A resource representing a type of merchant branded payment card. To promote customer value (convenience and earning rewards) and retailer value (merchants drive business using the store cards), PayPal will support as payment method.
*
* @package PayPal\Api
*
* @property string id
* @property string card_number
* @property string issuer_id
* @property string issuer_name
* @property string image_key
*/
class PrivateLabelCard extends PayPalModel
{
/**
* encrypted identifier of the private label card instrument.
*
* @param string $id
*
* @return $this
*/
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* encrypted identifier of the private label card instrument.
*
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* last 4 digits of the card number.
*
* @param string $card_number
*
* @return $this
*/
public function setCardNumber($card_number)
{
$this->card_number = $card_number;
return $this;
}
/**
* last 4 digits of the card number.
*
* @return string
*/
public function getCardNumber()
{
return $this->card_number;
}
/**
* Merchants providing private label store cards have associated issuer account. This value indicates encrypted account number of the associated issuer account.
*
* @param string $issuer_id
*
* @return $this
*/
public function setIssuerId($issuer_id)
{
$this->issuer_id = $issuer_id;
return $this;
}
/**
* Merchants providing private label store cards have associated issuer account. This value indicates encrypted account number of the associated issuer account.
*
* @return string
*/
public function getIssuerId()
{
return $this->issuer_id;
}
/**
* Merchants providing private label store cards have associated issuer account. This value indicates name on the issuer account.
*
* @param string $issuer_name
*
* @return $this
*/
public function setIssuerName($issuer_name)
{
$this->issuer_name = $issuer_name;
return $this;
}
/**
* Merchants providing private label store cards have associated issuer account. This value indicates name on the issuer account.
*
* @return string
*/
public function getIssuerName()
{
return $this->issuer_name;
}
/**
* This value indicates URL to access PLCC program logo image
*
* @param string $image_key
*
* @return $this
*/
public function setImageKey($image_key)
{
$this->image_key = $image_key;
return $this;
}
/**
* This value indicates URL to access PLCC program logo image
*
* @return string
*/
public function getImageKey()
{
return $this->image_key;
}
}

View File

@@ -0,0 +1,162 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class ProcessorResponse
*
* Collection of payment response related fields returned from a payment request
*
* @package PayPal\Api
*
* @property string response_code
* @property string avs_code
* @property string cvv_code
* @property string advice_code
* @property string eci_submitted
* @property string vpas
*/
class ProcessorResponse extends PayPalModel
{
/**
* Paypal normalized response code, generated from the processor's specific response code
*
* @param string $response_code
*
* @return $this
*/
public function setResponseCode($response_code)
{
$this->response_code = $response_code;
return $this;
}
/**
* Paypal normalized response code, generated from the processor's specific response code
*
* @return string
*/
public function getResponseCode()
{
return $this->response_code;
}
/**
* Address Verification System response code. https://developer.paypal.com/webapps/developer/docs/classic/api/AVSResponseCodes/
*
* @param string $avs_code
*
* @return $this
*/
public function setAvsCode($avs_code)
{
$this->avs_code = $avs_code;
return $this;
}
/**
* Address Verification System response code. https://developer.paypal.com/webapps/developer/docs/classic/api/AVSResponseCodes/
*
* @return string
*/
public function getAvsCode()
{
return $this->avs_code;
}
/**
* CVV System response code. https://developer.paypal.com/webapps/developer/docs/classic/api/AVSResponseCodes/
*
* @param string $cvv_code
*
* @return $this
*/
public function setCvvCode($cvv_code)
{
$this->cvv_code = $cvv_code;
return $this;
}
/**
* CVV System response code. https://developer.paypal.com/webapps/developer/docs/classic/api/AVSResponseCodes/
*
* @return string
*/
public function getCvvCode()
{
return $this->cvv_code;
}
/**
* Provides merchant advice on how to handle declines related to recurring payments
* Valid Values: ["01_NEW_ACCOUNT_INFORMATION", "02_TRY_AGAIN_LATER", "02_STOP_SPECIFIC_PAYMENT", "03_DO_NOT_TRY_AGAIN", "03_REVOKE_AUTHORIZATION_FOR_FUTURE_PAYMENT", "21_DO_NOT_TRY_AGAIN_CARD_HOLDER_CANCELLED_RECURRRING_CHARGE", "21_CANCEL_ALL_RECURRING_PAYMENTS"]
*
* @param string $advice_code
*
* @return $this
*/
public function setAdviceCode($advice_code)
{
$this->advice_code = $advice_code;
return $this;
}
/**
* Provides merchant advice on how to handle declines related to recurring payments
*
* @return string
*/
public function getAdviceCode()
{
return $this->advice_code;
}
/**
* Response back from the authorization. Provided by the processor
*
* @param string $eci_submitted
*
* @return $this
*/
public function setEciSubmitted($eci_submitted)
{
$this->eci_submitted = $eci_submitted;
return $this;
}
/**
* Response back from the authorization. Provided by the processor
*
* @return string
*/
public function getEciSubmitted()
{
return $this->eci_submitted;
}
/**
* Visa Payer Authentication Service status. Will be return from processor
*
* @param string $vpas
*
* @return $this
*/
public function setVpas($vpas)
{
$this->vpas = $vpas;
return $this;
}
/**
* Visa Payer Authentication Service status. Will be return from processor
*
* @return string
*/
public function getVpas()
{
return $this->vpas;
}
}

View File

@@ -8,7 +8,7 @@ use PayPal\Validation\UrlValidator;
/** /**
* Class RedirectUrls * Class RedirectUrls
* *
* Redirect urls required only when using payment_method as PayPal - the only settings supported are return and cancel urls. * Set of redirect URLs you provide only for PayPal-based payments.
* *
* @package PayPal\Api * @package PayPal\Api
* *
@@ -18,7 +18,7 @@ use PayPal\Validation\UrlValidator;
class RedirectUrls extends PayPalModel class RedirectUrls extends PayPalModel
{ {
/** /**
* Url where the payer would be redirected to after approving the payment. * Url where the payer would be redirected to after approving the payment. **Required for PayPal account payments.**
* *
* @param string $return_url * @param string $return_url
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
@@ -32,7 +32,7 @@ class RedirectUrls extends PayPalModel
} }
/** /**
* Url where the payer would be redirected to after approving the payment. * Url where the payer would be redirected to after approving the payment. **Required for PayPal account payments.**
* *
* @return string * @return string
*/ */
@@ -42,7 +42,7 @@ class RedirectUrls extends PayPalModel
} }
/** /**
* Url where the payer would be redirected to after canceling the payment. * Url where the payer would be redirected to after canceling the payment. **Required for PayPal account payments.**
* *
* @param string $cancel_url * @param string $cancel_url
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
@@ -56,7 +56,7 @@ class RedirectUrls extends PayPalModel
} }
/** /**
* Url where the payer would be redirected to after canceling the payment. * Url where the payer would be redirected to after canceling the payment. **Required for PayPal account payments.**
* *
* @return string * @return string
*/ */

View File

@@ -4,7 +4,6 @@ namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel; use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext; use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator; use PayPal\Validation\ArgumentValidator;
/** /**
@@ -14,25 +13,25 @@ use PayPal\Validation\ArgumentValidator;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string id * @property string id
* @property string create_time * @property \PayPal\Api\Amount amount
* @property string update_time * @property string state
* @property \PayPal\Api\Amount amount * @property string reason
* @property string state * @property string sale_id
* @property string reason * @property string capture_id
* @property string sale_id * @property string parent_payment
* @property string capture_id * @property string description
* @property string parent_payment * @property string create_time
* @property string description * @property string update_time
* @property \PayPal\Api\Links[] links * @property \PayPal\Api\Links[] links
*/ */
class Refund extends PayPalResourceModel class Refund extends PayPalResourceModel
{ {
/** /**
* Identifier of the refund transaction in UTC ISO8601 format. * ID of the refund transaction. 17 characters max.
* *
* @param string $id * @param string $id
* *
* @return $this * @return $this
*/ */
public function setId($id) public function setId($id)
@@ -42,7 +41,7 @@ class Refund extends PayPalResourceModel
} }
/** /**
* Identifier of the refund transaction in UTC ISO8601 format. * ID of the refund transaction. 17 characters max.
* *
* @return string * @return string
*/ */
@@ -52,10 +51,10 @@ class Refund extends PayPalResourceModel
} }
/** /**
* Details including both refunded amount (to Payer) and refunded fee (to Payee).If amount is not specified, it's assumed to be full refund. * Details including both refunded amount (to payer) and refunded fee (to payee). 10 characters max.
* *
* @param \PayPal\Api\Amount $amount * @param \PayPal\Api\Amount $amount
* *
* @return $this * @return $this
*/ */
public function setAmount($amount) public function setAmount($amount)
@@ -65,7 +64,7 @@ class Refund extends PayPalResourceModel
} }
/** /**
* Details including both refunded amount (to Payer) and refunded fee (to Payee).If amount is not specified, it's assumed to be full refund. * Details including both refunded amount (to payer) and refunded fee (to payee). 10 characters max.
* *
* @return \PayPal\Api\Amount * @return \PayPal\Api\Amount
*/ */
@@ -75,11 +74,11 @@ class Refund extends PayPalResourceModel
} }
/** /**
* State of the refund transaction. * State of the refund.
* Valid Values: ["pending", "completed", "failed"] * Valid Values: ["pending", "completed", "failed"]
* *
* @param string $state * @param string $state
* *
* @return $this * @return $this
*/ */
public function setState($state) public function setState($state)
@@ -89,7 +88,7 @@ class Refund extends PayPalResourceModel
} }
/** /**
* State of the refund transaction. * State of the refund.
* *
* @return string * @return string
*/ */
@@ -102,7 +101,7 @@ class Refund extends PayPalResourceModel
* Reason description for the Sale transaction being refunded. * Reason description for the Sale transaction being refunded.
* *
* @param string $reason * @param string $reason
* *
* @return $this * @return $this
*/ */
public function setReason($reason) public function setReason($reason)
@@ -122,10 +121,10 @@ class Refund extends PayPalResourceModel
} }
/** /**
* ID of the Sale transaction being refunded. * ID of the Sale transaction being refunded.
* *
* @param string $sale_id * @param string $sale_id
* *
* @return $this * @return $this
*/ */
public function setSaleId($sale_id) public function setSaleId($sale_id)
@@ -135,7 +134,7 @@ class Refund extends PayPalResourceModel
} }
/** /**
* ID of the Sale transaction being refunded. * ID of the Sale transaction being refunded.
* *
* @return string * @return string
*/ */
@@ -145,10 +144,10 @@ class Refund extends PayPalResourceModel
} }
/** /**
* ID of the Capture transaction being refunded. * ID of the sale transaction being refunded.
* *
* @param string $capture_id * @param string $capture_id
* *
* @return $this * @return $this
*/ */
public function setCaptureId($capture_id) public function setCaptureId($capture_id)
@@ -158,7 +157,7 @@ class Refund extends PayPalResourceModel
} }
/** /**
* ID of the Capture transaction being refunded. * ID of the sale transaction being refunded.
* *
* @return string * @return string
*/ */
@@ -168,10 +167,10 @@ class Refund extends PayPalResourceModel
} }
/** /**
* ID of the Payment resource that this transaction is based on. * ID of the payment resource on which this transaction is based.
* *
* @param string $parent_payment * @param string $parent_payment
* *
* @return $this * @return $this
*/ */
public function setParentPayment($parent_payment) public function setParentPayment($parent_payment)
@@ -181,7 +180,7 @@ class Refund extends PayPalResourceModel
} }
/** /**
* ID of the Payment resource that this transaction is based on. * ID of the payment resource on which this transaction is based.
* *
* @return string * @return string
*/ */
@@ -194,7 +193,7 @@ class Refund extends PayPalResourceModel
* Description of what is being refunded for. * Description of what is being refunded for.
* *
* @param string $description * @param string $description
* *
* @return $this * @return $this
*/ */
public function setDescription($description) public function setDescription($description)
@@ -214,10 +213,10 @@ class Refund extends PayPalResourceModel
} }
/** /**
* Time the resource was created in UTC ISO8601 format. * Time of refund as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
* *
* @param string $create_time * @param string $create_time
* *
* @return $this * @return $this
*/ */
public function setCreateTime($create_time) public function setCreateTime($create_time)
@@ -227,7 +226,7 @@ class Refund extends PayPalResourceModel
} }
/** /**
* Time the resource was created in UTC ISO8601 format. * Time of refund as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
* *
* @return string * @return string
*/ */
@@ -237,10 +236,10 @@ class Refund extends PayPalResourceModel
} }
/** /**
* Time the resource was last updated in UTC ISO8601 format. * Time that the resource was last updated.
* *
* @param string $update_time * @param string $update_time
* *
* @return $this * @return $this
*/ */
public function setUpdateTime($update_time) public function setUpdateTime($update_time)
@@ -250,7 +249,7 @@ class Refund extends PayPalResourceModel
} }
/** /**
* Time the resource was last updated in UTC ISO8601 format. * Time that the resource was last updated.
* *
* @return string * @return string
*/ */
@@ -262,9 +261,9 @@ class Refund extends PayPalResourceModel
/** /**
* Retrieve details about a specific refund by passing the refund_id in the request URI. * Retrieve details about a specific refund by passing the refund_id in the request URI.
* *
* @param string $refundId * @param string $refundId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Refund * @return Refund
*/ */
public static function get($refundId, $apiContext = null, $restCall = null) public static function get($refundId, $apiContext = null, $restCall = null)

View File

@@ -11,17 +11,16 @@ use PayPal\Common\PayPalModel;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property \PayPal\Api\Sale sale * @property \PayPal\Api\Sale sale
* @property \PayPal\Api\Authorization authorization * @property \PayPal\Api\Authorization authorization
* @property \PayPal\Api\Order order * @property \PayPal\Api\Order order
* @property \PayPal\Api\Capture capture * @property \PayPal\Api\Capture capture
* @property \PayPal\Api\Refund refund * @property \PayPal\Api\Refund refund
*/ */
class RelatedResources extends PayPalModel class RelatedResources extends PayPalModel
{ {
/** /**
* A sale transaction * Sale transaction
*
* *
* @param \PayPal\Api\Sale $sale * @param \PayPal\Api\Sale $sale
* *
@@ -34,7 +33,7 @@ class RelatedResources extends PayPalModel
} }
/** /**
* A sale transaction * Sale transaction
* *
* @return \PayPal\Api\Sale * @return \PayPal\Api\Sale
*/ */
@@ -44,8 +43,7 @@ class RelatedResources extends PayPalModel
} }
/** /**
* An authorization transaction * Authorization transaction
*
* *
* @param \PayPal\Api\Authorization $authorization * @param \PayPal\Api\Authorization $authorization
* *
@@ -58,7 +56,7 @@ class RelatedResources extends PayPalModel
} }
/** /**
* An authorization transaction * Authorization transaction
* *
* @return \PayPal\Api\Authorization * @return \PayPal\Api\Authorization
*/ */
@@ -68,8 +66,7 @@ class RelatedResources extends PayPalModel
} }
/** /**
* An order transaction * Order transaction
*
* *
* @param \PayPal\Api\Order $order * @param \PayPal\Api\Order $order
* *
@@ -82,7 +79,7 @@ class RelatedResources extends PayPalModel
} }
/** /**
* An order transaction * Order transaction
* *
* @return \PayPal\Api\Order * @return \PayPal\Api\Order
*/ */
@@ -92,8 +89,7 @@ class RelatedResources extends PayPalModel
} }
/** /**
* A capture transaction * Capture transaction
*
* *
* @param \PayPal\Api\Capture $capture * @param \PayPal\Api\Capture $capture
* *
@@ -106,7 +102,7 @@ class RelatedResources extends PayPalModel
} }
/** /**
* A capture transaction * Capture transaction
* *
* @return \PayPal\Api\Capture * @return \PayPal\Api\Capture
*/ */
@@ -116,8 +112,7 @@ class RelatedResources extends PayPalModel
} }
/** /**
* A refund transaction * Refund transaction
*
* *
* @param \PayPal\Api\Refund $refund * @param \PayPal\Api\Refund $refund
* *
@@ -130,7 +125,7 @@ class RelatedResources extends PayPalModel
} }
/** /**
* A refund transaction * Refund transaction
* *
* @return \PayPal\Api\Refund * @return \PayPal\Api\Refund
*/ */

View File

@@ -4,7 +4,6 @@ namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel; use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext; use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator; use PayPal\Validation\ArgumentValidator;
/** /**
@@ -14,35 +13,36 @@ use PayPal\Validation\ArgumentValidator;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string id * @property string id
* @property string purchase_unit_reference_id * @property string purchase_unit_reference_id
* @property string create_time * @property \PayPal\Api\Amount amount
* @property string update_time * @property string payment_mode
* @property \PayPal\Api\Amount amount * @property string state
* @property string payment_mode * @property string reason_code
* @property string pending_reason * @property string protection_eligibility
* @property string state * @property string protection_eligibility_type
* @property string reason_code * @property string clearing_time
* @property string protection_eligibility * @property string payment_hold_status
* @property string protection_eligibility_type * @property string[] payment_hold_reasons
* @property string clearing_time * @property \PayPal\Api\Currency transaction_fee
* @property string recipient_fund_status * @property \PayPal\Api\Currency receivable_amount
* @property string hold_reason * @property string exchange_rate
* @property \PayPal\Api\Currency transaction_fee * @property \PayPal\Api\FmfDetails fmf_details
* @property \PayPal\Api\Currency receivable_amount * @property string receipt_id
* @property string exchange_rate * @property string parent_payment
* @property \PayPal\Api\FmfDetails fmf_details * @property \PayPal\Api\ProcessorResponse processor_response
* @property string receipt_id * @property string billing_agreement_id
* @property string parent_payment * @property string create_time
* @property \PayPal\Api\Links[] links * @property string update_time
* @property \PayPal\Api\Links[] links
*/ */
class Sale extends PayPalResourceModel class Sale extends PayPalResourceModel
{ {
/** /**
* Identifier of the sale transaction. * ID of the sale transaction.
* *
* @param string $id * @param string $id
* *
* @return $this * @return $this
*/ */
public function setId($id) public function setId($id)
@@ -52,7 +52,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Identifier of the sale transaction. * ID of the sale transaction.
* *
* @return string * @return string
*/ */
@@ -62,10 +62,10 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Identifier to the purchase unit corresponding to this sale transaction. * Identifier of the purchased unit associated with this object.
* *
* @param string $purchase_unit_reference_id * @param string $purchase_unit_reference_id
* *
* @return $this * @return $this
*/ */
public function setPurchaseUnitReferenceId($purchase_unit_reference_id) public function setPurchaseUnitReferenceId($purchase_unit_reference_id)
@@ -75,7 +75,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Identifier to the purchase unit corresponding to this sale transaction. * Identifier of the purchased unit associated with this object.
* *
* @return string * @return string
*/ */
@@ -88,7 +88,7 @@ class Sale extends PayPalResourceModel
* Amount being collected. * Amount being collected.
* *
* @param \PayPal\Api\Amount $amount * @param \PayPal\Api\Amount $amount
* *
* @return $this * @return $this
*/ */
public function setAmount($amount) public function setAmount($amount)
@@ -108,11 +108,11 @@ class Sale extends PayPalResourceModel
} }
/** /**
* specifies payment mode of the transaction * Specifies payment mode of the transaction. Only supported when the `payment_method` is set to `paypal`.
* Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"] * Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
* *
* @param string $payment_mode * @param string $payment_mode
* *
* @return $this * @return $this
*/ */
public function setPaymentMode($payment_mode) public function setPaymentMode($payment_mode)
@@ -122,7 +122,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* specifies payment mode of the transaction * Specifies payment mode of the transaction. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -132,35 +132,11 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Reason of Pending transaction. * State of the sale.
*
*
*
* @param string $pending_reason
* @return $this
*/
public function setPendingReason($pending_reason)
{
$this->pending_reason = $pending_reason;
return $this;
}
/**
* Reason of Pending transaction.
*
* @return string
*/
public function getPendingReason()
{
return $this->pending_reason;
}
/**
* State of the sale transaction.
* Valid Values: ["completed", "partially_refunded", "pending", "refunded"] * Valid Values: ["completed", "partially_refunded", "pending", "refunded"]
* *
* @param string $state * @param string $state
* *
* @return $this * @return $this
*/ */
public function setState($state) public function setState($state)
@@ -170,7 +146,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* State of the sale transaction. * State of the sale.
* *
* @return string * @return string
*/ */
@@ -180,11 +156,11 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Reason code for the transaction state being Pending or Reversed. * Reason code for the transaction state being Pending or Reversed. Only supported when the `payment_method` is set to `paypal`.
* 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"] * 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"]
* *
* @param string $reason_code * @param string $reason_code
* *
* @return $this * @return $this
*/ */
public function setReasonCode($reason_code) public function setReasonCode($reason_code)
@@ -194,7 +170,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Reason code for the transaction state being Pending or Reversed. * Reason code for the transaction state being Pending or Reversed. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -204,11 +180,11 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Protection Eligibility of the Payer * The level of seller protection in force for the transaction. Only supported when the `payment_method` is set to `paypal`.
* Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"] * Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
* *
* @param string $protection_eligibility * @param string $protection_eligibility
* *
* @return $this * @return $this
*/ */
public function setProtectionEligibility($protection_eligibility) public function setProtectionEligibility($protection_eligibility)
@@ -218,7 +194,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Protection Eligibility of the Payer * The level of seller protection in force for the transaction. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -228,11 +204,11 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Protection Eligibility Type of the Payer * The kind of seller protection in force for the transaction. It is returned only when protection_eligibility is ELIGIBLE or PARTIALLY_ELIGIBLE. Only supported when the `payment_method` is set to `paypal`.
* Valid Values: ["ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE", "INELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE"] * Valid Values: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"]
* *
* @param string $protection_eligibility_type * @param string $protection_eligibility_type
* *
* @return $this * @return $this
*/ */
public function setProtectionEligibilityType($protection_eligibility_type) public function setProtectionEligibilityType($protection_eligibility_type)
@@ -242,7 +218,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Protection Eligibility Type of the Payer * The kind of seller protection in force for the transaction. It is returned only when protection_eligibility is ELIGIBLE or PARTIALLY_ELIGIBLE. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -252,10 +228,10 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Expected clearing time for eCheck Transactions * Expected clearing time for eCheck transactions. Only supported when the `payment_method` is set to `paypal`.
* *
* @param string $clearing_time * @param string $clearing_time
* *
* @return $this * @return $this
*/ */
public function setClearingTime($clearing_time) public function setClearingTime($clearing_time)
@@ -265,7 +241,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Expected clearing time for eCheck Transactions * Expected clearing time for eCheck transactions. Only supported when the `payment_method` is set to `paypal`.
* *
* @return string * @return string
*/ */
@@ -275,58 +251,87 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Indicates the credit status of fund to the recipient. It will be returned only when payment status is 'completed' * Status of the Recipient Fund. For now, it will be returned only when fund status is held
* Valid Values: ["COMPLETED", "HELD"] * Valid Values: ["HELD"]
*
* @param string $payment_hold_status
* *
* @param string $recipient_fund_status
*
* @return $this * @return $this
*/ */
public function setRecipientFundStatus($recipient_fund_status) public function setPaymentHoldStatus($payment_hold_status)
{ {
$this->recipient_fund_status = $recipient_fund_status; $this->payment_hold_status = $payment_hold_status;
return $this; return $this;
} }
/** /**
* Indicates the credit status of fund to the recipient. It will be returned only when payment status is 'completed' * Status of the Recipient Fund. For now, it will be returned only when fund status is held
* *
* @return string * @return string
*/ */
public function getRecipientFundStatus() public function getPaymentHoldStatus()
{ {
return $this->recipient_fund_status; return $this->payment_hold_status;
} }
/** /**
* Reason for holding the funds. * Reasons for PayPal holding recipient fund. It is set only if payment hold status is held
* Valid Values: ["NEW_SELLER_PAYMENT_HOLD", "PAYMENT_HOLD"] *
* @param string[] $payment_hold_reasons
* *
* @param string $hold_reason
*
* @return $this * @return $this
*/ */
public function setHoldReason($hold_reason) public function setPaymentHoldReasons($payment_hold_reasons)
{ {
$this->hold_reason = $hold_reason; $this->payment_hold_reasons = $payment_hold_reasons;
return $this; return $this;
} }
/** /**
* Reason for holding the funds. * Reasons for PayPal holding recipient fund. It is set only if payment hold status is held
* *
* @return string * @return string[]
*/ */
public function getHoldReason() public function getPaymentHoldReasons()
{ {
return $this->hold_reason; return $this->payment_hold_reasons;
} }
/** /**
* Transaction fee applicable for this payment. * Append PaymentHoldReasons to the list.
*
* @param string $string
* @return $this
*/
public function addPaymentHoldReason($string)
{
if (!$this->getPaymentHoldReasons()) {
return $this->setPaymentHoldReasons(array($string));
} else {
return $this->setPaymentHoldReasons(
array_merge($this->getPaymentHoldReasons(), array($string))
);
}
}
/**
* Remove PaymentHoldReasons from the list.
*
* @param string $string
* @return $this
*/
public function removePaymentHoldReason($string)
{
return $this->setPaymentHoldReasons(
array_diff($this->getPaymentHoldReasons(), array($string))
);
}
/**
* Transaction fee charged by PayPal for this transaction.
* *
* @param \PayPal\Api\Currency $transaction_fee * @param \PayPal\Api\Currency $transaction_fee
* *
* @return $this * @return $this
*/ */
public function setTransactionFee($transaction_fee) public function setTransactionFee($transaction_fee)
@@ -336,7 +341,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Transaction fee applicable for this payment. * Transaction fee charged by PayPal for this transaction.
* *
* @return \PayPal\Api\Currency * @return \PayPal\Api\Currency
*/ */
@@ -346,10 +351,10 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Net amount payee receives for this transaction after deducting transaction fee. * Net amount the merchant receives for this transaction in their receivable currency. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
* *
* @param \PayPal\Api\Currency $receivable_amount * @param \PayPal\Api\Currency $receivable_amount
* *
* @return $this * @return $this
*/ */
public function setReceivableAmount($receivable_amount) public function setReceivableAmount($receivable_amount)
@@ -359,7 +364,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Net amount payee receives for this transaction after deducting transaction fee. * Net amount the merchant receives for this transaction in their receivable currency. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
* *
* @return \PayPal\Api\Currency * @return \PayPal\Api\Currency
*/ */
@@ -369,10 +374,10 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Exchange rate applied for this transaction. * Exchange rate applied for this transaction. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
* *
* @param string $exchange_rate * @param string $exchange_rate
* *
* @return $this * @return $this
*/ */
public function setExchangeRate($exchange_rate) public function setExchangeRate($exchange_rate)
@@ -382,7 +387,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Exchange rate applied for this transaction. * Exchange rate applied for this transaction. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
* *
* @return string * @return string
*/ */
@@ -392,10 +397,10 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action. * 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](/docs/classic/fmf/integration-guide/FMFSummary/) for more information.
* *
* @param \PayPal\Api\FmfDetails $fmf_details * @param \PayPal\Api\FmfDetails $fmf_details
* *
* @return $this * @return $this
*/ */
public function setFmfDetails($fmf_details) public function setFmfDetails($fmf_details)
@@ -405,7 +410,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action. * 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](/docs/classic/fmf/integration-guide/FMFSummary/) for more information.
* *
* @return \PayPal\Api\FmfDetails * @return \PayPal\Api\FmfDetails
*/ */
@@ -415,10 +420,10 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Receipt id is 16 digit number payment identification number returned for guest users to identify the payment. * Receipt id is a payment identification number returned for guest users to identify the payment.
* *
* @param string $receipt_id * @param string $receipt_id
* *
* @return $this * @return $this
*/ */
public function setReceiptId($receipt_id) public function setReceiptId($receipt_id)
@@ -428,7 +433,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Receipt id is 16 digit number payment identification number returned for guest users to identify the payment. * Receipt id is a payment identification number returned for guest users to identify the payment.
* *
* @return string * @return string
*/ */
@@ -438,10 +443,10 @@ class Sale extends PayPalResourceModel
} }
/** /**
* ID of the Payment resource that this transaction is based on. * ID of the payment resource on which this transaction is based.
* *
* @param string $parent_payment * @param string $parent_payment
* *
* @return $this * @return $this
*/ */
public function setParentPayment($parent_payment) public function setParentPayment($parent_payment)
@@ -451,7 +456,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* ID of the Payment resource that this transaction is based on. * ID of the payment resource on which this transaction is based.
* *
* @return string * @return string
*/ */
@@ -461,10 +466,56 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Time the resource was created in UTC ISO8601 format. * Response codes returned by the processor concerning the submitted payment. Only supported when the `payment_method` is set to `credit_card`.
*
* @param \PayPal\Api\ProcessorResponse $processor_response
*
* @return $this
*/
public function setProcessorResponse($processor_response)
{
$this->processor_response = $processor_response;
return $this;
}
/**
* Response codes returned by the processor concerning the submitted payment. Only supported when the `payment_method` is set to `credit_card`.
*
* @return \PayPal\Api\ProcessorResponse
*/
public function getProcessorResponse()
{
return $this->processor_response;
}
/**
* ID of the billing agreement used as reference to execute this transaction.
*
* @param string $billing_agreement_id
*
* @return $this
*/
public function setBillingAgreementId($billing_agreement_id)
{
$this->billing_agreement_id = $billing_agreement_id;
return $this;
}
/**
* ID of the billing agreement used as reference to execute this transaction.
*
* @return string
*/
public function getBillingAgreementId()
{
return $this->billing_agreement_id;
}
/**
* Time of sale as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6)
* *
* @param string $create_time * @param string $create_time
* *
* @return $this * @return $this
*/ */
public function setCreateTime($create_time) public function setCreateTime($create_time)
@@ -474,7 +525,7 @@ class Sale extends PayPalResourceModel
} }
/** /**
* Time the resource was created in UTC ISO8601 format. * Time of sale as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6)
* *
* @return string * @return string
*/ */
@@ -487,7 +538,7 @@ class Sale extends PayPalResourceModel
* Time the resource was last updated in UTC ISO8601 format. * Time the resource was last updated in UTC ISO8601 format.
* *
* @param string $update_time * @param string $update_time
* *
* @return $this * @return $this
*/ */
public function setUpdateTime($update_time) public function setUpdateTime($update_time)
@@ -509,9 +560,9 @@ class Sale extends PayPalResourceModel
/** /**
* Retrieve details about a sale transaction by passing the sale_id in the request URI. This request returns only the sales that were created via the REST API. * Retrieve details about a sale transaction by passing the sale_id in the request URI. This request returns only the sales that were created via the REST API.
* *
* @param string $saleId * @param string $saleId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Sale * @return Sale
*/ */
public static function get($saleId, $apiContext = null, $restCall = null) public static function get($saleId, $apiContext = null, $restCall = null)
@@ -534,9 +585,9 @@ class Sale extends PayPalResourceModel
/** /**
* Refund a completed payment by passing the sale_id in the request URI. In addition, include an empty JSON payload in the request body for a full refund. For a partial refund, include an amount object in the request body. * Refund a completed payment by passing the sale_id in the request URI. In addition, include an empty JSON payload in the request body for a full refund. For a partial refund, include an amount object in the request body.
* *
* @param Refund $refund * @param Refund $refund
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. * @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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Refund * @return Refund
*/ */
public function refund($refund, $apiContext = null, $restCall = null) public function refund($refund, $apiContext = null, $restCall = null)

View File

@@ -110,6 +110,28 @@ class ShippingInfo extends PayPalModel
return $this->phone; return $this->phone;
} }
/**
*
*
* @param string $email
* @return $this
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
*
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/** /**
* Address of the invoice recipient. * Address of the invoice recipient.
* *

View File

@@ -9,8 +9,6 @@ namespace PayPal\Api;
* *
* @package PayPal\Api * @package PayPal\Api
* *
* @property string purchase_unit_reference_id
* @property Transaction transactions
*/ */
class Transaction extends TransactionBase class Transaction extends TransactionBase
{ {

View File

@@ -122,7 +122,6 @@ class PayPalModel
*/ */
public function __set($key, $value) public function __set($key, $value)
{ {
ModelAccessorValidator::validate($this, $this->convertToCamelCase($key));
if (!is_array($value) && $value === null) { if (!is_array($value) && $value === null) {
$this->__unset($key); $this->__unset($key);
} else { } else {
@@ -249,9 +248,9 @@ class PayPalModel
private function assignValue($key, $value) private function assignValue($key, $value)
{ {
// If we find the getter setter, use that, otherwise use magic method. $setter = 'set'. $this->convertToCamelCase($key);
if (ModelAccessorValidator::validate($this, $this->convertToCamelCase($key))) { // If we find the setter, use that, otherwise use magic method.
$setter = "set" . $this->convertToCamelCase($key); if (method_exists($this, $setter)) {
$this->$setter($value); $this->$setter($value);
} else { } else {
$this->__set($key, $value); $this->__set($key, $value);

View File

@@ -1,53 +0,0 @@
<?php
namespace PayPal\Validation;
use PayPal\Common\PayPalModel;
use PayPal\Core\PayPalConfigManager;
use PayPal\Core\PayPalLoggingManager;
/**
* Class ModelAccessorValidator
*
* @package PayPal\Validation
*/
class ModelAccessorValidator
{
/**
* Helper method for validating if the class contains accessor methods (getter and setter) for a given attribute
*
* @param PayPalModel $class An object of PayPalModel
* @param string $attributeName Attribute name
* @return bool
*/
public static function validate(PayPalModel $class, $attributeName)
{
$mode = PayPalConfigManager::getInstance()->get('validation.level');
if (!empty($mode) && $mode != 'disabled') {
//Check if $attributeName is string
if (gettype($attributeName) !== 'string') {
return false;
}
//If the mode is disabled, bypass the validation
foreach (array('set' . $attributeName, 'get' . $attributeName) as $methodName) {
if (get_class($class) == get_class(new PayPalModel())) {
// Silently return false on cases where you are using PayPalModel instance directly
return false;
}
//Check if both getter and setter exists for given attribute
elseif (!method_exists($class, $methodName)) {
//Delegate the error based on the choice
$className = is_object($class) ? get_class($class) : (string)$class;
$errorMessage = "Missing Accessor: $className:$methodName. You might be using older version of SDK. If not, create an issue at https://github.com/paypal/PayPal-PHP-SDK/issues";
PayPalLoggingManager::getInstance(__CLASS__)->debug($errorMessage);
if ($mode == 'strict') {
trigger_error($errorMessage, E_USER_NOTICE);
}
return false;
}
}
return true;
}
return false;
}
}

View File

@@ -75,7 +75,6 @@ function getApiContext($clientId, $clientSecret)
'log.LogEnabled' => true, 'log.LogEnabled' => true,
'log.FileName' => '../PayPal.log', 'log.FileName' => '../PayPal.log',
'log.LogLevel' => 'DEBUG', // PLEASE USE `FINE` LEVEL FOR LOGGING IN LIVE ENVIRONMENTS 'log.LogLevel' => 'DEBUG', // PLEASE USE `FINE` LEVEL FOR LOGGING IN LIVE ENVIRONMENTS
'validation.level' => 'log',
'cache.enabled' => true, 'cache.enabled' => true,
// 'http.CURLOPT_CONNECTTIMEOUT' => 30 // 'http.CURLOPT_CONNECTTIMEOUT' => 30
// 'http.headers.PayPal-Partner-Attribution-Id' => '123123123' // 'http.headers.PayPal-Partner-Attribution-Id' => '123123123'

File diff suppressed because it is too large Load Diff

View File

@@ -8,13 +8,8 @@ API used: /v1/payments/billing-plans</p></div></div></div><div class="segment"><
<span class="hljs-keyword">try</span> { <span class="hljs-keyword">try</span> {
<span class="hljs-variable">$result</span> = <span class="hljs-variable">$createdPlan</span>-&gt;delete(<span class="hljs-variable">$apiContext</span>); <span class="hljs-variable">$result</span> = <span class="hljs-variable">$createdPlan</span>-&gt;delete(<span class="hljs-variable">$apiContext</span>);
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) { } <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printError(<span class="hljs-string">"Deleted a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$createdPlan</span>-&gt;getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError(<span class="hljs-string">"Deleted a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$createdPlan</span>-&gt;getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>); <span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
} }</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printResult(<span class="hljs-string">"Deleted a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$createdPlan</span>-&gt;getId(), <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY <span class="hljs-keyword">return</span> <span class="hljs-variable">$createdPlan</span>;</div></div></div></div></body></html>
ResultPrinter::printResult(<span class="hljs-string">"Deleted a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$createdPlan</span>-&gt;getId(), <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>);
<span class="hljs-keyword">return</span> <span class="hljs-variable">$createdPlan</span>;</div></div></div></div></body></html>

View File

@@ -8,13 +8,8 @@ API used: /v1/payments/billing-plans</p></div></div></div><div class="segment"><
<span class="hljs-keyword">try</span> { <span class="hljs-keyword">try</span> {
<span class="hljs-variable">$plan</span> = Plan::get(<span class="hljs-variable">$createdPlan</span>-&gt;getId(), <span class="hljs-variable">$apiContext</span>); <span class="hljs-variable">$plan</span> = Plan::get(<span class="hljs-variable">$createdPlan</span>-&gt;getId(), <span class="hljs-variable">$apiContext</span>);
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) { } <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printError(<span class="hljs-string">"Retrieved a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$plan</span>-&gt;getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError(<span class="hljs-string">"Retrieved a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$plan</span>-&gt;getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>); <span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
} }</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printResult(<span class="hljs-string">"Retrieved a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$plan</span>-&gt;getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$plan</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY <span class="hljs-keyword">return</span> <span class="hljs-variable">$plan</span>;</div></div></div></div></body></html>
ResultPrinter::printResult(<span class="hljs-string">"Retrieved a Plan"</span>, <span class="hljs-string">"Plan"</span>, <span class="hljs-variable">$plan</span>-&gt;getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$plan</span>);
<span class="hljs-keyword">return</span> <span class="hljs-variable">$plan</span>;</div></div></div></div></body></html>

View File

@@ -9,10 +9,6 @@ all invoice from history.</p></div></div><div class="code"><div class="wrapper">
static <code>get_all</code> method on the Invoice class. static <code>get_all</code> method on the Invoice class.
Refer the method doc for valid values for keys Refer the method doc for valid values for keys
(See bootstrap.php for more on <code>ApiContext</code>)</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$invoices</span> = Invoice::getAll(<span class="hljs-keyword">array</span>(<span class="hljs-string">'page'</span> =&gt; <span class="hljs-number">0</span>, <span class="hljs-string">'page_size'</span> =&gt; <span class="hljs-number">4</span>, <span class="hljs-string">'total_count_required'</span> =&gt; <span class="hljs-string">"true"</span>), <span class="hljs-variable">$apiContext</span>); (See bootstrap.php for more on <code>ApiContext</code>)</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$invoices</span> = Invoice::getAll(<span class="hljs-keyword">array</span>(<span class="hljs-string">'page'</span> =&gt; <span class="hljs-number">0</span>, <span class="hljs-string">'page_size'</span> =&gt; <span class="hljs-number">4</span>, <span class="hljs-string">'total_count_required'</span> =&gt; <span class="hljs-string">"true"</span>), <span class="hljs-variable">$apiContext</span>);
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) { } <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printError(<span class="hljs-string">"Lookup Invoice History"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError(<span class="hljs-string">"Lookup Invoice History"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>); <span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
} }</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printResult(<span class="hljs-string">"Lookup Invoice History"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$invoices</span>);</div></div></div></div></body></html>
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printResult(<span class="hljs-string">"Lookup Invoice History"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$invoices</span>);</div></div></div></div></body></html>

View File

@@ -20,10 +20,6 @@ Using the new way to inject raw json string to constructor</p></div></div><div c
static <code>search</code> method on the Invoice class. static <code>search</code> method on the Invoice class.
Refer the method doc for valid values for keys Refer the method doc for valid values for keys
(See bootstrap.php for more on <code>ApiContext</code>)</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$invoices</span> = Invoice::search(<span class="hljs-variable">$search</span>, <span class="hljs-variable">$apiContext</span>); (See bootstrap.php for more on <code>ApiContext</code>)</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$invoices</span> = Invoice::search(<span class="hljs-variable">$search</span>, <span class="hljs-variable">$apiContext</span>);
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) { } <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printError(<span class="hljs-string">"Search Invoice"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError(<span class="hljs-string">"Search Invoice"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>); <span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
} }</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printResult(<span class="hljs-string">"Search Invoice"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$search</span>, <span class="hljs-variable">$invoices</span>);</div></div></div></div></body></html>
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printResult(<span class="hljs-string">"Search Invoice"</span>, <span class="hljs-string">"Invoice"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$search</span>, <span class="hljs-variable">$invoices</span>);</div></div></div></div></body></html>

View File

@@ -7,13 +7,8 @@ that contains the web profile ID.</p></div></div><div class="code"><div class="w
<span class="hljs-variable">$createProfileResponse</span> = <span class="hljs-keyword">require</span> <span class="hljs-string">'CreateWebProfile.php'</span>; <span class="hljs-variable">$createProfileResponse</span> = <span class="hljs-keyword">require</span> <span class="hljs-string">'CreateWebProfile.php'</span>;
<span class="hljs-keyword">try</span> {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>If your request is successful, the API returns a web_profile object response that contains the profile details.</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$webProfile</span> = \PayPal\Api\WebProfile::get(<span class="hljs-variable">$createProfileResponse</span>-&gt;getId(), <span class="hljs-variable">$apiContext</span>); <span class="hljs-keyword">try</span> {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>If your request is successful, the API returns a web_profile object response that contains the profile details.</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$webProfile</span> = \PayPal\Api\WebProfile::get(<span class="hljs-variable">$createProfileResponse</span>-&gt;getId(), <span class="hljs-variable">$apiContext</span>);
} <span class="hljs-keyword">catch</span> (\PayPal\<span class="hljs-keyword">Exception</span>\PayPalConnectionException <span class="hljs-variable">$ex</span>) { } <span class="hljs-keyword">catch</span> (\PayPal\<span class="hljs-keyword">Exception</span>\PayPalConnectionException <span class="hljs-variable">$ex</span>) {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printError(<span class="hljs-string">"Get Web Profile"</span>, <span class="hljs-string">"Web Profile"</span>, <span class="hljs-variable">$webProfile</span>-&gt;getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError(<span class="hljs-string">"Get Web Profile"</span>, <span class="hljs-string">"Web Profile"</span>, <span class="hljs-variable">$webProfile</span>-&gt;getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>); <span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
} }</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printResult(<span class="hljs-string">"Get Web Profile"</span>, <span class="hljs-string">"Web Profile"</span>, <span class="hljs-variable">$webProfile</span>-&gt;getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$webProfile</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY <span class="hljs-keyword">return</span> <span class="hljs-variable">$webProfile</span>;</div></div></div></div></body></html>
ResultPrinter::printResult(<span class="hljs-string">"Get Web Profile"</span>, <span class="hljs-string">"Web Profile"</span>, <span class="hljs-variable">$webProfile</span>-&gt;getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$webProfile</span>);
<span class="hljs-keyword">return</span> <span class="hljs-variable">$webProfile</span>;</div></div></div></div></body></html>

View File

@@ -67,16 +67,11 @@ The return object contains the state and the
url to which the buyer must be redirected to url to which the buyer must be redirected to
for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> { for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
<span class="hljs-variable">$payment</span>-&gt;create(<span class="hljs-variable">$apiContext</span>); <span class="hljs-variable">$payment</span>-&gt;create(<span class="hljs-variable">$apiContext</span>);
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) { } <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printError(<span class="hljs-string">"Created Payment Authorization Using PayPal. Please visit the URL to Authorize."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError(<span class="hljs-string">"Created Payment Authorization Using PayPal. Please visit the URL to Authorize."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>); <span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3> }</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3>
<p>The API response provides the url that you must redirect <p>The API response provides the url that you must redirect
the buyer to. Retrieve the url from the $payment-&gt;getLinks() the buyer to. Retrieve the url from the $payment-&gt;getLinks()
method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>-&gt;getApprovalLink(); method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>-&gt;getApprovalLink();</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printResult(<span class="hljs-string">"Created Payment Authorization Using PayPal. Please visit the URL to Authorize."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"&lt;a href='$approvalUrl' &gt;$approvalUrl&lt;/a&gt;"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY <span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
ResultPrinter::printResult(<span class="hljs-string">"Created Payment Authorization Using PayPal. Please visit the URL to Authorize."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"&lt;a href='$approvalUrl' &gt;$approvalUrl&lt;/a&gt;"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>

View File

@@ -64,16 +64,11 @@ The return object contains the state and the
url to which the buyer must be redirected to url to which the buyer must be redirected to
for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> { for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
<span class="hljs-variable">$payment</span>-&gt;create(<span class="hljs-variable">$apiContext</span>); <span class="hljs-variable">$payment</span>-&gt;create(<span class="hljs-variable">$apiContext</span>);
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) { } <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printError(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>); <span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3> }</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3>
<p>The API response provides the url that you must redirect <p>The API response provides the url that you must redirect
the buyer to. Retrieve the url from the $payment-&gt;getApprovalLink() the buyer to. Retrieve the url from the $payment-&gt;getApprovalLink()
method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>-&gt;getApprovalLink(); method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>-&gt;getApprovalLink();</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printResult(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"&lt;a href='$approvalUrl' &gt;$approvalUrl&lt;/a&gt;"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY <span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
ResultPrinter::printResult(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"&lt;a href='$approvalUrl' &gt;$approvalUrl&lt;/a&gt;"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>

View File

@@ -64,16 +64,11 @@ The return object contains the state and the
url to which the buyer must be redirected to url to which the buyer must be redirected to
for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> { for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
<span class="hljs-variable">$payment</span>-&gt;create(<span class="hljs-variable">$apiContext</span>); <span class="hljs-variable">$payment</span>-&gt;create(<span class="hljs-variable">$apiContext</span>);
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) { } <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printError(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>); <span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3> }</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3>
<p>The API response provides the url that you must redirect <p>The API response provides the url that you must redirect
the buyer to. Retrieve the url from the $payment-&gt;getApprovalLink() the buyer to. Retrieve the url from the $payment-&gt;getApprovalLink()
method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>-&gt;getApprovalLink(); method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>-&gt;getApprovalLink();</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printResult(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"&lt;a href='$approvalUrl' &gt;$approvalUrl&lt;/a&gt;"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY <span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
ResultPrinter::printResult(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"&lt;a href='$approvalUrl' &gt;$approvalUrl&lt;/a&gt;"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>

View File

@@ -64,16 +64,11 @@ The return object contains the state and the
url to which the buyer must be redirected to url to which the buyer must be redirected to
for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> { for payment approval</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
<span class="hljs-variable">$payment</span>-&gt;create(<span class="hljs-variable">$apiContext</span>); <span class="hljs-variable">$payment</span>-&gt;create(<span class="hljs-variable">$apiContext</span>);
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) { } <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printError(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
ResultPrinter::printError(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$ex</span>);
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>); <span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3> }</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="get-redirect-url">Get redirect url</h3>
<p>The API response provides the url that you must redirect <p>The API response provides the url that you must redirect
the buyer to. Retrieve the url from the $payment-&gt;getApprovalLink() the buyer to. Retrieve the url from the $payment-&gt;getApprovalLink()
method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>-&gt;getApprovalLink(); method</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$approvalUrl</span> = <span class="hljs-variable">$payment</span>-&gt;getApprovalLink();</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printResult(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"&lt;a href='$approvalUrl' &gt;$approvalUrl&lt;/a&gt;"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY <span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
ResultPrinter::printResult(<span class="hljs-string">"Created Payment Order Using PayPal. Please visit the URL to Approve."</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-string">"&lt;a href='$approvalUrl' &gt;$approvalUrl&lt;/a&gt;"</span>, <span class="hljs-variable">$request</span>, <span class="hljs-variable">$payment</span>);
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>

View File

@@ -43,16 +43,6 @@ log.FileName=../PayPal.log
; with a warning message ; with a warning message
log.LogLevel=INFO log.LogLevel=INFO
;Validation Configuration
[validation]
; If validation is set to strict, the PayPalModel would make sure that
; there are proper accessors (Getters and Setters) for each model
; objects. Accepted value is
; 'log' : logs the error message to logger only (default)
; 'strict' : throws a php notice message
; 'disable' : disable the validation
validation.level=disable
;Caching Configuration ;Caching Configuration
[cache] [cache]
; If Cache is enabled, it stores the access token retrieved from ClientId and Secret from the ; If Cache is enabled, it stores the access token retrieved from ClientId and Secret from the

View File

@@ -13,6 +13,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object Address * Gets Json String of Object Address
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
@@ -22,6 +23,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return Address * @return Address
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return Address * @return Address
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -68,4 +71,5 @@ class AddressTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getStatus(), "TestSample"); $this->assertEquals($obj->getStatus(), "TestSample");
} }
} }

View File

@@ -0,0 +1,61 @@
<?php
namespace PayPal\Test\Api;
use PayPal\Common\PayPalModel;
use PayPal\Api\AlternatePayment;
/**
* Class AlternatePayment
*
* @package PayPal\Test\Api
*/
class AlternatePaymentTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object AlternatePayment
* @return string
*/
public static function getJson()
{
return '{"alternate_payment_account_id":"TestSample","external_customer_id":"TestSample","alternate_payment_provider_id":"TestSample"}';
}
/**
* Gets Object Instance with Json data filled in
* @return AlternatePayment
*/
public static function getObject()
{
return new AlternatePayment(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return AlternatePayment
*/
public function testSerializationDeserialization()
{
$obj = new AlternatePayment(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getAlternatePaymentAccountId());
$this->assertNotNull($obj->getExternalCustomerId());
$this->assertNotNull($obj->getAlternatePaymentProviderId());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param AlternatePayment $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getAlternatePaymentAccountId(), "TestSample");
$this->assertEquals($obj->getExternalCustomerId(), "TestSample");
$this->assertEquals($obj->getAlternatePaymentProviderId(), "TestSample");
}
}

View File

@@ -13,15 +13,17 @@ class AmountTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object Amount * Gets Json String of Object Amount
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"currency":"TestSample","total":"12.34","details":' .DetailsTest::getJson() . '}'; return '{"currency":"TestSample","total":"12.34","details":' . DetailsTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return Amount * @return Amount
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class AmountTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return Amount * @return Amount
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -56,4 +59,5 @@ class AmountTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getDetails(), DetailsTest::getObject()); $this->assertEquals($obj->getDetails(), DetailsTest::getObject());
} }
} }

View File

@@ -14,15 +14,17 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object Authorization * Gets Json String of Object Authorization
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"id":"TestSample","amount":' .AmountTest::getJson() . ',"payment_mode":"TestSample","state":"TestSample","reason_code":"TestSample","pending_reason":"TestSample","protection_eligibility":"TestSample","protection_eligibility_type":"TestSample","fmf_details":' .FmfDetailsTest::getJson() . ',"parent_payment":"TestSample","valid_until":"TestSample","create_time":"TestSample","update_time":"TestSample","links":' .LinksTest::getJson() . '}'; return '{"id":"TestSample","amount":' . AmountTest::getJson() . ',"payment_mode":"TestSample","state":"TestSample","reason_code":"TestSample","pending_reason":"TestSample","protection_eligibility":"TestSample","protection_eligibility_type":"TestSample","fmf_details":' . FmfDetailsTest::getJson() . ',"parent_payment":"TestSample","valid_until":"TestSample","create_time":"TestSample","update_time":"TestSample","links":' . LinksTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return Authorization * @return Authorization
*/ */
public static function getObject() public static function getObject()
@@ -33,6 +35,7 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return Authorization * @return Authorization
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -79,7 +82,6 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getLinks(), LinksTest::getObject()); $this->assertEquals($obj->getLinks(), LinksTest::getObject());
} }
/** /**
* @dataProvider mockProvider * @dataProvider mockProvider
* @param Authorization $obj * @param Authorization $obj
@@ -93,12 +95,13 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any()) $mockPPRestCall->expects($this->any())
->method('execute') ->method('execute')
->will($this->returnValue( ->will($this->returnValue(
AuthorizationTest::getJson() AuthorizationTest::getJson()
)); ));
$result = $obj->get("authorizationId", $mockApiContext, $mockPPRestCall); $result = $obj->get("authorizationId", $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result); $this->assertNotNull($result);
} }
/** /**
* @dataProvider mockProvider * @dataProvider mockProvider
* @param Authorization $obj * @param Authorization $obj
@@ -112,13 +115,14 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any()) $mockPPRestCall->expects($this->any())
->method('execute') ->method('execute')
->will($this->returnValue( ->will($this->returnValue(
CaptureTest::getJson() CaptureTest::getJson()
)); ));
$capture = CaptureTest::getObject(); $capture = CaptureTest::getObject();
$result = $obj->capture($capture, $mockApiContext, $mockPPRestCall); $result = $obj->capture($capture, $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result); $this->assertNotNull($result);
} }
/** /**
* @dataProvider mockProvider * @dataProvider mockProvider
* @param Authorization $obj * @param Authorization $obj
@@ -132,12 +136,13 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any()) $mockPPRestCall->expects($this->any())
->method('execute') ->method('execute')
->will($this->returnValue( ->will($this->returnValue(
self::getJson() self::getJson()
)); ));
$result = $obj->void($mockApiContext, $mockPPRestCall); $result = $obj->void($mockApiContext, $mockPPRestCall);
$this->assertNotNull($result); $this->assertNotNull($result);
} }
/** /**
* @dataProvider mockProvider * @dataProvider mockProvider
* @param Authorization $obj * @param Authorization $obj
@@ -151,7 +156,7 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any()) $mockPPRestCall->expects($this->any())
->method('execute') ->method('execute')
->will($this->returnValue( ->will($this->returnValue(
self::getJson() self::getJson()
)); ));
$result = $obj->reauthorize($mockApiContext, $mockPPRestCall); $result = $obj->reauthorize($mockApiContext, $mockPPRestCall);
@@ -162,8 +167,8 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
{ {
$obj = self::getObject(); $obj = self::getObject();
$mockApiContext = $this->getMockBuilder('ApiContext') $mockApiContext = $this->getMockBuilder('ApiContext')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
return array( return array(
array($obj, $mockApiContext), array($obj, $mockApiContext),
array($obj, null) array($obj, null)

View File

@@ -13,15 +13,17 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object BankAccount * Gets Json String of Object BankAccount
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"id":"TestSample","account_number":"TestSample","account_number_type":"TestSample","routing_number":"TestSample","account_type":"TestSample","account_name":"TestSample","check_type":"TestSample","auth_type":"TestSample","auth_capture_timestamp":"TestSample","bank_name":"TestSample","country_code":"TestSample","first_name":"TestSample","last_name":"TestSample","birth_date":"TestSample","billing_address":' .AddressTest::getJson() . ',"state":"TestSample","confirmation_status":"TestSample","payer_id":"TestSample","external_customer_id":"TestSample","merchant_id":"TestSample","create_time":"TestSample","update_time":"TestSample","valid_until":"TestSample","links":' .LinksTest::getJson() . '}'; return '{"id":"TestSample","account_number":"TestSample","account_number_type":"TestSample","routing_number":"TestSample","account_type":"TestSample","account_name":"TestSample","check_type":"TestSample","auth_type":"TestSample","auth_capture_timestamp":"TestSample","bank_name":"TestSample","country_code":"TestSample","first_name":"TestSample","last_name":"TestSample","birth_date":"TestSample","billing_address":' . AddressTest::getJson() . ',"state":"TestSample","confirmation_status":"TestSample","payer_id":"TestSample","external_customer_id":"TestSample","merchant_id":"TestSample","create_time":"TestSample","update_time":"TestSample","valid_until":"TestSample","links":' . LinksTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return BankAccount * @return BankAccount
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return BankAccount * @return BankAccount
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -98,93 +101,5 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getLinks(), LinksTest::getObject()); $this->assertEquals($obj->getLinks(), LinksTest::getObject());
} }
/**
* @dataProvider mockProvider
* @param BankAccount $obj
*/
public function testCreate($obj, $mockApiContext)
{
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
->disableOriginalConstructor()
->getMock();
$mockPayPalRestCall->expects($this->any())
->method('execute')
->will($this->returnValue(
self::getJson()
));
$result = $obj->create($mockApiContext, $mockPayPalRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param BankAccount $obj
*/
public function testGet($obj, $mockApiContext)
{
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
->disableOriginalConstructor()
->getMock();
$mockPayPalRestCall->expects($this->any())
->method('execute')
->will($this->returnValue(
BankAccountTest::getJson()
));
$result = $obj->get("bankAccountId", $mockApiContext, $mockPayPalRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param BankAccount $obj
*/
public function testDelete($obj, $mockApiContext)
{
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
->disableOriginalConstructor()
->getMock();
$mockPayPalRestCall->expects($this->any())
->method('execute')
->will($this->returnValue(
true
));
$result = $obj->delete($mockApiContext, $mockPayPalRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param BankAccount $obj
*/
public function testUpdate($obj, $mockApiContext)
{
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
->disableOriginalConstructor()
->getMock();
$mockPayPalRestCall->expects($this->any())
->method('execute')
->will($this->returnValue(
self::getJson()
));
$patchRequest = PatchRequestTest::getObject();
$result = $obj->update($patchRequest, $mockApiContext, $mockPayPalRestCall);
$this->assertNotNull($result);
}
public function mockProvider()
{
$obj = self::getObject();
$mockApiContext = $this->getMockBuilder('ApiContext')
->disableOriginalConstructor()
->getMock();
return array(
array($obj, $mockApiContext),
array($obj, null)
);
}
} }

View File

@@ -13,6 +13,7 @@ class BankTokenTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object BankToken * Gets Json String of Object BankToken
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
@@ -22,6 +23,7 @@ class BankTokenTest extends \PHPUnit_Framework_TestCase
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return BankToken * @return BankToken
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class BankTokenTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return BankToken * @return BankToken
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -56,4 +59,5 @@ class BankTokenTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getMandateReferenceNumber(), "TestSample"); $this->assertEquals($obj->getMandateReferenceNumber(), "TestSample");
} }
} }

View File

@@ -0,0 +1,57 @@
<?php
namespace PayPal\Test\Api;
use PayPal\Common\PayPalModel;
use PayPal\Api\Billing;
/**
* Class Billing
*
* @package PayPal\Test\Api
*/
class BillingTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object Billing
* @return string
*/
public static function getJson()
{
return '{"billing_agreement_id":"TestSample"}';
}
/**
* Gets Object Instance with Json data filled in
* @return Billing
*/
public static function getObject()
{
return new Billing(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return Billing
*/
public function testSerializationDeserialization()
{
$obj = new Billing(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getBillingAgreementId());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param Billing $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getBillingAgreementId(), "TestSample");
}
}

View File

@@ -14,15 +14,17 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object Capture * Gets Json String of Object Capture
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"id":"TestSample","amount":' .AmountTest::getJson() . ',"is_final_capture":true,"state":"TestSample","parent_payment":"TestSample","transaction_fee":' .CurrencyTest::getJson() . ',"create_time":"TestSample","update_time":"TestSample","links":' .LinksTest::getJson() . '}'; return '{"id":"TestSample","amount":' . AmountTest::getJson() . ',"is_final_capture":true,"state":"TestSample","parent_payment":"TestSample","transaction_fee":' . CurrencyTest::getJson() . ',"create_time":"TestSample","update_time":"TestSample","links":' . LinksTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return Capture * @return Capture
*/ */
public static function getObject() public static function getObject()
@@ -33,6 +35,7 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return Capture * @return Capture
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -69,7 +72,6 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getLinks(), LinksTest::getObject()); $this->assertEquals($obj->getLinks(), LinksTest::getObject());
} }
/** /**
* @dataProvider mockProvider * @dataProvider mockProvider
* @param Capture $obj * @param Capture $obj
@@ -83,12 +85,13 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any()) $mockPPRestCall->expects($this->any())
->method('execute') ->method('execute')
->will($this->returnValue( ->will($this->returnValue(
CaptureTest::getJson() CaptureTest::getJson()
)); ));
$result = $obj->get("captureId", $mockApiContext, $mockPPRestCall); $result = $obj->get("captureId", $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result); $this->assertNotNull($result);
} }
/** /**
* @dataProvider mockProvider * @dataProvider mockProvider
* @param Capture $obj * @param Capture $obj
@@ -102,7 +105,7 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any()) $mockPPRestCall->expects($this->any())
->method('execute') ->method('execute')
->will($this->returnValue( ->will($this->returnValue(
RefundTest::getJson() RefundTest::getJson()
)); ));
$refund = RefundTest::getObject(); $refund = RefundTest::getObject();
@@ -114,8 +117,8 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
{ {
$obj = self::getObject(); $obj = self::getObject();
$mockApiContext = $this->getMockBuilder('ApiContext') $mockApiContext = $this->getMockBuilder('ApiContext')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
return array( return array(
array($obj, $mockApiContext), array($obj, $mockApiContext),
array($obj, null) array($obj, null)

View File

@@ -0,0 +1,65 @@
<?php
namespace PayPal\Test\Api;
use PayPal\Common\PayPalModel;
use PayPal\Api\CarrierAccount;
/**
* Class CarrierAccount
*
* @package PayPal\Test\Api
*/
class CarrierAccountTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object CarrierAccount
* @return string
*/
public static function getJson()
{
return '{"id":"TestSample","phone_number":"TestSample","external_customer_id":"TestSample","phone_source":"TestSample","country_code":' .CountryCodeTest::getJson() . '}';
}
/**
* Gets Object Instance with Json data filled in
* @return CarrierAccount
*/
public static function getObject()
{
return new CarrierAccount(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return CarrierAccount
*/
public function testSerializationDeserialization()
{
$obj = new CarrierAccount(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getId());
$this->assertNotNull($obj->getPhoneNumber());
$this->assertNotNull($obj->getExternalCustomerId());
$this->assertNotNull($obj->getPhoneSource());
$this->assertNotNull($obj->getCountryCode());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param CarrierAccount $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getId(), "TestSample");
$this->assertEquals($obj->getPhoneNumber(), "TestSample");
$this->assertEquals($obj->getExternalCustomerId(), "TestSample");
$this->assertEquals($obj->getPhoneSource(), "TestSample");
$this->assertEquals($obj->getCountryCode(), CountryCodeTest::getObject());
}
}

View File

@@ -13,6 +13,7 @@ class CarrierAccountTokenTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object CarrierAccountToken * Gets Json String of Object CarrierAccountToken
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
@@ -22,6 +23,7 @@ class CarrierAccountTokenTest extends \PHPUnit_Framework_TestCase
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return CarrierAccountToken * @return CarrierAccountToken
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class CarrierAccountTokenTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return CarrierAccountToken * @return CarrierAccountToken
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -53,4 +56,6 @@ class CarrierAccountTokenTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getCarrierAccountId(), "TestSample"); $this->assertEquals($obj->getCarrierAccountId(), "TestSample");
$this->assertEquals($obj->getExternalCustomerId(), "TestSample"); $this->assertEquals($obj->getExternalCustomerId(), "TestSample");
} }
} }

View File

@@ -13,15 +13,17 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object CartBase * Gets Json String of Object CartBase
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"amount":' .AmountTest::getJson() . ',"payee":' .PayeeTest::getJson() . ',"description":"TestSample","note_to_payee":"TestSample","custom":"TestSample","invoice_number":"TestSample","soft_descriptor":"TestSample","payment_options":' .PaymentOptionsTest::getJson() . ',"item_list":' .ItemListTest::getJson() . ',"notify_url":"http://www.google.com","order_url":"http://www.google.com"}'; return '{"reference_id":"TestSample","amount":' . AmountTest::getJson() . ',"payee":' . PayeeTest::getJson() . ',"description":"TestSample","note_to_payee":"TestSample","custom":"TestSample","invoice_number":"TestSample","soft_descriptor":"TestSample","soft_descriptor_city":"TestSample","payment_options":' . PaymentOptionsTest::getJson() . ',"item_list":' . ItemListTest::getJson() . ',"notify_url":"http://www.google.com","order_url":"http://www.google.com","external_funding":' . ExternalFundingTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return CartBase * @return CartBase
*/ */
public static function getObject() public static function getObject()
@@ -32,12 +34,14 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return CartBase * @return CartBase
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
{ {
$obj = new CartBase(self::getJson()); $obj = new CartBase(self::getJson());
$this->assertNotNull($obj); $this->assertNotNull($obj);
$this->assertNotNull($obj->getReferenceId());
$this->assertNotNull($obj->getAmount()); $this->assertNotNull($obj->getAmount());
$this->assertNotNull($obj->getPayee()); $this->assertNotNull($obj->getPayee());
$this->assertNotNull($obj->getDescription()); $this->assertNotNull($obj->getDescription());
@@ -45,10 +49,12 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj->getCustom()); $this->assertNotNull($obj->getCustom());
$this->assertNotNull($obj->getInvoiceNumber()); $this->assertNotNull($obj->getInvoiceNumber());
$this->assertNotNull($obj->getSoftDescriptor()); $this->assertNotNull($obj->getSoftDescriptor());
$this->assertNotNull($obj->getSoftDescriptorCity());
$this->assertNotNull($obj->getPaymentOptions()); $this->assertNotNull($obj->getPaymentOptions());
$this->assertNotNull($obj->getItemList()); $this->assertNotNull($obj->getItemList());
$this->assertNotNull($obj->getNotifyUrl()); $this->assertNotNull($obj->getNotifyUrl());
$this->assertNotNull($obj->getOrderUrl()); $this->assertNotNull($obj->getOrderUrl());
$this->assertNotNull($obj->getExternalFunding());
$this->assertEquals(self::getJson(), $obj->toJson()); $this->assertEquals(self::getJson(), $obj->toJson());
return $obj; return $obj;
} }
@@ -59,6 +65,7 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
*/ */
public function testGetters($obj) public function testGetters($obj)
{ {
$this->assertEquals($obj->getReferenceId(), "TestSample");
$this->assertEquals($obj->getAmount(), AmountTest::getObject()); $this->assertEquals($obj->getAmount(), AmountTest::getObject());
$this->assertEquals($obj->getPayee(), PayeeTest::getObject()); $this->assertEquals($obj->getPayee(), PayeeTest::getObject());
$this->assertEquals($obj->getDescription(), "TestSample"); $this->assertEquals($obj->getDescription(), "TestSample");
@@ -66,10 +73,12 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getCustom(), "TestSample"); $this->assertEquals($obj->getCustom(), "TestSample");
$this->assertEquals($obj->getInvoiceNumber(), "TestSample"); $this->assertEquals($obj->getInvoiceNumber(), "TestSample");
$this->assertEquals($obj->getSoftDescriptor(), "TestSample"); $this->assertEquals($obj->getSoftDescriptor(), "TestSample");
$this->assertEquals($obj->getSoftDescriptorCity(), "TestSample");
$this->assertEquals($obj->getPaymentOptions(), PaymentOptionsTest::getObject()); $this->assertEquals($obj->getPaymentOptions(), PaymentOptionsTest::getObject());
$this->assertEquals($obj->getItemList(), ItemListTest::getObject()); $this->assertEquals($obj->getItemList(), ItemListTest::getObject());
$this->assertEquals($obj->getNotifyUrl(), "http://www.google.com"); $this->assertEquals($obj->getNotifyUrl(), "http://www.google.com");
$this->assertEquals($obj->getOrderUrl(), "http://www.google.com"); $this->assertEquals($obj->getOrderUrl(), "http://www.google.com");
$this->assertEquals($obj->getExternalFunding(), ExternalFundingTest::getObject());
} }
/** /**
@@ -81,6 +90,7 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
$obj = new CartBase(); $obj = new CartBase();
$obj->setNotifyUrl(null); $obj->setNotifyUrl(null);
} }
/** /**
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
* @expectedExceptionMessage OrderUrl is not a fully qualified URL * @expectedExceptionMessage OrderUrl is not a fully qualified URL
@@ -90,4 +100,5 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
$obj = new CartBase(); $obj = new CartBase();
$obj->setOrderUrl(null); $obj->setOrderUrl(null);
} }
} }

View File

@@ -0,0 +1,57 @@
<?php
namespace PayPal\Test\Api;
use PayPal\Common\PayPalModel;
use PayPal\Api\CountryCode;
/**
* Class CountryCode
*
* @package PayPal\Test\Api
*/
class CountryCodeTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object CountryCode
* @return string
*/
public static function getJson()
{
return '{"country_code":"TestSample"}';
}
/**
* Gets Object Instance with Json data filled in
* @return CountryCode
*/
public static function getObject()
{
return new CountryCode(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return CountryCode
*/
public function testSerializationDeserialization()
{
$obj = new CountryCode(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getCountryCode());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param CountryCode $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getCountryCode(), "TestSample");
}
}

View File

@@ -3,7 +3,6 @@
namespace PayPal\Test\Api; namespace PayPal\Test\Api;
use PayPal\Api\CreditCard; use PayPal\Api\CreditCard;
use PayPal\Transport\PPRestCall;
/** /**
* Class CreditCard * Class CreditCard
@@ -14,15 +13,17 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object CreditCard * Gets Json String of Object CreditCard
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"id":"TestSample","number":"TestSample","type":"TestSample","expire_month":123,"expire_year":123,"cvv2":"TestSample","first_name":"TestSample","last_name":"TestSample","billing_address":' .AddressTest::getJson() . ',"external_customer_id":"TestSample","merchant_id":"TestSample","payer_id":"TestSample","external_card_id":"TestSample","state":"TestSample","create_time":"TestSample","update_time":"TestSample","valid_until":"TestSample","links":' .LinksTest::getJson() . '}'; return '{"id":"TestSample","number":"TestSample","type":"TestSample","expire_month":123,"expire_year":123,"cvv2":"TestSample","first_name":"TestSample","last_name":"TestSample","billing_address":' . AddressTest::getJson() . ',"external_customer_id":"TestSample","state":"TestSample","valid_until":"TestSample","links":' . LinksTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return CreditCard * @return CreditCard
*/ */
public static function getObject() public static function getObject()
@@ -33,6 +34,7 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return CreditCard * @return CreditCard
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -49,12 +51,7 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj->getLastName()); $this->assertNotNull($obj->getLastName());
$this->assertNotNull($obj->getBillingAddress()); $this->assertNotNull($obj->getBillingAddress());
$this->assertNotNull($obj->getExternalCustomerId()); $this->assertNotNull($obj->getExternalCustomerId());
$this->assertNotNull($obj->getMerchantId());
$this->assertNotNull($obj->getPayerId());
$this->assertNotNull($obj->getExternalCardId());
$this->assertNotNull($obj->getState()); $this->assertNotNull($obj->getState());
$this->assertNotNull($obj->getCreateTime());
$this->assertNotNull($obj->getUpdateTime());
$this->assertNotNull($obj->getValidUntil()); $this->assertNotNull($obj->getValidUntil());
$this->assertNotNull($obj->getLinks()); $this->assertNotNull($obj->getLinks());
$this->assertEquals(self::getJson(), $obj->toJson()); $this->assertEquals(self::getJson(), $obj->toJson());
@@ -77,123 +74,10 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getLastName(), "TestSample"); $this->assertEquals($obj->getLastName(), "TestSample");
$this->assertEquals($obj->getBillingAddress(), AddressTest::getObject()); $this->assertEquals($obj->getBillingAddress(), AddressTest::getObject());
$this->assertEquals($obj->getExternalCustomerId(), "TestSample"); $this->assertEquals($obj->getExternalCustomerId(), "TestSample");
$this->assertEquals($obj->getMerchantId(), "TestSample");
$this->assertEquals($obj->getPayerId(), "TestSample");
$this->assertEquals($obj->getExternalCardId(), "TestSample");
$this->assertEquals($obj->getState(), "TestSample"); $this->assertEquals($obj->getState(), "TestSample");
$this->assertEquals($obj->getCreateTime(), "TestSample");
$this->assertEquals($obj->getUpdateTime(), "TestSample");
$this->assertEquals($obj->getValidUntil(), "TestSample"); $this->assertEquals($obj->getValidUntil(), "TestSample");
$this->assertEquals($obj->getLinks(), LinksTest::getObject()); $this->assertEquals($obj->getLinks(), LinksTest::getObject());
} }
/**
* @dataProvider mockProvider
* @param CreditCard $obj
*/
public function testCreate($obj, $mockApiContext)
{
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
->disableOriginalConstructor()
->getMock();
$mockPPRestCall->expects($this->any())
->method('execute')
->will($this->returnValue(
self::getJson()
));
$result = $obj->create($mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param CreditCard $obj
*/
public function testGet($obj, $mockApiContext)
{
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
->disableOriginalConstructor()
->getMock();
$mockPPRestCall->expects($this->any())
->method('execute')
->will($this->returnValue(
CreditCardTest::getJson()
));
$result = $obj->get("creditCardId", $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param CreditCard $obj
*/
public function testDelete($obj, $mockApiContext)
{
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
->disableOriginalConstructor()
->getMock();
$mockPPRestCall->expects($this->any())
->method('execute')
->will($this->returnValue(
true
));
$result = $obj->delete($mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param CreditCard $obj
*/
public function testUpdate($obj, $mockApiContext)
{
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
->disableOriginalConstructor()
->getMock();
$mockPPRestCall->expects($this->any())
->method('execute')
->will($this->returnValue(
self::getJson()
));
$patchRequest = PatchRequestTest::getObject();
$result = $obj->update($patchRequest, $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param CreditCard $obj
*/
public function testList($obj, $mockApiContext)
{
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
->disableOriginalConstructor()
->getMock();
$mockPPRestCall->expects($this->any())
->method('execute')
->will($this->returnValue(
CreditCardListTest::getJson()
));
$params = array();
$result = $obj->all($params, $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
public function mockProvider()
{
$obj = self::getObject();
$mockApiContext = $this->getMockBuilder('ApiContext')
->disableOriginalConstructor()
->getMock();
return array(
array($obj, $mockApiContext),
array($obj, null)
);
}
} }

View File

@@ -13,6 +13,7 @@ class CreditCardTokenTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object CreditCardToken * Gets Json String of Object CreditCardToken
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
@@ -22,6 +23,7 @@ class CreditCardTokenTest extends \PHPUnit_Framework_TestCase
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return CreditCardToken * @return CreditCardToken
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class CreditCardTokenTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return CreditCardToken * @return CreditCardToken
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -62,4 +65,5 @@ class CreditCardTokenTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getExpireYear(), 123); $this->assertEquals($obj->getExpireYear(), 123);
} }
} }

View File

@@ -0,0 +1,67 @@
<?php
namespace PayPal\Test\Api;
use PayPal\Common\PayPalModel;
use PayPal\Api\CreditFinancingOffered;
/**
* Class CreditFinancingOffered
*
* @package PayPal\Test\Api
*/
class CreditFinancingOfferedTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object CreditFinancingOffered
* @return string
*/
public static function getJson()
{
return '{"total_cost":' .CurrencyTest::getJson() . ',"term":"12.34","monthly_payment":' .CurrencyTest::getJson() . ',"total_interest":' .CurrencyTest::getJson() . ',"payer_acceptance":true,"cart_amount_immutable":true}';
}
/**
* Gets Object Instance with Json data filled in
* @return CreditFinancingOffered
*/
public static function getObject()
{
return new CreditFinancingOffered(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return CreditFinancingOffered
*/
public function testSerializationDeserialization()
{
$obj = new CreditFinancingOffered(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getTotalCost());
$this->assertNotNull($obj->getTerm());
$this->assertNotNull($obj->getMonthlyPayment());
$this->assertNotNull($obj->getTotalInterest());
$this->assertNotNull($obj->getPayerAcceptance());
$this->assertNotNull($obj->getCartAmountImmutable());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param CreditFinancingOffered $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getTotalCost(), CurrencyTest::getObject());
$this->assertEquals($obj->getTerm(), "12.34");
$this->assertEquals($obj->getMonthlyPayment(), CurrencyTest::getObject());
$this->assertEquals($obj->getTotalInterest(), CurrencyTest::getObject());
$this->assertEquals($obj->getPayerAcceptance(), true);
$this->assertEquals($obj->getCartAmountImmutable(), true);
}
}

View File

@@ -13,6 +13,7 @@ class CreditTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object Credit * Gets Json String of Object Credit
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
@@ -22,6 +23,7 @@ class CreditTest extends \PHPUnit_Framework_TestCase
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return Credit * @return Credit
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class CreditTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return Credit * @return Credit
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -54,4 +57,5 @@ class CreditTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getType(), "TestSample"); $this->assertEquals($obj->getType(), "TestSample");
} }
} }

View File

@@ -13,15 +13,17 @@ class CurrencyConversionTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object CurrencyConversion * Gets Json String of Object CurrencyConversion
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"conversion_date":"TestSample","from_currency":"TestSample","from_amount":"TestSample","to_currency":"TestSample","to_amount":"TestSample","conversion_type":"TestSample","conversion_type_changeable":true,"web_url":"http://www.google.com","links":' .LinksTest::getJson() . '}'; return '{"conversion_date":"TestSample","from_currency":"TestSample","from_amount":"TestSample","to_currency":"TestSample","to_amount":"TestSample","conversion_type":"TestSample","conversion_type_changeable":true,"web_url":"http://www.google.com","links":' . LinksTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return CurrencyConversion * @return CurrencyConversion
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class CurrencyConversionTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return CurrencyConversion * @return CurrencyConversion
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()

View File

@@ -13,6 +13,7 @@ class CurrencyTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object Currency * Gets Json String of Object Currency
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
@@ -22,6 +23,7 @@ class CurrencyTest extends \PHPUnit_Framework_TestCase
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return Currency * @return Currency
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class CurrencyTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return Currency * @return Currency
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -54,4 +57,5 @@ class CurrencyTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getValue(), "12.34"); $this->assertEquals($obj->getValue(), "12.34");
} }
} }

View File

@@ -13,6 +13,7 @@ class DetailsTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object Details * Gets Json String of Object Details
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
@@ -22,6 +23,7 @@ class DetailsTest extends \PHPUnit_Framework_TestCase
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return Details * @return Details
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class DetailsTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return Details * @return Details
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -65,4 +68,6 @@ class DetailsTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getGiftWrap(), "12.34"); $this->assertEquals($obj->getGiftWrap(), "12.34");
$this->assertEquals($obj->getFee(), "12.34"); $this->assertEquals($obj->getFee(), "12.34");
} }
} }

View File

@@ -13,6 +13,7 @@ class ErrorDetailsTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object ErrorDetails * Gets Json String of Object ErrorDetails
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
@@ -22,6 +23,7 @@ class ErrorDetailsTest extends \PHPUnit_Framework_TestCase
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return ErrorDetails * @return ErrorDetails
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class ErrorDetailsTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return ErrorDetails * @return ErrorDetails
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -58,4 +61,5 @@ class ErrorDetailsTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getCode(), "TestSample"); $this->assertEquals($obj->getCode(), "TestSample");
} }
} }

View File

@@ -13,15 +13,17 @@ class ErrorTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object Error * Gets Json String of Object Error
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"name":"TestSample","purchase_unit_reference_id":"TestSample","debug_id":"TestSample","message":"TestSample","code":"TestSample","information_link":"TestSample","details":' .ErrorDetailsTest::getJson() . ',"links":' .LinksTest::getJson() . '}'; return '{"name":"TestSample","purchase_unit_reference_id":"TestSample","message":"TestSample","code":"TestSample","details":' . ErrorDetailsTest::getJson() . ',"processor_response":' . ProcessorResponseTest::getJson() . ',"fmf_details":' . FmfDetailsTest::getJson() . ',"information_link":"TestSample","debug_id":"TestSample","links":' . LinksTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return Error * @return Error
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class ErrorTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return Error * @return Error
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -40,11 +43,13 @@ class ErrorTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj); $this->assertNotNull($obj);
$this->assertNotNull($obj->getName()); $this->assertNotNull($obj->getName());
$this->assertNotNull($obj->getPurchaseUnitReferenceId()); $this->assertNotNull($obj->getPurchaseUnitReferenceId());
$this->assertNotNull($obj->getDebugId());
$this->assertNotNull($obj->getMessage()); $this->assertNotNull($obj->getMessage());
$this->assertNotNull($obj->getCode()); $this->assertNotNull($obj->getCode());
$this->assertNotNull($obj->getInformationLink());
$this->assertNotNull($obj->getDetails()); $this->assertNotNull($obj->getDetails());
$this->assertNotNull($obj->getProcessorResponse());
$this->assertNotNull($obj->getFmfDetails());
$this->assertNotNull($obj->getInformationLink());
$this->assertNotNull($obj->getDebugId());
$this->assertNotNull($obj->getLinks()); $this->assertNotNull($obj->getLinks());
$this->assertEquals(self::getJson(), $obj->toJson()); $this->assertEquals(self::getJson(), $obj->toJson());
return $obj; return $obj;
@@ -58,12 +63,15 @@ class ErrorTest extends \PHPUnit_Framework_TestCase
{ {
$this->assertEquals($obj->getName(), "TestSample"); $this->assertEquals($obj->getName(), "TestSample");
$this->assertEquals($obj->getPurchaseUnitReferenceId(), "TestSample"); $this->assertEquals($obj->getPurchaseUnitReferenceId(), "TestSample");
$this->assertEquals($obj->getDebugId(), "TestSample");
$this->assertEquals($obj->getMessage(), "TestSample"); $this->assertEquals($obj->getMessage(), "TestSample");
$this->assertEquals($obj->getCode(), "TestSample"); $this->assertEquals($obj->getCode(), "TestSample");
$this->assertEquals($obj->getInformationLink(), "TestSample");
$this->assertEquals($obj->getDetails(), ErrorDetailsTest::getObject()); $this->assertEquals($obj->getDetails(), ErrorDetailsTest::getObject());
$this->assertEquals($obj->getProcessorResponse(), ProcessorResponseTest::getObject());
$this->assertEquals($obj->getFmfDetails(), FmfDetailsTest::getObject());
$this->assertEquals($obj->getInformationLink(), "TestSample");
$this->assertEquals($obj->getDebugId(), "TestSample");
$this->assertEquals($obj->getLinks(), LinksTest::getObject()); $this->assertEquals($obj->getLinks(), LinksTest::getObject());
} }
} }

View File

@@ -13,6 +13,7 @@ class ExtendedBankAccountTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object ExtendedBankAccount * Gets Json String of Object ExtendedBankAccount
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
@@ -22,6 +23,7 @@ class ExtendedBankAccountTest extends \PHPUnit_Framework_TestCase
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return ExtendedBankAccount * @return ExtendedBankAccount
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class ExtendedBankAccountTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return ExtendedBankAccount * @return ExtendedBankAccount
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -52,4 +55,5 @@ class ExtendedBankAccountTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getMandateReferenceNumber(), "TestSample"); $this->assertEquals($obj->getMandateReferenceNumber(), "TestSample");
} }
} }

View File

@@ -0,0 +1,65 @@
<?php
namespace PayPal\Test\Api;
use PayPal\Common\PayPalModel;
use PayPal\Api\ExternalFunding;
/**
* Class ExternalFunding
*
* @package PayPal\Test\Api
*/
class ExternalFundingTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object ExternalFunding
* @return string
*/
public static function getJson()
{
return '{"reference_id":"TestSample","code":"TestSample","funding_account_id":"TestSample","display_text":"TestSample","amount":' .AmountTest::getJson() . '}';
}
/**
* Gets Object Instance with Json data filled in
* @return ExternalFunding
*/
public static function getObject()
{
return new ExternalFunding(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return ExternalFunding
*/
public function testSerializationDeserialization()
{
$obj = new ExternalFunding(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getReferenceId());
$this->assertNotNull($obj->getCode());
$this->assertNotNull($obj->getFundingAccountId());
$this->assertNotNull($obj->getDisplayText());
$this->assertNotNull($obj->getAmount());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param ExternalFunding $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getReferenceId(), "TestSample");
$this->assertEquals($obj->getCode(), "TestSample");
$this->assertEquals($obj->getFundingAccountId(), "TestSample");
$this->assertEquals($obj->getDisplayText(), "TestSample");
$this->assertEquals($obj->getAmount(), AmountTest::getObject());
}
}

View File

@@ -13,6 +13,7 @@ class FmfDetailsTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object FmfDetails * Gets Json String of Object FmfDetails
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
@@ -22,6 +23,7 @@ class FmfDetailsTest extends \PHPUnit_Framework_TestCase
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return FmfDetails * @return FmfDetails
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class FmfDetailsTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return FmfDetails * @return FmfDetails
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -58,4 +61,5 @@ class FmfDetailsTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getDescription(), "TestSample"); $this->assertEquals($obj->getDescription(), "TestSample");
} }
} }

View File

@@ -13,15 +13,17 @@ class FundingDetailTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object FundingDetail * Gets Json String of Object FundingDetail
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"clearing_time":"TestSample","payment_hold_date":"TestSample"}'; return '{"clearing_time":"TestSample","payment_hold_date":"TestSample","payment_debit_date":"TestSample","processing_type":"TestSample"}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return FundingDetail * @return FundingDetail
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class FundingDetailTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return FundingDetail * @return FundingDetail
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -40,6 +43,8 @@ class FundingDetailTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj); $this->assertNotNull($obj);
$this->assertNotNull($obj->getClearingTime()); $this->assertNotNull($obj->getClearingTime());
$this->assertNotNull($obj->getPaymentHoldDate()); $this->assertNotNull($obj->getPaymentHoldDate());
$this->assertNotNull($obj->getPaymentDebitDate());
$this->assertNotNull($obj->getProcessingType());
$this->assertEquals(self::getJson(), $obj->toJson()); $this->assertEquals(self::getJson(), $obj->toJson());
return $obj; return $obj;
} }
@@ -52,6 +57,9 @@ class FundingDetailTest extends \PHPUnit_Framework_TestCase
{ {
$this->assertEquals($obj->getClearingTime(), "TestSample"); $this->assertEquals($obj->getClearingTime(), "TestSample");
$this->assertEquals($obj->getPaymentHoldDate(), "TestSample"); $this->assertEquals($obj->getPaymentHoldDate(), "TestSample");
$this->assertEquals($obj->getPaymentDebitDate(), "TestSample");
$this->assertEquals($obj->getProcessingType(), "TestSample");
} }
} }

View File

@@ -13,15 +13,17 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object FundingInstrument * Gets Json String of Object FundingInstrument
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"credit_card":' .CreditCardTest::getJson() . ',"credit_card_token":' .CreditCardTokenTest::getJson() . ',"payment_card":' .PaymentCardTest::getJson() . ',"payment_card_token":' .PaymentCardTokenTest::getJson() . ',"bank_account":' .ExtendedBankAccountTest::getJson() . ',"bank_account_token":' .BankTokenTest::getJson() . ',"credit":' .CreditTest::getJson() . '}'; return '{"credit_card":' . CreditCardTest::getJson() . ',"credit_card_token":' . CreditCardTokenTest::getJson() . ',"payment_card":' . PaymentCardTest::getJson() . ',"bank_account":' . ExtendedBankAccountTest::getJson() . ',"bank_account_token":' . BankTokenTest::getJson() . ',"credit":' . CreditTest::getJson() . ',"incentive":' . IncentiveTest::getJson() . ',"external_funding":' . ExternalFundingTest::getJson() . ',"carrier_account_token":' . CarrierAccountTokenTest::getJson() . ',"carrier_account":' . CarrierAccountTest::getJson() . ',"private_label_card":' . PrivateLabelCardTest::getJson() . ',"billing":' . BillingTest::getJson() . ',"alternate_payment":' . AlternatePaymentTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return FundingInstrument * @return FundingInstrument
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return FundingInstrument * @return FundingInstrument
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -41,10 +44,16 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj->getCreditCard()); $this->assertNotNull($obj->getCreditCard());
$this->assertNotNull($obj->getCreditCardToken()); $this->assertNotNull($obj->getCreditCardToken());
$this->assertNotNull($obj->getPaymentCard()); $this->assertNotNull($obj->getPaymentCard());
$this->assertNotNull($obj->getPaymentCardToken());
$this->assertNotNull($obj->getBankAccount()); $this->assertNotNull($obj->getBankAccount());
$this->assertNotNull($obj->getBankAccountToken()); $this->assertNotNull($obj->getBankAccountToken());
$this->assertNotNull($obj->getCredit()); $this->assertNotNull($obj->getCredit());
$this->assertNotNull($obj->getIncentive());
$this->assertNotNull($obj->getExternalFunding());
$this->assertNotNull($obj->getCarrierAccountToken());
$this->assertNotNull($obj->getCarrierAccount());
$this->assertNotNull($obj->getPrivateLabelCard());
$this->assertNotNull($obj->getBilling());
$this->assertNotNull($obj->getAlternatePayment());
$this->assertEquals(self::getJson(), $obj->toJson()); $this->assertEquals(self::getJson(), $obj->toJson());
return $obj; return $obj;
} }
@@ -58,10 +67,16 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getCreditCard(), CreditCardTest::getObject()); $this->assertEquals($obj->getCreditCard(), CreditCardTest::getObject());
$this->assertEquals($obj->getCreditCardToken(), CreditCardTokenTest::getObject()); $this->assertEquals($obj->getCreditCardToken(), CreditCardTokenTest::getObject());
$this->assertEquals($obj->getPaymentCard(), PaymentCardTest::getObject()); $this->assertEquals($obj->getPaymentCard(), PaymentCardTest::getObject());
$this->assertEquals($obj->getPaymentCardToken(), PaymentCardTokenTest::getObject());
$this->assertEquals($obj->getBankAccount(), ExtendedBankAccountTest::getObject()); $this->assertEquals($obj->getBankAccount(), ExtendedBankAccountTest::getObject());
$this->assertEquals($obj->getBankAccountToken(), BankTokenTest::getObject()); $this->assertEquals($obj->getBankAccountToken(), BankTokenTest::getObject());
$this->assertEquals($obj->getCredit(), CreditTest::getObject()); $this->assertEquals($obj->getCredit(), CreditTest::getObject());
$this->assertEquals($obj->getIncentive(), IncentiveTest::getObject());
$this->assertEquals($obj->getExternalFunding(), ExternalFundingTest::getObject());
$this->assertEquals($obj->getCarrierAccountToken(), CarrierAccountTokenTest::getObject());
$this->assertEquals($obj->getCarrierAccount(), CarrierAccountTest::getObject());
$this->assertEquals($obj->getPrivateLabelCard(), PrivateLabelCardTest::getObject());
$this->assertEquals($obj->getBilling(), BillingTest::getObject());
$this->assertEquals($obj->getAlternatePayment(), AlternatePaymentTest::getObject());
} }

View File

@@ -13,15 +13,17 @@ class FundingOptionTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object FundingOption * Gets Json String of Object FundingOption
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"id":"TestSample","funding_sources":' .FundingSourceTest::getJson() . ',"backup_funding_instrument":' .FundingInstrumentTest::getJson() . ',"currency_conversion":' .CurrencyConversionTest::getJson() . ',"installment_info":' .InstallmentInfoTest::getJson() . ',"links":' .LinksTest::getJson() . '}'; return '{"id":"TestSample","funding_sources":' . FundingSourceTest::getJson() . ',"backup_funding_instrument":' . FundingInstrumentTest::getJson() . ',"currency_conversion":' . CurrencyConversionTest::getJson() . ',"installment_info":' . InstallmentInfoTest::getJson() . ',"links":' . LinksTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return FundingOption * @return FundingOption
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class FundingOptionTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return FundingOption * @return FundingOption
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -61,4 +64,6 @@ class FundingOptionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getInstallmentInfo(), InstallmentInfoTest::getObject()); $this->assertEquals($obj->getInstallmentInfo(), InstallmentInfoTest::getObject());
$this->assertEquals($obj->getLinks(), LinksTest::getObject()); $this->assertEquals($obj->getLinks(), LinksTest::getObject());
} }
} }

View File

@@ -13,15 +13,17 @@ class FundingSourceTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object FundingSource * Gets Json String of Object FundingSource
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"funding_mode":"TestSample","funding_instrument_type":"TestSample","soft_descriptor":"TestSample","amount":' .CurrencyTest::getJson() . ',"legal_text":"TestSample","funding_detail":' .FundingDetailTest::getJson() . ',"additional_text":"TestSample","extends":' .FundingInstrumentTest::getJson() . ',"links":' .LinksTest::getJson() . '}'; return '{"funding_mode":"TestSample","funding_instrument_type":"TestSample","soft_descriptor":"TestSample","amount":' . CurrencyTest::getJson() . ',"legal_text":"TestSample","funding_detail":' . FundingDetailTest::getJson() . ',"additional_text":"TestSample","extends":' . FundingInstrumentTest::getJson() . ',"links":' . LinksTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return FundingSource * @return FundingSource
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class FundingSourceTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return FundingSource * @return FundingSource
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -67,4 +70,6 @@ class FundingSourceTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getExtends(), FundingInstrumentTest::getObject()); $this->assertEquals($obj->getExtends(), FundingInstrumentTest::getObject());
$this->assertEquals($obj->getLinks(), LinksTest::getObject()); $this->assertEquals($obj->getLinks(), LinksTest::getObject());
} }
} }

View File

@@ -13,15 +13,17 @@ class IncentiveTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object Incentive * Gets Json String of Object Incentive
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"id":"TestSample","code":"TestSample","name":"TestSample","description":"TestSample","minimum_purchase_amount":' .CurrencyTest::getJson() . ',"logo_image_url":"http://www.google.com","expiry_date":"TestSample","type":"TestSample","terms":"TestSample"}'; return '{"id":"TestSample","code":"TestSample","name":"TestSample","description":"TestSample","minimum_purchase_amount":' . CurrencyTest::getJson() . ',"logo_image_url":"http://www.google.com","expiry_date":"TestSample","type":"TestSample","terms":"TestSample"}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return Incentive * @return Incentive
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class IncentiveTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return Incentive * @return Incentive
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -77,4 +80,5 @@ class IncentiveTest extends \PHPUnit_Framework_TestCase
$obj = new Incentive(); $obj = new Incentive();
$obj->setLogoImageUrl(null); $obj->setLogoImageUrl(null);
} }
} }

View File

@@ -13,15 +13,17 @@ class InstallmentInfoTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object InstallmentInfo * Gets Json String of Object InstallmentInfo
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"installment_id":"TestSample","network":"TestSample","issuer":"TestSample","installment_options":' .InstallmentOptionTest::getJson() . '}'; return '{"installment_id":"TestSample","network":"TestSample","issuer":"TestSample","installment_options":' . InstallmentOptionTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return InstallmentInfo * @return InstallmentInfo
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class InstallmentInfoTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return InstallmentInfo * @return InstallmentInfo
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -57,4 +60,6 @@ class InstallmentInfoTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getIssuer(), "TestSample"); $this->assertEquals($obj->getIssuer(), "TestSample");
$this->assertEquals($obj->getInstallmentOptions(), InstallmentOptionTest::getObject()); $this->assertEquals($obj->getInstallmentOptions(), InstallmentOptionTest::getObject());
} }
} }

View File

@@ -13,15 +13,17 @@ class InstallmentOptionTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object InstallmentOption * Gets Json String of Object InstallmentOption
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"term":123,"monthly_payment":' .CurrencyTest::getJson() . ',"discount_amount":' .CurrencyTest::getJson() . ',"discount_percentage":"12.34"}'; return '{"term":123,"monthly_payment":' . CurrencyTest::getJson() . ',"discount_amount":' . CurrencyTest::getJson() . ',"discount_percentage":"TestSample"}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return InstallmentOption * @return InstallmentOption
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class InstallmentOptionTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return InstallmentOption * @return InstallmentOption
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -55,6 +58,8 @@ class InstallmentOptionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getTerm(), 123); $this->assertEquals($obj->getTerm(), 123);
$this->assertEquals($obj->getMonthlyPayment(), CurrencyTest::getObject()); $this->assertEquals($obj->getMonthlyPayment(), CurrencyTest::getObject());
$this->assertEquals($obj->getDiscountAmount(), CurrencyTest::getObject()); $this->assertEquals($obj->getDiscountAmount(), CurrencyTest::getObject());
$this->assertEquals($obj->getDiscountPercentage(), "12.34"); $this->assertEquals($obj->getDiscountPercentage(), "TestSample");
} }
} }

View File

@@ -13,15 +13,17 @@ class ItemListTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object ItemList * Gets Json String of Object ItemList
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"items":' .ItemTest::getJson() . ',"shipping_address":' .ShippingAddressTest::getJson() . ',"shipping_method":"TestSample"}'; return '{"items":' . ItemTest::getJson() . ',"shipping_address":' . ShippingAddressTest::getJson() . ',"shipping_method":"TestSample","shipping_phone_number":"TestSample"}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return ItemList * @return ItemList
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class ItemListTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return ItemList * @return ItemList
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -41,6 +44,7 @@ class ItemListTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj->getItems()); $this->assertNotNull($obj->getItems());
$this->assertNotNull($obj->getShippingAddress()); $this->assertNotNull($obj->getShippingAddress());
$this->assertNotNull($obj->getShippingMethod()); $this->assertNotNull($obj->getShippingMethod());
$this->assertNotNull($obj->getShippingPhoneNumber());
$this->assertEquals(self::getJson(), $obj->toJson()); $this->assertEquals(self::getJson(), $obj->toJson());
return $obj; return $obj;
} }
@@ -54,6 +58,8 @@ class ItemListTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getItems(), ItemTest::getObject()); $this->assertEquals($obj->getItems(), ItemTest::getObject());
$this->assertEquals($obj->getShippingAddress(), ShippingAddressTest::getObject()); $this->assertEquals($obj->getShippingAddress(), ShippingAddressTest::getObject());
$this->assertEquals($obj->getShippingMethod(), "TestSample"); $this->assertEquals($obj->getShippingMethod(), "TestSample");
$this->assertEquals($obj->getShippingPhoneNumber(), "TestSample");
} }
} }

View File

@@ -13,15 +13,17 @@ class ItemTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object Item * Gets Json String of Object Item
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"quantity":"TestSample","name":"TestSample","description":"TestSample","price":"12.34","tax":"12.34","currency":"TestSample","sku":"TestSample","url":"http://www.google.com","category":"TestSample","weight":' .MeasurementTest::getJson() . ',"length":' .MeasurementTest::getJson() . ',"height":' .MeasurementTest::getJson() . ',"width":' .MeasurementTest::getJson() . ',"supplementary_data":' .NameValuePairTest::getJson() . ',"postback_data":' .NameValuePairTest::getJson() . '}'; return '{"sku":"TestSample","name":"TestSample","description":"TestSample","quantity":"12.34","price":"12.34","currency":"TestSample","tax":"12.34","url":"http://www.google.com","category":"TestSample","weight":' . MeasurementTest::getJson() . ',"length":' . MeasurementTest::getJson() . ',"height":' . MeasurementTest::getJson() . ',"width":' . MeasurementTest::getJson() . ',"supplementary_data":' . NameValuePairTest::getJson() . ',"postback_data":' . NameValuePairTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return Item * @return Item
*/ */
public static function getObject() public static function getObject()
@@ -32,19 +34,20 @@ class ItemTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return Item * @return Item
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
{ {
$obj = new Item(self::getJson()); $obj = new Item(self::getJson());
$this->assertNotNull($obj); $this->assertNotNull($obj);
$this->assertNotNull($obj->getQuantity()); $this->assertNotNull($obj->getSku());
$this->assertNotNull($obj->getName()); $this->assertNotNull($obj->getName());
$this->assertNotNull($obj->getDescription()); $this->assertNotNull($obj->getDescription());
$this->assertNotNull($obj->getQuantity());
$this->assertNotNull($obj->getPrice()); $this->assertNotNull($obj->getPrice());
$this->assertNotNull($obj->getTax());
$this->assertNotNull($obj->getCurrency()); $this->assertNotNull($obj->getCurrency());
$this->assertNotNull($obj->getSku()); $this->assertNotNull($obj->getTax());
$this->assertNotNull($obj->getUrl()); $this->assertNotNull($obj->getUrl());
$this->assertNotNull($obj->getCategory()); $this->assertNotNull($obj->getCategory());
$this->assertNotNull($obj->getWeight()); $this->assertNotNull($obj->getWeight());
@@ -63,13 +66,13 @@ class ItemTest extends \PHPUnit_Framework_TestCase
*/ */
public function testGetters($obj) public function testGetters($obj)
{ {
$this->assertEquals($obj->getQuantity(), "TestSample"); $this->assertEquals($obj->getSku(), "TestSample");
$this->assertEquals($obj->getName(), "TestSample"); $this->assertEquals($obj->getName(), "TestSample");
$this->assertEquals($obj->getDescription(), "TestSample"); $this->assertEquals($obj->getDescription(), "TestSample");
$this->assertEquals($obj->getQuantity(), "12.34");
$this->assertEquals($obj->getPrice(), "12.34"); $this->assertEquals($obj->getPrice(), "12.34");
$this->assertEquals($obj->getTax(), "12.34");
$this->assertEquals($obj->getCurrency(), "TestSample"); $this->assertEquals($obj->getCurrency(), "TestSample");
$this->assertEquals($obj->getSku(), "TestSample"); $this->assertEquals($obj->getTax(), "12.34");
$this->assertEquals($obj->getUrl(), "http://www.google.com"); $this->assertEquals($obj->getUrl(), "http://www.google.com");
$this->assertEquals($obj->getCategory(), "TestSample"); $this->assertEquals($obj->getCategory(), "TestSample");
$this->assertEquals($obj->getWeight(), MeasurementTest::getObject()); $this->assertEquals($obj->getWeight(), MeasurementTest::getObject());

View File

@@ -13,6 +13,7 @@ class MeasurementTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object Measurement * Gets Json String of Object Measurement
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
@@ -22,6 +23,7 @@ class MeasurementTest extends \PHPUnit_Framework_TestCase
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return Measurement * @return Measurement
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class MeasurementTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return Measurement * @return Measurement
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -54,4 +57,5 @@ class MeasurementTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getUnit(), "TestSample"); $this->assertEquals($obj->getUnit(), "TestSample");
} }
} }

View File

@@ -13,6 +13,7 @@ class NameValuePairTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object NameValuePair * Gets Json String of Object NameValuePair
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
@@ -22,6 +23,7 @@ class NameValuePairTest extends \PHPUnit_Framework_TestCase
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return NameValuePair * @return NameValuePair
*/ */
public static function getObject() public static function getObject()
@@ -32,6 +34,7 @@ class NameValuePairTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return NameValuePair * @return NameValuePair
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -54,4 +57,5 @@ class NameValuePairTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getValue(), "TestSample"); $this->assertEquals($obj->getValue(), "TestSample");
} }
} }

View File

@@ -4,7 +4,6 @@ namespace PayPal\Test\Api;
use PayPal\Api\Authorization; use PayPal\Api\Authorization;
use PayPal\Api\Order; use PayPal\Api\Order;
use PayPal\Transport\PPRestCall;
/** /**
* Class Order * Class Order
@@ -15,15 +14,17 @@ class OrderTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* Gets Json String of Object Order * Gets Json String of Object Order
*
* @return string * @return string
*/ */
public static function getJson() public static function getJson()
{ {
return '{"id":"TestSample","purchase_unit_reference_id":"TestSample","amount":' .AmountTest::getJson() . ',"payment_mode":"TestSample","state":"TestSample","reason_code":"TestSample","pending_reason":"TestSample","protection-eligibility":"TestSample","protection-eligibility_type":"TestSample","parent_payment":"TestSample","fmf_details":' .FmfDetailsTest::getJson() . ',"create_time":"TestSample","update_time":"TestSample","links":' .LinksTest::getJson() . '}'; return '{"id":"TestSample","purchase_unit_reference_id":"TestSample","amount":' . AmountTest::getJson() . ',"payment_mode":"TestSample","state":"TestSample","reason_code":"TestSample","pending_reason":"TestSample","protection_eligibility":"TestSample","protection_eligibility_type":"TestSample","parent_payment":"TestSample","fmf_details":' . FmfDetailsTest::getJson() . ',"create_time":"TestSample","update_time":"TestSample","links":' . LinksTest::getJson() . '}';
} }
/** /**
* Gets Object Instance with Json data filled in * Gets Object Instance with Json data filled in
*
* @return Order * @return Order
*/ */
public static function getObject() public static function getObject()
@@ -34,6 +35,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase
/** /**
* Tests for Serialization and Deserialization Issues * Tests for Serialization and Deserialization Issues
*
* @return Order * @return Order
*/ */
public function testSerializationDeserialization() public function testSerializationDeserialization()
@@ -80,7 +82,6 @@ class OrderTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getLinks(), LinksTest::getObject()); $this->assertEquals($obj->getLinks(), LinksTest::getObject());
} }
/** /**
* @dataProvider mockProvider * @dataProvider mockProvider
* @param Order $obj * @param Order $obj
@@ -94,12 +95,13 @@ class OrderTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any()) $mockPPRestCall->expects($this->any())
->method('execute') ->method('execute')
->will($this->returnValue( ->will($this->returnValue(
OrderTest::getJson() OrderTest::getJson()
)); ));
$result = $obj->get("orderId", $mockApiContext, $mockPPRestCall); $result = $obj->get("orderId", $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result); $this->assertNotNull($result);
} }
/** /**
* @dataProvider mockProvider * @dataProvider mockProvider
* @param Order $obj * @param Order $obj
@@ -113,13 +115,14 @@ class OrderTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any()) $mockPPRestCall->expects($this->any())
->method('execute') ->method('execute')
->will($this->returnValue( ->will($this->returnValue(
CaptureTest::getJson() CaptureTest::getJson()
)); ));
$capture = CaptureTest::getObject(); $capture = CaptureTest::getObject();
$result = $obj->capture($capture, $mockApiContext, $mockPPRestCall); $result = $obj->capture($capture, $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result); $this->assertNotNull($result);
} }
/** /**
* @dataProvider mockProvider * @dataProvider mockProvider
* @param Order $obj * @param Order $obj
@@ -133,12 +136,13 @@ class OrderTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any()) $mockPPRestCall->expects($this->any())
->method('execute') ->method('execute')
->will($this->returnValue( ->will($this->returnValue(
self::getJson() self::getJson()
)); ));
$result = $obj->void($mockApiContext, $mockPPRestCall); $result = $obj->void($mockApiContext, $mockPPRestCall);
$this->assertNotNull($result); $this->assertNotNull($result);
} }
/** /**
* @dataProvider mockProvider * @dataProvider mockProvider
* @param Order $obj * @param Order $obj
@@ -152,7 +156,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any()) $mockPPRestCall->expects($this->any())
->method('execute') ->method('execute')
->will($this->returnValue( ->will($this->returnValue(
AuthorizationTest::getJson() AuthorizationTest::getJson()
)); ));
$authorization = new Authorization(); $authorization = new Authorization();
@@ -164,8 +168,8 @@ class OrderTest extends \PHPUnit_Framework_TestCase
{ {
$obj = self::getObject(); $obj = self::getObject();
$mockApiContext = $this->getMockBuilder('ApiContext') $mockApiContext = $this->getMockBuilder('ApiContext')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
return array( return array(
array($obj, $mockApiContext), array($obj, $mockApiContext),
array($obj, null) array($obj, null)

Some files were not shown because too many files have changed in this diff Show More