Payments API Updates

This commit is contained in:
Jay Patel
2015-10-02 14:25:46 -05:00
parent 02fca1bda4
commit a37b880e96
112 changed files with 3857 additions and 1495 deletions

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

@@ -20,7 +20,7 @@ use PayPal\Validation\NumericValidator;
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
*
@@ -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
*/
@@ -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
*
@@ -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
*/

View File

@@ -4,7 +4,6 @@ namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
@@ -15,8 +14,6 @@ use PayPal\Validation\ArgumentValidator;
* @package PayPal\Api
*
* @property string id
* @property string create_time
* @property string update_time
* @property \PayPal\Api\Amount amount
* @property string payment_mode
* @property string state
@@ -26,14 +23,16 @@ use PayPal\Validation\ArgumentValidator;
* @property string protection_eligibility_type
* @property \PayPal\Api\FmfDetails fmf_details
* @property string parent_payment
* @property string clearing_time
* @property \PayPal\Api\ProcessorResponse processor_response
* @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
{
/**
* Identifier of the authorization transaction.
* ID of the authorization transaction.
*
* @param string $id
*
@@ -46,7 +45,7 @@ class Authorization extends PayPalResourceModel
}
/**
* Identifier of the authorization transaction.
* ID of the authorization transaction.
*
* @return string
*/
@@ -56,7 +55,7 @@ class Authorization extends PayPalResourceModel
}
/**
* Amount being authorized for.
* Amount being authorized.
*
* @param \PayPal\Api\Amount $amount
*
@@ -69,7 +68,7 @@ class Authorization extends PayPalResourceModel
}
/**
* Amount being authorized for.
* Amount being authorized.
*
* @return \PayPal\Api\Amount
*/
@@ -79,8 +78,8 @@ class Authorization extends PayPalResourceModel
}
/**
* specifies payment mode of the transaction
* Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
* Specifies the payment mode of the transaction.
* Valid Values: ["INSTANT_TRANSFER"]
*
* @param string $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
*/
@@ -103,7 +102,7 @@ class Authorization extends PayPalResourceModel
}
/**
* State of the authorization transaction.
* State of the authorization.
* Valid Values: ["pending", "authorized", "partially_captured", "captured", "expired", "voided"]
*
* @param string $state
@@ -117,7 +116,7 @@ class Authorization extends PayPalResourceModel
}
/**
* State of the authorization transaction.
* State of the authorization.
*
* @return string
*/
@@ -127,7 +126,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`.
* Valid Values: ["AUTHORIZATION"]
*
* @param string $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
*/
@@ -153,7 +152,7 @@ class Authorization extends PayPalResourceModel
/**
* [DEPRECATED] Reason code for the transaction state being Pending.Obsolete. use reason_code field instead.
* Valid Values: ["AUTHORIZATION"]
* @deprecated Plese Use setReasonCode instead
*
* @param string $pending_reason
*
* @return $this
@@ -165,8 +164,8 @@ class Authorization extends PayPalResourceModel
}
/**
* [DEPRECATED] Reason code for the transaction state being Pending.Obsolete. use reason_code field instead.
* @deprecated Plese Use setReasonCode instead
* @deprecated [DEPRECATED] Reason code for the transaction state being Pending.Obsolete. use reason_code field instead.
*
* @return string
*/
public function getPendingReason()
@@ -175,7 +174,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.
* Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
*
* @param string $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
*/
@@ -199,8 +198,8 @@ class Authorization extends PayPalResourceModel
}
/**
* Protection Eligibility Type of the Payer
* Valid Values: ["ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE", "INELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE"]
* 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: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"]
*
* @param string $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
*/
@@ -223,7 +222,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.
*
* @param \PayPal\Api\FmfDetails $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
*/
@@ -269,31 +268,30 @@ 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 string $clearing_time
* @param \PayPal\Api\ProcessorResponse $processor_response
*
* @return $this
*/
public function setClearingTime($clearing_time)
public function setProcessorResponse($processor_response)
{
$this->clearing_time = $clearing_time;
$this->processor_response = $processor_response;
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
*
@@ -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
*/
@@ -316,7 +314,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).
*
* @param string $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
*/
@@ -339,7 +337,7 @@ 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
*
@@ -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
*/
@@ -436,7 +434,7 @@ 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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls

View File

@@ -2,10 +2,7 @@
namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
use PayPal\Common\PayPalModel;
/**
* Class BankAccount
@@ -14,7 +11,6 @@ use PayPal\Validation\ArgumentValidator;
*
* @package PayPal\Api
*
* @property string id
* @property string account_number
* @property string account_number_type
* @property string routing_number
@@ -37,12 +33,14 @@ use PayPal\Validation\ArgumentValidator;
* @property string create_time
* @property string update_time
* @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.
*
* @deprecated Not publicly available
* @param string $id
*
* @return $this
@@ -56,6 +54,7 @@ class BankAccount extends PayPalResourceModel
/**
* ID of the bank account being saved for later use.
*
* @deprecated Not publicly available
* @return string
*/
public function getId()
@@ -438,7 +437,7 @@ class BankAccount extends PayPalResourceModel
}
/**
* Deprecated - Use external_customer_id instead.
* [DEPRECATED] Use external_customer_id instead.
*
* @param string $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
*/
@@ -483,7 +482,6 @@ class BankAccount extends PayPalResourceModel
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.
*
@@ -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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return BankAccount
* @param \PayPal\Api\Links[] $links
*
* @return $this
*/
public function create($apiContext = null, $restCall = null)
public function setLinks($links)
{
$payLoad = $this->toJSON();
$json = self::executeCall(
"/v1/vault/bank-accounts",
"POST",
$payLoad,
null,
$apiContext,
$restCall
);
$this->fromJson($json);
$this->links = $links;
return $this;
}
/**
* Obtain the Bank Account resource for the given identifier.
* Gets Links
*
* @param string $bankAccountId
* @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
* @return \PayPal\Api\Links[]
*/
public static function get($bankAccountId, $apiContext = null, $restCall = null)
public function getLinks()
{
ArgumentValidator::validate($bankAccountId, 'bankAccountId');
$payLoad = "";
$json = self::executeCall(
"/v1/vault/bank-accounts/$bankAccountId",
"GET",
$payLoad,
null,
$apiContext,
$restCall
);
$ret = new BankAccount();
$ret->fromJson($json);
return $ret;
return $this->links;
}
/**
* 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 PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return bool
* @param \PayPal\Api\Links $links
* @return $this
*/
public function delete($apiContext = null, $restCall = null)
public function addLink($links)
{
ArgumentValidator::validate($this->getId(), "Id");
$payLoad = "";
self::executeCall(
"/v1/vault/bank-accounts/{$this->getId()}",
"DELETE",
$payLoad,
null,
$apiContext,
$restCall
if (!$this->getLinks()) {
return $this->setLinks(array($links));
} else {
return $this->setLinks(
array_merge($this->getLinks(), array($links))
);
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 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
* @param \PayPal\Api\Links $links
* @return $this
*/
public function update($patchRequest, $apiContext = null, $restCall = null)
public function removeLink($links)
{
ArgumentValidator::validate($this->getId(), "Id");
ArgumentValidator::validate($patchRequest, 'patchRequest');
$payLoad = $patchRequest->toJSON();
$json = self::executeCall(
"/v1/vault/bank-accounts/{$this->getId()}",
"PATCH",
$payLoad,
null,
$apiContext,
$restCall
return $this->setLinks(
array_diff($this->getLinks(), array($links))
);
$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\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
@@ -15,19 +14,19 @@ use PayPal\Validation\ArgumentValidator;
* @package PayPal\Api
*
* @property string id
* @property string create_time
* @property string update_time
* @property \PayPal\Api\Amount amount
* @property bool is_final_capture
* @property string state
* @property string parent_payment
* @property \PayPal\Api\Currency transaction_fee
* @property string create_time
* @property string update_time
* @property \PayPal\Api\Links[] links
*/
class Capture extends PayPalResourceModel
{
/**
* Identifier of the Capture transaction.
* ID of the capture transaction.
*
* @param string $id
*
@@ -40,7 +39,7 @@ class Capture extends PayPalResourceModel
}
/**
* Identifier of the Capture transaction.
* ID of the capture transaction.
*
* @return string
*/
@@ -50,7 +49,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`.
*
* @param \PayPal\Api\Amount $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
*/
@@ -73,7 +72,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.
*
* @param bool $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
*/
@@ -96,7 +95,7 @@ class Capture extends PayPalResourceModel
}
/**
* State of the capture transaction.
* State of the capture.
* Valid Values: ["pending", "completed", "refunded", "partially_refunded"]
*
* @param string $state
@@ -110,7 +109,7 @@ class Capture extends PayPalResourceModel
}
/**
* State of the capture transaction.
* State of the capture.
*
* @return string
*/
@@ -120,7 +119,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.
*
* @param string $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
*/
@@ -166,7 +165,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).
*
* @param string $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
*/
@@ -189,7 +188,7 @@ 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
*
@@ -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
*/

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
*
* @return $this
*/
public function setExternalCustomerId($external_customer_id)

View File

@@ -12,8 +12,8 @@ use PayPal\Validation\UrlValidator;
*
* @package PayPal\Api
*
* @property string reference_id
* @property \PayPal\Api\Amount amount
* @property \PayPal\Api\Payee payee
* @property string description
* @property string note_to_payee
* @property string custom
@@ -26,6 +26,29 @@ use PayPal\Validation\UrlValidator;
*/
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.
*
@@ -52,6 +75,7 @@ class CartBase extends PayPalModel
/**
* Recipient of the funds in this transaction.
*
* @deprecated Not publicly available
* @param \PayPal\Api\Payee $payee
*
* @return $this
@@ -65,6 +89,7 @@ class CartBase extends PayPalModel
/**
* Recipient of the funds in this transaction.
*
* @deprecated Not publicly available
* @return \PayPal\Api\Payee
*/
public function getPayee()
@@ -73,7 +98,7 @@ class CartBase extends PayPalModel
}
/**
* Description of what is being paid for.
* Description of transaction.
*
* @param string $description
*
@@ -86,7 +111,7 @@ class CartBase extends PayPalModel
}
/**
* Description of what is being paid for.
* Description of transaction.
*
* @return string
*/
@@ -119,8 +144,7 @@ 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
*
@@ -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
*/
@@ -143,7 +167,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`.
*
* @param string $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
*/
@@ -166,8 +190,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
*
* @param string $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
*/
@@ -190,8 +213,32 @@ class CartBase extends PayPalModel
}
/**
* Payment options requested for this purchase unit
* 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
*
* @param \PayPal\Api\PaymentOptions $payment_options
*
@@ -214,7 +261,7 @@ class CartBase extends PayPalModel
}
/**
* List of items being paid for.
* Items and related shipping address within a transaction.
*
* @param \PayPal\Api\ItemList $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
*/
@@ -283,4 +330,62 @@ class CartBase extends PayPalModel
{
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;
use PayPal\Common\PayPalModel;
/**
* Class CreateProfileResponse
*
@@ -13,7 +11,7 @@ use PayPal\Common\PayPalModel;
*
* @property string id
*/
class CreateProfileResponse extends PayPalModel
class CreateProfileResponse extends WebProfile
{
/**
* ID of the payment web experience profile.

View File

@@ -13,7 +13,6 @@ use PayPal\Common\PayPalModel;
*
* @property string id
* @property string type
* @property string terms
*/
class Credit extends PayPalModel
{
@@ -41,7 +40,7 @@ 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"]
*
* @param string $type
@@ -55,7 +54,7 @@ class Credit extends PayPalModel
}
/**
* Specifies the type of credit
* specifies type of credit
*
* @return string
*/
@@ -64,27 +63,4 @@ class Credit extends PayPalModel
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,11 +10,10 @@ use PayPal\Validation\ArgumentValidator;
/**
* Class CreditCard
*
* A resource representing a credit card that can be used to fund a payment.
* @deprecated Represents a credit card to fund a payment. Use Payment Card instead.
*
* @package PayPal\Api
*
* @property string id
* @property string number
* @property string type
* @property int expire_month
@@ -24,20 +23,16 @@ use PayPal\Validation\ArgumentValidator;
* @property string last_name
* @property \PayPal\Api\Address billing_address
* @property string external_customer_id
* @property string merchant_id
* @property string payer_id
* @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
*/
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
*
* @return $this
@@ -49,8 +44,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
*/
public function getId()
@@ -59,7 +55,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.*
*
* @param string $number
*
@@ -72,7 +68,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
*/
@@ -82,8 +78,7 @@ class CreditCard extends PayPalResourceModel
}
/**
* Type of the Card. Currently supporting Visa, Mastercard, Amex, Discover and Maestro
* Valid Values: ["visa", "mastercard", "amex", "discover", "maestro"]
* Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`
*
* @param string $type
*
@@ -96,7 +91,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
*/
@@ -106,7 +101,7 @@ 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
*
@@ -119,7 +114,7 @@ class CreditCard extends PayPalResourceModel
}
/**
* 2 digit card expiry month.
* Expiration month with no leading zero. Acceptable values are 1 through 12.
*
* @return int
*/
@@ -129,7 +124,7 @@ class CreditCard extends PayPalResourceModel
}
/**
* 4 digit card expiry year
* 4-digit expiration year.
*
* @param int $expire_year
*
@@ -142,7 +137,7 @@ class CreditCard extends PayPalResourceModel
}
/**
* 4 digit card expiry year
* 4-digit expiration year.
*
* @return int
*/
@@ -152,7 +147,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.
*
* @param string $cvv2
*
@@ -165,7 +160,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
*/
@@ -244,7 +239,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.**
*
* @param string $external_customer_id
*
@@ -257,7 +252,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
*/
@@ -291,6 +286,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.
*
* @deprecated This is being deprecated in favor of the `external_customer_id` property.
* @param string $payer_id
*
@@ -304,6 +300,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.
*
* @deprecated This is being deprecated in favor of the `external_customer_id` property.
* @return string
*/
@@ -350,7 +347,7 @@ class CreditCard extends PayPalResourceModel
}
/**
* State of the funding instrument.
* State of the credit card funding instrument.
*
* @return string
*/
@@ -360,7 +357,7 @@ 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
*
@@ -419,7 +416,7 @@ class CreditCard extends PayPalResourceModel
}
/**
* Date/Time until this resource can be used fund a payment.
* Funding instrument expiration date.
*
* @return string
*/

View File

@@ -21,7 +21,7 @@ use PayPal\Common\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
*
@@ -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
*/
@@ -44,7 +44,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.**
*
* @param string $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
*/
@@ -67,7 +67,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.
*
* @param string $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
*/
@@ -90,7 +90,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.
*
* @param string $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
*/
@@ -113,7 +113,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.
*
* @param int $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
*/
@@ -136,7 +136,7 @@ class CreditCardToken extends PayPalModel
}
/**
* 4 digit card expiry year from the saved card
* 4-digit expiration year.
*
* @param int $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
*/

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

@@ -19,7 +19,6 @@ use PayPal\Validation\UrlValidator;
* @property string to_amount
* @property string conversion_type
* @property bool conversion_type_changeable
* @property string web_url
* @property \PayPal\Api\Links[] links
*/
class CurrencyConversion extends PayPalModel
@@ -190,6 +189,7 @@ class CurrencyConversion extends PayPalModel
* Base URL to web applications endpoint
* Valid Values: ["https://www.paypal.com/{country_code}/webapps/xocspartaweb/webflow/sparta/proxwebflow", "https://www.paypal.com/{country_code}/proxflow"]
*
* @deprecated Not publicly available
* @param string $web_url
* @throws \InvalidArgumentException
* @return $this
@@ -204,6 +204,7 @@ class CurrencyConversion extends PayPalModel
/**
* Base URL to web applications endpoint
*
* @deprecated Not publicly available
* @return string
*/
public function getWebUrl()

View File

@@ -25,7 +25,7 @@ use PayPal\Validation\NumericValidator;
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
*
@@ -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
*/
@@ -50,7 +50,7 @@ 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
*
@@ -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
*/
@@ -75,7 +75,7 @@ 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
*
@@ -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
*/
@@ -100,9 +100,9 @@ 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 $handling_fee
* @param string|double $handling_fee
*
* @return $this
*/
@@ -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
*/
@@ -125,9 +125,9 @@ 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 $shipping_discount
* @param string|double $shipping_discount
*
* @return $this
*/
@@ -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
*/
@@ -150,7 +150,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`.
*
* @param string|double $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
*/
@@ -177,7 +177,7 @@ class Details extends PayPalModel
/**
* Amount being charged as gift wrap fee.
*
* @param string $gift_wrap
* @param string|double $gift_wrap
*
* @return $this
*/

View File

@@ -12,12 +12,10 @@ use PayPal\Common\PayPalModel;
* @package PayPal\Api
*
* @property string name
* @property string purchase_unit_reference_id
* @property string debug_id
* @property string message
* @property string code
* @property string information_link
* @property \PayPal\Api\ErrorDetails[] details
* @property string information_link
* @property string debug_id
* @property \PayPal\Api\Links[] links
*/
class Error extends PayPalModel
@@ -48,6 +46,7 @@ class Error extends PayPalModel
/**
* Reference ID of the purchase_unit associated with this error
*
* @deprecated Not publicly available
* @param string $purchase_unit_reference_id
*
* @return $this
@@ -61,6 +60,7 @@ class Error extends PayPalModel
/**
* Reference ID of the purchase_unit associated with this error
*
* @deprecated Not publicly available
* @return string
*/
public function getPurchaseUnitReferenceId()
@@ -68,29 +68,6 @@ class Error extends PayPalModel
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.
*
@@ -117,6 +94,7 @@ class Error extends PayPalModel
/**
* PayPal internal error code.
*
* @deprecated Not publicly available
* @param string $code
*
* @return $this
@@ -130,6 +108,7 @@ class Error extends PayPalModel
/**
* PayPal internal error code.
*
* @deprecated Not publicly available
* @return string
*/
public function getCode()
@@ -137,29 +116,6 @@ class Error extends PayPalModel
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
*
@@ -213,6 +169,102 @@ 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
*

View File

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

View File

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

@@ -44,7 +44,7 @@ class FmfDetails extends PayPalModel
/**
* 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
*

View File

@@ -13,6 +13,8 @@ use PayPal\Common\PayPalModel;
*
* @property string clearing_time
* @property string payment_hold_date
* @property string payment_debit_date
* @property string processing_type
*/
class FundingDetail extends PayPalModel
{
@@ -40,7 +42,7 @@ 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
*
@@ -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
*/
@@ -62,4 +64,51 @@ class FundingDetail extends PayPalModel
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,25 +7,18 @@ use PayPal\Common\PayPalModel;
/**
* 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
*
* @property \PayPal\Api\CreditCard credit_card
* @property \PayPal\Api\ExtendedBankAccount bank_account
* @property \PayPal\Api\CreditCardToken credit_card_token
* @property \PayPal\Api\Incentive incentive
* @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
*
* @property \PayPal\Api\Billing billing
*/
class FundingInstrument extends PayPalModel
{
/**
* Credit Card information.
* Credit Card instrument.
*
* @param \PayPal\Api\CreditCard $credit_card
*
@@ -38,7 +31,7 @@ class FundingInstrument extends PayPalModel
}
/**
* Credit Card information.
* Credit Card instrument.
*
* @return \PayPal\Api\CreditCard
*/
@@ -48,7 +41,7 @@ class FundingInstrument extends PayPalModel
}
/**
* Credit Card information.
* PayPal vaulted credit Card instrument.
*
* @param \PayPal\Api\CreditCardToken $credit_card_token
*
@@ -61,7 +54,7 @@ class FundingInstrument extends PayPalModel
}
/**
* Credit Card information.
* PayPal vaulted credit Card instrument.
*
* @return \PayPal\Api\CreditCardToken
*/
@@ -73,6 +66,7 @@ class FundingInstrument extends PayPalModel
/**
* Payment Card information.
*
* @deprecated Not publicly available
* @param \PayPal\Api\PaymentCard $payment_card
*
* @return $this
@@ -86,6 +80,7 @@ class FundingInstrument extends PayPalModel
/**
* Payment Card information.
*
* @deprecated Not publicly available
* @return \PayPal\Api\PaymentCard
*/
public function getPaymentCard()
@@ -93,32 +88,10 @@ class FundingInstrument extends PayPalModel
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.
*
* @deprecated Not publicly available
* @param \PayPal\Api\ExtendedBankAccount $bank_account
*
* @return $this
@@ -132,6 +105,7 @@ class FundingInstrument extends PayPalModel
/**
* Bank Account information.
*
* @deprecated Not publicly available
* @return \PayPal\Api\ExtendedBankAccount
*/
public function getBankAccount()
@@ -140,8 +114,9 @@ class FundingInstrument extends PayPalModel
}
/**
* Bank Account information.
* Vaulted bank account instrument.
*
* @deprecated Not publicly available
* @param \PayPal\Api\BankToken $bank_account_token
*
* @return $this
@@ -153,8 +128,9 @@ class FundingInstrument extends PayPalModel
}
/**
* Bank Account information.
* Vaulted bank account instrument.
*
* @deprecated Not publicly available
* @return \PayPal\Api\BankToken
*/
public function getBankAccountToken()
@@ -163,8 +139,9 @@ class FundingInstrument extends PayPalModel
}
/**
* Credit funding information.
* PayPal credit funding instrument.
*
* @deprecated Not publicly available
* @param \PayPal\Api\Credit $credit
*
* @return $this
@@ -176,8 +153,9 @@ class FundingInstrument extends PayPalModel
}
/**
* Credit funding information.
* PayPal credit funding instrument.
*
* @deprecated Not publicly available
* @return \PayPal\Api\Credit
*/
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
*
* @return $this
@@ -199,8 +178,9 @@ class FundingInstrument extends PayPalModel
}
/**
* Incentive funding information.
* Incentive funding instrument.
*
* @deprecated Not publicly available
* @return \PayPal\Api\Incentive
*/
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
*
* @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
*/
public function getCarrierAccountToken()
@@ -231,4 +238,102 @@ class FundingInstrument extends PayPalModel
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

@@ -15,6 +15,7 @@ use PayPal\Common\PayPalModel;
* @property string funding_instrument_type
* @property string soft_descriptor
* @property \PayPal\Api\Currency amount
* @property \PayPal\Api\Currency negative_balance_amount
* @property string legal_text
* @property \PayPal\Api\FundingDetail funding_detail
* @property string additional_text
@@ -117,6 +118,29 @@ class FundingSource extends PayPalModel
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.
*

View File

@@ -188,7 +188,7 @@ class Incentive extends PayPalModel
/**
* Specifies type of incentive
* Valid Values: ["COUPON", "GIFT_CARD", "MERCHANT_SPECIFIC_BALANCE"]
* Valid Values: ["COUPON", "GIFT_CARD", "MERCHANT_SPECIFIC_BALANCE", "VOUCHER"]
*
* @param string $type
*

View File

@@ -3,8 +3,6 @@
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
use PayPal\Converter\FormatConverter;
use PayPal\Validation\NumericValidator;
/**
* Class InstallmentOption
@@ -98,8 +96,6 @@ class InstallmentOption extends PayPalModel
*/
public function setDiscountPercentage($discount_percentage)
{
NumericValidator::validate($discount_percentage, "Discount Percentage");
$discount_percentage = FormatConverter::formatToPrice($discount_percentage);
$this->discount_percentage = $discount_percentage;
return $this;
}
@@ -114,5 +110,4 @@ class InstallmentOption extends PayPalModel
return $this->discount_percentage;
}
}

View File

@@ -10,53 +10,47 @@ use PayPal\Validation\UrlValidator;
/**
* Class Item
*
* An item being paid for.
* Item details.
*
* @package PayPal\Api
*
* @property string quantity
* @property string sku
* @property string name
* @property string description
* @property string quantity
* @property string price
* @property string tax
* @property string currency
* @property string sku
* @property string tax
* @property string url
* @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
{
/**
* Number of items.
* Stock keeping unit corresponding (SKU) to item.
*
* @param string $quantity
* @param string $sku
*
* @return $this
*/
public function setQuantity($quantity)
public function setSku($sku)
{
$this->quantity = $quantity;
$this->sku = $sku;
return $this;
}
/**
* Number of items.
* Stock keeping unit corresponding (SKU) to item.
*
* @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
*
@@ -69,7 +63,7 @@ class Item extends PayPalModel
}
/**
* Name of the item.
* Item name. 127 characters max.
*
* @return string
*/
@@ -79,7 +73,7 @@ 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
*
@@ -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
*/
@@ -102,7 +96,30 @@ 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
*
@@ -117,7 +134,7 @@ class Item extends PayPalModel
}
/**
* Cost of the item.
* Item cost. 10 characters max.
*
* @return string
*/
@@ -127,7 +144,30 @@ 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
*
@@ -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
*/
@@ -151,52 +191,6 @@ class Item extends PayPalModel
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.
*
@@ -248,6 +242,7 @@ class Item extends PayPalModel
/**
* Weight of the item.
*
* @deprecated Not publicly available
* @param \PayPal\Api\Measurement $weight
*
* @return $this
@@ -261,6 +256,7 @@ class Item extends PayPalModel
/**
* Weight of the item.
*
* @deprecated Not publicly available
* @return \PayPal\Api\Measurement
*/
public function getWeight()
@@ -271,6 +267,7 @@ class Item extends PayPalModel
/**
* Length of the item.
*
* @deprecated Not publicly available
* @param \PayPal\Api\Measurement $length
*
* @return $this
@@ -284,6 +281,7 @@ class Item extends PayPalModel
/**
* Length of the item.
*
* @deprecated Not publicly available
* @return \PayPal\Api\Measurement
*/
public function getLength()
@@ -294,6 +292,7 @@ class Item extends PayPalModel
/**
* Height of the item.
*
* @deprecated Not publicly available
* @param \PayPal\Api\Measurement $height
*
* @return $this
@@ -307,6 +306,7 @@ class Item extends PayPalModel
/**
* Height of the item.
*
* @deprecated Not publicly available
* @return \PayPal\Api\Measurement
*/
public function getHeight()
@@ -317,6 +317,7 @@ class Item extends PayPalModel
/**
* Width of the item.
*
* @deprecated Not publicly available
* @param \PayPal\Api\Measurement $width
*
* @return $this
@@ -330,6 +331,7 @@ class Item extends PayPalModel
/**
* Width of the item.
*
* @deprecated Not publicly available
* @return \PayPal\Api\Measurement
*/
public function getWidth()
@@ -340,6 +342,7 @@ class Item extends PayPalModel
/**
* Set of optional data used for PayPal risk determination.
*
* @deprecated Not publicly available
* @param \PayPal\Api\NameValuePair[] $supplementary_data
*
* @return $this
@@ -353,6 +356,7 @@ class Item extends PayPalModel
/**
* Set of optional data used for PayPal risk determination.
*
* @deprecated Not publicly available
* @return \PayPal\Api\NameValuePair[]
*/
public function getSupplementaryData()
@@ -363,6 +367,7 @@ class Item extends PayPalModel
/**
* Append SupplementaryData to the list.
*
* @deprecated Not publicly available
* @param \PayPal\Api\NameValuePair $nameValuePair
* @return $this
*/
@@ -380,6 +385,7 @@ class Item extends PayPalModel
/**
* Remove SupplementaryData from the list.
*
* @deprecated Not publicly available
* @param \PayPal\Api\NameValuePair $nameValuePair
* @return $this
*/
@@ -393,6 +399,7 @@ class Item extends PayPalModel
/**
* Set of optional data used for PayPal post-transaction notifications.
*
* @deprecated Not publicly available
* @param \PayPal\Api\NameValuePair[] $postback_data
*
* @return $this
@@ -406,6 +413,7 @@ class Item extends PayPalModel
/**
* Set of optional data used for PayPal post-transaction notifications.
*
* @deprecated Not publicly available
* @return \PayPal\Api\NameValuePair[]
*/
public function getPostbackData()
@@ -416,6 +424,7 @@ class Item extends PayPalModel
/**
* Append PostbackData to the list.
*
* @deprecated Not publicly available
* @param \PayPal\Api\NameValuePair $nameValuePair
* @return $this
*/
@@ -433,6 +442,7 @@ class Item extends PayPalModel
/**
* Remove PostbackData from the list.
*
* @deprecated Not publicly available
* @param \PayPal\Api\NameValuePair $nameValuePair
* @return $this
*/

View File

@@ -7,24 +7,17 @@ use PayPal\Common\PayPalModel;
/**
* Class ItemList
*
* List of items being paid for.
* Items and related shipping address within a transaction.
*
* @package PayPal\Api
*
* @property \PayPal\Api\Item[] items
* @property \PayPal\Api\ShippingAddress shipping_address
* @property string shipping_method
* @property string shipping_phone_number
*/
class ItemList extends PayPalModel
{
/**
* Is this list empty?
*/
public function isEmpty()
{
return empty($this->items);
}
/**
* List of items.
*
@@ -79,7 +72,7 @@ class ItemList extends PayPalModel
}
/**
* Shipping address.
* Shipping address, if different than the payer address.
*
* @param \PayPal\Api\ShippingAddress $shipping_address
*
@@ -92,7 +85,7 @@ class ItemList extends PayPalModel
}
/**
* Shipping address.
* Shipping address, if different than the payer address.
*
* @return \PayPal\Api\ShippingAddress
*/
@@ -124,4 +117,27 @@ class ItemList extends PayPalModel
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\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
@@ -27,6 +26,7 @@ use PayPal\Validation\ArgumentValidator;
* @property \PayPal\Api\FmfDetails fmf_details
* @property string create_time
* @property string update_time
* @property \PayPal\Api\Links[] links
*/
class Order extends PayPalResourceModel
{
@@ -148,7 +148,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`.
* Valid Values: ["PAYER_SHIPPING_UNCONFIRMED", "MULTI_CURRENCY", "RISK_REVIEW", "REGULATORY_REVIEW", "VERIFICATION_REQUIRED", "ORDER", "OTHER"]
*
* @param string $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
*/
@@ -172,7 +172,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] 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"]
*
* @param string $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
*/
@@ -196,7 +196,7 @@ 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"]
*
* @param string $protection_eligibility
@@ -205,23 +205,23 @@ class Order extends PayPalResourceModel
*/
public function setProtectionEligibility($protection_eligibility)
{
$this->{"protection-eligibility"} = $protection_eligibility;
$this->protection_eligibility = $protection_eligibility;
return $this;
}
/**
* Protection Eligibility of the Payer
* The level of seller protection in force for the transaction.
*
* @return string
*/
public function getProtectionEligibility()
{
return $this->{"protection-eligibility"};
return $this->protection_eligibility;
}
/**
* Protection Eligibility Type of the Payer
* Valid Values: ["ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE", "INELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE"]
* 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: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"]
*
* @param string $protection_eligibility_type
*
@@ -229,18 +229,18 @@ class Order extends PayPalResourceModel
*/
public function setProtectionEligibilityType($protection_eligibility_type)
{
$this->{"protection-eligibility_type"} = $protection_eligibility_type;
$this->protection_eligibility_type = $protection_eligibility_type;
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
*/
public function getProtectionEligibilityType()
{
return $this->{"protection-eligibility_type"};
return $this->protection_eligibility_type;
}
/**
@@ -361,7 +361,7 @@ 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 ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.

View File

@@ -7,7 +7,7 @@ use PayPal\Common\PayPalModel;
/**
* 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
*
@@ -43,7 +43,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.
*
* @param string $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
*/
@@ -89,7 +89,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.
*
* @param string $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
*/

View File

@@ -7,20 +7,18 @@ use PayPal\Common\PayPalModel;
/**
* 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
*
* @property string email
* @property string merchant_id
* @property \PayPal\Api\Phone phone
*/
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.
*
*
* @param string $email
*
* @return $this
@@ -42,8 +40,7 @@ class Payee extends PayPalModel
}
/**
* Encrypted PayPal Account identifier for the Payee.
*
* Encrypted PayPal account identifier for the Payee.
*
* @param string $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
*/
@@ -65,10 +62,85 @@ class Payee extends PayPalModel
return $this->merchant_id;
}
/**
* 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
*
* @return $this
@@ -82,6 +154,7 @@ 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.
*
* @deprecated Not publicly available
* @return \PayPal\Api\Phone
*/
public function getPhone()

View File

@@ -13,19 +13,15 @@ use PayPal\Common\PayPalModel;
*
* @property string payment_method
* @property string status
* @property string account_type
* @property string account_age
* @property \PayPal\Api\FundingInstrument[] funding_instruments
* @property string funding_option_id
* @property \PayPal\Api\FundingOption funding_option
* @property \PayPal\Api\FundingOption related_funding_option
* @property \PayPal\Api\PayerInfo payer_info
*/
class Payer extends PayPalModel
{
/**
* 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
*
@@ -75,6 +71,7 @@ class Payer extends PayPalModel
* Type of account relationship payer has with PayPal.
* Valid Values: ["BUSINESS", "PERSONAL", "PREMIER"]
*
* @deprecated Not publicly available
* @param string $account_type
*
* @return $this
@@ -88,6 +85,7 @@ class Payer extends PayPalModel
/**
* Type of account relationship payer has with PayPal.
*
* @deprecated Not publicly available
* @return string
*/
public function getAccountType()
@@ -98,6 +96,7 @@ class Payer extends PayPalModel
/**
* Duration since the payer established account relationship with PayPal in days.
*
* @deprecated Not publicly available
* @param string $account_age
*
* @return $this
@@ -111,6 +110,7 @@ class Payer extends PayPalModel
/**
* Duration since the payer established account relationship with PayPal in days.
*
* @deprecated Not publicly available
* @return string
*/
public function getAccountAge()
@@ -119,7 +119,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.
*
* @param \PayPal\Api\FundingInstrument[] $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[]
*/
@@ -172,7 +172,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.
*
* @param string $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
*/
@@ -197,6 +197,7 @@ class Payer extends PayPalModel
/**
* Default funding option available for the payment
*
* @deprecated Not publicly available
* @param \PayPal\Api\FundingOption $funding_option
*
* @return $this
@@ -210,6 +211,7 @@ class Payer extends PayPalModel
/**
* Default funding option available for the payment
*
* @deprecated Not publicly available
* @return \PayPal\Api\FundingOption
*/
public function getFundingOption()
@@ -220,6 +222,7 @@ class Payer extends PayPalModel
/**
* Funding option related to default funding option.
*
* @deprecated Not publicly available
* @param \PayPal\Api\FundingOption $related_funding_option
*
* @return $this
@@ -233,6 +236,7 @@ class Payer extends PayPalModel
/**
* Funding option related to default funding option.
*
* @deprecated Not publicly available
* @return \PayPal\Api\FundingOption
*/
public function getRelatedFundingOption()

View File

@@ -13,7 +13,6 @@ use PayPal\Common\PayPalModel;
*
* @property string email
* @property string external_remember_me_id
* @property string buyer_account_number
* @property string salutation
* @property string first_name
* @property string middle_name
@@ -32,7 +31,7 @@ use PayPal\Common\PayPalModel;
class PayerInfo extends PayPalModel
{
/**
* Email address representing the Payer.
* Email address representing the payer. 127 characters max.
*
* @param string $email
*
@@ -45,7 +44,7 @@ class PayerInfo extends PayPalModel
}
/**
* Email address representing the Payer.
* Email address representing the payer. 127 characters max.
*
* @return string
*/
@@ -55,7 +54,7 @@ class PayerInfo extends PayPalModel
}
/**
* External Remember Me id representing the Payer
* External Remember Me id representing the payer
*
* @param string $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
*/
@@ -80,28 +79,30 @@ class PayerInfo extends PayPalModel
/**
* Account Number representing the Payer
*
* @param string $buyer_account_number
* @deprecated Not publicly available
* @param string $account_number
*
* @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;
}
/**
* Account Number representing the Payer
*
* @deprecated Not publicly available
* @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
*
@@ -114,7 +115,7 @@ class PayerInfo extends PayPalModel
}
/**
* Salutation of the Payer.
* Salutation of the payer.
*
* @return string
*/
@@ -124,7 +125,7 @@ class PayerInfo extends PayPalModel
}
/**
* First Name of the Payer.
* First name of the payer.
*
* @param string $first_name
*
@@ -137,7 +138,7 @@ class PayerInfo extends PayPalModel
}
/**
* First Name of the Payer.
* First name of the payer.
*
* @return string
*/
@@ -147,7 +148,7 @@ class PayerInfo extends PayPalModel
}
/**
* Middle Name of the Payer.
* Middle name of the payer.
*
* @param string $middle_name
*
@@ -160,7 +161,7 @@ class PayerInfo extends PayPalModel
}
/**
* Middle Name of the Payer.
* Middle name of the payer.
*
* @return string
*/
@@ -170,7 +171,7 @@ class PayerInfo extends PayPalModel
}
/**
* Last Name of the Payer.
* Last name of the payer.
*
* @param string $last_name
*
@@ -183,7 +184,7 @@ class PayerInfo extends PayPalModel
}
/**
* Last Name of the Payer.
* Last name of the payer.
*
* @return string
*/
@@ -193,7 +194,7 @@ class PayerInfo extends PayPalModel
}
/**
* Suffix of the Payer.
* Suffix of the payer.
*
* @param string $suffix
*
@@ -206,7 +207,7 @@ class PayerInfo extends PayPalModel
}
/**
* Suffix of the Payer.
* Suffix of the payer.
*
* @return string
*/
@@ -216,7 +217,7 @@ class PayerInfo extends PayPalModel
}
/**
* PayPal assigned Payer ID.
* PayPal assigned encrypted Payer ID.
*
* @param string $payer_id
*
@@ -229,7 +230,7 @@ class PayerInfo extends PayPalModel
}
/**
* PayPal assigned Payer ID.
* PayPal assigned encrypted Payer ID.
*
* @return string
*/
@@ -239,7 +240,7 @@ class PayerInfo extends PayPalModel
}
/**
* Phone number representing the Payer.
* Phone number representing the payer. 20 characters max.
*
* @param string $phone
*
@@ -252,7 +253,7 @@ class PayerInfo extends PayPalModel
}
/**
* Phone number representing the Payer.
* Phone number representing the payer. 20 characters max.
*
* @return string
*/
@@ -309,7 +310,7 @@ 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
*
@@ -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
*/
@@ -332,7 +333,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`.
* Valid Values: ["BR_CPF", "BR_CNPJ"]
*
* @param string $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
*/
@@ -356,7 +357,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.
*
* @param string $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
*/
@@ -402,7 +403,7 @@ class PayerInfo extends PayPalModel
}
/**
* Obsolete. Use shipping address present in purchase unit.
* Shipping address of payer PayPal account.
*
* @param \PayPal\Api\ShippingAddress $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
*/

View File

@@ -16,23 +16,26 @@ use PayPal\Validation\ArgumentValidator;
* @package PayPal\Api
*
* @property string id
* @property string create_time
* @property string update_time
* @property string intent
* @property \PayPal\Api\Payer payer
* @property \PayPal\Api\PotentialPayerInfo potential_payer_info
* @property \PayPal\Api\Payee payee
* @property string cart
* @property \PayPal\Api\Transaction[] transactions
* @property \PayPal\Api\Error[] failed_transactions
* @property string[] billing_agreement_tokens
* @property \PayPal\Api\PaymentInstruction payment_instruction
* @property string state
* @property \PayPal\Api\RedirectUrls redirect_urls
* @property string experience_profile_id
* @property string note_to_payer
* @property \PayPal\Api\RedirectUrls redirect_urls
* @property string failure_reason
* @property string create_time
* @property string update_time
* @property \PayPal\Api\Links[] links
*/
class Payment extends PayPalResourceModel
{
/**
* Identifier of the payment resource created.
* ID of the created payment, the 'transaction ID'
*
* @param string $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
*/
@@ -55,7 +58,7 @@ class Payment extends PayPalResourceModel
}
/**
* Intent of the payment - Sale or Authorization or Order.
* Payment intent.
* Valid Values: ["sale", "authorize", "order"]
*
* @param string $intent
@@ -69,7 +72,7 @@ class Payment extends PayPalResourceModel
}
/**
* Intent of the payment - Sale or Authorization or Order.
* Payment intent.
*
* @return string
*/
@@ -102,7 +105,30 @@ 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
*
@@ -115,7 +141,7 @@ class Payment extends PayPalResourceModel
}
/**
* .
* Receiver of funds for this payment. **Readonly for PayPal external REST payments.**
*
* @return \PayPal\Api\Payee
*/
@@ -127,6 +153,7 @@ class Payment extends PayPalResourceModel
/**
* ID of the cart to execute the payment.
*
* @deprecated Not publicly available
* @param string $cart
*
* @return $this
@@ -140,6 +167,7 @@ class Payment extends PayPalResourceModel
/**
* ID of the cart to execute the payment.
*
* @deprecated Not publicly available
* @return string
*/
public function getCart()
@@ -148,7 +176,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.
*
* @param \PayPal\Api\Transaction[] $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[]
*/
@@ -203,6 +231,7 @@ class Payment extends PayPalResourceModel
/**
* Applicable for advanced payments like multi seller payment (MSP) to support partial failures
*
* @deprecated Not publicly available
* @param \PayPal\Api\Error[] $failed_transactions
*
* @return $this
@@ -216,6 +245,7 @@ class Payment extends PayPalResourceModel
/**
* Applicable for advanced payments like multi seller payment (MSP) to support partial failures
*
* @deprecated Not publicly available
* @return \PayPal\Api\Error[]
*/
public function getFailedTransactions()
@@ -226,6 +256,7 @@ class Payment extends PayPalResourceModel
/**
* Append FailedTransactions to the list.
*
* @deprecated Not publicly available
* @param \PayPal\Api\Error $error
* @return $this
*/
@@ -243,6 +274,7 @@ class Payment extends PayPalResourceModel
/**
* Remove FailedTransactions from the list.
*
* @deprecated Not publicly available
* @param \PayPal\Api\Error $error
* @return $this
*/
@@ -254,7 +286,85 @@ 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
*
@@ -267,7 +377,7 @@ class Payment extends PayPalResourceModel
}
/**
* A payment instruction resource
* Instructions for the payer to complete this payment.
*
* @return \PayPal\Api\PaymentInstruction
*/
@@ -277,8 +387,8 @@ class Payment extends PayPalResourceModel
}
/**
* state of the payment
* Valid Values: ["created", "approved", "completed", "partially_completed", "failed", "canceled", "expired", "in_progress"]
* Payment state.
* Valid Values: ["created", "approved", "failed", "partially_completed", "in_progress"]
*
* @param string $state
*
@@ -291,7 +401,7 @@ class Payment extends PayPalResourceModel
}
/**
* state of the payment
* Payment state.
*
* @return string
*/
@@ -301,7 +411,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.
*
* @param string $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
*/
@@ -324,7 +434,30 @@ 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
*
@@ -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
*/
@@ -347,7 +480,31 @@ 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
*
@@ -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
*/
@@ -370,7 +527,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).
*
* @param string $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
*/
@@ -450,7 +607,7 @@ 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 ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
@@ -474,7 +631,7 @@ 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 ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.

View File

@@ -14,8 +14,8 @@ use PayPal\Common\PayPalModel;
* @property string id
* @property string number
* @property string type
* @property int expire_month
* @property int expire_year
* @property string expire_month
* @property string expire_year
* @property string start_month
* @property string start_year
* @property string cvv2
@@ -26,6 +26,7 @@ use PayPal\Common\PayPalModel;
* @property string external_customer_id
* @property string status
* @property string valid_until
* @property string issue_number
* @property \PayPal\Api\Links[] links
*/
class PaymentCard extends PayPalModel
@@ -103,7 +104,7 @@ class PaymentCard extends PayPalModel
/**
* 2 digit card expiry month.
*
* @param int $expire_month
* @param string $expire_month
*
* @return $this
*/
@@ -116,7 +117,7 @@ class PaymentCard extends PayPalModel
/**
* 2 digit card expiry month.
*
* @return int
* @return string
*/
public function getExpireMonth()
{
@@ -126,7 +127,7 @@ class PaymentCard extends PayPalModel
/**
* 4 digit card expiry year
*
* @param int $expire_year
* @param string $expire_year
*
* @return $this
*/
@@ -139,7 +140,7 @@ class PaymentCard extends PayPalModel
/**
* 4 digit card expiry year
*
* @return int
* @return string
*/
public function getExpireYear()
{
@@ -147,7 +148,7 @@ class PaymentCard extends PayPalModel
}
/**
* 2 digit card start month.
* 2 digit card start month. Needed for UK Maestro Card.
*
* @param string $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
*/
@@ -170,7 +171,7 @@ class PaymentCard extends PayPalModel
}
/**
* 4 digit card start year.
* 4 digit card start year. Needed for UK Maestro Card.
*
* @param string $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
*/
@@ -377,6 +378,29 @@ class PaymentCard extends PayPalModel
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
*

View File

@@ -12,12 +12,13 @@ use PayPal\Common\PayPalModel;
* @package PayPal\Api
*
* @property string payer_id
* @property string carrier_account_id
* @property \PayPal\Api\Transaction[] transactions
*/
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
*
@@ -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
*/
@@ -40,7 +41,30 @@ 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
*
@@ -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[]
*/

View File

@@ -4,13 +4,12 @@ namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
* 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
*
@@ -46,6 +45,7 @@ class PaymentInstruction extends PayPalResourceModel
{
return $this->reference_number;
}
/**
* Type of payment instruction
* Valid Values: ["MANUAL_BANK_TRANSFER", "PAY_UPON_INVOICE"]

View File

@@ -16,7 +16,7 @@ use PayPal\Common\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"]
*
* @param string $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
*/
@@ -39,4 +39,54 @@ class PaymentOptions extends PayPalModel
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
*
* 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
*
@@ -18,7 +18,7 @@ use PayPal\Validation\UrlValidator;
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
* @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
*/
@@ -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
* @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
*/

View File

@@ -4,7 +4,6 @@ namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
@@ -15,8 +14,6 @@ use PayPal\Validation\ArgumentValidator;
* @package PayPal\Api
*
* @property string id
* @property string create_time
* @property string update_time
* @property \PayPal\Api\Amount amount
* @property string state
* @property string reason
@@ -24,12 +21,14 @@ use PayPal\Validation\ArgumentValidator;
* @property string capture_id
* @property string parent_payment
* @property string description
* @property string create_time
* @property string update_time
* @property \PayPal\Api\Links[] links
*/
class Refund extends PayPalResourceModel
{
/**
* Identifier of the refund transaction in UTC ISO8601 format.
* ID of the refund transaction. 17 characters max.
*
* @param string $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
*/
@@ -52,7 +51,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.
*
* @param \PayPal\Api\Amount $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
*/
@@ -75,7 +74,7 @@ class Refund extends PayPalResourceModel
}
/**
* State of the refund transaction.
* State of the refund.
* Valid Values: ["pending", "completed", "failed"]
*
* @param string $state
@@ -89,7 +88,7 @@ class Refund extends PayPalResourceModel
}
/**
* State of the refund transaction.
* State of the refund.
*
* @return string
*/
@@ -145,7 +144,7 @@ class Refund extends PayPalResourceModel
}
/**
* ID of the Capture transaction being refunded.
* ID of the sale transaction being refunded.
*
* @param string $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
*/
@@ -168,7 +167,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.
*
* @param string $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
*/
@@ -214,7 +213,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).
*
* @param string $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
*/
@@ -237,7 +236,7 @@ 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
*
@@ -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
*/

View File

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

View File

@@ -4,7 +4,6 @@ namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
/**
@@ -16,30 +15,31 @@ use PayPal\Validation\ArgumentValidator;
*
* @property string id
* @property string purchase_unit_reference_id
* @property string create_time
* @property string update_time
* @property \PayPal\Api\Amount amount
* @property string payment_mode
* @property string pending_reason
* @property string state
* @property string reason_code
* @property string protection_eligibility
* @property string protection_eligibility_type
* @property string clearing_time
* @property string recipient_fund_status
* @property string hold_reason
* @property string payment_hold_status
* @property string[] payment_hold_reasons
* @property \PayPal\Api\Currency transaction_fee
* @property \PayPal\Api\Currency receivable_amount
* @property string exchange_rate
* @property \PayPal\Api\FmfDetails fmf_details
* @property string receipt_id
* @property string parent_payment
* @property \PayPal\Api\ProcessorResponse processor_response
* @property string billing_agreement_id
* @property string create_time
* @property string update_time
* @property \PayPal\Api\Links[] links
*/
class Sale extends PayPalResourceModel
{
/**
* Identifier of the sale transaction.
* ID of the sale transaction.
*
* @param string $id
*
@@ -52,7 +52,7 @@ class Sale extends PayPalResourceModel
}
/**
* Identifier of the sale transaction.
* ID of the sale transaction.
*
* @return string
*/
@@ -62,7 +62,7 @@ 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
*
@@ -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
*/
@@ -108,7 +108,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`.
* Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
*
* @param string $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
*/
@@ -132,31 +132,7 @@ class Sale extends PayPalResourceModel
}
/**
* Reason of Pending transaction.
*
*
*
* @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.
* State of the sale.
* Valid Values: ["completed", "partially_refunded", "pending", "refunded"]
*
* @param string $state
@@ -170,7 +146,7 @@ class Sale extends PayPalResourceModel
}
/**
* State of the sale transaction.
* State of the sale.
*
* @return string
*/
@@ -180,7 +156,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`.
* 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
@@ -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
*/
@@ -204,7 +180,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`.
* Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
*
* @param string $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
*/
@@ -228,8 +204,8 @@ class Sale extends PayPalResourceModel
}
/**
* Protection Eligibility Type of the Payer
* Valid Values: ["ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE", "INELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE"]
* 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: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"]
*
* @param string $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
*/
@@ -252,7 +228,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`.
*
* @param string $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
*/
@@ -275,55 +251,84 @@ class Sale extends PayPalResourceModel
}
/**
* Indicates the credit status of fund to the recipient. It will be returned only when payment status is 'completed'
* Valid Values: ["COMPLETED", "HELD"]
* Status of the Recipient Fund. For now, it will be returned only when fund status is held
* Valid Values: ["HELD"]
*
* @param string $recipient_fund_status
* @param string $payment_hold_status
*
* @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;
}
/**
* 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
*/
public function getRecipientFundStatus()
public function getPaymentHoldStatus()
{
return $this->recipient_fund_status;
return $this->payment_hold_status;
}
/**
* Reason for holding the funds.
* Valid Values: ["NEW_SELLER_PAYMENT_HOLD", "PAYMENT_HOLD"]
* Reasons for PayPal holding recipient fund. It is set only if payment hold status is held
*
* @param string $hold_reason
* @param string[] $payment_hold_reasons
*
* @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;
}
/**
* 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
*
@@ -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
*/
@@ -346,7 +351,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.
*
* @param \PayPal\Api\Currency $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
*/
@@ -369,7 +374,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.
*
* @param string $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
*/
@@ -392,7 +397,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.
*
* @param \PayPal\Api\FmfDetails $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
*/
@@ -415,7 +420,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.
*
* @param string $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
*/
@@ -438,7 +443,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.
*
* @param string $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
*/
@@ -461,7 +466,53 @@ 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
*
@@ -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
*/

View File

@@ -110,6 +110,28 @@ class ShippingInfo extends PayPalModel
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.
*

View File

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

View File

@@ -38,7 +38,7 @@ class ModelAccessorValidator
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";
$errorMessage = "It seems that $className:$methodName is a new field added to the API response. 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);

View File

@@ -13,6 +13,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object Address
*
* @return string
*/
public static function getJson()
@@ -22,6 +23,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase
/**
* Gets Object Instance with Json data filled in
*
* @return Address
*/
public static function getObject()
@@ -32,6 +34,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return Address
*/
public function testSerializationDeserialization()
@@ -68,4 +71,5 @@ class AddressTest extends \PHPUnit_Framework_TestCase
$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,6 +13,7 @@ class AmountTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object Amount
*
* @return string
*/
public static function getJson()
@@ -22,6 +23,7 @@ class AmountTest extends \PHPUnit_Framework_TestCase
/**
* Gets Object Instance with Json data filled in
*
* @return Amount
*/
public static function getObject()
@@ -32,6 +34,7 @@ class AmountTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return Amount
*/
public function testSerializationDeserialization()
@@ -56,4 +59,5 @@ class AmountTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getDetails(), DetailsTest::getObject());
}
}

View File

@@ -14,6 +14,7 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object Authorization
*
* @return string
*/
public static function getJson()
@@ -23,6 +24,7 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
/**
* Gets Object Instance with Json data filled in
*
* @return Authorization
*/
public static function getObject()
@@ -33,6 +35,7 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return Authorization
*/
public function testSerializationDeserialization()
@@ -79,7 +82,6 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
}
/**
* @dataProvider mockProvider
* @param Authorization $obj
@@ -99,6 +101,7 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
$result = $obj->get("authorizationId", $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Authorization $obj
@@ -119,6 +122,7 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
$result = $obj->capture($capture, $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Authorization $obj
@@ -138,6 +142,7 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
$result = $obj->void($mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Authorization $obj

View File

@@ -13,6 +13,7 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object BankAccount
*
* @return string
*/
public static function getJson()
@@ -22,6 +23,7 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase
/**
* Gets Object Instance with Json data filled in
*
* @return BankAccount
*/
public static function getObject()
@@ -32,6 +34,7 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return BankAccount
*/
public function testSerializationDeserialization()
@@ -98,93 +101,5 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase
$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
*
* @return string
*/
public static function getJson()
@@ -22,6 +23,7 @@ class BankTokenTest extends \PHPUnit_Framework_TestCase
/**
* Gets Object Instance with Json data filled in
*
* @return BankToken
*/
public static function getObject()
@@ -32,6 +34,7 @@ class BankTokenTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return BankToken
*/
public function testSerializationDeserialization()
@@ -56,4 +59,5 @@ class BankTokenTest extends \PHPUnit_Framework_TestCase
$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,6 +14,7 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object Capture
*
* @return string
*/
public static function getJson()
@@ -23,6 +24,7 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
/**
* Gets Object Instance with Json data filled in
*
* @return Capture
*/
public static function getObject()
@@ -33,6 +35,7 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return Capture
*/
public function testSerializationDeserialization()
@@ -69,7 +72,6 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
}
/**
* @dataProvider mockProvider
* @param Capture $obj
@@ -89,6 +91,7 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
$result = $obj->get("captureId", $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Capture $obj

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

View File

@@ -13,15 +13,17 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object CartBase
*
* @return string
*/
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
*
* @return CartBase
*/
public static function getObject()
@@ -32,12 +34,14 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return CartBase
*/
public function testSerializationDeserialization()
{
$obj = new CartBase(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getReferenceId());
$this->assertNotNull($obj->getAmount());
$this->assertNotNull($obj->getPayee());
$this->assertNotNull($obj->getDescription());
@@ -45,10 +49,12 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj->getCustom());
$this->assertNotNull($obj->getInvoiceNumber());
$this->assertNotNull($obj->getSoftDescriptor());
$this->assertNotNull($obj->getSoftDescriptorCity());
$this->assertNotNull($obj->getPaymentOptions());
$this->assertNotNull($obj->getItemList());
$this->assertNotNull($obj->getNotifyUrl());
$this->assertNotNull($obj->getOrderUrl());
$this->assertNotNull($obj->getExternalFunding());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
@@ -59,6 +65,7 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getReferenceId(), "TestSample");
$this->assertEquals($obj->getAmount(), AmountTest::getObject());
$this->assertEquals($obj->getPayee(), PayeeTest::getObject());
$this->assertEquals($obj->getDescription(), "TestSample");
@@ -66,10 +73,12 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getCustom(), "TestSample");
$this->assertEquals($obj->getInvoiceNumber(), "TestSample");
$this->assertEquals($obj->getSoftDescriptor(), "TestSample");
$this->assertEquals($obj->getSoftDescriptorCity(), "TestSample");
$this->assertEquals($obj->getPaymentOptions(), PaymentOptionsTest::getObject());
$this->assertEquals($obj->getItemList(), ItemListTest::getObject());
$this->assertEquals($obj->getNotifyUrl(), "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->setNotifyUrl(null);
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage OrderUrl is not a fully qualified URL
@@ -90,4 +100,5 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
$obj = new CartBase();
$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;
use PayPal\Api\CreditCard;
use PayPal\Transport\PPRestCall;
/**
* Class CreditCard
@@ -14,15 +13,17 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object CreditCard
*
* @return string
*/
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
*
* @return CreditCard
*/
public static function getObject()
@@ -33,6 +34,7 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return CreditCard
*/
public function testSerializationDeserialization()
@@ -49,12 +51,7 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj->getLastName());
$this->assertNotNull($obj->getBillingAddress());
$this->assertNotNull($obj->getExternalCustomerId());
$this->assertNotNull($obj->getMerchantId());
$this->assertNotNull($obj->getPayerId());
$this->assertNotNull($obj->getExternalCardId());
$this->assertNotNull($obj->getState());
$this->assertNotNull($obj->getCreateTime());
$this->assertNotNull($obj->getUpdateTime());
$this->assertNotNull($obj->getValidUntil());
$this->assertNotNull($obj->getLinks());
$this->assertEquals(self::getJson(), $obj->toJson());
@@ -77,123 +74,10 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getLastName(), "TestSample");
$this->assertEquals($obj->getBillingAddress(), AddressTest::getObject());
$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->getCreateTime(), "TestSample");
$this->assertEquals($obj->getUpdateTime(), "TestSample");
$this->assertEquals($obj->getValidUntil(), "TestSample");
$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
*
* @return string
*/
public static function getJson()
@@ -22,6 +23,7 @@ class CreditCardTokenTest extends \PHPUnit_Framework_TestCase
/**
* Gets Object Instance with Json data filled in
*
* @return CreditCardToken
*/
public static function getObject()
@@ -32,6 +34,7 @@ class CreditCardTokenTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return CreditCardToken
*/
public function testSerializationDeserialization()
@@ -62,4 +65,5 @@ class CreditCardTokenTest extends \PHPUnit_Framework_TestCase
$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
*
* @return string
*/
public static function getJson()
@@ -22,6 +23,7 @@ class CreditTest extends \PHPUnit_Framework_TestCase
/**
* Gets Object Instance with Json data filled in
*
* @return Credit
*/
public static function getObject()
@@ -32,6 +34,7 @@ class CreditTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return Credit
*/
public function testSerializationDeserialization()
@@ -54,4 +57,5 @@ class CreditTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getType(), "TestSample");
}
}

View File

@@ -13,6 +13,7 @@ class CurrencyConversionTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object CurrencyConversion
*
* @return string
*/
public static function getJson()
@@ -22,6 +23,7 @@ class CurrencyConversionTest extends \PHPUnit_Framework_TestCase
/**
* Gets Object Instance with Json data filled in
*
* @return CurrencyConversion
*/
public static function getObject()
@@ -32,6 +34,7 @@ class CurrencyConversionTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return CurrencyConversion
*/
public function testSerializationDeserialization()

View File

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

View File

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

View File

@@ -13,15 +13,17 @@ class ErrorTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object Error
*
* @return string
*/
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
*
* @return Error
*/
public static function getObject()
@@ -32,6 +34,7 @@ class ErrorTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return Error
*/
public function testSerializationDeserialization()
@@ -40,11 +43,13 @@ class ErrorTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj);
$this->assertNotNull($obj->getName());
$this->assertNotNull($obj->getPurchaseUnitReferenceId());
$this->assertNotNull($obj->getDebugId());
$this->assertNotNull($obj->getMessage());
$this->assertNotNull($obj->getCode());
$this->assertNotNull($obj->getInformationLink());
$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->assertEquals(self::getJson(), $obj->toJson());
return $obj;
@@ -58,12 +63,15 @@ class ErrorTest extends \PHPUnit_Framework_TestCase
{
$this->assertEquals($obj->getName(), "TestSample");
$this->assertEquals($obj->getPurchaseUnitReferenceId(), "TestSample");
$this->assertEquals($obj->getDebugId(), "TestSample");
$this->assertEquals($obj->getMessage(), "TestSample");
$this->assertEquals($obj->getCode(), "TestSample");
$this->assertEquals($obj->getInformationLink(), "TestSample");
$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());
}
}

View File

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

View File

@@ -13,15 +13,17 @@ class FundingDetailTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object FundingDetail
*
* @return string
*/
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
*
* @return FundingDetail
*/
public static function getObject()
@@ -32,6 +34,7 @@ class FundingDetailTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return FundingDetail
*/
public function testSerializationDeserialization()
@@ -40,6 +43,8 @@ class FundingDetailTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj);
$this->assertNotNull($obj->getClearingTime());
$this->assertNotNull($obj->getPaymentHoldDate());
$this->assertNotNull($obj->getPaymentDebitDate());
$this->assertNotNull($obj->getProcessingType());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
@@ -52,6 +57,9 @@ class FundingDetailTest extends \PHPUnit_Framework_TestCase
{
$this->assertEquals($obj->getClearingTime(), "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
*
* @return string
*/
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
*
* @return FundingInstrument
*/
public static function getObject()
@@ -32,6 +34,7 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return FundingInstrument
*/
public function testSerializationDeserialization()
@@ -41,10 +44,16 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj->getCreditCard());
$this->assertNotNull($obj->getCreditCardToken());
$this->assertNotNull($obj->getPaymentCard());
$this->assertNotNull($obj->getPaymentCardToken());
$this->assertNotNull($obj->getBankAccount());
$this->assertNotNull($obj->getBankAccountToken());
$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());
return $obj;
}
@@ -58,10 +67,16 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getCreditCard(), CreditCardTest::getObject());
$this->assertEquals($obj->getCreditCardToken(), CreditCardTokenTest::getObject());
$this->assertEquals($obj->getPaymentCard(), PaymentCardTest::getObject());
$this->assertEquals($obj->getPaymentCardToken(), PaymentCardTokenTest::getObject());
$this->assertEquals($obj->getBankAccount(), ExtendedBankAccountTest::getObject());
$this->assertEquals($obj->getBankAccountToken(), BankTokenTest::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,6 +13,7 @@ class FundingOptionTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object FundingOption
*
* @return string
*/
public static function getJson()
@@ -22,6 +23,7 @@ class FundingOptionTest extends \PHPUnit_Framework_TestCase
/**
* Gets Object Instance with Json data filled in
*
* @return FundingOption
*/
public static function getObject()
@@ -32,6 +34,7 @@ class FundingOptionTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return FundingOption
*/
public function testSerializationDeserialization()
@@ -61,4 +64,6 @@ class FundingOptionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getInstallmentInfo(), InstallmentInfoTest::getObject());
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
}
}

View File

@@ -13,6 +13,7 @@ class FundingSourceTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object FundingSource
*
* @return string
*/
public static function getJson()
@@ -22,6 +23,7 @@ class FundingSourceTest extends \PHPUnit_Framework_TestCase
/**
* Gets Object Instance with Json data filled in
*
* @return FundingSource
*/
public static function getObject()
@@ -32,6 +34,7 @@ class FundingSourceTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return FundingSource
*/
public function testSerializationDeserialization()
@@ -67,4 +70,6 @@ class FundingSourceTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getExtends(), FundingInstrumentTest::getObject());
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
}
}

View File

@@ -13,6 +13,7 @@ class IncentiveTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object Incentive
*
* @return string
*/
public static function getJson()
@@ -22,6 +23,7 @@ class IncentiveTest extends \PHPUnit_Framework_TestCase
/**
* Gets Object Instance with Json data filled in
*
* @return Incentive
*/
public static function getObject()
@@ -32,6 +34,7 @@ class IncentiveTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return Incentive
*/
public function testSerializationDeserialization()
@@ -77,4 +80,5 @@ class IncentiveTest extends \PHPUnit_Framework_TestCase
$obj = new Incentive();
$obj->setLogoImageUrl(null);
}
}

View File

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

View File

@@ -13,15 +13,17 @@ class InstallmentOptionTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object InstallmentOption
*
* @return string
*/
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
*
* @return InstallmentOption
*/
public static function getObject()
@@ -32,6 +34,7 @@ class InstallmentOptionTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return InstallmentOption
*/
public function testSerializationDeserialization()
@@ -55,6 +58,8 @@ class InstallmentOptionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getTerm(), 123);
$this->assertEquals($obj->getMonthlyPayment(), 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
*
* @return string
*/
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
*
* @return ItemList
*/
public static function getObject()
@@ -32,6 +34,7 @@ class ItemListTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return ItemList
*/
public function testSerializationDeserialization()
@@ -41,6 +44,7 @@ class ItemListTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj->getItems());
$this->assertNotNull($obj->getShippingAddress());
$this->assertNotNull($obj->getShippingMethod());
$this->assertNotNull($obj->getShippingPhoneNumber());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
@@ -54,6 +58,8 @@ class ItemListTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getItems(), ItemTest::getObject());
$this->assertEquals($obj->getShippingAddress(), ShippingAddressTest::getObject());
$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
*
* @return string
*/
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
*
* @return Item
*/
public static function getObject()
@@ -32,19 +34,20 @@ class ItemTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return Item
*/
public function testSerializationDeserialization()
{
$obj = new Item(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getQuantity());
$this->assertNotNull($obj->getSku());
$this->assertNotNull($obj->getName());
$this->assertNotNull($obj->getDescription());
$this->assertNotNull($obj->getQuantity());
$this->assertNotNull($obj->getPrice());
$this->assertNotNull($obj->getTax());
$this->assertNotNull($obj->getCurrency());
$this->assertNotNull($obj->getSku());
$this->assertNotNull($obj->getTax());
$this->assertNotNull($obj->getUrl());
$this->assertNotNull($obj->getCategory());
$this->assertNotNull($obj->getWeight());
@@ -63,13 +66,13 @@ class ItemTest extends \PHPUnit_Framework_TestCase
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getQuantity(), "TestSample");
$this->assertEquals($obj->getSku(), "TestSample");
$this->assertEquals($obj->getName(), "TestSample");
$this->assertEquals($obj->getDescription(), "TestSample");
$this->assertEquals($obj->getQuantity(), "12.34");
$this->assertEquals($obj->getPrice(), "12.34");
$this->assertEquals($obj->getTax(), "12.34");
$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->getCategory(), "TestSample");
$this->assertEquals($obj->getWeight(), MeasurementTest::getObject());

View File

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

View File

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

View File

@@ -4,7 +4,6 @@ namespace PayPal\Test\Api;
use PayPal\Api\Authorization;
use PayPal\Api\Order;
use PayPal\Transport\PPRestCall;
/**
* Class Order
@@ -15,15 +14,17 @@ class OrderTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object Order
*
* @return string
*/
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
*
* @return Order
*/
public static function getObject()
@@ -34,6 +35,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return Order
*/
public function testSerializationDeserialization()
@@ -80,7 +82,6 @@ class OrderTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
}
/**
* @dataProvider mockProvider
* @param Order $obj
@@ -100,6 +101,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase
$result = $obj->get("orderId", $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Order $obj
@@ -120,6 +122,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase
$result = $obj->capture($capture, $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Order $obj
@@ -139,6 +142,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase
$result = $obj->void($mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Order $obj

View File

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

View File

@@ -13,15 +13,17 @@ class PayeeTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object Payee
*
* @return string
*/
public static function getJson()
{
return '{"email":"TestSample","merchant_id":"TestSample"}';
return '{"email":"TestSample","merchant_id":"TestSample","first_name":"TestSample","last_name":"TestSample","account_number":"TestSample","phone":' . PhoneTest::getJson() . '}';
}
/**
* Gets Object Instance with Json data filled in
*
* @return Payee
*/
public static function getObject()
@@ -32,6 +34,7 @@ class PayeeTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return Payee
*/
public function testSerializationDeserialization()
@@ -40,6 +43,10 @@ class PayeeTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj);
$this->assertNotNull($obj->getEmail());
$this->assertNotNull($obj->getMerchantId());
$this->assertNotNull($obj->getFirstName());
$this->assertNotNull($obj->getLastName());
$this->assertNotNull($obj->getAccountNumber());
$this->assertNotNull($obj->getPhone());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
@@ -52,5 +59,11 @@ class PayeeTest extends \PHPUnit_Framework_TestCase
{
$this->assertEquals($obj->getEmail(), "TestSample");
$this->assertEquals($obj->getMerchantId(), "TestSample");
$this->assertEquals($obj->getFirstName(), "TestSample");
$this->assertEquals($obj->getLastName(), "TestSample");
$this->assertEquals($obj->getAccountNumber(), "TestSample");
$this->assertEquals($obj->getPhone(), PhoneTest::getObject());
}
}

View File

@@ -13,15 +13,17 @@ class PayerInfoTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object PayerInfo
*
* @return string
*/
public static function getJson()
{
return '{"email":"TestSample","external_remember_me_id":"TestSample","buyer_account_number":"TestSample","salutation":"TestSample","first_name":"TestSample","middle_name":"TestSample","last_name":"TestSample","suffix":"TestSample","payer_id":"TestSample","phone":"TestSample","phone_type":"TestSample","birth_date":"TestSample","tax_id":"TestSample","tax_id_type":"TestSample","country_code":"TestSample","billing_address":' .AddressTest::getJson() . ',"shipping_address":' .ShippingAddressTest::getJson() . '}';
return '{"email":"TestSample","external_remember_me_id":"TestSample","account_number":"TestSample","salutation":"TestSample","first_name":"TestSample","middle_name":"TestSample","last_name":"TestSample","suffix":"TestSample","payer_id":"TestSample","phone":"TestSample","phone_type":"TestSample","birth_date":"TestSample","tax_id":"TestSample","tax_id_type":"TestSample","country_code":"TestSample","billing_address":' . AddressTest::getJson() . ',"shipping_address":' . ShippingAddressTest::getJson() . '}';
}
/**
* Gets Object Instance with Json data filled in
*
* @return PayerInfo
*/
public static function getObject()
@@ -32,6 +34,7 @@ class PayerInfoTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return PayerInfo
*/
public function testSerializationDeserialization()
@@ -40,7 +43,7 @@ class PayerInfoTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj);
$this->assertNotNull($obj->getEmail());
$this->assertNotNull($obj->getExternalRememberMeId());
$this->assertNotNull($obj->getBuyerAccountNumber());
$this->assertNotNull($obj->getAccountNumber());
$this->assertNotNull($obj->getSalutation());
$this->assertNotNull($obj->getFirstName());
$this->assertNotNull($obj->getMiddleName());
@@ -67,7 +70,7 @@ class PayerInfoTest extends \PHPUnit_Framework_TestCase
{
$this->assertEquals($obj->getEmail(), "TestSample");
$this->assertEquals($obj->getExternalRememberMeId(), "TestSample");
$this->assertEquals($obj->getBuyerAccountNumber(), "TestSample");
$this->assertEquals($obj->getAccountNumber(), "TestSample");
$this->assertEquals($obj->getSalutation(), "TestSample");
$this->assertEquals($obj->getFirstName(), "TestSample");
$this->assertEquals($obj->getMiddleName(), "TestSample");
@@ -84,4 +87,5 @@ class PayerInfoTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getShippingAddress(), ShippingAddressTest::getObject());
}
}

View File

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

View File

@@ -13,15 +13,17 @@ class PaymentCardTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object PaymentCard
*
* @return string
*/
public static function getJson()
{
return '{"id":"TestSample","number":"TestSample","type":"TestSample","expire_month":123,"expire_year":123,"start_month":"TestSample","start_year":"TestSample","cvv2":"TestSample","first_name":"TestSample","last_name":"TestSample","billing_country":"TestSample","billing_address":' .AddressTest::getJson() . ',"external_customer_id":"TestSample","status":"TestSample","valid_until":"TestSample","links":' .LinksTest::getJson() . '}';
return '{"id":"TestSample","number":"TestSample","type":"TestSample","expire_month":123,"expire_year":123,"start_month":"TestSample","start_year":"TestSample","cvv2":"TestSample","first_name":"TestSample","last_name":"TestSample","billing_country":"TestSample","billing_address":' . AddressTest::getJson() . ',"external_customer_id":"TestSample","status":"TestSample","valid_until":"TestSample","issue_number":"TestSample","links":' . LinksTest::getJson() . '}';
}
/**
* Gets Object Instance with Json data filled in
*
* @return PaymentCard
*/
public static function getObject()
@@ -32,6 +34,7 @@ class PaymentCardTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return PaymentCard
*/
public function testSerializationDeserialization()
@@ -53,6 +56,7 @@ class PaymentCardTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj->getExternalCustomerId());
$this->assertNotNull($obj->getStatus());
$this->assertNotNull($obj->getValidUntil());
$this->assertNotNull($obj->getIssueNumber());
$this->assertNotNull($obj->getLinks());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
@@ -79,7 +83,9 @@ class PaymentCardTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getExternalCustomerId(), "TestSample");
$this->assertEquals($obj->getStatus(), "TestSample");
$this->assertEquals($obj->getValidUntil(), "TestSample");
$this->assertEquals($obj->getIssueNumber(), "TestSample");
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
}
}

View File

@@ -13,15 +13,17 @@ class PaymentExecutionTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object PaymentExecution
*
* @return string
*/
public static function getJson()
{
return '{"payer_id":"TestSample","transactions":[' .TransactionTest::getJson() . ']}';
return '{"payer_id":"TestSample","carrier_account_id":"TestSample","transactions":[' . TransactionTest::getJson() . ']}';
}
/**
* Gets Object Instance with Json data filled in
*
* @return PaymentExecution
*/
public static function getObject()
@@ -32,6 +34,7 @@ class PaymentExecutionTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return PaymentExecution
*/
public function testSerializationDeserialization()
@@ -39,6 +42,7 @@ class PaymentExecutionTest extends \PHPUnit_Framework_TestCase
$obj = new PaymentExecution(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getPayerId());
$this->assertNotNull($obj->getCarrierAccountId());
$this->assertNotNull($obj->getTransactions());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
@@ -51,6 +55,9 @@ class PaymentExecutionTest extends \PHPUnit_Framework_TestCase
public function testGetters($obj)
{
$this->assertEquals($obj->getPayerId(), "TestSample");
$this->assertEquals($obj->getCarrierAccountId(), "TestSample");
$this->assertEquals($obj->getTransactions(), array(TransactionTest::getObject()));
}
}

View File

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

View File

@@ -13,15 +13,17 @@ class PaymentOptionsTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object PaymentOptions
*
* @return string
*/
public static function getJson()
{
return '{"allowed_payment_method":"TestSample"}';
return '{"allowed_payment_method":"TestSample","recurring_flag":true,"skip_fmf":true}';
}
/**
* Gets Object Instance with Json data filled in
*
* @return PaymentOptions
*/
public static function getObject()
@@ -32,6 +34,7 @@ class PaymentOptionsTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return PaymentOptions
*/
public function testSerializationDeserialization()
@@ -39,6 +42,8 @@ class PaymentOptionsTest extends \PHPUnit_Framework_TestCase
$obj = new PaymentOptions(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getAllowedPaymentMethod());
$this->assertNotNull($obj->getRecurringFlag());
$this->assertNotNull($obj->getSkipFmf());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
@@ -50,5 +55,9 @@ class PaymentOptionsTest extends \PHPUnit_Framework_TestCase
public function testGetters($obj)
{
$this->assertEquals($obj->getAllowedPaymentMethod(), "TestSample");
$this->assertEquals($obj->getRecurringFlag(), true);
$this->assertEquals($obj->getSkipFmf(), true);
}
}

View File

@@ -4,7 +4,6 @@ namespace PayPal\Test\Api;
use PayPal\Api\object;
use PayPal\Api\Payment;
use PayPal\Transport\PPRestCall;
/**
* Class Payment
@@ -15,15 +14,17 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object Payment
*
* @return string
*/
public static function getJson()
{
return '{"id":"TestSample","intent":"TestSample","payer":' .PayerTest::getJson() . ',"payee":' .PayeeTest::getJson() . ',"cart":"TestSample","transactions":[' .TransactionTest::getJson() . '],"failed_transactions":' .ErrorTest::getJson() . ',"payment_instruction":' .PaymentInstructionTest::getJson() . ',"state":"TestSample","experience_profile_id":"TestSample","redirect_urls":' .RedirectUrlsTest::getJson() . ',"create_time":"TestSample","update_time":"TestSample","links":' .LinksTest::getJson() . '}';
return '{"id":"TestSample","intent":"TestSample","payer":' . PayerTest::getJson() . ',"potential_payer_info":' . PotentialPayerInfoTest::getJson() . ',"payee":' . PayeeTest::getJson() . ',"cart":"TestSample","transactions":[' . TransactionTest::getJson() . '],"failed_transactions":' . ErrorTest::getJson() . ',"billing_agreement_tokens":["TestSample"],"credit_financing_offered":' . CreditFinancingOfferedTest::getJson() . ',"payment_instruction":' . PaymentInstructionTest::getJson() . ',"state":"TestSample","experience_profile_id":"TestSample","note_to_payer":"TestSample","redirect_urls":' . RedirectUrlsTest::getJson() . ',"failure_reason":"TestSample","create_time":"TestSample","update_time":"TestSample","links":' . LinksTest::getJson() . '}';
}
/**
* Gets Object Instance with Json data filled in
*
* @return Payment
*/
public static function getObject()
@@ -34,6 +35,7 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return Payment
*/
public function testSerializationDeserialization()
@@ -43,14 +45,19 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj->getId());
$this->assertNotNull($obj->getIntent());
$this->assertNotNull($obj->getPayer());
$this->assertNotNull($obj->getPotentialPayerInfo());
$this->assertNotNull($obj->getPayee());
$this->assertNotNull($obj->getCart());
$this->assertNotNull($obj->getTransactions());
$this->assertNotNull($obj->getFailedTransactions());
$this->assertNotNull($obj->getBillingAgreementTokens());
$this->assertNotNull($obj->getCreditFinancingOffered());
$this->assertNotNull($obj->getPaymentInstruction());
$this->assertNotNull($obj->getState());
$this->assertNotNull($obj->getExperienceProfileId());
$this->assertNotNull($obj->getNoteToPayer());
$this->assertNotNull($obj->getRedirectUrls());
$this->assertNotNull($obj->getFailureReason());
$this->assertNotNull($obj->getCreateTime());
$this->assertNotNull($obj->getUpdateTime());
$this->assertNotNull($obj->getLinks());
@@ -67,14 +74,19 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getId(), "TestSample");
$this->assertEquals($obj->getIntent(), "TestSample");
$this->assertEquals($obj->getPayer(), PayerTest::getObject());
$this->assertEquals($obj->getPotentialPayerInfo(), PotentialPayerInfoTest::getObject());
$this->assertEquals($obj->getPayee(), PayeeTest::getObject());
$this->assertEquals($obj->getCart(), "TestSample");
$this->assertEquals($obj->getTransactions(), array(TransactionTest::getObject()));
$this->assertEquals($obj->getFailedTransactions(), ErrorTest::getObject());
$this->assertEquals($obj->getBillingAgreementTokens(), array("TestSample"));
$this->assertEquals($obj->getCreditFinancingOffered(), CreditFinancingOfferedTest::getObject());
$this->assertEquals($obj->getPaymentInstruction(), PaymentInstructionTest::getObject());
$this->assertEquals($obj->getState(), "TestSample");
$this->assertEquals($obj->getExperienceProfileId(), "TestSample");
$this->assertEquals($obj->getNoteToPayer(), "TestSample");
$this->assertEquals($obj->getRedirectUrls(), RedirectUrlsTest::getObject());
$this->assertEquals($obj->getFailureReason(), "TestSample");
$this->assertEquals($obj->getCreateTime(), "TestSample");
$this->assertEquals($obj->getUpdateTime(), "TestSample");
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
@@ -99,6 +111,7 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
$result = $obj->create($mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Payment $obj
@@ -118,6 +131,7 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
$result = $obj->get("paymentId", $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Payment $obj
@@ -138,6 +152,7 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
$result = $obj->update($patchRequest, $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Payment $obj
@@ -158,6 +173,7 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
$result = $obj->execute($paymentExecution, $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Payment $obj

View File

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

View File

@@ -0,0 +1,63 @@
<?php
namespace PayPal\Test\Api;
use PayPal\Common\PayPalModel;
use PayPal\Api\PotentialPayerInfo;
/**
* Class PotentialPayerInfo
*
* @package PayPal\Test\Api
*/
class PotentialPayerInfoTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object PotentialPayerInfo
* @return string
*/
public static function getJson()
{
return '{"email":"TestSample","external_remember_me_id":"TestSample","account_number":"TestSample","billing_address":' .AddressTest::getJson() . '}';
}
/**
* Gets Object Instance with Json data filled in
* @return PotentialPayerInfo
*/
public static function getObject()
{
return new PotentialPayerInfo(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return PotentialPayerInfo
*/
public function testSerializationDeserialization()
{
$obj = new PotentialPayerInfo(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getEmail());
$this->assertNotNull($obj->getExternalRememberMeId());
$this->assertNotNull($obj->getAccountNumber());
$this->assertNotNull($obj->getBillingAddress());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param PotentialPayerInfo $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getEmail(), "TestSample");
$this->assertEquals($obj->getExternalRememberMeId(), "TestSample");
$this->assertEquals($obj->getAccountNumber(), "TestSample");
$this->assertEquals($obj->getBillingAddress(), AddressTest::getObject());
}
}

View File

@@ -0,0 +1,65 @@
<?php
namespace PayPal\Test\Api;
use PayPal\Common\PayPalModel;
use PayPal\Api\PrivateLabelCard;
/**
* Class PrivateLabelCard
*
* @package PayPal\Test\Api
*/
class PrivateLabelCardTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object PrivateLabelCard
* @return string
*/
public static function getJson()
{
return '{"id":"TestSample","card_number":"TestSample","issuer_id":"TestSample","issuer_name":"TestSample","image_key":"TestSample"}';
}
/**
* Gets Object Instance with Json data filled in
* @return PrivateLabelCard
*/
public static function getObject()
{
return new PrivateLabelCard(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return PrivateLabelCard
*/
public function testSerializationDeserialization()
{
$obj = new PrivateLabelCard(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getId());
$this->assertNotNull($obj->getCardNumber());
$this->assertNotNull($obj->getIssuerId());
$this->assertNotNull($obj->getIssuerName());
$this->assertNotNull($obj->getImageKey());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param PrivateLabelCard $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getId(), "TestSample");
$this->assertEquals($obj->getCardNumber(), "TestSample");
$this->assertEquals($obj->getIssuerId(), "TestSample");
$this->assertEquals($obj->getIssuerName(), "TestSample");
$this->assertEquals($obj->getImageKey(), "TestSample");
}
}

View File

@@ -0,0 +1,67 @@
<?php
namespace PayPal\Test\Api;
use PayPal\Common\PayPalModel;
use PayPal\Api\ProcessorResponse;
/**
* Class ProcessorResponse
*
* @package PayPal\Test\Api
*/
class ProcessorResponseTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object ProcessorResponse
* @return string
*/
public static function getJson()
{
return '{"response_code":"TestSample","avs_code":"TestSample","cvv_code":"TestSample","advice_code":"TestSample","eci_submitted":"TestSample","vpas":"TestSample"}';
}
/**
* Gets Object Instance with Json data filled in
* @return ProcessorResponse
*/
public static function getObject()
{
return new ProcessorResponse(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return ProcessorResponse
*/
public function testSerializationDeserialization()
{
$obj = new ProcessorResponse(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getResponseCode());
$this->assertNotNull($obj->getAvsCode());
$this->assertNotNull($obj->getCvvCode());
$this->assertNotNull($obj->getAdviceCode());
$this->assertNotNull($obj->getEciSubmitted());
$this->assertNotNull($obj->getVpas());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param ProcessorResponse $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getResponseCode(), "TestSample");
$this->assertEquals($obj->getAvsCode(), "TestSample");
$this->assertEquals($obj->getCvvCode(), "TestSample");
$this->assertEquals($obj->getAdviceCode(), "TestSample");
$this->assertEquals($obj->getEciSubmitted(), "TestSample");
$this->assertEquals($obj->getVpas(), "TestSample");
}
}

View File

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

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