mirror of
https://github.com/Karaka-Management/Resources.git
synced 2026-01-09 20:38:40 +00:00
prepare workflows
This commit is contained in:
parent
3bac517a53
commit
a4fd969973
62
paypal/PayPal/Api/Address.php
Normal file
62
paypal/PayPal/Api/Address.php
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
* Class Address
|
||||
*
|
||||
* Base Address object used as billing address in a payment or extended for Shipping Address.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string phone
|
||||
* @property string type
|
||||
*/
|
||||
class Address extends BaseAddress
|
||||
{
|
||||
/**
|
||||
* Phone number in E.123 format. 50 characters max.
|
||||
*
|
||||
* @param string $phone
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
{
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone number in E.123 format. 50 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone()
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of address (e.g., HOME_OR_WORK, GIFT etc).
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of address (e.g., HOME_OR_WORK, GIFT etc).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
}
|
||||
647
paypal/PayPal/Api/Agreement.php
Normal file
647
paypal/PayPal/Api/Agreement.php
Normal file
|
|
@ -0,0 +1,647 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Core\PayPalConstants;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Transport\PayPalRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* Class Agreement
|
||||
*
|
||||
* A resource representing an agreement.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string state
|
||||
* @property string name
|
||||
* @property string description
|
||||
* @property string start_date
|
||||
* @property \PayPal\Api\Payer payer
|
||||
* @property \PayPal\Api\Address shipping_address
|
||||
* @property \PayPal\Api\MerchantPreferences override_merchant_preferences
|
||||
* @property \PayPal\Api\OverrideChargeModel[] override_charge_models
|
||||
* @property \PayPal\Api\Plan plan
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\AgreementDetails agreement_details
|
||||
*/
|
||||
class Agreement extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* Identifier of the agreement.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the agreement.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the agreement.
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the agreement.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the agreement.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the agreement.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the agreement.
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the agreement.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start date of the agreement. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @param string $start_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStartDate($start_date)
|
||||
{
|
||||
$this->start_date = $start_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start date of the agreement. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStartDate()
|
||||
{
|
||||
return $this->start_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Details of the buyer who is enrolling in this agreement. This information is gathered from execution of the approval URL.
|
||||
*
|
||||
* @param \PayPal\Api\Payer $payer
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayer($payer)
|
||||
{
|
||||
$this->payer = $payer;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Details of the buyer who is enrolling in this agreement. This information is gathered from execution of the approval URL.
|
||||
*
|
||||
* @return \PayPal\Api\Payer
|
||||
*/
|
||||
public function getPayer()
|
||||
{
|
||||
return $this->payer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping address object of the agreement, which should be provided if it is different from the default address.
|
||||
*
|
||||
* @param \PayPal\Api\Address $shipping_address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShippingAddress($shipping_address)
|
||||
{
|
||||
$this->shipping_address = $shipping_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping address object of the agreement, which should be provided if it is different from the default address.
|
||||
*
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
public function getShippingAddress()
|
||||
{
|
||||
return $this->shipping_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default merchant preferences from the billing plan are used, unless override preferences are provided here.
|
||||
*
|
||||
* @param \PayPal\Api\MerchantPreferences $override_merchant_preferences
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOverrideMerchantPreferences($override_merchant_preferences)
|
||||
{
|
||||
$this->override_merchant_preferences = $override_merchant_preferences;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default merchant preferences from the billing plan are used, unless override preferences are provided here.
|
||||
*
|
||||
* @return \PayPal\Api\MerchantPreferences
|
||||
*/
|
||||
public function getOverrideMerchantPreferences()
|
||||
{
|
||||
return $this->override_merchant_preferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of override_charge_model for this agreement if needed to change the default models from the billing plan.
|
||||
*
|
||||
* @param \PayPal\Api\OverrideChargeModel[] $override_charge_models
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOverrideChargeModels($override_charge_models)
|
||||
{
|
||||
$this->override_charge_models = $override_charge_models;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of override_charge_model for this agreement if needed to change the default models from the billing plan.
|
||||
*
|
||||
* @return \PayPal\Api\OverrideChargeModel[]
|
||||
*/
|
||||
public function getOverrideChargeModels()
|
||||
{
|
||||
return $this->override_charge_models;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append OverrideChargeModels to the list.
|
||||
*
|
||||
* @param \PayPal\Api\OverrideChargeModel $overrideChargeModel
|
||||
* @return $this
|
||||
*/
|
||||
public function addOverrideChargeModel($overrideChargeModel)
|
||||
{
|
||||
if (!$this->getOverrideChargeModels()) {
|
||||
return $this->setOverrideChargeModels(array($overrideChargeModel));
|
||||
} else {
|
||||
return $this->setOverrideChargeModels(
|
||||
array_merge($this->getOverrideChargeModels(), array($overrideChargeModel))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove OverrideChargeModels from the list.
|
||||
*
|
||||
* @param \PayPal\Api\OverrideChargeModel $overrideChargeModel
|
||||
* @return $this
|
||||
*/
|
||||
public function removeOverrideChargeModel($overrideChargeModel)
|
||||
{
|
||||
return $this->setOverrideChargeModels(
|
||||
array_diff($this->getOverrideChargeModels(), array($overrideChargeModel))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Plan details for this agreement.
|
||||
*
|
||||
* @param \PayPal\Api\Plan $plan
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPlan($plan)
|
||||
{
|
||||
$this->plan = $plan;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Plan details for this agreement.
|
||||
*
|
||||
* @return \PayPal\Api\Plan
|
||||
*/
|
||||
public function getPlan()
|
||||
{
|
||||
return $this->plan;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date and time that this resource was created. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date and time that this resource was created. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date and time that this resource was updated. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date and time that this resource was updated. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Agreement Details
|
||||
*
|
||||
* @param \PayPal\Api\AgreementDetails $agreement_details
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAgreementDetails($agreement_details)
|
||||
{
|
||||
$this->agreement_details = $agreement_details;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Agreement Details
|
||||
*
|
||||
* @return \PayPal\Api\AgreementDetails
|
||||
*/
|
||||
public function getAgreementDetails()
|
||||
{
|
||||
return $this->agreement_details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Approval Link
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getApprovalLink()
|
||||
{
|
||||
return $this->getLink(PayPalConstants::APPROVAL_URL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new billing agreement by passing the details for the agreement, including the name, description, start date, payer, and billing plan in the request JSON.
|
||||
*
|
||||
* @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 Agreement
|
||||
*/
|
||||
public function create($apiContext = null, $restCall = null)
|
||||
{
|
||||
$payLoad = $this->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/billing-agreements/",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a billing agreement after buyer approval by passing the payment token to the request URI.
|
||||
*
|
||||
* @param $paymentToken
|
||||
* @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 Agreement
|
||||
*/
|
||||
public function execute($paymentToken, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($paymentToken, 'paymentToken');
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/billing-agreements/$paymentToken/agreement-execute",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve details for a particular billing agreement by passing the ID of the agreement to the request URI.
|
||||
*
|
||||
* @param string $agreementId
|
||||
* @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 Agreement
|
||||
*/
|
||||
public static function get($agreementId, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($agreementId, 'agreementId');
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/billing-agreements/$agreementId",
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new Agreement();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update details of a billing agreement, such as the description, shipping address, and start date, by passing the ID of the agreement to the request URI.
|
||||
*
|
||||
* @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 bool
|
||||
*/
|
||||
public function update($patchRequest, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($patchRequest, 'patchRequest');
|
||||
$payLoad = $patchRequest->toJSON();
|
||||
self::executeCall(
|
||||
"/v1/payments/billing-agreements/{$this->getId()}",
|
||||
"PATCH",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Suspend a particular billing agreement by passing the ID of the agreement to the request URI.
|
||||
*
|
||||
* @param AgreementStateDescriptor $agreementStateDescriptor
|
||||
* @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
|
||||
*/
|
||||
public function suspend($agreementStateDescriptor, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($agreementStateDescriptor, 'agreementStateDescriptor');
|
||||
$payLoad = $agreementStateDescriptor->toJSON();
|
||||
self::executeCall(
|
||||
"/v1/payments/billing-agreements/{$this->getId()}/suspend",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reactivate a suspended billing agreement by passing the ID of the agreement to the appropriate URI. In addition, pass an agreement_state_descriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement.
|
||||
*
|
||||
* @param AgreementStateDescriptor $agreementStateDescriptor
|
||||
* @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
|
||||
*/
|
||||
public function reActivate($agreementStateDescriptor, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($agreementStateDescriptor, 'agreementStateDescriptor');
|
||||
$payLoad = $agreementStateDescriptor->toJSON();
|
||||
self::executeCall(
|
||||
"/v1/payments/billing-agreements/{$this->getId()}/re-activate",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel a billing agreement by passing the ID of the agreement to the request URI. In addition, pass an agreement_state_descriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement.
|
||||
*
|
||||
* @param AgreementStateDescriptor $agreementStateDescriptor
|
||||
* @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
|
||||
*/
|
||||
public function cancel($agreementStateDescriptor, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($agreementStateDescriptor, 'agreementStateDescriptor');
|
||||
$payLoad = $agreementStateDescriptor->toJSON();
|
||||
self::executeCall(
|
||||
"/v1/payments/billing-agreements/{$this->getId()}/cancel",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bill an outstanding amount for an agreement by passing the ID of the agreement to the request URI. In addition, pass an agreement_state_descriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement.
|
||||
*
|
||||
* @param AgreementStateDescriptor $agreementStateDescriptor
|
||||
* @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
|
||||
*/
|
||||
public function billBalance($agreementStateDescriptor, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($agreementStateDescriptor, 'agreementStateDescriptor');
|
||||
$payLoad = $agreementStateDescriptor->toJSON();
|
||||
self::executeCall(
|
||||
"/v1/payments/billing-agreements/{$this->getId()}/bill-balance",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the balance for an agreement by passing the ID of the agreement to the request URI. In addition, pass a common_currency object in the request JSON that specifies the currency type and value of the balance.
|
||||
*
|
||||
* @param Currency $currency
|
||||
* @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
|
||||
*/
|
||||
public function setBalance($currency, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($currency, 'currency');
|
||||
$payLoad = $currency->toJSON();
|
||||
self::executeCall(
|
||||
"/v1/payments/billing-agreements/{$this->getId()}/set-balance",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* List transactions for a billing agreement by passing the ID of the agreement, as well as the start and end dates of the range of transactions to list, to the request URI.
|
||||
*
|
||||
* @deprecated Please use searchTransactions Instead
|
||||
* @param string $agreementId
|
||||
* @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 AgreementTransactions
|
||||
*/
|
||||
public static function transactions($agreementId, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($agreementId, 'agreementId');
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/billing-agreements/$agreementId/transactions",
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new AgreementTransactions();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* List transactions for a billing agreement by passing the ID of the agreement, as well as the start and end dates of the range of transactions to list, to the request URI.
|
||||
*
|
||||
* @param string $agreementId
|
||||
* @param array $params Parameters for search string. Options: start_date, and end_date
|
||||
* @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 AgreementTransactions
|
||||
*/
|
||||
public static function searchTransactions($agreementId, $params = array(), $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($agreementId, 'agreementId');
|
||||
ArgumentValidator::validate($params, 'params');
|
||||
|
||||
$allowedParams = array(
|
||||
'start_date' => 1,
|
||||
'end_date' => 1,
|
||||
);
|
||||
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/billing-agreements/$agreementId/transactions?" . http_build_query(array_intersect_key($params, $allowedParams)),
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new AgreementTransactions();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
}
|
||||
209
paypal/PayPal/Api/AgreementDetails.php
Normal file
209
paypal/PayPal/Api/AgreementDetails.php
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class AgreementDetails
|
||||
*
|
||||
* A resource representing the agreement details.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Currency outstanding_balance
|
||||
* @property string cycles_remaining
|
||||
* @property string cycles_completed
|
||||
* @property string next_billing_date
|
||||
* @property string last_payment_date
|
||||
* @property \PayPal\Api\Currency last_payment_amount
|
||||
* @property string final_payment_date
|
||||
* @property string failed_payment_count
|
||||
*/
|
||||
class AgreementDetails extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The outstanding balance for this agreement.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $outstanding_balance
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOutstandingBalance($outstanding_balance)
|
||||
{
|
||||
$this->outstanding_balance = $outstanding_balance;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The outstanding balance for this agreement.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getOutstandingBalance()
|
||||
{
|
||||
return $this->outstanding_balance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of cycles remaining for this agreement.
|
||||
*
|
||||
* @param string $cycles_remaining
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCyclesRemaining($cycles_remaining)
|
||||
{
|
||||
$this->cycles_remaining = $cycles_remaining;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of cycles remaining for this agreement.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCyclesRemaining()
|
||||
{
|
||||
return $this->cycles_remaining;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of cycles completed for this agreement.
|
||||
*
|
||||
* @param string $cycles_completed
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCyclesCompleted($cycles_completed)
|
||||
{
|
||||
$this->cycles_completed = $cycles_completed;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of cycles completed for this agreement.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCyclesCompleted()
|
||||
{
|
||||
return $this->cycles_completed;
|
||||
}
|
||||
|
||||
/**
|
||||
* The next billing date for this agreement, represented as 2014-02-19T10:00:00Z format.
|
||||
*
|
||||
* @param string $next_billing_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNextBillingDate($next_billing_date)
|
||||
{
|
||||
$this->next_billing_date = $next_billing_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The next billing date for this agreement, represented as 2014-02-19T10:00:00Z format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNextBillingDate()
|
||||
{
|
||||
return $this->next_billing_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last payment date for this agreement, represented as 2014-06-09T09:42:31Z format.
|
||||
*
|
||||
* @param string $last_payment_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastPaymentDate($last_payment_date)
|
||||
{
|
||||
$this->last_payment_date = $last_payment_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last payment date for this agreement, represented as 2014-06-09T09:42:31Z format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastPaymentDate()
|
||||
{
|
||||
return $this->last_payment_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last payment amount for this agreement.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $last_payment_amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastPaymentAmount($last_payment_amount)
|
||||
{
|
||||
$this->last_payment_amount = $last_payment_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last payment amount for this agreement.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getLastPaymentAmount()
|
||||
{
|
||||
return $this->last_payment_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last payment date for this agreement, represented as 2015-02-19T10:00:00Z format.
|
||||
*
|
||||
* @param string $final_payment_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFinalPaymentDate($final_payment_date)
|
||||
{
|
||||
$this->final_payment_date = $final_payment_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last payment date for this agreement, represented as 2015-02-19T10:00:00Z format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFinalPaymentDate()
|
||||
{
|
||||
return $this->final_payment_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total number of failed payments for this agreement.
|
||||
*
|
||||
* @param string $failed_payment_count
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFailedPaymentCount($failed_payment_count)
|
||||
{
|
||||
$this->failed_payment_count = $failed_payment_count;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total number of failed payments for this agreement.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFailedPaymentCount()
|
||||
{
|
||||
return $this->failed_payment_count;
|
||||
}
|
||||
|
||||
}
|
||||
65
paypal/PayPal/Api/AgreementStateDescriptor.php
Normal file
65
paypal/PayPal/Api/AgreementStateDescriptor.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class AgreementStateDescriptor
|
||||
*
|
||||
* Description of the current state of the agreement.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string note
|
||||
* @property \PayPal\Api\Currency amount
|
||||
*/
|
||||
class AgreementStateDescriptor extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Reason for changing the state of the agreement.
|
||||
*
|
||||
* @param string $note
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNote($note)
|
||||
{
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason for changing the state of the agreement.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote()
|
||||
{
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount and currency of the agreement.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount and currency of the agreement.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
}
|
||||
257
paypal/PayPal/Api/AgreementTransaction.php
Normal file
257
paypal/PayPal/Api/AgreementTransaction.php
Normal file
|
|
@ -0,0 +1,257 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class AgreementTransaction
|
||||
*
|
||||
* A resource representing an agreement_transaction that is returned during a transaction search.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string transaction_id
|
||||
* @property string status
|
||||
* @property string transaction_type
|
||||
* @property \PayPal\Api\Currency amount
|
||||
* @property \PayPal\Api\Currency fee_amount
|
||||
* @property \PayPal\Api\Currency net_amount
|
||||
* @property string payer_email
|
||||
* @property string payer_name
|
||||
* @property string time_stamp
|
||||
* @property string time_zone
|
||||
*/
|
||||
class AgreementTransaction extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Id corresponding to this transaction.
|
||||
*
|
||||
* @param string $transaction_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTransactionId($transaction_id)
|
||||
{
|
||||
$this->transaction_id = $transaction_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Id corresponding to this transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTransactionId()
|
||||
{
|
||||
return $this->transaction_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the subscription at this time.
|
||||
*
|
||||
* @param string $status
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStatus($status)
|
||||
{
|
||||
$this->status = $status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the subscription at this time.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of transaction, usually Recurring Payment.
|
||||
*
|
||||
* @param string $transaction_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTransactionType($transaction_type)
|
||||
{
|
||||
$this->transaction_type = $transaction_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of transaction, usually Recurring Payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTransactionType()
|
||||
{
|
||||
return $this->transaction_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount for this transaction.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount for this transaction.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fee amount for this transaction.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $fee_amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFeeAmount($fee_amount)
|
||||
{
|
||||
$this->fee_amount = $fee_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fee amount for this transaction.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getFeeAmount()
|
||||
{
|
||||
return $this->fee_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Net amount for this transaction.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $net_amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNetAmount($net_amount)
|
||||
{
|
||||
$this->net_amount = $net_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Net amount for this transaction.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getNetAmount()
|
||||
{
|
||||
return $this->net_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email id of payer.
|
||||
*
|
||||
* @param string $payer_email
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerEmail($payer_email)
|
||||
{
|
||||
$this->payer_email = $payer_email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email id of payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerEmail()
|
||||
{
|
||||
return $this->payer_email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Business name of payer.
|
||||
*
|
||||
* @param string $payer_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerName($payer_name)
|
||||
{
|
||||
$this->payer_name = $payer_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Business name of payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerName()
|
||||
{
|
||||
return $this->payer_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time at which this transaction happened.
|
||||
*
|
||||
* @param string $time_stamp
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTimeStamp($time_stamp)
|
||||
{
|
||||
$this->time_stamp = $time_stamp;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time at which this transaction happened.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTimeStamp()
|
||||
{
|
||||
return $this->time_stamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time zone of time_updated field.
|
||||
*
|
||||
* @param string $time_zone
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTimeZone($time_zone)
|
||||
{
|
||||
$this->time_zone = $time_zone;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time zone of time_updated field.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTimeZone()
|
||||
{
|
||||
return $this->time_zone;
|
||||
}
|
||||
|
||||
}
|
||||
71
paypal/PayPal/Api/AgreementTransactions.php
Normal file
71
paypal/PayPal/Api/AgreementTransactions.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class AgreementTransactions
|
||||
*
|
||||
* A resource representing agreement_transactions that is returned during a transaction search.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\AgreementTransaction[] agreement_transaction_list
|
||||
*/
|
||||
class AgreementTransactions extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Array of agreement_transaction object.
|
||||
*
|
||||
* @param \PayPal\Api\AgreementTransaction[] $agreement_transaction_list
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAgreementTransactionList($agreement_transaction_list)
|
||||
{
|
||||
$this->agreement_transaction_list = $agreement_transaction_list;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of agreement_transaction object.
|
||||
*
|
||||
* @return \PayPal\Api\AgreementTransaction[]
|
||||
*/
|
||||
public function getAgreementTransactionList()
|
||||
{
|
||||
return $this->agreement_transaction_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append AgreementTransactionList to the list.
|
||||
*
|
||||
* @param \PayPal\Api\AgreementTransaction $agreementTransaction
|
||||
* @return $this
|
||||
*/
|
||||
public function addAgreementTransactionList($agreementTransaction)
|
||||
{
|
||||
if (!$this->getAgreementTransactionList()) {
|
||||
return $this->setAgreementTransactionList(array($agreementTransaction));
|
||||
} else {
|
||||
return $this->setAgreementTransactionList(
|
||||
array_merge($this->getAgreementTransactionList(), array($agreementTransaction))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove AgreementTransactionList from the list.
|
||||
*
|
||||
* @param \PayPal\Api\AgreementTransaction $agreementTransaction
|
||||
* @return $this
|
||||
*/
|
||||
public function removeAgreementTransactionList($agreementTransaction)
|
||||
{
|
||||
return $this->setAgreementTransactionList(
|
||||
array_diff($this->getAgreementTransactionList(), array($agreementTransaction))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
91
paypal/PayPal/Api/AlternatePayment.php
Normal file
91
paypal/PayPal/Api/AlternatePayment.php
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
<?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
|
||||
*
|
||||
* @deprecated Used for limited release only.
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
}
|
||||
93
paypal/PayPal/Api/Amount.php
Normal file
93
paypal/PayPal/Api/Amount.php
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Converter\FormatConverter;
|
||||
use PayPal\Validation\NumericValidator;
|
||||
|
||||
/**
|
||||
* Class Amount
|
||||
*
|
||||
* payment amount with break-ups.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string currency
|
||||
* @property string total
|
||||
* @property \PayPal\Api\Details details
|
||||
*/
|
||||
class Amount extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). PayPal does not support all currencies.
|
||||
*
|
||||
* @param string $currency
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCurrency($currency)
|
||||
{
|
||||
$this->currency = $currency;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function getCurrency()
|
||||
{
|
||||
return $this->currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total amount charged from the payer to the payee. In case of a refund, this is the refunded amount to the original payer from the payee. 10 characters max with support for 2 decimal places.
|
||||
*
|
||||
* @param string|double $total
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTotal($total)
|
||||
{
|
||||
NumericValidator::validate($total, "Total");
|
||||
$total = FormatConverter::formatToPrice($total, $this->getCurrency());
|
||||
$this->total = $total;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function getTotal()
|
||||
{
|
||||
return $this->total;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional details of the payment amount.
|
||||
*
|
||||
* @param \PayPal\Api\Details $details
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDetails($details)
|
||||
{
|
||||
$this->details = $details;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional details of the payment amount.
|
||||
*
|
||||
* @return \PayPal\Api\Details
|
||||
*/
|
||||
public function getDetails()
|
||||
{
|
||||
return $this->details;
|
||||
}
|
||||
|
||||
}
|
||||
507
paypal/PayPal/Api/Authorization.php
Normal file
507
paypal/PayPal/Api/Authorization.php
Normal file
|
|
@ -0,0 +1,507 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Authorization
|
||||
*
|
||||
* An authorization transaction.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string payment_mode
|
||||
* @property string state
|
||||
* @property string reason_code
|
||||
* @property string pending_reason
|
||||
* @property string protection_eligibility
|
||||
* @property string protection_eligibility_type
|
||||
* @property \PayPal\Api\FmfDetails fmf_details
|
||||
* @property string parent_payment
|
||||
* @property \PayPal\Api\ProcessorResponse processor_response
|
||||
* @property string valid_until
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property string reference_id
|
||||
* @property string receipt_id
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class Authorization extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* ID of the authorization transaction.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the authorization transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being authorized.
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being authorized.
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the payment mode of the transaction.
|
||||
* Valid Values: ["INSTANT_TRANSFER"]
|
||||
*
|
||||
* @param string $payment_mode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentMode($payment_mode)
|
||||
{
|
||||
$this->payment_mode = $payment_mode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the payment mode of the transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentMode()
|
||||
{
|
||||
return $this->payment_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the authorization.
|
||||
* Valid Values: ["pending", "authorized", "partially_captured", "captured", "expired", "voided"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the authorization.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code, `AUTHORIZATION`, for a transaction state of `pending`.
|
||||
* Valid Values: ["AUTHORIZATION"]
|
||||
*
|
||||
* @param string $reason_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReasonCode($reason_code)
|
||||
{
|
||||
$this->reason_code = $reason_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code, `AUTHORIZATION`, for a transaction state of `pending`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReasonCode()
|
||||
{
|
||||
return $this->reason_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* [DEPRECATED] Reason code for the transaction state being Pending.Obsolete. use reason_code field instead.
|
||||
* Valid Values: ["AUTHORIZATION"]
|
||||
*
|
||||
* @param string $pending_reason
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPendingReason($pending_reason)
|
||||
{
|
||||
$this->pending_reason = $pending_reason;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated [DEPRECATED] Reason code for the transaction state being Pending.Obsolete. use reason_code field instead.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPendingReason()
|
||||
{
|
||||
return $this->pending_reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtectionEligibility($protection_eligibility)
|
||||
{
|
||||
$this->protection_eligibility = $protection_eligibility;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function getProtectionEligibility()
|
||||
{
|
||||
return $this->protection_eligibility;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtectionEligibilityType($protection_eligibility_type)
|
||||
{
|
||||
$this->protection_eligibility_type = $protection_eligibility_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fraud Management Filter (FMF) details applied for the payment that could result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. See [Fraud Management Filters Summary](https://developer.paypal.com/docs/classic/fmf/integration-guide/FMFSummary/) for more information.
|
||||
*
|
||||
* @param \PayPal\Api\FmfDetails $fmf_details
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFmfDetails($fmf_details)
|
||||
{
|
||||
$this->fmf_details = $fmf_details;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function getFmfDetails()
|
||||
{
|
||||
return $this->fmf_details;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentPayment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getParentPayment()
|
||||
{
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Authorization expiration time and date as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @param string $valid_until
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValidUntil($valid_until)
|
||||
{
|
||||
$this->valid_until = $valid_until;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Authorization expiration time and date as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValidUntil()
|
||||
{
|
||||
return $this->valid_until;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time of authorization as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time of authorization as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time that the resource was last updated.
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time that the resource was last updated.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier to the purchase or transaction unit corresponding to this authorization transaction.
|
||||
*
|
||||
* @param string $reference_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReferenceId($reference_id)
|
||||
{
|
||||
$this->reference_id = $reference_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier to the purchase or transaction unit corresponding to this authorization transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReferenceId()
|
||||
{
|
||||
return $this->reference_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Receipt id is 16 digit number payment identification number returned for guest users to identify the payment.
|
||||
*
|
||||
* @param string $receipt_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReceiptId($receipt_id)
|
||||
{
|
||||
$this->receipt_id = $receipt_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Receipt id is 16 digit number payment identification number returned for guest users to identify the payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReceiptId()
|
||||
{
|
||||
return $this->receipt_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows details for an authorization, by ID.
|
||||
*
|
||||
* @param string $authorizationId
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Authorization
|
||||
*/
|
||||
public static function get($authorizationId, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($authorizationId, 'authorizationId');
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/authorization/$authorizationId",
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new Authorization();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Captures and processes an authorization, by ID. To use this call, the original payment call must specify an intent of `authorize`.
|
||||
*
|
||||
* @param Capture $capture
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Capture
|
||||
*/
|
||||
public function capture($capture, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($capture, 'capture');
|
||||
$payLoad = $capture->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/authorization/{$this->getId()}/capture",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new Capture();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Voids, or cancels, an authorization, by ID. You cannot void a fully captured authorization.
|
||||
*
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Authorization
|
||||
*/
|
||||
public function void($apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/authorization/{$this->getId()}/void",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reauthorizes a PayPal account payment, by authorization ID. To ensure that funds are still available, reauthorize a payment after the initial three-day honor period. Supports only the `amount` request parameter.
|
||||
*
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Authorization
|
||||
*/
|
||||
public function reauthorize($apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
$payLoad = $this->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/authorization/{$this->getId()}/reauthorize",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
629
paypal/PayPal/Api/BankAccount.php
Normal file
629
paypal/PayPal/Api/BankAccount.php
Normal file
|
|
@ -0,0 +1,629 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class BankAccount
|
||||
*
|
||||
* A resource representing a bank account that can be used to fund a payment.
|
||||
* @deprecated Deprecated. It is for internal use only. It may be removed in next major revision.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string account_number
|
||||
* @property string account_number_type
|
||||
* @property string routing_number
|
||||
* @property string account_type
|
||||
* @property string account_name
|
||||
* @property string check_type
|
||||
* @property string auth_type
|
||||
* @property string auth_capture_timestamp
|
||||
* @property string bank_name
|
||||
* @property string country_code
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* @property string birth_date
|
||||
* @property \PayPal\Api\Address billing_address
|
||||
* @property string state
|
||||
* @property string confirmation_status
|
||||
* @property string payer_id
|
||||
* @property string external_customer_id
|
||||
* @property string merchant_id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property string valid_until
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class BankAccount extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* ID of the bank account being saved for later use.
|
||||
* @deprecated Not publicly available
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the bank account being saved for later use.
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account number in either IBAN (max length 34) or BBAN (max length 17) format.
|
||||
*
|
||||
* @param string $account_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAccountNumber($account_number)
|
||||
{
|
||||
$this->account_number = $account_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account number in either IBAN (max length 34) or BBAN (max length 17) format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAccountNumber()
|
||||
{
|
||||
return $this->account_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the bank account number (International or Basic Bank Account Number). For more information refer to http://en.wikipedia.org/wiki/International_Bank_Account_Number.
|
||||
* Valid Values: ["BBAN", "IBAN"]
|
||||
*
|
||||
* @param string $account_number_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAccountNumberType($account_number_type)
|
||||
{
|
||||
$this->account_number_type = $account_number_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the bank account number (International or Basic Bank Account Number). For more information refer to http://en.wikipedia.org/wiki/International_Bank_Account_Number.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAccountNumberType()
|
||||
{
|
||||
return $this->account_number_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Routing transit number (aka Bank Code) of the bank (typically for domestic use only - for international use, IBAN includes bank code). For more information refer to http://en.wikipedia.org/wiki/Bank_code.
|
||||
*
|
||||
* @param string $routing_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRoutingNumber($routing_number)
|
||||
{
|
||||
$this->routing_number = $routing_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Routing transit number (aka Bank Code) of the bank (typically for domestic use only - for international use, IBAN includes bank code). For more information refer to http://en.wikipedia.org/wiki/Bank_code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRoutingNumber()
|
||||
{
|
||||
return $this->routing_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the bank account.
|
||||
* Valid Values: ["CHECKING", "SAVINGS"]
|
||||
*
|
||||
* @param string $account_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAccountType($account_type)
|
||||
{
|
||||
$this->account_type = $account_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the bank account.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAccountType()
|
||||
{
|
||||
return $this->account_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* A customer designated name.
|
||||
*
|
||||
* @param string $account_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAccountName($account_name)
|
||||
{
|
||||
$this->account_name = $account_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A customer designated name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAccountName()
|
||||
{
|
||||
return $this->account_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the check when this information was obtained through a check by the facilitator or merchant.
|
||||
* Valid Values: ["PERSONAL", "COMPANY"]
|
||||
*
|
||||
* @param string $check_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCheckType($check_type)
|
||||
{
|
||||
$this->check_type = $check_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the check when this information was obtained through a check by the facilitator or merchant.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCheckType()
|
||||
{
|
||||
return $this->check_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* How the check was obtained from the customer, if check was the source of the information provided.
|
||||
* Valid Values: ["CCD", "PPD", "TEL", "POP", "ARC", "RCK", "WEB"]
|
||||
*
|
||||
* @param string $auth_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAuthType($auth_type)
|
||||
{
|
||||
$this->auth_type = $auth_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* How the check was obtained from the customer, if check was the source of the information provided.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAuthType()
|
||||
{
|
||||
return $this->auth_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time at which the authorization (or check) was captured. Use this field if the user authorization needs to be captured due to any privacy requirements.
|
||||
*
|
||||
* @param string $auth_capture_timestamp
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAuthCaptureTimestamp($auth_capture_timestamp)
|
||||
{
|
||||
$this->auth_capture_timestamp = $auth_capture_timestamp;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time at which the authorization (or check) was captured. Use this field if the user authorization needs to be captured due to any privacy requirements.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAuthCaptureTimestamp()
|
||||
{
|
||||
return $this->auth_capture_timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the bank.
|
||||
*
|
||||
* @param string $bank_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBankName($bank_name)
|
||||
{
|
||||
$this->bank_name = $bank_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the bank.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBankName()
|
||||
{
|
||||
return $this->bank_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 letter country code of the Bank.
|
||||
*
|
||||
* @param string $country_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCountryCode($country_code)
|
||||
{
|
||||
$this->country_code = $country_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 letter country code of the Bank.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCountryCode()
|
||||
{
|
||||
return $this->country_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account holder's first name.
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirstName($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account holder's first name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName()
|
||||
{
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account holder's last name.
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastName($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account holder's last name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName()
|
||||
{
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Birth date of the bank account holder.
|
||||
*
|
||||
* @param string $birth_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBirthDate($birth_date)
|
||||
{
|
||||
$this->birth_date = $birth_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Birth date of the bank account holder.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBirthDate()
|
||||
{
|
||||
return $this->birth_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing address.
|
||||
*
|
||||
* @param \PayPal\Api\Address $billing_address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBillingAddress($billing_address)
|
||||
{
|
||||
$this->billing_address = $billing_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing address.
|
||||
*
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
public function getBillingAddress()
|
||||
{
|
||||
return $this->billing_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of this funding instrument.
|
||||
* Valid Values: ["ACTIVE", "INACTIVE", "DELETED"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of this funding instrument.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirmation status of a bank account.
|
||||
* Valid Values: ["UNCONFIRMED", "CONFIRMED"]
|
||||
*
|
||||
* @param string $confirmation_status
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setConfirmationStatus($confirmation_status)
|
||||
{
|
||||
$this->confirmation_status = $confirmation_status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirmation status of a bank account.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getConfirmationStatus()
|
||||
{
|
||||
return $this->confirmation_status;
|
||||
}
|
||||
|
||||
/**
|
||||
* [DEPRECATED] Use external_customer_id instead.
|
||||
*
|
||||
* @param string $payer_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerId($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated [DEPRECATED] Use external_customer_id instead.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerId()
|
||||
{
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault.
|
||||
*
|
||||
* @param string $external_customer_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternalCustomerId($external_customer_id)
|
||||
{
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalCustomerId()
|
||||
{
|
||||
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 merchant.
|
||||
*
|
||||
* @param string $merchant_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMerchantId($merchant_id)
|
||||
{
|
||||
$this->merchant_id = $merchant_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMerchantId()
|
||||
{
|
||||
return $this->merchant_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until this resource can be used to fund a payment.
|
||||
*
|
||||
* @param string $valid_until
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValidUntil($valid_until)
|
||||
{
|
||||
$this->valid_until = $valid_until;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until this resource can be used to fund a payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValidUntil()
|
||||
{
|
||||
return $this->valid_until;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
* @param \PayPal\Api\Links[] $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Links to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function addLink($links)
|
||||
{
|
||||
if (!$this->getLinks()) {
|
||||
return $this->setLinks(array($links));
|
||||
} else {
|
||||
return $this->setLinks(
|
||||
array_merge($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Links from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function removeLink($links)
|
||||
{
|
||||
return $this->setLinks(
|
||||
array_diff($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
119
paypal/PayPal/Api/BankAccountsList.php
Normal file
119
paypal/PayPal/Api/BankAccountsList.php
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class BankAccountsList
|
||||
*
|
||||
* A list of Bank Account Resources
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\BankAccount[] bank_accounts
|
||||
* @property int count
|
||||
* @property string next_id
|
||||
*/
|
||||
class BankAccountsList extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* A list of bank account resources
|
||||
*
|
||||
* @param \PayPal\Api\BankAccount[] $bank_accounts
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBankAccounts($bank_accounts)
|
||||
{
|
||||
$this->{"bank-accounts"} = $bank_accounts;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of bank account resources
|
||||
*
|
||||
* @return \PayPal\Api\BankAccount[]
|
||||
*/
|
||||
public function getBankAccounts()
|
||||
{
|
||||
return $this->{"bank-accounts"};
|
||||
}
|
||||
|
||||
/**
|
||||
* Append BankAccounts to the list.
|
||||
*
|
||||
* @param \PayPal\Api\BankAccount $bankAccount
|
||||
* @return $this
|
||||
*/
|
||||
public function addBankAccount($bankAccount)
|
||||
{
|
||||
if (!$this->getBankAccounts()) {
|
||||
return $this->setBankAccounts(array($bankAccount));
|
||||
} else {
|
||||
return $this->setBankAccounts(
|
||||
array_merge($this->getBankAccounts(), array($bankAccount))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove BankAccounts from the list.
|
||||
*
|
||||
* @param \PayPal\Api\BankAccount $bankAccount
|
||||
* @return $this
|
||||
*/
|
||||
public function removeBankAccount($bankAccount)
|
||||
{
|
||||
return $this->setBankAccounts(
|
||||
array_diff($this->getBankAccounts(), array($bankAccount))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
*
|
||||
* @param int $count
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCount($count)
|
||||
{
|
||||
$this->count = $count;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCount()
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
*
|
||||
* @param string $next_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNextId($next_id)
|
||||
{
|
||||
$this->next_id = $next_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNextId()
|
||||
{
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
}
|
||||
89
paypal/PayPal/Api/BankToken.php
Normal file
89
paypal/PayPal/Api/BankToken.php
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class BankToken
|
||||
*
|
||||
* A resource representing a bank that can be used to fund a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string bank_id
|
||||
* @property string external_customer_id
|
||||
* @property string mandate_reference_number
|
||||
*/
|
||||
class BankToken extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* ID of a previously saved Bank resource using /vault/bank API.
|
||||
*
|
||||
* @param string $bank_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBankId($bank_id)
|
||||
{
|
||||
$this->bank_id = $bank_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a previously saved Bank resource using /vault/bank API.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBankId()
|
||||
{
|
||||
return $this->bank_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this bank using /vault/bank API.
|
||||
*
|
||||
* @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 used when saving this bank using /vault/bank API.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalCustomerId()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
|
||||
*
|
||||
* @param string $mandate_reference_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMandateReferenceNumber($mandate_reference_number)
|
||||
{
|
||||
$this->mandate_reference_number = $mandate_reference_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMandateReferenceNumber()
|
||||
{
|
||||
return $this->mandate_reference_number;
|
||||
}
|
||||
|
||||
}
|
||||
211
paypal/PayPal/Api/BaseAddress.php
Normal file
211
paypal/PayPal/Api/BaseAddress.php
Normal file
|
|
@ -0,0 +1,211 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class BaseAddress
|
||||
*
|
||||
* Base Address object used as billing address in a payment or extended for Shipping Address.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string line1
|
||||
* @property string line2
|
||||
* @property string city
|
||||
* @property string country_code
|
||||
* @property string postal_code
|
||||
* @property string state
|
||||
* @property string normalization_status
|
||||
* @property string status
|
||||
*/
|
||||
class BaseAddress extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Line 1 of the Address (eg. number, street, etc).
|
||||
*
|
||||
* @param string $line1
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLine1($line1)
|
||||
{
|
||||
$this->line1 = $line1;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Line 1 of the Address (eg. number, street, etc).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLine1()
|
||||
{
|
||||
return $this->line1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional line 2 of the Address (eg. suite, apt #, etc.).
|
||||
*
|
||||
* @param string $line2
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLine2($line2)
|
||||
{
|
||||
$this->line2 = $line2;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional line 2 of the Address (eg. suite, apt #, etc.).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLine2()
|
||||
{
|
||||
return $this->line2;
|
||||
}
|
||||
|
||||
/**
|
||||
* City name.
|
||||
*
|
||||
* @param string $city
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCity($city)
|
||||
{
|
||||
$this->city = $city;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* City name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCity()
|
||||
{
|
||||
return $this->city;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 letter country code.
|
||||
*
|
||||
* @param string $country_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCountryCode($country_code)
|
||||
{
|
||||
$this->country_code = $country_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 letter country code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCountryCode()
|
||||
{
|
||||
return $this->country_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code.
|
||||
*
|
||||
* @param string $postal_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPostalCode($postal_code)
|
||||
{
|
||||
$this->postal_code = $postal_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPostalCode()
|
||||
{
|
||||
return $this->postal_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 letter code for US states, and the equivalent for other countries.
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 letter code for US states, and the equivalent for other countries.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address normalization status
|
||||
* Valid Values: ["UNKNOWN", "UNNORMALIZED_USER_PREFERRED", "NORMALIZED", "UNNORMALIZED"]
|
||||
*
|
||||
* @param string $normalization_status
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNormalizationStatus($normalization_status)
|
||||
{
|
||||
$this->normalization_status = $normalization_status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address normalization status
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNormalizationStatus()
|
||||
{
|
||||
return $this->normalization_status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address status
|
||||
* Valid Values: ["CONFIRMED", "UNCONFIRMED"]
|
||||
*
|
||||
* @param string $status
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStatus($status)
|
||||
{
|
||||
$this->status = $status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address status
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
}
|
||||
43
paypal/PayPal/Api/Billing.php
Normal file
43
paypal/PayPal/Api/Billing.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class Billing
|
||||
*
|
||||
* Billing instrument used to charge the payer.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @deprecated Used internally only.
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
}
|
||||
17
paypal/PayPal/Api/BillingAgreementToken.php
Normal file
17
paypal/PayPal/Api/BillingAgreementToken.php
Normal 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
|
||||
{
|
||||
}
|
||||
235
paypal/PayPal/Api/BillingInfo.php
Normal file
235
paypal/PayPal/Api/BillingInfo.php
Normal file
|
|
@ -0,0 +1,235 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class BillingInfo
|
||||
*
|
||||
* Billing information for the invoice recipient.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string email
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* @property string business_name
|
||||
* @property \PayPal\Api\InvoiceAddress address
|
||||
* @property string language
|
||||
* @property string additional_info
|
||||
* @property string notification_channel
|
||||
* @property \PayPal\Api\Phone phone
|
||||
*/
|
||||
class BillingInfo extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The invoice recipient email address. Maximum length is 260 characters.
|
||||
*
|
||||
* @param string $email
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice recipient email address. Maximum length is 260 characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice recipient first name. Maximum length is 30 characters.
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirstName($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice recipient first name. Maximum length is 30 characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName()
|
||||
{
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice recipient last name. Maximum length is 30 characters.
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastName($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice recipient last name. Maximum length is 30 characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName()
|
||||
{
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice recipient company business name. Maximum length is 100 characters.
|
||||
*
|
||||
* @param string $business_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBusinessName($business_name)
|
||||
{
|
||||
$this->business_name = $business_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice recipient company business name. Maximum length is 100 characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBusinessName()
|
||||
{
|
||||
return $this->business_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice recipient address.
|
||||
*
|
||||
* @param \PayPal\Api\InvoiceAddress $address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAddress($address)
|
||||
{
|
||||
$this->address = $address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice recipient address.
|
||||
*
|
||||
* @return \PayPal\Api\InvoiceAddress
|
||||
*/
|
||||
public function getAddress()
|
||||
{
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
/**
|
||||
* The language in which the email was sent to the payer. Used only when the payer does not have a PayPal account.
|
||||
* Valid Values: ["da_DK", "de_DE", "en_AU", "en_GB", "en_US", "es_ES", "es_XC", "fr_CA", "fr_FR", "fr_XC", "he_IL", "id_ID", "it_IT", "ja_JP", "nl_NL", "no_NO", "pl_PL", "pt_BR", "pt_PT", "ru_RU", "sv_SE", "th_TH", "tr_TR", "zh_CN", "zh_HK", "zh_TW", "zh_XC"]
|
||||
*
|
||||
* @param string $language
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLanguage($language)
|
||||
{
|
||||
$this->language = $language;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The language in which the email was sent to the payer. Used only when the payer does not have a PayPal account.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLanguage()
|
||||
{
|
||||
return $this->language;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional information, such as business hours. Maximum length is 40 characters.
|
||||
*
|
||||
* @param string $additional_info
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAdditionalInfo($additional_info)
|
||||
{
|
||||
$this->additional_info = $additional_info;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional information, such as business hours. Maximum length is 40 characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAdditionalInfo()
|
||||
{
|
||||
return $this->additional_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Preferred notification channel of the payer. Email by default.
|
||||
* Valid Values: ["SMS", "EMAIL"]
|
||||
*
|
||||
* @param string $notification_channel
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNotificationChannel($notification_channel)
|
||||
{
|
||||
$this->notification_channel = $notification_channel;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Preferred notification channel of the payer. Email by default.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNotificationChannel()
|
||||
{
|
||||
return $this->notification_channel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mobile Phone number of the recipient to which SMS will be sent if notification_channel is SMS.
|
||||
*
|
||||
* @param \PayPal\Api\Phone $phone
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
{
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mobile Phone number of the recipient to which SMS will be sent if notification_channel is SMS.
|
||||
*
|
||||
* @return \PayPal\Api\Phone
|
||||
*/
|
||||
public function getPhone()
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
}
|
||||
167
paypal/PayPal/Api/CancelNotification.php
Normal file
167
paypal/PayPal/Api/CancelNotification.php
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class CancelNotification
|
||||
*
|
||||
* Email/SMS notification.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string subject
|
||||
* @property string note
|
||||
* @property bool send_to_merchant
|
||||
* @property bool send_to_payer
|
||||
* @property string[] cc_emails
|
||||
*/
|
||||
class CancelNotification extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Subject of the notification.
|
||||
*
|
||||
* @param string $subject
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSubject($subject)
|
||||
{
|
||||
$this->subject = $subject;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subject of the notification.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSubject()
|
||||
{
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the payer.
|
||||
*
|
||||
* @param string $note
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNote($note)
|
||||
{
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote()
|
||||
{
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether to send a copy of the notification to the merchant.
|
||||
*
|
||||
* @param bool $send_to_merchant
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSendToMerchant($send_to_merchant)
|
||||
{
|
||||
$this->send_to_merchant = $send_to_merchant;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether to send a copy of the notification to the merchant.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getSendToMerchant()
|
||||
{
|
||||
return $this->send_to_merchant;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether to send a copy of the notification to the payer.
|
||||
*
|
||||
* @param bool $send_to_payer
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSendToPayer($send_to_payer)
|
||||
{
|
||||
$this->send_to_payer = $send_to_payer;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether to send a copy of the notification to the payer.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getSendToPayer()
|
||||
{
|
||||
return $this->send_to_payer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported.
|
||||
*
|
||||
* @param string[] $cc_emails
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCcEmails($cc_emails)
|
||||
{
|
||||
$this->cc_emails = $cc_emails;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCcEmails()
|
||||
{
|
||||
return $this->cc_emails;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append CcEmails to the list.
|
||||
*
|
||||
* @param string $string
|
||||
* @return $this
|
||||
*/
|
||||
public function addCcEmail($string)
|
||||
{
|
||||
if (!$this->getCcEmails()) {
|
||||
return $this->setCcEmails(array($string));
|
||||
} else {
|
||||
return $this->setCcEmails(
|
||||
array_merge($this->getCcEmails(), array($string))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove CcEmails from the list.
|
||||
*
|
||||
* @param string $string
|
||||
* @return $this
|
||||
*/
|
||||
public function removeCcEmail($string)
|
||||
{
|
||||
return $this->setCcEmails(
|
||||
array_diff($this->getCcEmails(), array($string))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
341
paypal/PayPal/Api/Capture.php
Normal file
341
paypal/PayPal/Api/Capture.php
Normal file
|
|
@ -0,0 +1,341 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Transport\PayPalRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Capture
|
||||
*
|
||||
* A capture transaction.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property bool is_final_capture
|
||||
* @property string state
|
||||
* @property string reason_code
|
||||
* @property string parent_payment
|
||||
* @property string invoice_number
|
||||
* @property \PayPal\Api\Currency transaction_fee
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class Capture extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* The ID of the capture transaction.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the capture transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount to capture. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`.
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount to capture. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`.
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether to release all remaining funds that the authorization holds in the funding instrument. Default is `false`.
|
||||
*
|
||||
* @param bool $is_final_capture
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsFinalCapture($is_final_capture)
|
||||
{
|
||||
$this->is_final_capture = $is_final_capture;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether to release all remaining funds that the authorization holds in the funding instrument. Default is `false`.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getIsFinalCapture()
|
||||
{
|
||||
return $this->is_final_capture;
|
||||
}
|
||||
|
||||
/**
|
||||
* The state of the capture.
|
||||
* Valid Values: ["pending", "completed", "refunded", "partially_refunded"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The state of the capture.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* The reason code that describes why the transaction state is pending or reversed.
|
||||
* Valid Values: ["CHARGEBACK", "GUARANTEE", "BUYER_COMPLAINT", "REFUND", "UNCONFIRMED_SHIPPING_ADDRESS", "ECHECK", "INTERNATIONAL_WITHDRAWAL", "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION", "PAYMENT_REVIEW", "REGULATORY_REVIEW", "UNILATERAL", "VERIFICATION_REQUIRED", "TRANSACTION_APPROVED_AWAITING_FUNDING"]
|
||||
*
|
||||
* @param string $reason_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReasonCode($reason_code)
|
||||
{
|
||||
$this->reason_code = $reason_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The reason code that describes why the transaction state is pending or reversed.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReasonCode()
|
||||
{
|
||||
return $this->reason_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the payment on which this transaction is based.
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentPayment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the payment on which this transaction is based.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getParentPayment()
|
||||
{
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice number to track this payment.
|
||||
*
|
||||
* @param string $invoice_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInvoiceNumber($invoice_number)
|
||||
{
|
||||
$this->invoice_number = $invoice_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice number to track this payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInvoiceNumber()
|
||||
{
|
||||
return $this->invoice_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The transaction fee for this payment.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $transaction_fee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTransactionFee($transaction_fee)
|
||||
{
|
||||
$this->transaction_fee = $transaction_fee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The transaction fee for this payment.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getTransactionFee()
|
||||
{
|
||||
return $this->transaction_fee;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time of capture, as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time of capture, as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time when the resource was last updated.
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time when the resource was last updated.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows details for a captured payment, by ID.
|
||||
*
|
||||
* @param string $captureId
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Capture
|
||||
*/
|
||||
public static function get($captureId, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($captureId, 'captureId');
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/capture/$captureId",
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new Capture();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refund a captured payment by passing the capture_id in the request URI. In addition, include an amount object in the body of the request JSON.
|
||||
*
|
||||
* @deprecated Please use #refundCapturedPayment instead.
|
||||
* @param Refund $refund
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Refund
|
||||
*/
|
||||
public function refund($refund, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($refund, 'refund');
|
||||
$payLoad = $refund->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/capture/{$this->getId()}/refund",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new Refund();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refunds a captured payment, by ID. Include an `amount` object in the JSON request body.
|
||||
*
|
||||
* @param RefundRequest $refundRequest
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return DetailedRefund
|
||||
*/
|
||||
public function refundCapturedPayment($refundRequest, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($refundRequest, 'refundRequest');
|
||||
$payLoad = $refundRequest->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/capture/{$this->getId()}/refund",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new DetailedRefund();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
}
|
||||
138
paypal/PayPal/Api/CarrierAccount.php
Normal file
138
paypal/PayPal/Api/CarrierAccount.php
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class CarrierAccount
|
||||
*
|
||||
* Payment instrument that enables 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
|
||||
{
|
||||
/**
|
||||
* The ID of the carrier account of the payer. Use in subsequent REST API calls. For example, to make payments.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the carrier account of the payer. Use in subsequent REST API calls. For example, to make payments.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The phone number of the payer, in E.164 format.
|
||||
*
|
||||
* @param string $phone_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhoneNumber($phone_number)
|
||||
{
|
||||
$this->phone_number = $phone_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The phone number of the payer, in E.164 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPhoneNumber()
|
||||
{
|
||||
return $this->phone_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the customer, 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the customer, as created by the merchant.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalCustomerId()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The method used to obtain the phone number. Value is `READ_FROM_DEVICE` or `USER_PROVIDED`.
|
||||
* Valid Values: ["READ_FROM_DEVICE", "USER_PROVIDED"]
|
||||
*
|
||||
* @param string $phone_source
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhoneSource($phone_source)
|
||||
{
|
||||
$this->phone_source = $phone_source;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The method used to obtain the phone number. Value is `READ_FROM_DEVICE` or `USER_PROVIDED`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPhoneSource()
|
||||
{
|
||||
return $this->phone_source;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ISO 3166-1 alpha-2 country code where the phone number is registered.
|
||||
*
|
||||
* @param \PayPal\Api\CountryCode $country_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCountryCode($country_code)
|
||||
{
|
||||
$this->country_code = $country_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ISO 3166-1 alpha-2 country code where the phone number is registered.
|
||||
*
|
||||
* @return \PayPal\Api\CountryCode
|
||||
*/
|
||||
public function getCountryCode()
|
||||
{
|
||||
return $this->country_code;
|
||||
}
|
||||
|
||||
}
|
||||
65
paypal/PayPal/Api/CarrierAccountToken.php
Normal file
65
paypal/PayPal/Api/CarrierAccountToken.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class CarrierAccountToken
|
||||
*
|
||||
* A resource representing a carrier account that can be used to fund a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string carrier_account_id
|
||||
* @property string external_customer_id
|
||||
*/
|
||||
class CarrierAccountToken extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* ID of a previously saved carrier account resource.
|
||||
*
|
||||
* @param string $carrier_account_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCarrierAccountId($carrier_account_id)
|
||||
{
|
||||
$this->carrier_account_id = $carrier_account_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a previously saved carrier account resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCarrierAccountId()
|
||||
{
|
||||
return $this->carrier_account_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this carrier account instrument.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalCustomerId()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
}
|
||||
408
paypal/PayPal/Api/CartBase.php
Normal file
408
paypal/PayPal/Api/CartBase.php
Normal file
|
|
@ -0,0 +1,408 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Validation\UrlValidator;
|
||||
|
||||
/**
|
||||
* Class CartBase
|
||||
*
|
||||
* Base properties of a cart resource
|
||||
*
|
||||
* @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
|
||||
* @property string invoice_number
|
||||
* @property string purchase_order
|
||||
* @property string soft_descriptor
|
||||
* @property \PayPal\Api\PaymentOptions payment_options
|
||||
* @property \PayPal\Api\ItemList item_list
|
||||
* @property string notify_url
|
||||
* @property string order_url
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being collected.
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recipient of the funds in this transaction.
|
||||
*
|
||||
* @param \PayPal\Api\Payee $payee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayee($payee)
|
||||
{
|
||||
$this->payee = $payee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recipient of the funds in this transaction.
|
||||
*
|
||||
* @return \PayPal\Api\Payee
|
||||
*/
|
||||
public function getPayee()
|
||||
{
|
||||
return $this->payee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of what is being paid for.
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of what is being paid for.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the recipient of the funds in this transaction.
|
||||
*
|
||||
* @param string $note_to_payee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNoteToPayee($note_to_payee)
|
||||
{
|
||||
$this->note_to_payee = $note_to_payee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the recipient of the funds in this transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNoteToPayee()
|
||||
{
|
||||
return $this->note_to_payee;
|
||||
}
|
||||
|
||||
/**
|
||||
* free-form field for the use of clients
|
||||
*
|
||||
* @param string $custom
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCustom($custom)
|
||||
{
|
||||
$this->custom = $custom;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* free-form field for the use of clients
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCustom()
|
||||
{
|
||||
return $this->custom;
|
||||
}
|
||||
|
||||
/**
|
||||
* invoice number to track this payment
|
||||
*
|
||||
* @param string $invoice_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInvoiceNumber($invoice_number)
|
||||
{
|
||||
$this->invoice_number = $invoice_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* invoice number to track this payment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInvoiceNumber()
|
||||
{
|
||||
return $this->invoice_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* purchase order is number or id specific to this payment
|
||||
*
|
||||
* @param string $purchase_order
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPurchaseOrder($purchase_order)
|
||||
{
|
||||
$this->purchase_order = $purchase_order;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* purchase order is number or id specific to this payment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPurchaseOrder()
|
||||
{
|
||||
return $this->purchase_order;
|
||||
}
|
||||
|
||||
/**
|
||||
* Soft descriptor used when charging this funding source. If length exceeds max length, the value will be truncated
|
||||
*
|
||||
* @param string $soft_descriptor
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSoftDescriptor($soft_descriptor)
|
||||
{
|
||||
$this->soft_descriptor = $soft_descriptor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Soft descriptor used when charging this funding source. If length exceeds max length, the value will be truncated
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSoftDescriptor()
|
||||
{
|
||||
return $this->soft_descriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Soft descriptor city used when charging this funding source. If length exceeds max length, the value will be truncated. Only supported when the `payment_method` is set to `credit_card`
|
||||
* @deprecated Not publicly available
|
||||
* @param string $soft_descriptor_city
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSoftDescriptorCity($soft_descriptor_city)
|
||||
{
|
||||
$this->soft_descriptor_city = $soft_descriptor_city;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Soft descriptor city used when charging this funding source. If length exceeds max length, the value will be truncated. Only supported when the `payment_method` is set to `credit_card`
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getSoftDescriptorCity()
|
||||
{
|
||||
return $this->soft_descriptor_city;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment options requested for this purchase unit
|
||||
*
|
||||
* @param \PayPal\Api\PaymentOptions $payment_options
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentOptions($payment_options)
|
||||
{
|
||||
$this->payment_options = $payment_options;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment options requested for this purchase unit
|
||||
*
|
||||
* @return \PayPal\Api\PaymentOptions
|
||||
*/
|
||||
public function getPaymentOptions()
|
||||
{
|
||||
return $this->payment_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of items being paid for.
|
||||
*
|
||||
* @param \PayPal\Api\ItemList $item_list
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setItemList($item_list)
|
||||
{
|
||||
$this->item_list = $item_list;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of items being paid for.
|
||||
*
|
||||
* @return \PayPal\Api\ItemList
|
||||
*/
|
||||
public function getItemList()
|
||||
{
|
||||
return $this->item_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL to send payment notifications
|
||||
*
|
||||
* @param string $notify_url
|
||||
* @throws \InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setNotifyUrl($notify_url)
|
||||
{
|
||||
UrlValidator::validate($notify_url, "NotifyUrl");
|
||||
$this->notify_url = $notify_url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL to send payment notifications
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNotifyUrl()
|
||||
{
|
||||
return $this->notify_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Url on merchant site pertaining to this payment.
|
||||
*
|
||||
* @param string $order_url
|
||||
* @throws \InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setOrderUrl($order_url)
|
||||
{
|
||||
UrlValidator::validate($order_url, "OrderUrl");
|
||||
$this->order_url = $order_url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Url on merchant site pertaining to this payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOrderUrl()
|
||||
{
|
||||
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))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
89
paypal/PayPal/Api/ChargeModel.php
Normal file
89
paypal/PayPal/Api/ChargeModel.php
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class ChargeModel
|
||||
*
|
||||
* A resource representing a charge model for a payment definition.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string type
|
||||
* @property \PayPal\Api\Currency amount
|
||||
*/
|
||||
class ChargeModel extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Identifier of the charge model. 128 characters max.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the charge model. 128 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of charge model. Allowed values: `SHIPPING`, `TAX`.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of charge model. Allowed values: `SHIPPING`, `TAX`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specific amount for this charge model.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specific amount for this charge model.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
}
|
||||
69
paypal/PayPal/Api/Cost.php
Normal file
69
paypal/PayPal/Api/Cost.php
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Converter\FormatConverter;
|
||||
use PayPal\Validation\NumericValidator;
|
||||
|
||||
/**
|
||||
* Class Cost
|
||||
*
|
||||
* Cost as a percent or an amount. For example, to specify 10%, enter `10`. Alternatively, to specify an amount of 5, enter `5`.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string percent
|
||||
* @property \PayPal\Api\Currency amount
|
||||
*/
|
||||
class Cost extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Cost in percent. Range of 0 to 100.
|
||||
*
|
||||
* @param string $percent
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPercent($percent)
|
||||
{
|
||||
NumericValidator::validate($percent, "Percent");
|
||||
$percent = FormatConverter::formatToNumber($percent);
|
||||
$this->percent = $percent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cost in percent. Range of 0 to 100.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPercent()
|
||||
{
|
||||
return $this->percent;
|
||||
}
|
||||
|
||||
/**
|
||||
* The cost, as an amount. Valid range is from 0 to 1,000,000.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The cost, as an amount. Valid range is from 0 to 1,000,000.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
}
|
||||
41
paypal/PayPal/Api/CountryCode.php
Normal file
41
paypal/PayPal/Api/CountryCode.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class CountryCode
|
||||
*
|
||||
* The ISO 3166-1 alpha-2 country code. A complete list of valid codes is available at Wikipedia: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 In particular, note that the country code for Great Britain is GB, not UK as used in that country's top-level domain names.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
}
|
||||
40
paypal/PayPal/Api/CreateProfileResponse.php
Normal file
40
paypal/PayPal/Api/CreateProfileResponse.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
* Class CreateProfileResponse
|
||||
*
|
||||
* Response schema for create profile api
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
*/
|
||||
class CreateProfileResponse extends WebProfile
|
||||
{
|
||||
/**
|
||||
* ID of the payment web experience profile.
|
||||
*
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the payment web experience profile.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
}
|
||||
66
paypal/PayPal/Api/Credit.php
Normal file
66
paypal/PayPal/Api/Credit.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class Credit
|
||||
*
|
||||
* A resource representing a credit instrument.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string type
|
||||
*/
|
||||
class Credit extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Unique identifier of credit resource.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unique identifier of credit resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* specifies type of credit
|
||||
* Valid Values: ["BILL_ME_LATER", "PAYPAL_EXTRAS_MASTERCARD", "EBAY_MASTERCARD", "PAYPAL_SMART_CONNECT"]
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* specifies type of credit
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
}
|
||||
560
paypal/PayPal/Api/CreditCard.php
Normal file
560
paypal/PayPal/Api/CreditCard.php
Normal file
|
|
@ -0,0 +1,560 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Transport\PayPalRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* Class CreditCard
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string number
|
||||
* @property string type
|
||||
* @property int expire_month
|
||||
* @property int expire_year
|
||||
* @property string cvv2
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* @property \PayPal\Api\Address billing_address
|
||||
* @property string external_customer_id
|
||||
* @property string state
|
||||
* @property string valid_until
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class CreditCard extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNumber($number)
|
||||
{
|
||||
$this->number = $number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function getNumber()
|
||||
{
|
||||
return $this->number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expiration month with no leading zero. Acceptable values are 1 through 12.
|
||||
*
|
||||
* @param int $expire_month
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireMonth($expire_month)
|
||||
{
|
||||
$this->expire_month = $expire_month;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expiration month with no leading zero. Acceptable values are 1 through 12.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpireMonth()
|
||||
{
|
||||
return $this->expire_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4-digit expiration year.
|
||||
*
|
||||
* @param int $expire_year
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireYear($expire_year)
|
||||
{
|
||||
$this->expire_year = $expire_year;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4-digit expiration year.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpireYear()
|
||||
{
|
||||
return $this->expire_year;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3-4 digit card validation code.
|
||||
*
|
||||
* @param string $cvv2
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCvv2($cvv2)
|
||||
{
|
||||
$this->cvv2 = $cvv2;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3-4 digit card validation code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCvv2()
|
||||
{
|
||||
return $this->cvv2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cardholder's first name.
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirstName($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cardholder's first name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName()
|
||||
{
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cardholder's last name.
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastName($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cardholder's last name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName()
|
||||
{
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing Address associated with this card.
|
||||
*
|
||||
* @param \PayPal\Api\Address $billing_address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBillingAddress($billing_address)
|
||||
{
|
||||
$this->billing_address = $billing_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing Address associated with this card.
|
||||
*
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
public function getBillingAddress()
|
||||
{
|
||||
return $this->billing_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternalCustomerId($external_customer_id)
|
||||
{
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function getExternalCustomerId()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* A user provided, optional convenvience field that functions as a unique identifier for the merchant on behalf of whom this credit card is being stored for. Note that this has no relation to PayPal merchant id
|
||||
*
|
||||
* @param string $merchant_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMerchantId($merchant_id)
|
||||
{
|
||||
$this->merchant_id = $merchant_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A user provided, optional convenvience field that functions as a unique identifier for the merchant on behalf of whom this credit card is being stored for. Note that this has no relation to PayPal merchant id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMerchantId()
|
||||
{
|
||||
return $this->merchant_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerId($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function getPayerId()
|
||||
{
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier of the bank account resource. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant.
|
||||
*
|
||||
* @param string $external_card_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternalCardId($external_card_id)
|
||||
{
|
||||
$this->external_card_id = $external_card_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier of the bank account resource. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalCardId()
|
||||
{
|
||||
return $this->external_card_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the credit card funding instrument.
|
||||
* Valid Values: ["expired", "ok"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the credit card funding instrument.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Funding instrument expiration date.
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates creation time.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the updation time.
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the updation time.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until this resource can be used fund a payment.
|
||||
*
|
||||
* @param string $valid_until
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValidUntil($valid_until)
|
||||
{
|
||||
$this->valid_until = $valid_until;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Funding instrument expiration date.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValidUntil()
|
||||
{
|
||||
return $this->valid_until;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Credit Card Resource (aka Tokenize).
|
||||
*
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return CreditCard
|
||||
*/
|
||||
public function create($apiContext = null, $restCall = null)
|
||||
{
|
||||
$payLoad = $this->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/vault/credit-cards",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain the Credit Card resource for the given identifier.
|
||||
*
|
||||
* @param string $creditCardId
|
||||
* @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 CreditCard
|
||||
*/
|
||||
public static function get($creditCardId, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($creditCardId, 'creditCardId');
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/vault/credit-cards/$creditCardId",
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new CreditCard();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the Credit Card resource for the given identifier.
|
||||
*
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return bool
|
||||
*/
|
||||
public function delete($apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
$payLoad = "";
|
||||
self::executeCall(
|
||||
"/v1/vault/credit-cards/{$this->getId()}",
|
||||
"DELETE",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update information in a previously saved card. Only the modified fields need to be passed in the request.
|
||||
*
|
||||
* @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 CreditCard
|
||||
*/
|
||||
public function update($patchRequest, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($patchRequest, 'patch');
|
||||
$payload = $patchRequest->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/vault/credit-cards/{$this->getId()}",
|
||||
"PATCH",
|
||||
$payload,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a list of Credit Card resources.
|
||||
*
|
||||
* @param array $params
|
||||
* @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 CreditCardList
|
||||
*/
|
||||
public static function all($params, $apiContext = null, $restCall = null)
|
||||
{
|
||||
if (is_null($params)) {
|
||||
$params = array();
|
||||
}
|
||||
ArgumentValidator::validate($params, 'params');
|
||||
$payLoad = "";
|
||||
$allowedParams = array(
|
||||
'page_size' => 1,
|
||||
'page' => 1,
|
||||
'start_time' => 1,
|
||||
'end_time' => 1,
|
||||
'sort_order' => 1,
|
||||
'sort_by' => 1,
|
||||
'merchant_id' => 1,
|
||||
'external_card_id' => 1,
|
||||
'external_customer_id' => 1,
|
||||
'total_required' => 1
|
||||
);
|
||||
$json = self::executeCall(
|
||||
"/v1/vault/credit-cards" . "?" . http_build_query(array_intersect_key($params, $allowedParams)),
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new CreditCardList();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
}
|
||||
91
paypal/PayPal/Api/CreditCardHistory.php
Normal file
91
paypal/PayPal/Api/CreditCardHistory.php
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class CreditCardHistory
|
||||
*
|
||||
* A list of Credit Card Resources
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\CreditCard[] credit_cards
|
||||
* @property int count
|
||||
* @property string next_id
|
||||
*/
|
||||
class CreditCardHistory extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* A list of credit card resources
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard[] $credit_cards
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreditCards($credit_cards)
|
||||
{
|
||||
$this->{"credit-cards"} = $credit_cards;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of credit card resources
|
||||
*
|
||||
* @return \PayPal\Api\CreditCard
|
||||
*/
|
||||
public function getCreditCards()
|
||||
{
|
||||
return $this->{"credit-cards"};
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
*
|
||||
*
|
||||
* @param int $count
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCount($count)
|
||||
{
|
||||
$this->count = $count;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCount()
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
*
|
||||
*
|
||||
* @param string $next_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNextId($next_id)
|
||||
{
|
||||
$this->next_id = $next_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNextId()
|
||||
{
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
}
|
||||
120
paypal/PayPal/Api/CreditCardList.php
Normal file
120
paypal/PayPal/Api/CreditCardList.php
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
|
||||
/**
|
||||
* Class CreditCardList
|
||||
*
|
||||
* A list of Credit Card Resources
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\CreditCard[] items
|
||||
* @property \PayPal\Api\Links[] links
|
||||
* @property int total_items
|
||||
* @property int total_pages
|
||||
*/
|
||||
class CreditCardList extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* A list of credit card resources
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard[] $items
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setItems($items)
|
||||
{
|
||||
$this->items = $items;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of credit card resources
|
||||
*
|
||||
* @return \PayPal\Api\CreditCard[]
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Items to the list.
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $creditCard
|
||||
* @return $this
|
||||
*/
|
||||
public function addItem($creditCard)
|
||||
{
|
||||
if (!$this->getItems()) {
|
||||
return $this->setItems(array($creditCard));
|
||||
} else {
|
||||
return $this->setItems(
|
||||
array_merge($this->getItems(), array($creditCard))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Items from the list.
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $creditCard
|
||||
* @return $this
|
||||
*/
|
||||
public function removeItem($creditCard)
|
||||
{
|
||||
return $this->setItems(
|
||||
array_diff($this->getItems(), array($creditCard))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Total number of items present in the given list. Note that the number of items might be larger than the records in the current page.
|
||||
*
|
||||
* @param int $total_items
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTotalItems($total_items)
|
||||
{
|
||||
$this->total_items = $total_items;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total number of items present in the given list. Note that the number of items might be larger than the records in the current page.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTotalItems()
|
||||
{
|
||||
return $this->total_items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total number of pages that exist, for the total number of items, with the given page size.
|
||||
*
|
||||
* @param int $total_pages
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTotalPages($total_pages)
|
||||
{
|
||||
$this->total_pages = $total_pages;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total number of pages that exist, for the total number of items, with the given page size.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTotalPages()
|
||||
{
|
||||
return $this->total_pages;
|
||||
}
|
||||
|
||||
}
|
||||
161
paypal/PayPal/Api/CreditCardToken.php
Normal file
161
paypal/PayPal/Api/CreditCardToken.php
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class CreditCardToken
|
||||
*
|
||||
* A resource representing a credit card that can be used to fund a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string credit_card_id
|
||||
* @property string payer_id
|
||||
* @property string last4
|
||||
* @property string type
|
||||
* @property int expire_month
|
||||
* @property int expire_year
|
||||
*/
|
||||
class CreditCardToken extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* ID of credit card previously stored using `/vault/credit-card`.
|
||||
*
|
||||
* @param string $credit_card_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreditCardId($credit_card_id)
|
||||
{
|
||||
$this->credit_card_id = $credit_card_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of credit card previously stored using `/vault/credit-card`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreditCardId()
|
||||
{
|
||||
return $this->credit_card_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. **Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault.**
|
||||
*
|
||||
* @param string $payer_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerId($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function getPayerId()
|
||||
{
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last four digits of the stored credit card number.
|
||||
*
|
||||
* @param string $last4
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLast4($last4)
|
||||
{
|
||||
$this->last4 = $last4;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last four digits of the stored credit card number.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLast4()
|
||||
{
|
||||
return $this->last4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`. Values are presented in lowercase and not should not be used for display.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expiration month with no leading zero. Acceptable values are 1 through 12.
|
||||
*
|
||||
* @param int $expire_month
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireMonth($expire_month)
|
||||
{
|
||||
$this->expire_month = $expire_month;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expiration month with no leading zero. Acceptable values are 1 through 12.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpireMonth()
|
||||
{
|
||||
return $this->expire_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4-digit expiration year.
|
||||
*
|
||||
* @param int $expire_year
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireYear($expire_year)
|
||||
{
|
||||
$this->expire_year = $expire_year;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4-digit expiration year.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpireYear()
|
||||
{
|
||||
return $this->expire_year;
|
||||
}
|
||||
|
||||
}
|
||||
161
paypal/PayPal/Api/CreditFinancingOffered.php
Normal file
161
paypal/PayPal/Api/CreditFinancingOffered.php
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
69
paypal/PayPal/Api/Currency.php
Normal file
69
paypal/PayPal/Api/Currency.php
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Converter\FormatConverter;
|
||||
use PayPal\Validation\NumericValidator;
|
||||
|
||||
/**
|
||||
* Class Currency
|
||||
*
|
||||
* Base object for all financial value related fields (balance, payment due, etc.)
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string currency
|
||||
* @property string value
|
||||
*/
|
||||
class Currency extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* 3 letter currency code as defined by ISO 4217.
|
||||
*
|
||||
* @param string $currency
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCurrency($currency)
|
||||
{
|
||||
$this->currency = $currency;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3 letter currency code as defined by ISO 4217.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency()
|
||||
{
|
||||
return $this->currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code.
|
||||
*
|
||||
* @param string|double $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
NumericValidator::validate($value, "Value");
|
||||
$value = FormatConverter::formatToPrice($value, $this->getCurrency());
|
||||
$this->value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
}
|
||||
266
paypal/PayPal/Api/CurrencyConversion.php
Normal file
266
paypal/PayPal/Api/CurrencyConversion.php
Normal file
|
|
@ -0,0 +1,266 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Validation\UrlValidator;
|
||||
|
||||
/**
|
||||
* Class CurrencyConversion
|
||||
*
|
||||
* Object used to store the currency conversion rate.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string conversion_date
|
||||
* @property string from_currency
|
||||
* @property string from_amount
|
||||
* @property string to_currency
|
||||
* @property string to_amount
|
||||
* @property string conversion_type
|
||||
* @property bool conversion_type_changeable
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class CurrencyConversion extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Date of validity for the conversion rate.
|
||||
*
|
||||
* @param string $conversion_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setConversionDate($conversion_date)
|
||||
{
|
||||
$this->conversion_date = $conversion_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date of validity for the conversion rate.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getConversionDate()
|
||||
{
|
||||
return $this->conversion_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3 letter currency code
|
||||
*
|
||||
* @param string $from_currency
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFromCurrency($from_currency)
|
||||
{
|
||||
$this->from_currency = $from_currency;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3 letter currency code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFromCurrency()
|
||||
{
|
||||
return $this->from_currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount participating in currency conversion, set to 1 as default
|
||||
*
|
||||
* @param string $from_amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFromAmount($from_amount)
|
||||
{
|
||||
$this->from_amount = $from_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount participating in currency conversion, set to 1 as default
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFromAmount()
|
||||
{
|
||||
return $this->from_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3 letter currency code
|
||||
*
|
||||
* @param string $to_currency
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setToCurrency($to_currency)
|
||||
{
|
||||
$this->to_currency = $to_currency;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3 letter currency code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getToCurrency()
|
||||
{
|
||||
return $this->to_currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount resulting from currency conversion.
|
||||
*
|
||||
* @param string $to_amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setToAmount($to_amount)
|
||||
{
|
||||
$this->to_amount = $to_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount resulting from currency conversion.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getToAmount()
|
||||
{
|
||||
return $this->to_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Field indicating conversion type applied.
|
||||
* Valid Values: ["PAYPAL", "VENDOR"]
|
||||
*
|
||||
* @param string $conversion_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setConversionType($conversion_type)
|
||||
{
|
||||
$this->conversion_type = $conversion_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Field indicating conversion type applied.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getConversionType()
|
||||
{
|
||||
return $this->conversion_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow Payer to change conversion type.
|
||||
*
|
||||
* @param bool $conversion_type_changeable
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setConversionTypeChangeable($conversion_type_changeable)
|
||||
{
|
||||
$this->conversion_type_changeable = $conversion_type_changeable;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow Payer to change conversion type.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getConversionTypeChangeable()
|
||||
{
|
||||
return $this->conversion_type_changeable;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function setWebUrl($web_url)
|
||||
{
|
||||
UrlValidator::validate($web_url, "WebUrl");
|
||||
$this->web_url = $web_url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Base URL to web applications endpoint
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getWebUrl()
|
||||
{
|
||||
return $this->web_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
* @param \PayPal\Api\Links[] $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Links to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function addLink($links)
|
||||
{
|
||||
if (!$this->getLinks()) {
|
||||
return $this->setLinks(array($links));
|
||||
} else {
|
||||
return $this->setLinks(
|
||||
array_merge($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Links from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function removeLink($links)
|
||||
{
|
||||
return $this->setLinks(
|
||||
array_diff($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
65
paypal/PayPal/Api/CustomAmount.php
Normal file
65
paypal/PayPal/Api/CustomAmount.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class CustomAmount
|
||||
*
|
||||
* The custom amount applied on an invoice. If you include a label, the amount cannot be empty.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string label
|
||||
* @property \PayPal\Api\Currency amount
|
||||
*/
|
||||
class CustomAmount extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The custom amount label. Maximum length is 25 characters.
|
||||
*
|
||||
* @param string $label
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLabel($label)
|
||||
{
|
||||
$this->label = $label;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The custom amount label. Maximum length is 25 characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLabel()
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
/**
|
||||
* The custom amount value. Valid range is from -999999.99 to 999999.99.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The custom amount value. Valid range is from -999999.99 to 999999.99.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
}
|
||||
160
paypal/PayPal/Api/DetailedRefund.php
Normal file
160
paypal/PayPal/Api/DetailedRefund.php
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
|
||||
/**
|
||||
* Class DetailedRefund
|
||||
*
|
||||
* A refund transaction. This is the resource that is returned on GET /refund
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string custom
|
||||
* @property \PayPal\Api\Currency refund_to_payer
|
||||
* @property \PayPal\Api\ExternalFunding[] refund_to_external_funding
|
||||
* @property \PayPal\Api\Currency refund_from_transaction_fee
|
||||
* @property \PayPal\Api\Currency refund_from_received_amount
|
||||
* @property \PayPal\Api\Currency total_refunded_amount
|
||||
*/
|
||||
class DetailedRefund extends Refund
|
||||
{
|
||||
/**
|
||||
* free-form field for the use of clients
|
||||
*
|
||||
* @param string $custom
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCustom($custom)
|
||||
{
|
||||
$this->custom = $custom;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* free-form field for the use of clients
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCustom()
|
||||
{
|
||||
return $this->custom;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount refunded to payer of the original transaction, in the current Refund call
|
||||
*
|
||||
* @param \PayPal\Api\Currency $refund_to_payer
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRefundToPayer($refund_to_payer)
|
||||
{
|
||||
$this->refund_to_payer = $refund_to_payer;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount refunded to payer of the original transaction, in the current Refund call
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getRefundToPayer()
|
||||
{
|
||||
return $this->refund_to_payer;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of external funding that were refunded by the Refund call. Each external_funding unit should have a unique reference_id
|
||||
*
|
||||
* @param \PayPal\Api\ExternalFunding[] $refund_to_external_funding
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRefundToExternalFunding($refund_to_external_funding)
|
||||
{
|
||||
$this->refund_to_external_funding = $refund_to_external_funding;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of external funding that were refunded by the Refund call. Each external_funding unit should have a unique reference_id
|
||||
*
|
||||
* @return \PayPal\Api\ExternalFunding[]
|
||||
*/
|
||||
public function getRefundToExternalFunding()
|
||||
{
|
||||
return $this->refund_to_external_funding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transaction fee refunded to original recipient of payment.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $refund_from_transaction_fee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRefundFromTransactionFee($refund_from_transaction_fee)
|
||||
{
|
||||
$this->refund_from_transaction_fee = $refund_from_transaction_fee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transaction fee refunded to original recipient of payment.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getRefundFromTransactionFee()
|
||||
{
|
||||
return $this->refund_from_transaction_fee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount subtracted from PayPal balance of the original recipient of payment, to make this refund.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $refund_from_received_amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRefundFromReceivedAmount($refund_from_received_amount)
|
||||
{
|
||||
$this->refund_from_received_amount = $refund_from_received_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount subtracted from PayPal balance of the original recipient of payment, to make this refund.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getRefundFromReceivedAmount()
|
||||
{
|
||||
return $this->refund_from_received_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total amount refunded so far from the original purchase. Say, for example, a buyer makes $100 purchase, the buyer was refunded $20 a week ago and is refunded $30 in this transaction. The gross refund amount is $30 (in this transaction). The total refunded amount is $50.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $total_refunded_amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTotalRefundedAmount($total_refunded_amount)
|
||||
{
|
||||
$this->total_refunded_amount = $total_refunded_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total amount refunded so far from the original purchase. Say, for example, a buyer makes $100 purchase, the buyer was refunded $20 a week ago and is refunded $30 in this transaction. The gross refund amount is $30 (in this transaction). The total refunded amount is $50.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getTotalRefundedAmount()
|
||||
{
|
||||
return $this->total_refunded_amount;
|
||||
}
|
||||
|
||||
}
|
||||
227
paypal/PayPal/Api/Details.php
Normal file
227
paypal/PayPal/Api/Details.php
Normal file
|
|
@ -0,0 +1,227 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Converter\FormatConverter;
|
||||
use PayPal\Validation\NumericValidator;
|
||||
|
||||
/**
|
||||
* Class Details
|
||||
*
|
||||
* Additional details of the payment amount.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string subtotal
|
||||
* @property string shipping
|
||||
* @property string tax
|
||||
* @property string handling_fee
|
||||
* @property string shipping_discount
|
||||
* @property string insurance
|
||||
* @property string gift_wrap
|
||||
* @property string fee
|
||||
*/
|
||||
class Details extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Amount of the subtotal of the items. **Required** if line items are specified. 10 characters max, with support for 2 decimal places.
|
||||
*
|
||||
* @param string|double $subtotal
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSubtotal($subtotal)
|
||||
{
|
||||
NumericValidator::validate($subtotal, "Subtotal");
|
||||
$subtotal = FormatConverter::formatToPrice($subtotal);
|
||||
$this->subtotal = $subtotal;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount of the subtotal of the items. **Required** if line items are specified. 10 characters max, with support for 2 decimal places.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSubtotal()
|
||||
{
|
||||
return $this->subtotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount charged for shipping. 10 characters max with support for 2 decimal places.
|
||||
*
|
||||
* @param string|double $shipping
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShipping($shipping)
|
||||
{
|
||||
NumericValidator::validate($shipping, "Shipping");
|
||||
$shipping = FormatConverter::formatToPrice($shipping);
|
||||
$this->shipping = $shipping;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount charged for shipping. 10 characters max with support for 2 decimal places.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShipping()
|
||||
{
|
||||
return $this->shipping;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount charged for tax. 10 characters max with support for 2 decimal places.
|
||||
*
|
||||
* @param string|double $tax
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTax($tax)
|
||||
{
|
||||
NumericValidator::validate($tax, "Tax");
|
||||
$tax = FormatConverter::formatToPrice($tax);
|
||||
$this->tax = $tax;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount charged for tax. 10 characters max with support for 2 decimal places.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTax()
|
||||
{
|
||||
return $this->tax;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged for the handling fee. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @param string|double $handling_fee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHandlingFee($handling_fee)
|
||||
{
|
||||
NumericValidator::validate($handling_fee, "Handling Fee");
|
||||
$handling_fee = FormatConverter::formatToPrice($handling_fee);
|
||||
$this->handling_fee = $handling_fee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged for the handling fee. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHandlingFee()
|
||||
{
|
||||
return $this->handling_fee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being discounted for the shipping fee. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @param string|double $shipping_discount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShippingDiscount($shipping_discount)
|
||||
{
|
||||
NumericValidator::validate($shipping_discount, "Shipping Discount");
|
||||
$shipping_discount = FormatConverter::formatToPrice($shipping_discount);
|
||||
$this->shipping_discount = $shipping_discount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being discounted for the shipping fee. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShippingDiscount()
|
||||
{
|
||||
return $this->shipping_discount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged for the insurance fee. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @param string|double $insurance
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInsurance($insurance)
|
||||
{
|
||||
NumericValidator::validate($insurance, "Insurance");
|
||||
$insurance = FormatConverter::formatToPrice($insurance);
|
||||
$this->insurance = $insurance;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged for the insurance fee. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInsurance()
|
||||
{
|
||||
return $this->insurance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as gift wrap fee.
|
||||
*
|
||||
* @param string|double $gift_wrap
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setGiftWrap($gift_wrap)
|
||||
{
|
||||
NumericValidator::validate($gift_wrap, "Gift Wrap");
|
||||
$gift_wrap = FormatConverter::formatToPrice($gift_wrap);
|
||||
$this->gift_wrap = $gift_wrap;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being charged as gift wrap fee.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getGiftWrap()
|
||||
{
|
||||
return $this->gift_wrap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment.
|
||||
*
|
||||
* @param string|double $fee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFee($fee)
|
||||
{
|
||||
NumericValidator::validate($fee, "Fee");
|
||||
$fee = FormatConverter::formatToPrice($fee);
|
||||
$this->fee = $fee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFee()
|
||||
{
|
||||
return $this->fee;
|
||||
}
|
||||
|
||||
}
|
||||
320
paypal/PayPal/Api/Error.php
Normal file
320
paypal/PayPal/Api/Error.php
Normal file
|
|
@ -0,0 +1,320 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class Error
|
||||
*
|
||||
* Details of an Error
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string name
|
||||
* @property string message
|
||||
* @property \PayPal\Api\ErrorDetails[] details
|
||||
* @property string information_link
|
||||
* @property string debug_id
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class Error extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Human readable, unique name of the error.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Human readable, unique name of the error.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reference ID of the purchase_unit associated with this error
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $purchase_unit_reference_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPurchaseUnitReferenceId($purchase_unit_reference_id)
|
||||
{
|
||||
$this->purchase_unit_reference_id = $purchase_unit_reference_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reference ID of the purchase_unit associated with this error
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getPurchaseUnitReferenceId()
|
||||
{
|
||||
return $this->purchase_unit_reference_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal internal error code.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCode($code)
|
||||
{
|
||||
$this->code = $code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal internal error code.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getCode()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param string $message
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMessage($message)
|
||||
{
|
||||
$this->message = $message;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Message describing the error.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @param \PayPal\Api\ErrorDetails[] $details
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDetails($details)
|
||||
{
|
||||
$this->details = $details;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional details of the error
|
||||
*
|
||||
* @return \PayPal\Api\ErrorDetails[]
|
||||
*/
|
||||
public function getDetails()
|
||||
{
|
||||
return $this->details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Details to the list.
|
||||
*
|
||||
* @param \PayPal\Api\ErrorDetails $errorDetails
|
||||
* @return $this
|
||||
*/
|
||||
public function addDetail($errorDetails)
|
||||
{
|
||||
if (!$this->getDetails()) {
|
||||
return $this->setDetails(array($errorDetails));
|
||||
} else {
|
||||
return $this->setDetails(
|
||||
array_merge($this->getDetails(), array($errorDetails))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Details from the list.
|
||||
*
|
||||
* @param \PayPal\Api\ErrorDetails $errorDetails
|
||||
* @return $this
|
||||
*/
|
||||
public function removeDetail($errorDetails)
|
||||
{
|
||||
return $this->setDetails(
|
||||
array_diff($this->getDetails(), array($errorDetails))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
* @param \PayPal\Api\Links[] $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Links to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function addLink($links)
|
||||
{
|
||||
if (!$this->getLinks()) {
|
||||
return $this->setLinks(array($links));
|
||||
} else {
|
||||
return $this->setLinks(
|
||||
array_merge($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Links from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function removeLink($links)
|
||||
{
|
||||
return $this->setLinks(
|
||||
array_diff($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
}
|
||||
111
paypal/PayPal/Api/ErrorDetails.php
Normal file
111
paypal/PayPal/Api/ErrorDetails.php
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class ErrorDetails
|
||||
*
|
||||
* Details about a specific error.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string field
|
||||
* @property string issue
|
||||
*/
|
||||
class ErrorDetails extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Name of the field that caused the error.
|
||||
*
|
||||
* @param string $field
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setField($field)
|
||||
{
|
||||
$this->field = $field;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the field that caused the error.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getField()
|
||||
{
|
||||
return $this->field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason for the error.
|
||||
*
|
||||
* @param string $issue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIssue($issue)
|
||||
{
|
||||
$this->issue = $issue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason for the error.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIssue()
|
||||
{
|
||||
return $this->issue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reference ID of the purchase_unit associated with this error
|
||||
* @deprecated Not publicly available
|
||||
* @param string $purchase_unit_reference_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPurchaseUnitReferenceId($purchase_unit_reference_id)
|
||||
{
|
||||
$this->purchase_unit_reference_id = $purchase_unit_reference_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reference ID of the purchase_unit associated with this error
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getPurchaseUnitReferenceId()
|
||||
{
|
||||
return $this->purchase_unit_reference_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal internal error code.
|
||||
* @deprecated Not publicly available
|
||||
* @param string $code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCode($code)
|
||||
{
|
||||
$this->code = $code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal internal error code.
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getCode()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
}
|
||||
38
paypal/PayPal/Api/ExtendedBankAccount.php
Normal file
38
paypal/PayPal/Api/ExtendedBankAccount.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
* Class ExtendedBankAccount
|
||||
*
|
||||
* A resource representing a bank account that can be used to fund a payment including support for SEPA.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
*/
|
||||
class ExtendedBankAccount extends BankAccount
|
||||
{
|
||||
/**
|
||||
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
|
||||
* @deprecated Not publicly available
|
||||
* @param string $mandate_reference_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMandateReferenceNumber($mandate_reference_number)
|
||||
{
|
||||
$this->mandate_reference_number = $mandate_reference_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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()
|
||||
{
|
||||
return $this->mandate_reference_number;
|
||||
}
|
||||
|
||||
}
|
||||
161
paypal/PayPal/Api/ExternalFunding.php
Normal file
161
paypal/PayPal/Api/ExternalFunding.php
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
<?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
|
||||
* @property string funding_instruction
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates that the Payment should be fully funded by External Funded Incentive
|
||||
* Valid Values: ["FULLY_FUNDED"]
|
||||
*
|
||||
* @param string $funding_instruction
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFundingInstruction($funding_instruction)
|
||||
{
|
||||
$this->funding_instruction = $funding_instruction;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates that the Payment should be fully funded by External Funded Incentive
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFundingInstruction()
|
||||
{
|
||||
return $this->funding_instruction;
|
||||
}
|
||||
}
|
||||
67
paypal/PayPal/Api/FileAttachment.php
Normal file
67
paypal/PayPal/Api/FileAttachment.php
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Validation\UrlValidator;
|
||||
|
||||
/**
|
||||
* Class FileAttachment
|
||||
*
|
||||
* File attached to an invoice or template
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string name
|
||||
* @property string url
|
||||
*/
|
||||
class FileAttachment extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Name of the file attached.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the file attached.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL of the attached file that can be downloaded.
|
||||
*
|
||||
* @param string $url
|
||||
* @throws \InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setUrl($url)
|
||||
{
|
||||
UrlValidator::validate($url, "Url");
|
||||
$this->url = $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL of the attached file that can be downloaded.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
}
|
||||
115
paypal/PayPal/Api/FlowConfig.php
Normal file
115
paypal/PayPal/Api/FlowConfig.php
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Validation\UrlValidator;
|
||||
|
||||
/**
|
||||
* Class FlowConfig
|
||||
*
|
||||
* Parameters for flow configuration.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string landing_page_type
|
||||
* @property string bank_txn_pending_url
|
||||
* @property string user_action
|
||||
* @property string return_uri_http_method
|
||||
*/
|
||||
class FlowConfig extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The type of landing page to display on the PayPal site for user checkout. Set to `Billing` to use the non-PayPal account landing page. Set to `Login` to use the PayPal account login landing page.
|
||||
*
|
||||
* @param string $landing_page_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLandingPageType($landing_page_type)
|
||||
{
|
||||
$this->landing_page_type = $landing_page_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of landing page to display on the PayPal site for user checkout. Set to `Billing` to use the non-PayPal account landing page. Set to `Login` to use the PayPal account login landing page.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLandingPageType()
|
||||
{
|
||||
return $this->landing_page_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant site URL to display after a bank transfer payment. Valid for only the Giropay or bank transfer payment method in Germany.
|
||||
*
|
||||
* @param string $bank_txn_pending_url
|
||||
* @throws \InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setBankTxnPendingUrl($bank_txn_pending_url)
|
||||
{
|
||||
UrlValidator::validate($bank_txn_pending_url, "BankTxnPendingUrl");
|
||||
$this->bank_txn_pending_url = $bank_txn_pending_url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant site URL to display after a bank transfer payment. Valid for only the Giropay or bank transfer payment method in Germany.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBankTxnPendingUrl()
|
||||
{
|
||||
return $this->bank_txn_pending_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines whether buyers can complete purchases on the PayPal or merchant website.
|
||||
*
|
||||
* @param string $user_action
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUserAction($user_action)
|
||||
{
|
||||
$this->user_action = $user_action;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines whether buyers can complete purchases on the PayPal or merchant website.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUserAction()
|
||||
{
|
||||
return $this->user_action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the HTTP method to use to redirect the user to a return URL. A valid value is `GET` or `POST`.
|
||||
*
|
||||
* @param string $return_uri_http_method
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReturnUriHttpMethod($return_uri_http_method)
|
||||
{
|
||||
$this->return_uri_http_method = $return_uri_http_method;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the HTTP method to use to redirect the user to a return URL. A valid value is `GET` or `POST`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReturnUriHttpMethod()
|
||||
{
|
||||
return $this->return_uri_http_method;
|
||||
}
|
||||
|
||||
}
|
||||
115
paypal/PayPal/Api/FmfDetails.php
Normal file
115
paypal/PayPal/Api/FmfDetails.php
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class FmfDetails
|
||||
*
|
||||
* Details of Fraud Management Filter (FMF).
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string filter_type
|
||||
* @property string filter_id
|
||||
* @property string name
|
||||
* @property string description
|
||||
*/
|
||||
class FmfDetails extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Type of filter.
|
||||
* Valid Values: ["ACCEPT", "PENDING", "DENY", "REPORT"]
|
||||
*
|
||||
* @param string $filter_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFilterType($filter_type)
|
||||
{
|
||||
$this->filter_type = $filter_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of filter.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFilterType()
|
||||
{
|
||||
return $this->filter_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_MISMATCH", "RISKY_ZIP_CODE", "SUSPECTED_FREIGHT_FORWARDER_CHECK", "TOTAL_PURCHASE_PRICE_MINIMUM", "IP_ADDRESS_VELOCITY", "RISKY_EMAIL_ADDRESS_DOMAIN_CHECK", "RISKY_BANK_IDENTIFICATION_NUMBER_CHECK", "RISKY_IP_ADDRESS_RANGE", "PAYPAL_FRAUD_MODEL"]
|
||||
*
|
||||
* @param string $filter_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFilterId($filter_id)
|
||||
{
|
||||
$this->filter_id = $filter_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter Identifier.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFilterId()
|
||||
{
|
||||
return $this->filter_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the filter
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the filter
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the filter.
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the filter.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
}
|
||||
114
paypal/PayPal/Api/FundingDetail.php
Normal file
114
paypal/PayPal/Api/FundingDetail.php
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class FundingDetail
|
||||
*
|
||||
* Additional detail of the funding.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string clearing_time
|
||||
* @property string payment_hold_date
|
||||
* @property string payment_debit_date
|
||||
* @property string processing_type
|
||||
*/
|
||||
class FundingDetail extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Expected clearing time
|
||||
*
|
||||
* @param string $clearing_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setClearingTime($clearing_time)
|
||||
{
|
||||
$this->clearing_time = $clearing_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expected clearing time
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getClearingTime()
|
||||
{
|
||||
return $this->clearing_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* [DEPRECATED] Hold-off duration of the payment. payment_debit_date should be used instead.
|
||||
*
|
||||
* @param string $payment_hold_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentHoldDate($payment_hold_date)
|
||||
{
|
||||
$this->payment_hold_date = $payment_hold_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated [DEPRECATED] Hold-off duration of the payment. payment_debit_date should be used instead.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentHoldDate()
|
||||
{
|
||||
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: ["CUP_SECURE", "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;
|
||||
}
|
||||
|
||||
}
|
||||
321
paypal/PayPal/Api/FundingInstrument.php
Normal file
321
paypal/PayPal/Api/FundingInstrument.php
Normal file
|
|
@ -0,0 +1,321 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class FundingInstrument
|
||||
*
|
||||
* 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\CreditCardToken credit_card_token
|
||||
* @property \PayPal\Api\Billing billing
|
||||
*/
|
||||
class FundingInstrument extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Credit Card instrument.
|
||||
*
|
||||
* @param \PayPal\Api\CreditCard $credit_card
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreditCard($credit_card)
|
||||
{
|
||||
$this->credit_card = $credit_card;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit Card instrument.
|
||||
*
|
||||
* @return \PayPal\Api\CreditCard
|
||||
*/
|
||||
public function getCreditCard()
|
||||
{
|
||||
return $this->credit_card;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal vaulted credit Card instrument.
|
||||
*
|
||||
* @param \PayPal\Api\CreditCardToken $credit_card_token
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreditCardToken($credit_card_token)
|
||||
{
|
||||
$this->credit_card_token = $credit_card_token;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal vaulted credit Card instrument.
|
||||
*
|
||||
* @return \PayPal\Api\CreditCardToken
|
||||
*/
|
||||
public function getCreditCardToken()
|
||||
{
|
||||
return $this->credit_card_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment Card information.
|
||||
*
|
||||
* @param \PayPal\Api\PaymentCard $payment_card
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentCard($payment_card)
|
||||
{
|
||||
$this->payment_card = $payment_card;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment Card information.
|
||||
*
|
||||
* @return \PayPal\Api\PaymentCard
|
||||
*/
|
||||
public function getPaymentCard()
|
||||
{
|
||||
return $this->payment_card;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bank Account information.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\ExtendedBankAccount $bank_account
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBankAccount($bank_account)
|
||||
{
|
||||
$this->bank_account = $bank_account;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bank Account information.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\ExtendedBankAccount
|
||||
*/
|
||||
public function getBankAccount()
|
||||
{
|
||||
return $this->bank_account;
|
||||
}
|
||||
|
||||
/**
|
||||
* Vaulted bank account instrument.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\BankToken $bank_account_token
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBankAccountToken($bank_account_token)
|
||||
{
|
||||
$this->bank_account_token = $bank_account_token;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Vaulted bank account instrument.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\BankToken
|
||||
*/
|
||||
public function getBankAccountToken()
|
||||
{
|
||||
return $this->bank_account_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal credit funding instrument.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Credit $credit
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCredit($credit)
|
||||
{
|
||||
$this->credit = $credit;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal credit funding instrument.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Credit
|
||||
*/
|
||||
public function getCredit()
|
||||
{
|
||||
return $this->credit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Incentive funding instrument.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Incentive $incentive
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIncentive($incentive)
|
||||
{
|
||||
$this->incentive = $incentive;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Incentive funding instrument.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Incentive
|
||||
*/
|
||||
public function getIncentive()
|
||||
{
|
||||
return $this->incentive;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public function setCarrierAccountToken($carrier_account_token)
|
||||
{
|
||||
$this->carrier_account_token = $carrier_account_token;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Carrier account token instrument.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\CarrierAccountToken
|
||||
*/
|
||||
public function getCarrierAccountToken()
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
221
paypal/PayPal/Api/FundingOption.php
Normal file
221
paypal/PayPal/Api/FundingOption.php
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class FundingOption
|
||||
*
|
||||
* specifies the funding option details.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property \PayPal\Api\FundingSource[] funding_sources
|
||||
* @property \PayPal\Api\FundingInstrument backup_funding_instrument
|
||||
* @property \PayPal\Api\CurrencyConversion currency_conversion
|
||||
* @property \PayPal\Api\InstallmentInfo installment_info
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class FundingOption extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* id of the funding option.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* id of the funding option.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of funding sources that contributes to a payment.
|
||||
*
|
||||
* @param \PayPal\Api\FundingSource[] $funding_sources
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFundingSources($funding_sources)
|
||||
{
|
||||
$this->funding_sources = $funding_sources;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of funding sources that contributes to a payment.
|
||||
*
|
||||
* @return \PayPal\Api\FundingSource[]
|
||||
*/
|
||||
public function getFundingSources()
|
||||
{
|
||||
return $this->funding_sources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append FundingSources to the list.
|
||||
*
|
||||
* @param \PayPal\Api\FundingSource $fundingSource
|
||||
* @return $this
|
||||
*/
|
||||
public function addFundingSource($fundingSource)
|
||||
{
|
||||
if (!$this->getFundingSources()) {
|
||||
return $this->setFundingSources(array($fundingSource));
|
||||
} else {
|
||||
return $this->setFundingSources(
|
||||
array_merge($this->getFundingSources(), array($fundingSource))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove FundingSources from the list.
|
||||
*
|
||||
* @param \PayPal\Api\FundingSource $fundingSource
|
||||
* @return $this
|
||||
*/
|
||||
public function removeFundingSource($fundingSource)
|
||||
{
|
||||
return $this->setFundingSources(
|
||||
array_diff($this->getFundingSources(), array($fundingSource))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Backup funding instrument which will be used for payment if primary fails.
|
||||
*
|
||||
* @param \PayPal\Api\FundingInstrument $backup_funding_instrument
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBackupFundingInstrument($backup_funding_instrument)
|
||||
{
|
||||
$this->backup_funding_instrument = $backup_funding_instrument;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Backup funding instrument which will be used for payment if primary fails.
|
||||
*
|
||||
* @return \PayPal\Api\FundingInstrument
|
||||
*/
|
||||
public function getBackupFundingInstrument()
|
||||
{
|
||||
return $this->backup_funding_instrument;
|
||||
}
|
||||
|
||||
/**
|
||||
* Currency conversion applicable to this funding option.
|
||||
*
|
||||
* @param \PayPal\Api\CurrencyConversion $currency_conversion
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCurrencyConversion($currency_conversion)
|
||||
{
|
||||
$this->currency_conversion = $currency_conversion;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Currency conversion applicable to this funding option.
|
||||
*
|
||||
* @return \PayPal\Api\CurrencyConversion
|
||||
*/
|
||||
public function getCurrencyConversion()
|
||||
{
|
||||
return $this->currency_conversion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Installment options available for a funding option.
|
||||
*
|
||||
* @param \PayPal\Api\InstallmentInfo $installment_info
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInstallmentInfo($installment_info)
|
||||
{
|
||||
$this->installment_info = $installment_info;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Installment options available for a funding option.
|
||||
*
|
||||
* @return \PayPal\Api\InstallmentInfo
|
||||
*/
|
||||
public function getInstallmentInfo()
|
||||
{
|
||||
return $this->installment_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
* @param \PayPal\Api\Links[] $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Links to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function addLink($links)
|
||||
{
|
||||
if (!$this->getLinks()) {
|
||||
return $this->setLinks(array($links));
|
||||
} else {
|
||||
return $this->setLinks(
|
||||
array_merge($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Links from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function removeLink($links)
|
||||
{
|
||||
return $this->setLinks(
|
||||
array_diff($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
292
paypal/PayPal/Api/FundingSource.php
Normal file
292
paypal/PayPal/Api/FundingSource.php
Normal file
|
|
@ -0,0 +1,292 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class FundingSource
|
||||
*
|
||||
* specifies the funding source details.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string funding_mode
|
||||
* @property string funding_instrument_type
|
||||
* @property string soft_descriptor
|
||||
* @property \PayPal\Api\Currency amount
|
||||
* @property \PayPal\Api\Currency negative_balance_amount
|
||||
* @property string legal_text
|
||||
* @property \PayPal\Api\FundingDetail funding_detail
|
||||
* @property string additional_text
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class FundingSource extends FundingInstrument
|
||||
{
|
||||
/**
|
||||
* specifies funding mode of the instrument
|
||||
* Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK", "PAY_UPON_INVOICE"]
|
||||
*
|
||||
* @param string $funding_mode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFundingMode($funding_mode)
|
||||
{
|
||||
$this->funding_mode = $funding_mode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* specifies funding mode of the instrument
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFundingMode()
|
||||
{
|
||||
return $this->funding_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Instrument type for this funding source
|
||||
* Valid Values: ["BALANCE", "PAYMENT_CARD", "BANK_ACCOUNT", "CREDIT", "INCENTIVE", "EXTERNAL_FUNDING", "TAB"]
|
||||
*
|
||||
* @param string $funding_instrument_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFundingInstrumentType($funding_instrument_type)
|
||||
{
|
||||
$this->funding_instrument_type = $funding_instrument_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Instrument type for this funding source
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFundingInstrumentType()
|
||||
{
|
||||
return $this->funding_instrument_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Soft descriptor used when charging this funding source.
|
||||
*
|
||||
* @param string $soft_descriptor
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSoftDescriptor($soft_descriptor)
|
||||
{
|
||||
$this->soft_descriptor = $soft_descriptor;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Soft descriptor used when charging this funding source.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSoftDescriptor()
|
||||
{
|
||||
return $this->soft_descriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total anticipated amount of money to be pulled from instrument.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total anticipated amount of money to be pulled from instrument.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional amount to be pulled from the instrument to recover a negative balance on the buyer's account that is owed to PayPal.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $negative_balance_amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNegativeBalanceAmount($negative_balance_amount)
|
||||
{
|
||||
$this->negative_balance_amount = $negative_balance_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional amount to be pulled from the instrument to recover a negative balance on the buyer's account that is owed to PayPal.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getNegativeBalanceAmount()
|
||||
{
|
||||
return $this->negative_balance_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Localized legal text relevant to funding source.
|
||||
*
|
||||
* @param string $legal_text
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLegalText($legal_text)
|
||||
{
|
||||
$this->legal_text = $legal_text;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Localized legal text relevant to funding source.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLegalText()
|
||||
{
|
||||
return $this->legal_text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional detail of the funding.
|
||||
*
|
||||
* @param \PayPal\Api\FundingDetail $funding_detail
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFundingDetail($funding_detail)
|
||||
{
|
||||
$this->funding_detail = $funding_detail;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional detail of the funding.
|
||||
*
|
||||
* @return \PayPal\Api\FundingDetail
|
||||
*/
|
||||
public function getFundingDetail()
|
||||
{
|
||||
return $this->funding_detail;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional text relevant to funding source.
|
||||
*
|
||||
* @param string $additional_text
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAdditionalText($additional_text)
|
||||
{
|
||||
$this->additional_text = $additional_text;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional text relevant to funding source.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAdditionalText()
|
||||
{
|
||||
return $this->additional_text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Extends
|
||||
*
|
||||
* @param \PayPal\Api\FundingInstrument $extends
|
||||
*
|
||||
* @deprecated Unused
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExtends($extends)
|
||||
{
|
||||
$this->extends = $extends;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Extends
|
||||
*
|
||||
* @deprecated Unused
|
||||
*
|
||||
* @return \PayPal\Api\FundingInstrument
|
||||
*/
|
||||
public function getExtends()
|
||||
{
|
||||
return $this->extends;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
* @param \PayPal\Api\Links[] $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Links to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function addLink($links)
|
||||
{
|
||||
if (!$this->getLinks()) {
|
||||
return $this->setLinks(array($links));
|
||||
} else {
|
||||
return $this->setLinks(
|
||||
array_merge($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Links from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function removeLink($links)
|
||||
{
|
||||
return $this->setLinks(
|
||||
array_diff($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
59
paypal/PayPal/Api/FuturePayment.php
Normal file
59
paypal/PayPal/Api/FuturePayment.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Transport\PayPalRestCall;
|
||||
|
||||
/**
|
||||
* Class FuturePayment
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*/
|
||||
class FuturePayment extends Payment
|
||||
{
|
||||
|
||||
/**
|
||||
* Extends the Payment object to create future payments
|
||||
*
|
||||
* @param null $apiContext
|
||||
* @param string|null $clientMetadataId
|
||||
* @param PayPalRestCall|null $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return $this
|
||||
*/
|
||||
public function create($apiContext = null, $clientMetadataId = null, $restCall = null)
|
||||
{
|
||||
$headers = array();
|
||||
if ($clientMetadataId != null) {
|
||||
$headers = array(
|
||||
'PAYPAL-CLIENT-METADATA-ID' => $clientMetadataId
|
||||
);
|
||||
}
|
||||
$payLoad = $this->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/payment",
|
||||
"POST",
|
||||
$payLoad,
|
||||
$headers,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Refresh Token from Authorization Code
|
||||
*
|
||||
* @param $authorizationCode
|
||||
* @param ApiContext $apiContext
|
||||
* @return string|null refresh token
|
||||
*/
|
||||
public static function getRefreshToken($authorizationCode, $apiContext = null)
|
||||
{
|
||||
$apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential);
|
||||
$credential = $apiContext->getCredential();
|
||||
return $credential->getRefreshToken($apiContext->getConfig(), $authorizationCode);
|
||||
}
|
||||
|
||||
}
|
||||
191
paypal/PayPal/Api/HyperSchema.php
Normal file
191
paypal/PayPal/Api/HyperSchema.php
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class HyperSchema
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Links[] links
|
||||
* @property string fragmentResolution
|
||||
* @property bool readonly
|
||||
* @property string contentEncoding
|
||||
* @property string pathStart
|
||||
* @property string mediaType
|
||||
*/
|
||||
class HyperSchema extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
* @param \PayPal\Api\Links[] $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Links to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function addLink($links)
|
||||
{
|
||||
if (!$this->getLinks()) {
|
||||
return $this->setLinks(array($links));
|
||||
} else {
|
||||
return $this->setLinks(
|
||||
array_merge($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Links from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function removeLink($links)
|
||||
{
|
||||
return $this->setLinks(
|
||||
array_diff($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets FragmentResolution
|
||||
*
|
||||
* @param string $fragmentResolution
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFragmentResolution($fragmentResolution)
|
||||
{
|
||||
$this->fragmentResolution = $fragmentResolution;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets FragmentResolution
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFragmentResolution()
|
||||
{
|
||||
return $this->fragmentResolution;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Readonly
|
||||
*
|
||||
* @param bool $readonly
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReadonly($readonly)
|
||||
{
|
||||
$this->readonly = $readonly;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Readonly
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getReadonly()
|
||||
{
|
||||
return $this->readonly;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets ContentEncoding
|
||||
*
|
||||
* @param string $contentEncoding
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setContentEncoding($contentEncoding)
|
||||
{
|
||||
$this->contentEncoding = $contentEncoding;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets ContentEncoding
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getContentEncoding()
|
||||
{
|
||||
return $this->contentEncoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets PathStart
|
||||
*
|
||||
* @param string $pathStart
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPathStart($pathStart)
|
||||
{
|
||||
$this->pathStart = $pathStart;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets PathStart
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPathStart()
|
||||
{
|
||||
return $this->pathStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets MediaType
|
||||
*
|
||||
* @param string $mediaType
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMediaType($mediaType)
|
||||
{
|
||||
$this->mediaType = $mediaType;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets MediaType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMediaType()
|
||||
{
|
||||
return $this->mediaType;
|
||||
}
|
||||
|
||||
}
|
||||
56
paypal/PayPal/Api/Image.php
Normal file
56
paypal/PayPal/Api/Image.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class Image
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string image
|
||||
*/
|
||||
class Image extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* List of invoices belonging to a merchant.
|
||||
*
|
||||
* @param string $imageBase64String
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setImage($imageBase64String)
|
||||
{
|
||||
$this->image = $imageBase64String;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Image as Base-64 encoded String
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getImage()
|
||||
{
|
||||
return $this->image;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores the Image to file
|
||||
*
|
||||
* @param string $name File Name
|
||||
* @return string File name
|
||||
*/
|
||||
public function saveToFile($name = null)
|
||||
{
|
||||
// Self Generate File Location
|
||||
if (!$name) {
|
||||
$name = uniqid() . '.png';
|
||||
}
|
||||
// Save to File
|
||||
file_put_contents($name, base64_decode($this->getImage()));
|
||||
return $name;
|
||||
}
|
||||
|
||||
}
|
||||
236
paypal/PayPal/Api/Incentive.php
Normal file
236
paypal/PayPal/Api/Incentive.php
Normal file
|
|
@ -0,0 +1,236 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Validation\UrlValidator;
|
||||
|
||||
/**
|
||||
* Class Incentive
|
||||
*
|
||||
* A resource representing a incentive.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string code
|
||||
* @property string name
|
||||
* @property string description
|
||||
* @property \PayPal\Api\Currency minimum_purchase_amount
|
||||
* @property string logo_image_url
|
||||
* @property string expiry_date
|
||||
* @property string type
|
||||
* @property string terms
|
||||
*/
|
||||
class Incentive extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Identifier of the instrument in PayPal Wallet
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the instrument in PayPal Wallet
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Code that identifies the incentive.
|
||||
*
|
||||
* @param string $code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCode($code)
|
||||
{
|
||||
$this->code = $code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Code that identifies the incentive.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCode()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the incentive.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the incentive.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the incentive.
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the incentive.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates incentive is applicable for this minimum purchase amount.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $minimum_purchase_amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMinimumPurchaseAmount($minimum_purchase_amount)
|
||||
{
|
||||
$this->minimum_purchase_amount = $minimum_purchase_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates incentive is applicable for this minimum purchase amount.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getMinimumPurchaseAmount()
|
||||
{
|
||||
return $this->minimum_purchase_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logo image url for the incentive.
|
||||
*
|
||||
* @param string $logo_image_url
|
||||
* @throws \InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setLogoImageUrl($logo_image_url)
|
||||
{
|
||||
UrlValidator::validate($logo_image_url, "LogoImageUrl");
|
||||
$this->logo_image_url = $logo_image_url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logo image url for the incentive.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLogoImageUrl()
|
||||
{
|
||||
return $this->logo_image_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* expiry date of the incentive.
|
||||
*
|
||||
* @param string $expiry_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpiryDate($expiry_date)
|
||||
{
|
||||
$this->expiry_date = $expiry_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* expiry date of the incentive.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExpiryDate()
|
||||
{
|
||||
return $this->expiry_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies type of incentive
|
||||
* Valid Values: ["COUPON", "GIFT_CARD", "MERCHANT_SPECIFIC_BALANCE", "VOUCHER"]
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies type of incentive
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
89
paypal/PayPal/Api/InputFields.php
Normal file
89
paypal/PayPal/Api/InputFields.php
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class InputFields
|
||||
*
|
||||
* Parameters for input fields customization.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property bool allow_note
|
||||
* @property int no_shipping
|
||||
* @property int address_override
|
||||
*/
|
||||
class InputFields extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Indicates whether the buyer can enter a note to the merchant on the PayPal page during checkout.
|
||||
*
|
||||
* @param bool $allow_note
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAllowNote($allow_note)
|
||||
{
|
||||
$this->allow_note = $allow_note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the buyer can enter a note to the merchant on the PayPal page during checkout.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getAllowNote()
|
||||
{
|
||||
return $this->allow_note;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether PayPal displays shipping address fields on the experience pages. Valid value is `0`, `1`, or `2`. Set to `0` to display the shipping address on the PayPal pages. Set to `1` to redact shipping address fields from the PayPal pages. Set to `2` to not pass the shipping address but instead get it from the buyer's account profile. For digital goods, this field is required and value must be `1`.
|
||||
*
|
||||
* @param int $no_shipping
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNoShipping($no_shipping)
|
||||
{
|
||||
$this->no_shipping = $no_shipping;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether PayPal displays shipping address fields on the experience pages. Valid value is `0`, `1`, or `2`. Set to `0` to display the shipping address on the PayPal pages. Set to `1` to redact shipping address fields from the PayPal pages. Set to `2` to not pass the shipping address but instead get it from the buyer's account profile. For digital goods, this field is required and value must be `1`.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getNoShipping()
|
||||
{
|
||||
return $this->no_shipping;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether to display the shipping address that is passed to this call rather than the one on file with PayPal for this buyer on the PayPal experience pages. Valid value is `0` or `1`. Set to `0` to display the shipping address on file. Set to `1` to display the shipping address supplied to this call; the buyer cannot edit this shipping address.
|
||||
*
|
||||
* @param int $address_override
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAddressOverride($address_override)
|
||||
{
|
||||
$this->address_override = $address_override;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether to display the shipping address that is passed to this call rather than the one on file with PayPal for this buyer on the PayPal experience pages. Valid value is `0` or `1`. Set to `0` to display the shipping address on file. Set to `1` to display the shipping address supplied to this call; the buyer cannot edit this shipping address.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getAddressOverride()
|
||||
{
|
||||
return $this->address_override;
|
||||
}
|
||||
|
||||
}
|
||||
144
paypal/PayPal/Api/InstallmentInfo.php
Normal file
144
paypal/PayPal/Api/InstallmentInfo.php
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class InstallmentInfo
|
||||
*
|
||||
* A resource representing installment information available for a transaction
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string installment_id
|
||||
* @property string network
|
||||
* @property string issuer
|
||||
* @property \PayPal\Api\InstallmentOption[] installment_options
|
||||
*/
|
||||
class InstallmentInfo extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Installment id.
|
||||
*
|
||||
* @param string $installment_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInstallmentId($installment_id)
|
||||
{
|
||||
$this->installment_id = $installment_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Installment id.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInstallmentId()
|
||||
{
|
||||
return $this->installment_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit card network.
|
||||
* Valid Values: ["VISA", "MASTERCARD"]
|
||||
*
|
||||
* @param string $network
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNetwork($network)
|
||||
{
|
||||
$this->network = $network;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit card network.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNetwork()
|
||||
{
|
||||
return $this->network;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit card issuer.
|
||||
*
|
||||
* @param string $issuer
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIssuer($issuer)
|
||||
{
|
||||
$this->issuer = $issuer;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit card issuer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIssuer()
|
||||
{
|
||||
return $this->issuer;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of available installment options and the cost associated with each one.
|
||||
*
|
||||
* @param \PayPal\Api\InstallmentOption[] $installment_options
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInstallmentOptions($installment_options)
|
||||
{
|
||||
$this->installment_options = $installment_options;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of available installment options and the cost associated with each one.
|
||||
*
|
||||
* @return \PayPal\Api\InstallmentOption[]
|
||||
*/
|
||||
public function getInstallmentOptions()
|
||||
{
|
||||
return $this->installment_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append InstallmentOptions to the list.
|
||||
*
|
||||
* @param \PayPal\Api\InstallmentOption $installmentOption
|
||||
* @return $this
|
||||
*/
|
||||
public function addInstallmentOption($installmentOption)
|
||||
{
|
||||
if (!$this->getInstallmentOptions()) {
|
||||
return $this->setInstallmentOptions(array($installmentOption));
|
||||
} else {
|
||||
return $this->setInstallmentOptions(
|
||||
array_merge($this->getInstallmentOptions(), array($installmentOption))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove InstallmentOptions from the list.
|
||||
*
|
||||
* @param \PayPal\Api\InstallmentOption $installmentOption
|
||||
* @return $this
|
||||
*/
|
||||
public function removeInstallmentOption($installmentOption)
|
||||
{
|
||||
return $this->setInstallmentOptions(
|
||||
array_diff($this->getInstallmentOptions(), array($installmentOption))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
113
paypal/PayPal/Api/InstallmentOption.php
Normal file
113
paypal/PayPal/Api/InstallmentOption.php
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class InstallmentOption
|
||||
*
|
||||
* A resource describing an installment
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property int term
|
||||
* @property \PayPal\Api\Currency monthly_payment
|
||||
* @property \PayPal\Api\Currency discount_amount
|
||||
* @property string discount_percentage
|
||||
*/
|
||||
class InstallmentOption extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Number of installments
|
||||
*
|
||||
* @param int $term
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTerm($term)
|
||||
{
|
||||
$this->term = $term;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of installments
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTerm()
|
||||
{
|
||||
return $this->term;
|
||||
}
|
||||
|
||||
/**
|
||||
* Monthly payment
|
||||
*
|
||||
* @param \PayPal\Api\Currency $monthly_payment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMonthlyPayment($monthly_payment)
|
||||
{
|
||||
$this->monthly_payment = $monthly_payment;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Monthly payment
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getMonthlyPayment()
|
||||
{
|
||||
return $this->monthly_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Discount amount applied to the payment, if any
|
||||
*
|
||||
* @param \PayPal\Api\Currency $discount_amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDiscountAmount($discount_amount)
|
||||
{
|
||||
$this->discount_amount = $discount_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Discount amount applied to the payment, if any
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getDiscountAmount()
|
||||
{
|
||||
return $this->discount_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Discount percentage applied to the payment, if any
|
||||
*
|
||||
* @param string $discount_percentage
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDiscountPercentage($discount_percentage)
|
||||
{
|
||||
$this->discount_percentage = $discount_percentage;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Discount percentage applied to the payment, if any
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDiscountPercentage()
|
||||
{
|
||||
return $this->discount_percentage;
|
||||
}
|
||||
|
||||
}
|
||||
1340
paypal/PayPal/Api/Invoice.php
Normal file
1340
paypal/PayPal/Api/Invoice.php
Normal file
File diff suppressed because it is too large
Load Diff
39
paypal/PayPal/Api/InvoiceAddress.php
Normal file
39
paypal/PayPal/Api/InvoiceAddress.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
/**
|
||||
* Class InvoiceAddress
|
||||
*
|
||||
* Base Address object used as billing address in a payment or extended for Shipping Address.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Phone phone
|
||||
*/
|
||||
class InvoiceAddress extends BaseAddress
|
||||
{
|
||||
/**
|
||||
* Phone number in E.123 format.
|
||||
*
|
||||
* @param \PayPal\Api\Phone $phone
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
{
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone number in E.123 format.
|
||||
*
|
||||
* @return \PayPal\Api\Phone
|
||||
*/
|
||||
public function getPhone()
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
}
|
||||
239
paypal/PayPal/Api/InvoiceItem.php
Normal file
239
paypal/PayPal/Api/InvoiceItem.php
Normal file
|
|
@ -0,0 +1,239 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Converter\FormatConverter;
|
||||
use PayPal\Validation\NumericValidator;
|
||||
use PayPal\Validation\UrlValidator;
|
||||
|
||||
/**
|
||||
* Class InvoiceItem
|
||||
*
|
||||
* Information about a single line item.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string name
|
||||
* @property string description
|
||||
* @property \PayPal\Api\number quantity
|
||||
* @property \PayPal\Api\Currency unit_price
|
||||
* @property \PayPal\Api\Tax tax
|
||||
* @property string date
|
||||
* @property \PayPal\Api\Cost discount
|
||||
* @property string unit_of_measure
|
||||
*/
|
||||
class InvoiceItem extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Name of the item. 200 characters max.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the item. 200 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the item. 1000 characters max.
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the item. 1000 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Quantity of the item. Range of -10000 to 10000.
|
||||
*
|
||||
* @param string|double $quantity
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setQuantity($quantity)
|
||||
{
|
||||
NumericValidator::validate($quantity, "Quantity");
|
||||
$quantity = FormatConverter::formatToPrice($quantity);
|
||||
$this->quantity = $quantity;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Quantity of the item. Range of -10000 to 10000.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getQuantity()
|
||||
{
|
||||
return $this->quantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unit price of the item. Range of -1,000,000 to 1,000,000.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $unit_price
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUnitPrice($unit_price)
|
||||
{
|
||||
$this->unit_price = $unit_price;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unit price of the item. Range of -1,000,000 to 1,000,000.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getUnitPrice()
|
||||
{
|
||||
return $this->unit_price;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tax associated with the item.
|
||||
*
|
||||
* @param \PayPal\Api\Tax $tax
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTax($tax)
|
||||
{
|
||||
$this->tax = $tax;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tax associated with the item.
|
||||
*
|
||||
* @return \PayPal\Api\Tax
|
||||
*/
|
||||
public function getTax()
|
||||
{
|
||||
return $this->tax;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date when the item or service was provided. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @param string $date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDate($date)
|
||||
{
|
||||
$this->date = $date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date when the item or service was provided. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDate()
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
/**
|
||||
* The item discount, as a percent or an amount value.
|
||||
*
|
||||
* @param \PayPal\Api\Cost $discount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDiscount($discount)
|
||||
{
|
||||
$this->discount = $discount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The item discount, as a percent or an amount value.
|
||||
*
|
||||
* @return \PayPal\Api\Cost
|
||||
*/
|
||||
public function getDiscount()
|
||||
{
|
||||
return $this->discount;
|
||||
}
|
||||
|
||||
/**
|
||||
* The image URL. Maximum length is 4000 characters.
|
||||
* @deprecated Not publicly available
|
||||
* @param string $image_url
|
||||
* @throws \InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setImageUrl($image_url)
|
||||
{
|
||||
UrlValidator::validate($image_url, "ImageUrl");
|
||||
$this->image_url = $image_url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The image URL. Maximum length is 4000 characters.
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getImageUrl()
|
||||
{
|
||||
return $this->image_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unit of measure of the item being invoiced.
|
||||
* Valid Values: ["QUANTITY", "HOURS", "AMOUNT"]
|
||||
*
|
||||
* @param string $unit_of_measure
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUnitOfMeasure($unit_of_measure)
|
||||
{
|
||||
$this->unit_of_measure = $unit_of_measure;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unit of measure of the item being invoiced.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUnitOfMeasure()
|
||||
{
|
||||
return $this->unit_of_measure;
|
||||
}
|
||||
|
||||
}
|
||||
38
paypal/PayPal/Api/InvoiceNumber.php
Normal file
38
paypal/PayPal/Api/InvoiceNumber.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class InvoiceNumber
|
||||
*
|
||||
* The next invoice number
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string number
|
||||
*/
|
||||
class InvoiceNumber extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The next invoice number.
|
||||
*
|
||||
* @param string $number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNumber($number) {
|
||||
$this->number = $number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The next invoice number.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNumber() {
|
||||
return $this->number;
|
||||
}
|
||||
}
|
||||
95
paypal/PayPal/Api/InvoiceSearchResponse.php
Normal file
95
paypal/PayPal/Api/InvoiceSearchResponse.php
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class InvoiceSearchResponse
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property int total_count
|
||||
* @property \PayPal\Api\Invoice[] invoices
|
||||
*/
|
||||
class InvoiceSearchResponse extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Total number of invoices.
|
||||
*
|
||||
* @param int $total_count
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTotalCount($total_count)
|
||||
{
|
||||
$this->total_count = $total_count;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total number of invoices.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTotalCount()
|
||||
{
|
||||
return $this->total_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of invoices belonging to a merchant.
|
||||
*
|
||||
* @param \PayPal\Api\Invoice[] $invoices
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInvoices($invoices)
|
||||
{
|
||||
$this->invoices = $invoices;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of invoices belonging to a merchant.
|
||||
*
|
||||
* @return \PayPal\Api\Invoice[]
|
||||
*/
|
||||
public function getInvoices()
|
||||
{
|
||||
return $this->invoices;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Invoices to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Invoice $invoice
|
||||
* @return $this
|
||||
*/
|
||||
public function addInvoice($invoice)
|
||||
{
|
||||
if (!$this->getInvoices()) {
|
||||
return $this->setInvoices(array($invoice));
|
||||
} else {
|
||||
return $this->setInvoices(
|
||||
array_merge($this->getInvoices(), array($invoice))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Invoices from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Invoice $invoice
|
||||
* @return $this
|
||||
*/
|
||||
public function removeInvoice($invoice)
|
||||
{
|
||||
return $this->setInvoices(
|
||||
array_diff($this->getInvoices(), array($invoice))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
439
paypal/PayPal/Api/Item.php
Normal file
439
paypal/PayPal/Api/Item.php
Normal file
|
|
@ -0,0 +1,439 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Converter\FormatConverter;
|
||||
use PayPal\Validation\NumericValidator;
|
||||
use PayPal\Validation\UrlValidator;
|
||||
|
||||
/**
|
||||
* Class Item
|
||||
*
|
||||
* Item details.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string sku
|
||||
* @property string name
|
||||
* @property string description
|
||||
* @property string quantity
|
||||
* @property string price
|
||||
* @property string currency
|
||||
* @property string tax
|
||||
* @property string url
|
||||
*/
|
||||
class Item extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Stock keeping unit corresponding (SKU) to item.
|
||||
*
|
||||
* @param string $sku
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSku($sku)
|
||||
{
|
||||
$this->sku = $sku;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stock keeping unit corresponding (SKU) to item.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSku()
|
||||
{
|
||||
return $this->sku;
|
||||
}
|
||||
|
||||
/**
|
||||
* Item name. 127 characters max.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Item name. 127 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the item. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the item. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPrice($price)
|
||||
{
|
||||
NumericValidator::validate($price, "Price");
|
||||
$price = FormatConverter::formatToPrice($price, $this->getCurrency());
|
||||
$this->price = $price;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Item cost. 10 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTax($tax)
|
||||
{
|
||||
NumericValidator::validate($tax, "Tax");
|
||||
$tax = FormatConverter::formatToPrice($tax, $this->getCurrency());
|
||||
$this->tax = $tax;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tax of the item. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTax()
|
||||
{
|
||||
return $this->tax;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL linking to item information. Available to payer in transaction history.
|
||||
*
|
||||
* @param string $url
|
||||
* @throws \InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setUrl($url)
|
||||
{
|
||||
UrlValidator::validate($url, "Url");
|
||||
$this->url = $url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL linking to item information. Available to payer in transaction history.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Category type of the item.
|
||||
* Valid Values: ["DIGITAL", "PHYSICAL"]
|
||||
* @deprecated Not publicly available
|
||||
* @param string $category
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCategory($category)
|
||||
{
|
||||
$this->category = $category;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Category type of the item.
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getCategory()
|
||||
{
|
||||
return $this->category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Weight of the item.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Measurement $weight
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setWeight($weight)
|
||||
{
|
||||
$this->weight = $weight;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Weight of the item.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Measurement
|
||||
*/
|
||||
public function getWeight()
|
||||
{
|
||||
return $this->weight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Length of the item.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Measurement $length
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLength($length)
|
||||
{
|
||||
$this->length = $length;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Length of the item.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Measurement
|
||||
*/
|
||||
public function getLength()
|
||||
{
|
||||
return $this->length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Height of the item.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Measurement $height
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHeight($height)
|
||||
{
|
||||
$this->height = $height;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Height of the item.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Measurement
|
||||
*/
|
||||
public function getHeight()
|
||||
{
|
||||
return $this->height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Width of the item.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Measurement $width
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setWidth($width)
|
||||
{
|
||||
$this->width = $width;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Width of the item.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Measurement
|
||||
*/
|
||||
public function getWidth()
|
||||
{
|
||||
return $this->width;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal risk determination.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\NameValuePair[] $supplementary_data
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSupplementaryData($supplementary_data)
|
||||
{
|
||||
$this->supplementary_data = $supplementary_data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal risk determination.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\NameValuePair[]
|
||||
*/
|
||||
public function getSupplementaryData()
|
||||
{
|
||||
return $this->supplementary_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append SupplementaryData to the list.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\NameValuePair $nameValuePair
|
||||
* @return $this
|
||||
*/
|
||||
public function addSupplementaryData($nameValuePair)
|
||||
{
|
||||
if (!$this->getSupplementaryData()) {
|
||||
return $this->setSupplementaryData(array($nameValuePair));
|
||||
} else {
|
||||
return $this->setSupplementaryData(
|
||||
array_merge($this->getSupplementaryData(), array($nameValuePair))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove SupplementaryData from the list.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\NameValuePair $nameValuePair
|
||||
* @return $this
|
||||
*/
|
||||
public function removeSupplementaryData($nameValuePair)
|
||||
{
|
||||
return $this->setSupplementaryData(
|
||||
array_diff($this->getSupplementaryData(), array($nameValuePair))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal post-transaction notifications.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\NameValuePair[] $postback_data
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPostbackData($postback_data)
|
||||
{
|
||||
$this->postback_data = $postback_data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal post-transaction notifications.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\NameValuePair[]
|
||||
*/
|
||||
public function getPostbackData()
|
||||
{
|
||||
return $this->postback_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append PostbackData to the list.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\NameValuePair $nameValuePair
|
||||
* @return $this
|
||||
*/
|
||||
public function addPostbackData($nameValuePair)
|
||||
{
|
||||
if (!$this->getPostbackData()) {
|
||||
return $this->setPostbackData(array($nameValuePair));
|
||||
} else {
|
||||
return $this->setPostbackData(
|
||||
array_merge($this->getPostbackData(), array($nameValuePair))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove PostbackData from the list.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\NameValuePair $nameValuePair
|
||||
* @return $this
|
||||
*/
|
||||
public function removePostbackData($nameValuePair)
|
||||
{
|
||||
return $this->setPostbackData(
|
||||
array_diff($this->getPostbackData(), array($nameValuePair))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
143
paypal/PayPal/Api/ItemList.php
Normal file
143
paypal/PayPal/Api/ItemList.php
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class ItemList
|
||||
*
|
||||
* List of items being paid for.
|
||||
*
|
||||
* @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
|
||||
{
|
||||
/**
|
||||
* List of items.
|
||||
*
|
||||
* @param \PayPal\Api\Item[] $items
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setItems($items)
|
||||
{
|
||||
$this->items = array_values($items);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of items.
|
||||
*
|
||||
* @return \PayPal\Api\Item[]
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Items to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Item $item
|
||||
* @return $this
|
||||
*/
|
||||
public function addItem($item)
|
||||
{
|
||||
if (!$this->getItems()) {
|
||||
return $this->setItems(array($item));
|
||||
} else {
|
||||
return $this->setItems(
|
||||
array_merge($this->getItems(), array($item))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Items from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Item $item
|
||||
* @return $this
|
||||
*/
|
||||
public function removeItem($item)
|
||||
{
|
||||
return $this->setItems(
|
||||
array_diff($this->getItems(), array($item))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping address.
|
||||
*
|
||||
* @param \PayPal\Api\ShippingAddress $shipping_address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShippingAddress($shipping_address)
|
||||
{
|
||||
$this->shipping_address = $shipping_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping address.
|
||||
*
|
||||
* @return \PayPal\Api\ShippingAddress
|
||||
*/
|
||||
public function getShippingAddress()
|
||||
{
|
||||
return $this->shipping_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping method used for this payment like USPSParcel etc.
|
||||
*
|
||||
* @param string $shipping_method
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShippingMethod($shipping_method)
|
||||
{
|
||||
$this->shipping_method = $shipping_method;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping method used for this payment like USPSParcel etc.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShippingMethod()
|
||||
{
|
||||
return $this->shipping_method;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows merchant's to share payer’s contact number with PayPal for the current payment. Final contact number of payer associated with the transaction might be same as shipping_phone_number or different based on Payer’s action on PayPal. The phone number must be represented in its canonical international format, as defined by the E.164 numbering plan
|
||||
*
|
||||
* @param string $shipping_phone_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShippingPhoneNumber($shipping_phone_number)
|
||||
{
|
||||
$this->shipping_phone_number = $shipping_phone_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows merchant's to share payer’s contact number with PayPal for the current payment. Final contact number of payer associated with the transaction might be same as shipping_phone_number or different based on Payer’s action on PayPal. The phone number must be represented in its canonical international format, as defined by the E.164 numbering plan
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShippingPhoneNumber()
|
||||
{
|
||||
return $this->shipping_phone_number;
|
||||
}
|
||||
|
||||
}
|
||||
161
paypal/PayPal/Api/Links.php
Normal file
161
paypal/PayPal/Api/Links.php
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class Links
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string href
|
||||
* @property string rel
|
||||
* @property \PayPal\Api\HyperSchema targetSchema
|
||||
* @property string method
|
||||
* @property string enctype
|
||||
* @property \PayPal\Api\HyperSchema schema
|
||||
*/
|
||||
class Links extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Sets Href
|
||||
*
|
||||
* @param string $href
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHref($href)
|
||||
{
|
||||
$this->href = $href;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Href
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHref()
|
||||
{
|
||||
return $this->href;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Rel
|
||||
*
|
||||
* @param string $rel
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRel($rel)
|
||||
{
|
||||
$this->rel = $rel;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Rel
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRel()
|
||||
{
|
||||
return $this->rel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets TargetSchema
|
||||
*
|
||||
* @param \PayPal\Api\HyperSchema $targetSchema
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTargetSchema($targetSchema)
|
||||
{
|
||||
$this->targetSchema = $targetSchema;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets TargetSchema
|
||||
*
|
||||
* @return \PayPal\Api\HyperSchema
|
||||
*/
|
||||
public function getTargetSchema()
|
||||
{
|
||||
return $this->targetSchema;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Method
|
||||
*
|
||||
* @param string $method
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMethod($method)
|
||||
{
|
||||
$this->method = $method;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Method
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMethod()
|
||||
{
|
||||
return $this->method;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Enctype
|
||||
*
|
||||
* @param string $enctype
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnctype($enctype)
|
||||
{
|
||||
$this->enctype = $enctype;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Enctype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEnctype()
|
||||
{
|
||||
return $this->enctype;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Schema
|
||||
*
|
||||
* @param \PayPal\Api\HyperSchema $schema
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSchema($schema)
|
||||
{
|
||||
$this->schema = $schema;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Schema
|
||||
*
|
||||
* @return \PayPal\Api\HyperSchema
|
||||
*/
|
||||
public function getSchema()
|
||||
{
|
||||
return $this->schema;
|
||||
}
|
||||
|
||||
}
|
||||
65
paypal/PayPal/Api/Measurement.php
Normal file
65
paypal/PayPal/Api/Measurement.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class Measurement
|
||||
*
|
||||
* Measurement to represent item dimensions like length, width, height and weight etc.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string value
|
||||
* @property string unit
|
||||
*/
|
||||
class Measurement extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Value this measurement represents.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Value this measurement represents.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unit in which the value is represented.
|
||||
*
|
||||
* @param string $unit
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUnit($unit)
|
||||
{
|
||||
$this->unit = $unit;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unit in which the value is represented.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUnit()
|
||||
{
|
||||
return $this->unit;
|
||||
}
|
||||
|
||||
}
|
||||
281
paypal/PayPal/Api/MerchantInfo.php
Normal file
281
paypal/PayPal/Api/MerchantInfo.php
Normal file
|
|
@ -0,0 +1,281 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class MerchantInfo
|
||||
*
|
||||
* Merchant business information that appears on the invoice.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string email
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* @property \PayPal\Api\InvoiceAddress address
|
||||
* @property string business_name
|
||||
* @property \PayPal\Api\Phone phone
|
||||
* @property \PayPal\Api\Phone fax
|
||||
* @property string website
|
||||
* @property string tax_id
|
||||
* @property string additional_info_label
|
||||
* @property string additional_info
|
||||
*/
|
||||
class MerchantInfo extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The merchant email address. Maximum length is 260 characters.
|
||||
*
|
||||
* @param string $email
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant email address. Maximum length is 260 characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant first name. Maximum length is 30 characters.
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirstName($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant first name. Maximum length is 30 characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName()
|
||||
{
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant last name. Maximum length is 30 characters.
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastName($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant last name. Maximum length is 30 characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName()
|
||||
{
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant address.
|
||||
*
|
||||
* @param \PayPal\Api\InvoiceAddress $address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAddress($address)
|
||||
{
|
||||
$this->address = $address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant address.
|
||||
*
|
||||
* @return \PayPal\Api\InvoiceAddress
|
||||
*/
|
||||
public function getAddress()
|
||||
{
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant company business name. Maximum length is 100 characters.
|
||||
*
|
||||
* @param string $business_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBusinessName($business_name)
|
||||
{
|
||||
$this->business_name = $business_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant company business name. Maximum length is 100 characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBusinessName()
|
||||
{
|
||||
return $this->business_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant phone number.
|
||||
*
|
||||
* @param \PayPal\Api\Phone $phone
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
{
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant phone number.
|
||||
*
|
||||
* @return \PayPal\Api\Phone
|
||||
*/
|
||||
public function getPhone()
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant fax number.
|
||||
*
|
||||
* @param \PayPal\Api\Phone $fax
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFax($fax)
|
||||
{
|
||||
$this->fax = $fax;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant fax number.
|
||||
*
|
||||
* @return \PayPal\Api\Phone
|
||||
*/
|
||||
public function getFax()
|
||||
{
|
||||
return $this->fax;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant website. Maximum length is 2048 characters.
|
||||
*
|
||||
* @param string $website
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setWebsite($website)
|
||||
{
|
||||
$this->website = $website;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant website. Maximum length is 2048 characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getWebsite()
|
||||
{
|
||||
return $this->website;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant tax ID. Maximum length is 100 characters.
|
||||
*
|
||||
* @param string $tax_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTaxId($tax_id)
|
||||
{
|
||||
$this->tax_id = $tax_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The merchant tax ID. Maximum length is 100 characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTaxId()
|
||||
{
|
||||
return $this->tax_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Option to provide a label to the additional_info field. 40 characters max.
|
||||
*
|
||||
* @param string $additional_info_label
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAdditionalInfoLabel($additional_info_label)
|
||||
{
|
||||
$this->additional_info_label = $additional_info_label;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Option to provide a label to the additional_info field. 40 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAdditionalInfoLabel()
|
||||
{
|
||||
return $this->additional_info_label;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional information, such as business hours. Maximum length is 40 characters.
|
||||
*
|
||||
* @param string $additional_info
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAdditionalInfo($additional_info)
|
||||
{
|
||||
$this->additional_info = $additional_info;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional information, such as business hours. Maximum length is 40 characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAdditionalInfo()
|
||||
{
|
||||
return $this->additional_info;
|
||||
}
|
||||
|
||||
}
|
||||
261
paypal/PayPal/Api/MerchantPreferences.php
Normal file
261
paypal/PayPal/Api/MerchantPreferences.php
Normal file
|
|
@ -0,0 +1,261 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Validation\UrlValidator;
|
||||
|
||||
/**
|
||||
* Class MerchantPreferences
|
||||
*
|
||||
* Resource representing merchant preferences like max failed attempts, set up fee and others for a plan.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property \PayPal\Api\Currency setup_fee
|
||||
* @property string cancel_url
|
||||
* @property string return_url
|
||||
* @property string notify_url
|
||||
* @property string max_fail_attempts
|
||||
* @property string auto_bill_amount
|
||||
* @property string initial_fail_amount_action
|
||||
* @property string accepted_payment_type
|
||||
* @property string char_set
|
||||
*/
|
||||
class MerchantPreferences extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Identifier of the merchant_preferences. 128 characters max.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the merchant_preferences. 128 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup fee amount. Default is 0.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $setup_fee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSetupFee($setup_fee)
|
||||
{
|
||||
$this->setup_fee = $setup_fee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup fee amount. Default is 0.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getSetupFee()
|
||||
{
|
||||
return $this->setup_fee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect URL on cancellation of agreement request. 1000 characters max.
|
||||
*
|
||||
* @param string $cancel_url
|
||||
* @throws \InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setCancelUrl($cancel_url)
|
||||
{
|
||||
UrlValidator::validate($cancel_url, "CancelUrl");
|
||||
$this->cancel_url = $cancel_url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect URL on cancellation of agreement request. 1000 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCancelUrl()
|
||||
{
|
||||
return $this->cancel_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect URL on creation of agreement request. 1000 characters max.
|
||||
*
|
||||
* @param string $return_url
|
||||
* @throws \InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setReturnUrl($return_url)
|
||||
{
|
||||
UrlValidator::validate($return_url, "ReturnUrl");
|
||||
$this->return_url = $return_url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect URL on creation of agreement request. 1000 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReturnUrl()
|
||||
{
|
||||
return $this->return_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify URL on agreement creation. 1000 characters max.
|
||||
*
|
||||
* @param string $notify_url
|
||||
* @throws \InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setNotifyUrl($notify_url)
|
||||
{
|
||||
UrlValidator::validate($notify_url, "NotifyUrl");
|
||||
$this->notify_url = $notify_url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify URL on agreement creation. 1000 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNotifyUrl()
|
||||
{
|
||||
return $this->notify_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total number of failed attempts allowed. Default is 0, representing an infinite number of failed attempts.
|
||||
*
|
||||
* @param string $max_fail_attempts
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMaxFailAttempts($max_fail_attempts)
|
||||
{
|
||||
$this->max_fail_attempts = $max_fail_attempts;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total number of failed attempts allowed. Default is 0, representing an infinite number of failed attempts.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMaxFailAttempts()
|
||||
{
|
||||
return $this->max_fail_attempts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow auto billing for the outstanding amount of the agreement in the next cycle. Allowed values: `YES`, `NO`. Default is `NO`.
|
||||
*
|
||||
* @param string $auto_bill_amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAutoBillAmount($auto_bill_amount)
|
||||
{
|
||||
$this->auto_bill_amount = $auto_bill_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow auto billing for the outstanding amount of the agreement in the next cycle. Allowed values: `YES`, `NO`. Default is `NO`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAutoBillAmount()
|
||||
{
|
||||
return $this->auto_bill_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Action to take if a failure occurs during initial payment. Allowed values: `CONTINUE`, `CANCEL`. Default is continue.
|
||||
*
|
||||
* @param string $initial_fail_amount_action
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInitialFailAmountAction($initial_fail_amount_action)
|
||||
{
|
||||
$this->initial_fail_amount_action = $initial_fail_amount_action;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Action to take if a failure occurs during initial payment. Allowed values: `CONTINUE`, `CANCEL`. Default is continue.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInitialFailAmountAction()
|
||||
{
|
||||
return $this->initial_fail_amount_action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment types that are accepted for this plan.
|
||||
*
|
||||
* @param string $accepted_payment_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAcceptedPaymentType($accepted_payment_type)
|
||||
{
|
||||
$this->accepted_payment_type = $accepted_payment_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment types that are accepted for this plan.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAcceptedPaymentType()
|
||||
{
|
||||
return $this->accepted_payment_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* char_set for this plan.
|
||||
*
|
||||
* @param string $char_set
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCharSet($char_set)
|
||||
{
|
||||
$this->char_set = $char_set;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* char_set for this plan.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCharSet()
|
||||
{
|
||||
return $this->char_set;
|
||||
}
|
||||
|
||||
}
|
||||
259
paypal/PayPal/Api/Metadata.php
Normal file
259
paypal/PayPal/Api/Metadata.php
Normal file
|
|
@ -0,0 +1,259 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Validation\UrlValidator;
|
||||
|
||||
/**
|
||||
* Class Metadata
|
||||
*
|
||||
* Audit information for the resource.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string created_date
|
||||
* @property string created_by
|
||||
* @property string cancelled_date
|
||||
* @property string cancelled_by
|
||||
* @property string last_updated_date
|
||||
* @property string last_updated_by
|
||||
* @property string first_sent_date
|
||||
* @property string last_sent_date
|
||||
* @property string last_sent_by
|
||||
* @property string payer_view_url
|
||||
*/
|
||||
class Metadata extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The date and time when the resource was created.
|
||||
*
|
||||
* @param string $created_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreatedDate($created_date)
|
||||
{
|
||||
$this->created_date = $created_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time when the resource was created.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreatedDate()
|
||||
{
|
||||
return $this->created_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* The email address of the account that created the resource.
|
||||
*
|
||||
* @param string $created_by
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreatedBy($created_by)
|
||||
{
|
||||
$this->created_by = $created_by;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The email address of the account that created the resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreatedBy()
|
||||
{
|
||||
return $this->created_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time when the resource was cancelled.
|
||||
*
|
||||
* @param string $cancelled_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCancelledDate($cancelled_date)
|
||||
{
|
||||
$this->cancelled_date = $cancelled_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time when the resource was cancelled.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCancelledDate()
|
||||
{
|
||||
return $this->cancelled_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* The actor who cancelled the resource.
|
||||
*
|
||||
* @param string $cancelled_by
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCancelledBy($cancelled_by)
|
||||
{
|
||||
$this->cancelled_by = $cancelled_by;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The actor who cancelled the resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCancelledBy()
|
||||
{
|
||||
return $this->cancelled_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time when the resource was last edited.
|
||||
*
|
||||
* @param string $last_updated_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastUpdatedDate($last_updated_date)
|
||||
{
|
||||
$this->last_updated_date = $last_updated_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time when the resource was last edited.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastUpdatedDate()
|
||||
{
|
||||
return $this->last_updated_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* The email address of the account that last edited the resource.
|
||||
*
|
||||
* @param string $last_updated_by
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastUpdatedBy($last_updated_by)
|
||||
{
|
||||
$this->last_updated_by = $last_updated_by;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The email address of the account that last edited the resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastUpdatedBy()
|
||||
{
|
||||
return $this->last_updated_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time when the resource was first sent.
|
||||
*
|
||||
* @param string $first_sent_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirstSentDate($first_sent_date)
|
||||
{
|
||||
$this->first_sent_date = $first_sent_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time when the resource was first sent.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstSentDate()
|
||||
{
|
||||
return $this->first_sent_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time when the resource was last sent.
|
||||
*
|
||||
* @param string $last_sent_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastSentDate($last_sent_date)
|
||||
{
|
||||
$this->last_sent_date = $last_sent_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time when the resource was last sent.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastSentDate()
|
||||
{
|
||||
return $this->last_sent_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* The email address of the account that last sent the resource.
|
||||
*
|
||||
* @param string $last_sent_by
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastSentBy($last_sent_by)
|
||||
{
|
||||
$this->last_sent_by = $last_sent_by;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The email address of the account that last sent the resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastSentBy()
|
||||
{
|
||||
return $this->last_sent_by;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL representing the payer's view of the invoice.
|
||||
*
|
||||
* @param string $payer_view_url
|
||||
* @throws \InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerViewUrl($payer_view_url)
|
||||
{
|
||||
UrlValidator::validate($payer_view_url, "PayerViewUrl");
|
||||
$this->payer_view_url = $payer_view_url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL representing the payer's view of the invoice.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerViewUrl()
|
||||
{
|
||||
return $this->payer_view_url;
|
||||
}
|
||||
|
||||
}
|
||||
65
paypal/PayPal/Api/NameValuePair.php
Normal file
65
paypal/PayPal/Api/NameValuePair.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class NameValuePair
|
||||
*
|
||||
* Used to define a type for name-value pairs. The use of name value pairs in an API should be limited and approved by architecture.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string name
|
||||
* @property string value
|
||||
*/
|
||||
class NameValuePair extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Key for the name value pair. The value name types should be correlated
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Key for the name value pair. The value name types should be correlated
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Value for the name value pair.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Value for the name value pair.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
}
|
||||
143
paypal/PayPal/Api/Notification.php
Normal file
143
paypal/PayPal/Api/Notification.php
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class Notification
|
||||
*
|
||||
* Email/SMS notification.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string subject
|
||||
* @property string note
|
||||
* @property bool send_to_merchant
|
||||
* @property string[] cc_emails
|
||||
*/
|
||||
class Notification extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Subject of the notification.
|
||||
*
|
||||
* @param string $subject
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSubject($subject)
|
||||
{
|
||||
$this->subject = $subject;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subject of the notification.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSubject()
|
||||
{
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the payer.
|
||||
*
|
||||
* @param string $note
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNote($note)
|
||||
{
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note to the payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote()
|
||||
{
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether to send a copy of the email to the merchant.
|
||||
*
|
||||
* @param bool $send_to_merchant
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSendToMerchant($send_to_merchant)
|
||||
{
|
||||
$this->send_to_merchant = $send_to_merchant;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether to send a copy of the email to the merchant.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getSendToMerchant()
|
||||
{
|
||||
return $this->send_to_merchant;
|
||||
}
|
||||
|
||||
/**
|
||||
* Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported.
|
||||
*
|
||||
* @param string[] $cc_emails
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCcEmails($cc_emails)
|
||||
{
|
||||
$this->cc_emails = $cc_emails;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCcEmails()
|
||||
{
|
||||
return $this->cc_emails;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append CcEmails to the list.
|
||||
*
|
||||
* @param string $string
|
||||
* @return $this
|
||||
*/
|
||||
public function addCcEmail($string)
|
||||
{
|
||||
if (!$this->getCcEmails()) {
|
||||
return $this->setCcEmails(array($string));
|
||||
} else {
|
||||
return $this->setCcEmails(
|
||||
array_merge($this->getCcEmails(), array($string))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove CcEmails from the list.
|
||||
*
|
||||
* @param string $string
|
||||
* @return $this
|
||||
*/
|
||||
public function removeCcEmail($string)
|
||||
{
|
||||
return $this->setCcEmails(
|
||||
array_diff($this->getCcEmails(), array($string))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
133
paypal/PayPal/Api/OpenIdAddress.php
Normal file
133
paypal/PayPal/Api/OpenIdAddress.php
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class OpenIdAddress
|
||||
*
|
||||
* End-User's preferred address.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string street_address
|
||||
* @property string locality
|
||||
* @property string region
|
||||
* @property string postal_code
|
||||
* @property string country
|
||||
*/
|
||||
class OpenIdAddress extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Full street address component, which may include house number, street name.
|
||||
*
|
||||
* @param string $street_address
|
||||
* @return self
|
||||
*/
|
||||
public function setStreetAddress($street_address)
|
||||
{
|
||||
$this->street_address = $street_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Full street address component, which may include house number, street name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStreetAddress()
|
||||
{
|
||||
return $this->street_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* City or locality component.
|
||||
*
|
||||
* @param string $locality
|
||||
* @return self
|
||||
*/
|
||||
public function setLocality($locality)
|
||||
{
|
||||
$this->locality = $locality;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* City or locality component.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLocality()
|
||||
{
|
||||
return $this->locality;
|
||||
}
|
||||
|
||||
/**
|
||||
* State, province, prefecture or region component.
|
||||
*
|
||||
* @param string $region
|
||||
* @return self
|
||||
*/
|
||||
public function setRegion($region)
|
||||
{
|
||||
$this->region = $region;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State, province, prefecture or region component.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRegion()
|
||||
{
|
||||
return $this->region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Zip code or postal code component.
|
||||
*
|
||||
* @param string $postal_code
|
||||
* @return self
|
||||
*/
|
||||
public function setPostalCode($postal_code)
|
||||
{
|
||||
$this->postal_code = $postal_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Zip code or postal code component.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPostalCode()
|
||||
{
|
||||
return $this->postal_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Country name component.
|
||||
*
|
||||
* @param string $country
|
||||
* @return self
|
||||
*/
|
||||
public function setCountry($country)
|
||||
{
|
||||
$this->country = $country;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Country name component.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCountry()
|
||||
{
|
||||
return $this->country;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
85
paypal/PayPal/Api/OpenIdError.php
Normal file
85
paypal/PayPal/Api/OpenIdError.php
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class OpenIdError
|
||||
*
|
||||
* Error resource
|
||||
*
|
||||
* @property string error
|
||||
* @property string error_description
|
||||
* @property string error_uri
|
||||
*/
|
||||
class OpenIdError extends PayPalModel
|
||||
{
|
||||
|
||||
/**
|
||||
* A single ASCII error code from the following enum.
|
||||
*
|
||||
* @param string $error
|
||||
* @return self
|
||||
*/
|
||||
public function setError($error)
|
||||
{
|
||||
$this->error = $error;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A single ASCII error code from the following enum.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getError()
|
||||
{
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
/**
|
||||
* A resource ID that indicates the starting resource in the returned results.
|
||||
*
|
||||
* @param string $error_description
|
||||
* @return self
|
||||
*/
|
||||
public function setErrorDescription($error_description)
|
||||
{
|
||||
$this->error_description = $error_description;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A resource ID that indicates the starting resource in the returned results.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getErrorDescription()
|
||||
{
|
||||
return $this->error_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.
|
||||
*
|
||||
* @param string $error_uri
|
||||
* @return self
|
||||
*/
|
||||
public function setErrorUri($error_uri)
|
||||
{
|
||||
$this->error_uri = $error_uri;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getErrorUri()
|
||||
{
|
||||
return $this->error_uri;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
107
paypal/PayPal/Api/OpenIdSession.php
Normal file
107
paypal/PayPal/Api/OpenIdSession.php
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
|
||||
use PayPal\Core\PayPalConstants;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
class OpenIdSession
|
||||
{
|
||||
|
||||
/**
|
||||
* Returns the PayPal URL to which the user must be redirected to
|
||||
* start the authentication / authorization process.
|
||||
*
|
||||
* @param string $redirectUri Uri on merchant website to where
|
||||
* the user must be redirected to post paypal login
|
||||
* @param array $scope The access privilges that you are requesting for
|
||||
* from the user. Pass empty array for all scopes.
|
||||
* @param string $clientId client id from developer portal
|
||||
* See https://developer.paypal.com/docs/integration/direct/log-in-with-paypal/detailed/#attributes for more
|
||||
* @param null $nonce
|
||||
* @param null $state
|
||||
* @param ApiContext $apiContext Optional API Context
|
||||
* @return string Authorization URL
|
||||
*/
|
||||
public static function getAuthorizationUrl($redirectUri, $scope, $clientId, $nonce = null, $state = null, $apiContext = null)
|
||||
{
|
||||
$apiContext = $apiContext ? $apiContext : new ApiContext();
|
||||
$config = $apiContext->getConfig();
|
||||
|
||||
if ($apiContext->get($clientId)) {
|
||||
$clientId = $apiContext->get($clientId);
|
||||
}
|
||||
|
||||
$clientId = $clientId ? $clientId : $apiContext->getCredential()->getClientId();
|
||||
|
||||
$scope = count($scope) != 0 ? $scope : array('openid', 'profile', 'address', 'email', 'phone',
|
||||
'https://uri.paypal.com/services/paypalattributes', 'https://uri.paypal.com/services/expresscheckout');
|
||||
if (!in_array('openid', $scope)) {
|
||||
$scope[] = 'openid';
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'client_id' => $clientId,
|
||||
'response_type' => 'code',
|
||||
'scope' => implode(" ", $scope),
|
||||
'redirect_uri' => $redirectUri
|
||||
);
|
||||
|
||||
if ($nonce) {
|
||||
$params['nonce'] = $nonce;
|
||||
}
|
||||
if ($state) {
|
||||
$params['state'] = $state;
|
||||
}
|
||||
return sprintf("%s/signin/authorize?%s", self::getBaseUrl($config), http_build_query($params));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the URL to which the user must be redirected to
|
||||
* logout from the OpenID provider (i.e. PayPal)
|
||||
*
|
||||
* @param string $redirectUri Uri on merchant website to where
|
||||
* the user must be redirected to post logout
|
||||
* @param string $idToken id_token from the TokenInfo object
|
||||
* @param ApiContext $apiContext Optional API Context
|
||||
* @return string logout URL
|
||||
*/
|
||||
public static function getLogoutUrl($redirectUri, $idToken, $apiContext = null)
|
||||
{
|
||||
|
||||
if (is_null($apiContext)) {
|
||||
$apiContext = new ApiContext();
|
||||
}
|
||||
$config = $apiContext->getConfig();
|
||||
|
||||
$params = array(
|
||||
'id_token' => $idToken,
|
||||
'redirect_uri' => $redirectUri,
|
||||
'logout' => 'true'
|
||||
);
|
||||
return sprintf("%s/webapps/auth/protocol/openidconnect/v1/endsession?%s", self::getBaseUrl($config), http_build_query($params));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the base URL for the Redirect URI
|
||||
*
|
||||
* @param $config
|
||||
* @return null|string
|
||||
*/
|
||||
private static function getBaseUrl($config)
|
||||
{
|
||||
|
||||
if (array_key_exists('openid.RedirectUri', $config)) {
|
||||
return $config['openid.RedirectUri'];
|
||||
} else if (array_key_exists('mode', $config)) {
|
||||
switch (strtoupper($config['mode'])) {
|
||||
case 'SANDBOX':
|
||||
return PayPalConstants::OPENID_REDIRECT_SANDBOX_URL;
|
||||
case 'LIVE':
|
||||
return PayPalConstants::OPENID_REDIRECT_LIVE_URL;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
255
paypal/PayPal/Api/OpenIdTokeninfo.php
Normal file
255
paypal/PayPal/Api/OpenIdTokeninfo.php
Normal file
|
|
@ -0,0 +1,255 @@
|
|||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Transport\PayPalRestCall;
|
||||
|
||||
/**
|
||||
* Class OpenIdTokeninfo
|
||||
*
|
||||
* Token grant resource
|
||||
*
|
||||
* @property string scope
|
||||
* @property string access_token
|
||||
* @property string refresh_token
|
||||
* @property string token_type
|
||||
* @property string id_token
|
||||
* @property int expires_in
|
||||
*/
|
||||
class OpenIdTokeninfo extends PayPalResourceModel
|
||||
{
|
||||
|
||||
/**
|
||||
* OPTIONAL, if identical to the scope requested by the client; otherwise, REQUIRED.
|
||||
*
|
||||
* @param string $scope
|
||||
* @return self
|
||||
*/
|
||||
public function setScope($scope)
|
||||
{
|
||||
$this->scope = $scope;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* OPTIONAL, if identical to the scope requested by the client; otherwise, REQUIRED.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getScope()
|
||||
{
|
||||
return $this->scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* The access token issued by the authorization server.
|
||||
*
|
||||
* @param string $access_token
|
||||
* @return self
|
||||
*/
|
||||
public function setAccessToken($access_token)
|
||||
{
|
||||
$this->access_token = $access_token;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The access token issued by the authorization server.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAccessToken()
|
||||
{
|
||||
return $this->access_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* The refresh token, which can be used to obtain new access tokens using the same authorization grant as described in OAuth2.0 RFC6749 in Section 6.
|
||||
*
|
||||
* @param string $refresh_token
|
||||
* @return self
|
||||
*/
|
||||
public function setRefreshToken($refresh_token)
|
||||
{
|
||||
$this->refresh_token = $refresh_token;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The refresh token, which can be used to obtain new access tokens using the same authorization grant as described in OAuth2.0 RFC6749 in Section 6.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRefreshToken()
|
||||
{
|
||||
return $this->refresh_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of the token issued as described in OAuth2.0 RFC6749 (Section 7.1). Value is case insensitive.
|
||||
*
|
||||
* @param string $token_type
|
||||
* @return self
|
||||
*/
|
||||
public function setTokenType($token_type)
|
||||
{
|
||||
$this->token_type = $token_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of the token issued as described in OAuth2.0 RFC6749 (Section 7.1). Value is case insensitive.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTokenType()
|
||||
{
|
||||
return $this->token_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The id_token is a session token assertion that denotes the user's authentication status
|
||||
*
|
||||
* @param string $id_token
|
||||
* @return self
|
||||
*/
|
||||
public function setIdToken($id_token)
|
||||
{
|
||||
$this->id_token = $id_token;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The id_token is a session token assertion that denotes the user's authentication status
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIdToken()
|
||||
{
|
||||
return $this->id_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* The lifetime in seconds of the access token.
|
||||
*
|
||||
* @param integer $expires_in
|
||||
* @return self
|
||||
*/
|
||||
public function setExpiresIn($expires_in)
|
||||
{
|
||||
$this->expires_in = $expires_in;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The lifetime in seconds of the access token.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getExpiresIn()
|
||||
{
|
||||
return $this->expires_in;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates an Access Token from an Authorization Code.
|
||||
*
|
||||
* @path /v1/identity/openidconnect/tokenservice
|
||||
* @method POST
|
||||
* @param array $params (allowed values are client_id, client_secret, grant_type, code and redirect_uri)
|
||||
* (required) client_id from developer portal
|
||||
* (required) client_secret from developer portal
|
||||
* (required) code is Authorization code previously received from the authorization server
|
||||
* (required) redirect_uri Redirection endpoint that must match the one provided during the
|
||||
* authorization request that ended in receiving the authorization code.
|
||||
* (optional) grant_type is the Token grant type. Defaults to authorization_code
|
||||
* @param string $clientId
|
||||
* @param string $clientSecret
|
||||
* @param ApiContext $apiContext Optional API Context
|
||||
* @param PayPalRestCall $restCall
|
||||
* @return OpenIdTokeninfo
|
||||
*/
|
||||
public static function createFromAuthorizationCode($params, $clientId = null, $clientSecret = null, $apiContext = null, $restCall = null)
|
||||
{
|
||||
static $allowedParams = array('grant_type' => 1, 'code' => 1, 'redirect_uri' => 1);
|
||||
|
||||
if (!array_key_exists('grant_type', $params)) {
|
||||
$params['grant_type'] = 'authorization_code';
|
||||
}
|
||||
$apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential);
|
||||
|
||||
if (sizeof($apiContext->get($clientId)) > 0) {
|
||||
$clientId = $apiContext->get($clientId);
|
||||
}
|
||||
|
||||
if (sizeof($apiContext->get($clientSecret)) > 0) {
|
||||
$clientSecret = $apiContext->get($clientSecret);
|
||||
}
|
||||
|
||||
$clientId = $clientId ? $clientId : $apiContext->getCredential()->getClientId();
|
||||
$clientSecret = $clientSecret ? $clientSecret : $apiContext->getCredential()->getClientSecret();
|
||||
|
||||
$json = self::executeCall(
|
||||
"/v1/identity/openidconnect/tokenservice",
|
||||
"POST",
|
||||
http_build_query(array_intersect_key($params, $allowedParams)),
|
||||
array(
|
||||
'Content-Type' => 'application/x-www-form-urlencoded',
|
||||
'Authorization' => 'Basic ' . base64_encode($clientId . ":" . $clientSecret)
|
||||
),
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$token = new OpenIdTokeninfo();
|
||||
$token->fromJson($json);
|
||||
return $token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an Access Token from an Refresh Token.
|
||||
*
|
||||
* @path /v1/identity/openidconnect/tokenservice
|
||||
* @method POST
|
||||
* @param array $params (allowed values are grant_type and scope)
|
||||
* (required) client_id from developer portal
|
||||
* (required) client_secret from developer portal
|
||||
* (optional) refresh_token refresh token. If one is not passed, refresh token from the current object is used.
|
||||
* (optional) grant_type is the Token grant type. Defaults to refresh_token
|
||||
* (optional) scope is an array that either the same or a subset of the scope passed to the authorization request
|
||||
* @param APIContext $apiContext Optional API Context
|
||||
* @param PayPalRestCall $restCall
|
||||
* @return OpenIdTokeninfo
|
||||
*/
|
||||
public function createFromRefreshToken($params, $apiContext = null, $restCall = null)
|
||||
{
|
||||
static $allowedParams = array('grant_type' => 1, 'refresh_token' => 1, 'scope' => 1);
|
||||
$apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential);
|
||||
|
||||
if (!array_key_exists('grant_type', $params)) {
|
||||
$params['grant_type'] = 'refresh_token';
|
||||
}
|
||||
if (!array_key_exists('refresh_token', $params)) {
|
||||
$params['refresh_token'] = $this->getRefreshToken();
|
||||
}
|
||||
|
||||
$clientId = isset($params['client_id']) ? $params['client_id'] : $apiContext->getCredential()->getClientId();
|
||||
$clientSecret = isset($params['client_secret']) ? $params['client_secret'] : $apiContext->getCredential()->getClientSecret();
|
||||
|
||||
$json = self::executeCall(
|
||||
"/v1/identity/openidconnect/tokenservice",
|
||||
"POST",
|
||||
http_build_query(array_intersect_key($params, $allowedParams)),
|
||||
array(
|
||||
'Content-Type' => 'application/x-www-form-urlencoded',
|
||||
'Authorization' => 'Basic ' . base64_encode($clientId . ":" . $clientSecret)
|
||||
),
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
540
paypal/PayPal/Api/OpenIdUserinfo.php
Normal file
540
paypal/PayPal/Api/OpenIdUserinfo.php
Normal file
|
|
@ -0,0 +1,540 @@
|
|||
<?php
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class OpenIdUserinfo
|
||||
*
|
||||
* OpenIdConnect UserInfo Resource
|
||||
*
|
||||
* @property string user_id
|
||||
* @property string sub
|
||||
* @property mixed name
|
||||
* @property string given_name
|
||||
* @property string family_name
|
||||
* @property string middle_name
|
||||
* @property string picture
|
||||
* @property string email
|
||||
* @property bool email_verified
|
||||
* @property string gender
|
||||
* @property string birthday
|
||||
* @property string zoneinfo
|
||||
* @property string locale
|
||||
* @property string language
|
||||
* @property bool verified
|
||||
* @property string phone_number
|
||||
* @property OpenIdAddress address
|
||||
* @property mixed verified_account
|
||||
* @property mixed account_type
|
||||
* @property string age_range
|
||||
* @property string payer_id
|
||||
*/
|
||||
class OpenIdUserinfo extends PayPalResourceModel
|
||||
{
|
||||
|
||||
/**
|
||||
* Subject - Identifier for the End-User at the Issuer.
|
||||
*
|
||||
* @param string $user_id
|
||||
* @return self
|
||||
*/
|
||||
public function setUserId($user_id)
|
||||
{
|
||||
$this->user_id = $user_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subject - Identifier for the End-User at the Issuer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUserId()
|
||||
{
|
||||
return $this->user_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subject - Identifier for the End-User at the Issuer.
|
||||
*
|
||||
* @param string $sub
|
||||
* @return self
|
||||
*/
|
||||
public function setSub($sub)
|
||||
{
|
||||
$this->sub = $sub;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subject - Identifier for the End-User at the Issuer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSub()
|
||||
{
|
||||
return $this->sub;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's full name in displayable form including all name parts, possibly including titles and suffixes, ordered according to the End-User's locale and preferences.
|
||||
*
|
||||
* @param string $name
|
||||
* @return self
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's full name in displayable form including all name parts, possibly including titles and suffixes, ordered according to the End-User's locale and preferences.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given name(s) or first name(s) of the End-User
|
||||
*
|
||||
* @param string $given_name
|
||||
* @return self
|
||||
*/
|
||||
public function setGivenName($given_name)
|
||||
{
|
||||
$this->given_name = $given_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given name(s) or first name(s) of the End-User
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getGivenName()
|
||||
{
|
||||
return $this->given_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Surname(s) or last name(s) of the End-User.
|
||||
*
|
||||
* @param string $family_name
|
||||
* @return self
|
||||
*/
|
||||
public function setFamilyName($family_name)
|
||||
{
|
||||
$this->family_name = $family_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Surname(s) or last name(s) of the End-User.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFamilyName()
|
||||
{
|
||||
return $this->family_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Middle name(s) of the End-User.
|
||||
*
|
||||
* @param string $middle_name
|
||||
* @return self
|
||||
*/
|
||||
public function setMiddleName($middle_name)
|
||||
{
|
||||
$this->middle_name = $middle_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Middle name(s) of the End-User.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMiddleName()
|
||||
{
|
||||
return $this->middle_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL of the End-User's profile picture.
|
||||
*
|
||||
* @param string $picture
|
||||
* @return self
|
||||
*/
|
||||
public function setPicture($picture)
|
||||
{
|
||||
$this->picture = $picture;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL of the End-User's profile picture.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPicture()
|
||||
{
|
||||
return $this->picture;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's preferred e-mail address.
|
||||
*
|
||||
* @param string $email
|
||||
* @return self
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's preferred e-mail address.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* True if the End-User's e-mail address has been verified; otherwise false.
|
||||
*
|
||||
* @param boolean $email_verified
|
||||
* @return self
|
||||
*/
|
||||
public function setEmailVerified($email_verified)
|
||||
{
|
||||
$this->email_verified = $email_verified;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* True if the End-User's e-mail address has been verified; otherwise false.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getEmailVerified()
|
||||
{
|
||||
return $this->email_verified;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's gender.
|
||||
*
|
||||
* @param string $gender
|
||||
* @return self
|
||||
*/
|
||||
public function setGender($gender)
|
||||
{
|
||||
$this->gender = $gender;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's gender.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getGender()
|
||||
{
|
||||
return $this->gender;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's birthday, represented as an YYYY-MM-DD format. They year MAY be 0000, indicating it is omited. To represent only the year, YYYY format would be used.
|
||||
*
|
||||
* @param string $birthday
|
||||
* @return self
|
||||
*/
|
||||
public function setBirthday($birthday)
|
||||
{
|
||||
$this->birthday = $birthday;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's birthday, represented as an YYYY-MM-DD format. They year MAY be 0000, indicating it is omited. To represent only the year, YYYY format would be used.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBirthday()
|
||||
{
|
||||
return $this->birthday;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time zone database representing the End-User's time zone
|
||||
*
|
||||
* @param string $zoneinfo
|
||||
* @return self
|
||||
*/
|
||||
public function setZoneinfo($zoneinfo)
|
||||
{
|
||||
$this->zoneinfo = $zoneinfo;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time zone database representing the End-User's time zone
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getZoneinfo()
|
||||
{
|
||||
return $this->zoneinfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's locale.
|
||||
*
|
||||
* @param string $locale
|
||||
* @return self
|
||||
*/
|
||||
public function setLocale($locale)
|
||||
{
|
||||
$this->locale = $locale;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's locale.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLocale()
|
||||
{
|
||||
return $this->locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's language.
|
||||
*
|
||||
* @param string $language
|
||||
* @return self
|
||||
*/
|
||||
public function setLanguage($language)
|
||||
{
|
||||
$this->language = $language;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's language.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLanguage()
|
||||
{
|
||||
return $this->language;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's verified status.
|
||||
*
|
||||
* @param boolean $verified
|
||||
* @return self
|
||||
*/
|
||||
public function setVerified($verified)
|
||||
{
|
||||
$this->verified = $verified;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's verified status.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getVerified()
|
||||
{
|
||||
return $this->verified;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's preferred telephone number.
|
||||
*
|
||||
* @param string $phone_number
|
||||
* @return self
|
||||
*/
|
||||
public function setPhoneNumber($phone_number)
|
||||
{
|
||||
$this->phone_number = $phone_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's preferred telephone number.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPhoneNumber()
|
||||
{
|
||||
return $this->phone_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's preferred address.
|
||||
*
|
||||
* @param \PayPal\Api\OpenIdAddress $address
|
||||
* @return self
|
||||
*/
|
||||
public function setAddress($address)
|
||||
{
|
||||
$this->address = $address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* End-User's preferred address.
|
||||
*
|
||||
* @return \PayPal\Api\OpenIdAddress
|
||||
*/
|
||||
public function getAddress()
|
||||
{
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verified account status.
|
||||
*
|
||||
* @param boolean $verified_account
|
||||
* @return self
|
||||
*/
|
||||
public function setVerifiedAccount($verified_account)
|
||||
{
|
||||
$this->verified_account = $verified_account;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verified account status.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getVerifiedAccount()
|
||||
{
|
||||
return $this->verified_account;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account type.
|
||||
*
|
||||
* @param string $account_type
|
||||
* @return self
|
||||
*/
|
||||
public function setAccountType($account_type)
|
||||
{
|
||||
$this->account_type = $account_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAccountType()
|
||||
{
|
||||
return $this->account_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account holder age range.
|
||||
*
|
||||
* @param string $age_range
|
||||
* @return self
|
||||
*/
|
||||
public function setAgeRange($age_range)
|
||||
{
|
||||
$this->age_range = $age_range;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account holder age range.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAgeRange()
|
||||
{
|
||||
return $this->age_range;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account payer identifier.
|
||||
*
|
||||
* @param string $payer_id
|
||||
* @return self
|
||||
*/
|
||||
public function setPayerId($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account payer identifier.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerId()
|
||||
{
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* returns user details
|
||||
*
|
||||
* @path /v1/identity/openidconnect/userinfo
|
||||
* @method GET
|
||||
* @param array $params (allowed values are access_token)
|
||||
* access_token - access token from the createFromAuthorizationCode / createFromRefreshToken calls
|
||||
* @param ApiContext $apiContext Optional API Context
|
||||
* @param PayPalRestCall $restCall
|
||||
* @return OpenIdUserinfo
|
||||
*/
|
||||
public static function getUserinfo($params, $apiContext = null, $restCall = null)
|
||||
{
|
||||
static $allowedParams = array('schema' => 1);
|
||||
|
||||
$params = is_array($params) ? $params : array();
|
||||
|
||||
if (!array_key_exists('schema', $params)) {
|
||||
$params['schema'] = 'openid';
|
||||
}
|
||||
$requestUrl = "/v1/identity/openidconnect/userinfo?"
|
||||
. http_build_query(array_intersect_key($params, $allowedParams));
|
||||
|
||||
$json = self::executeCall(
|
||||
$requestUrl,
|
||||
"GET",
|
||||
"",
|
||||
array(
|
||||
'Authorization' => "Bearer " . $params['access_token'],
|
||||
'Content-Type' => 'x-www-form-urlencoded'
|
||||
),
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
|
||||
$ret = new OpenIdUserinfo();
|
||||
$ret->fromJson($json);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
464
paypal/PayPal/Api/Order.php
Normal file
464
paypal/PayPal/Api/Order.php
Normal file
|
|
@ -0,0 +1,464 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Order
|
||||
*
|
||||
* An order transaction.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string reference_id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string payment_mode
|
||||
* @property string state
|
||||
* @property string reason_code
|
||||
* @property string pending_reason
|
||||
* @property string protection_eligibility
|
||||
* @property string protection_eligibility_type
|
||||
* @property string parent_payment
|
||||
* @property \PayPal\Api\FmfDetails fmf_details
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class Order extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* Identifier of the order transaction.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the order transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
|
||||
*
|
||||
* @deprecated Use #setReferenceId instead
|
||||
*
|
||||
* @param string $purchase_unit_reference_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPurchaseUnitReferenceId($purchase_unit_reference_id)
|
||||
{
|
||||
$this->purchase_unit_reference_id = $purchase_unit_reference_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
|
||||
* @deprecated Use #getReferenceId instead
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPurchaseUnitReferenceId()
|
||||
{
|
||||
return $this->purchase_unit_reference_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
|
||||
*
|
||||
* @param string $reference_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReferenceId($reference_id)
|
||||
{
|
||||
$this->reference_id = $reference_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReferenceId()
|
||||
{
|
||||
return $this->reference_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being collected.
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being collected.
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* specifies payment mode of the transaction
|
||||
* Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
|
||||
*
|
||||
* @param string $payment_mode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentMode($payment_mode)
|
||||
{
|
||||
$this->payment_mode = $payment_mode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* specifies payment mode of the transaction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentMode()
|
||||
{
|
||||
return $this->payment_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the order transaction.
|
||||
* Valid Values: ["pending", "completed", "voided", "authorized", "captured"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the order transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually. Only supported when the `payment_method` is set to `paypal`.
|
||||
* Valid Values: ["PAYER_SHIPPING_UNCONFIRMED", "MULTI_CURRENCY", "RISK_REVIEW", "REGULATORY_REVIEW", "VERIFICATION_REQUIRED", "ORDER", "OTHER"]
|
||||
*
|
||||
* @param string $reason_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReasonCode($reason_code)
|
||||
{
|
||||
$this->reason_code = $reason_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReasonCode()
|
||||
{
|
||||
return $this->reason_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* [DEPRECATED] Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead.
|
||||
* Valid Values: ["payer_shipping_unconfirmed", "multi_currency", "risk_review", "regulatory_review", "verification_required", "order", "other"]
|
||||
*
|
||||
* @param string $pending_reason
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPendingReason($pending_reason)
|
||||
{
|
||||
$this->pending_reason = $pending_reason;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated [DEPRECATED] Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPendingReason()
|
||||
{
|
||||
return $this->pending_reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* The level of seller protection in force for the transaction.
|
||||
* Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
|
||||
*
|
||||
* @param string $protection_eligibility
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtectionEligibility($protection_eligibility)
|
||||
{
|
||||
$this->protection_eligibility = $protection_eligibility;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The level of seller protection in force for the transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProtectionEligibility()
|
||||
{
|
||||
return $this->protection_eligibility;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtectionEligibilityType($protection_eligibility_type)
|
||||
{
|
||||
$this->protection_eligibility_type = $protection_eligibility_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
* @param string $parent_payment
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setParentPayment($parent_payment)
|
||||
{
|
||||
$this->parent_payment = $parent_payment;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Payment resource that this transaction is based on.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getParentPayment()
|
||||
{
|
||||
return $this->parent_payment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action.
|
||||
*
|
||||
* @param \PayPal\Api\FmfDetails $fmf_details
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFmfDetails($fmf_details)
|
||||
{
|
||||
$this->fmf_details = $fmf_details;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action.
|
||||
*
|
||||
* @return \PayPal\Api\FmfDetails
|
||||
*/
|
||||
public function getFmfDetails()
|
||||
{
|
||||
return $this->fmf_details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was created in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time the resource was last updated in UTC ISO8601 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows details for an order, by ID.
|
||||
*
|
||||
* @param string $orderId
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Order
|
||||
*/
|
||||
public static function get($orderId, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($orderId, 'orderId');
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/orders/$orderId",
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new Order();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Captures a payment for an order, by ID. To use this call, the original payment call must specify an intent of `order`. In the JSON request body, include the payment amount and indicate whether this capture is the final capture for the authorization.
|
||||
*
|
||||
* @param Capture $capture
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Capture
|
||||
*/
|
||||
public function capture($capture, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($capture, 'capture');
|
||||
$payLoad = $capture->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/orders/{$this->getId()}/capture",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new Capture();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Voids, or cancels, an order, by ID. You cannot void an order if a payment has already been partially or fully captured.
|
||||
*
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Order
|
||||
*/
|
||||
public function void($apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/orders/{$this->getId()}/do-void",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Authorizes an order, by ID. Include an `amount` object in the JSON request body.
|
||||
*
|
||||
* @param Authorization $authorization Authorization Object with Amount value to be authorized
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Authorization
|
||||
*/
|
||||
public function authorize($authorization, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($authorization, 'Authorization');
|
||||
$payLoad = $authorization->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/orders/{$this->getId()}/authorize",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new Authorization();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
}
|
||||
65
paypal/PayPal/Api/OverrideChargeModel.php
Normal file
65
paypal/PayPal/Api/OverrideChargeModel.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class OverrideChargeModel
|
||||
*
|
||||
* A resource representing an override_charge_model to be used during creation of the agreement.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string charge_id
|
||||
* @property \PayPal\Api\Currency amount
|
||||
*/
|
||||
class OverrideChargeModel extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* ID of charge model.
|
||||
*
|
||||
* @param string $charge_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setChargeId($charge_id)
|
||||
{
|
||||
$this->charge_id = $charge_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of charge model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getChargeId()
|
||||
{
|
||||
return $this->charge_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated Amount to be associated with this charge model.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated Amount to be associated with this charge model.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
}
|
||||
233
paypal/PayPal/Api/Participant.php
Normal file
233
paypal/PayPal/Api/Participant.php
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class Participant
|
||||
*
|
||||
* Participant information.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string email
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* @property string business_name
|
||||
* @property \PayPal\Api\Phone phone
|
||||
* @property \PayPal\Api\Phone fax
|
||||
* @property string website
|
||||
* @property string additional_info
|
||||
* @property \PayPal\Api\Address address
|
||||
*/
|
||||
class Participant extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The participant email address.
|
||||
*
|
||||
* @param string $email
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant email address.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant first name.
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirstName($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant first name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName()
|
||||
{
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant last name.
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastName($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant last name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName()
|
||||
{
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant company business name.
|
||||
*
|
||||
* @param string $business_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBusinessName($business_name)
|
||||
{
|
||||
$this->business_name = $business_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant company business name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBusinessName()
|
||||
{
|
||||
return $this->business_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant phone number.
|
||||
*
|
||||
* @param \PayPal\Api\Phone $phone
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
{
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant phone number.
|
||||
*
|
||||
* @return \PayPal\Api\Phone
|
||||
*/
|
||||
public function getPhone()
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant fax number.
|
||||
*
|
||||
* @param \PayPal\Api\Phone $fax
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFax($fax)
|
||||
{
|
||||
$this->fax = $fax;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant fax number.
|
||||
*
|
||||
* @return \PayPal\Api\Phone
|
||||
*/
|
||||
public function getFax()
|
||||
{
|
||||
return $this->fax;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant website.
|
||||
*
|
||||
* @param string $website
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setWebsite($website)
|
||||
{
|
||||
$this->website = $website;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant website.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getWebsite()
|
||||
{
|
||||
return $this->website;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional information, such as business hours.
|
||||
*
|
||||
* @param string $additional_info
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAdditionalInfo($additional_info)
|
||||
{
|
||||
$this->additional_info = $additional_info;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional information, such as business hours.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAdditionalInfo()
|
||||
{
|
||||
return $this->additional_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant address.
|
||||
*
|
||||
* @param \PayPal\Api\Address $address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAddress($address)
|
||||
{
|
||||
$this->address = $address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The participant address.
|
||||
*
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
public function getAddress()
|
||||
{
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
}
|
||||
114
paypal/PayPal/Api/Patch.php
Normal file
114
paypal/PayPal/Api/Patch.php
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class Patch
|
||||
*
|
||||
* A JSON patch object that you can use to apply partial updates to resources.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string op
|
||||
* @property string path
|
||||
* @property mixed value
|
||||
* @property string from
|
||||
*/
|
||||
class Patch extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The operation to perform.
|
||||
* Valid Values: ["add", "remove", "replace", "move", "copy", "test"]
|
||||
*
|
||||
* @param string $op
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOp($op)
|
||||
{
|
||||
$this->op = $op;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The operation to perform.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOp()
|
||||
{
|
||||
return $this->op;
|
||||
}
|
||||
|
||||
/**
|
||||
* A JSON pointer that references a location in the target document where the operation is performed. A `string` value.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPath($path)
|
||||
{
|
||||
$this->path = $path;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A JSON pointer that references a location in the target document where the operation is performed. A `string` value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPath()
|
||||
{
|
||||
return $this->path;
|
||||
}
|
||||
|
||||
/**
|
||||
* New value to apply based on the operation.
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* New value to apply based on the operation.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* A string containing a JSON Pointer value that references the location in the target document to move the value from.
|
||||
*
|
||||
* @param string $from
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFrom($from)
|
||||
{
|
||||
$this->from = $from;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A string containing a JSON Pointer value that references the location in the target document to move the value from.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFrom()
|
||||
{
|
||||
return $this->from;
|
||||
}
|
||||
|
||||
}
|
||||
86
paypal/PayPal/Api/PatchRequest.php
Normal file
86
paypal/PayPal/Api/PatchRequest.php
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PatchRequest
|
||||
*
|
||||
* A JSON patch request.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Patch[] patches
|
||||
*/
|
||||
class PatchRequest extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Placeholder for holding array of patch objects
|
||||
*
|
||||
* @param \PayPal\Api\Patch[] $patches
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPatches($patches)
|
||||
{
|
||||
$this->patches = $patches;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Placeholder for holding array of patch objects
|
||||
*
|
||||
* @return \PayPal\Api\Patch[]
|
||||
*/
|
||||
public function getPatches()
|
||||
{
|
||||
return $this->patches;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Patches to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Patch $patch
|
||||
* @return $this
|
||||
*/
|
||||
public function addPatch($patch)
|
||||
{
|
||||
if (!$this->getPatches()) {
|
||||
return $this->setPatches(array($patch));
|
||||
} else {
|
||||
return $this->setPatches(
|
||||
array_merge($this->getPatches(), array($patch))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Patches from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Patch $patch
|
||||
* @return $this
|
||||
*/
|
||||
public function removePatch($patch)
|
||||
{
|
||||
return $this->setPatches(
|
||||
array_diff($this->getPatches(), array($patch))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* As PatchRequest holds the array of Patch object, we would override the json conversion to return
|
||||
* a json representation of array of Patch objects.
|
||||
*
|
||||
* @param int $options
|
||||
* @return mixed|string
|
||||
*/
|
||||
public function toJSON($options = 0)
|
||||
{
|
||||
$json = array();
|
||||
foreach ($this->getPatches() as $patch) {
|
||||
$json[] = $patch->toArray();
|
||||
}
|
||||
return str_replace('\\/', '/', json_encode($json, $options));
|
||||
}
|
||||
}
|
||||
157
paypal/PayPal/Api/Payee.php
Normal file
157
paypal/PayPal/Api/Payee.php
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class Payee
|
||||
*
|
||||
* A resource representing a Payee who receives the funds and fulfills the order.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string email
|
||||
* @property string merchant_id
|
||||
*/
|
||||
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 receive PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
|
||||
*
|
||||
* @param string $email
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receive PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypted PayPal account identifier for the Payee.
|
||||
*
|
||||
* @param string $merchant_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMerchantId($merchant_id)
|
||||
{
|
||||
$this->merchant_id = $merchant_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypted PayPal account identifier for the Payee.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMerchantId()
|
||||
{
|
||||
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 Payee.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Phone $phone
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
{
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information related to the Payee.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Phone
|
||||
*/
|
||||
public function getPhone()
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
}
|
||||
288
paypal/PayPal/Api/Payer.php
Normal file
288
paypal/PayPal/Api/Payer.php
Normal file
|
|
@ -0,0 +1,288 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class Payer
|
||||
*
|
||||
* A resource representing a Payer that funds a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string payment_method
|
||||
* @property string status
|
||||
* @property \PayPal\Api\FundingInstrument[] funding_instruments
|
||||
* @property string external_selected_funding_instrument_type
|
||||
* @property \PayPal\Api\PayerInfo payer_info
|
||||
*/
|
||||
class Payer extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Payment method being used. "credit_card" is not available for general use.
|
||||
* Please ensure that you have acquired the approval for using "credit_card" for your live
|
||||
* credentials.
|
||||
* Valid Values: ["credit_card", "paypal"]
|
||||
*
|
||||
* @param string $payment_method
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentMethod($payment_method)
|
||||
{
|
||||
$this->payment_method = $payment_method;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment method being used - PayPal Wallet payment, Bank Direct Debit or Direct Credit card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentMethod()
|
||||
{
|
||||
return $this->payment_method;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status of payer's PayPal Account.
|
||||
* Valid Values: ["VERIFIED", "UNVERIFIED"]
|
||||
*
|
||||
* @param string $status
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStatus($status)
|
||||
{
|
||||
$this->status = $status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status of payer's PayPal Account.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of account relationship payer has with PayPal.
|
||||
* Valid Values: ["BUSINESS", "PERSONAL", "PREMIER"]
|
||||
* @deprecated Not publicly available
|
||||
* @param string $account_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAccountType($account_type)
|
||||
{
|
||||
$this->account_type = $account_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of account relationship payer has with PayPal.
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getAccountType()
|
||||
{
|
||||
return $this->account_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Duration since the payer established account relationship with PayPal in days.
|
||||
* @deprecated Not publicly available
|
||||
* @param string $account_age
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAccountAge($account_age)
|
||||
{
|
||||
$this->account_age = $account_age;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Duration since the payer established account relationship with PayPal in days.
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getAccountAge()
|
||||
{
|
||||
return $this->account_age;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of funding instruments to fund the payment. 'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed.
|
||||
*
|
||||
* @param \PayPal\Api\FundingInstrument[] $funding_instruments
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFundingInstruments($funding_instruments)
|
||||
{
|
||||
$this->funding_instruments = $funding_instruments;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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[]
|
||||
*/
|
||||
public function getFundingInstruments()
|
||||
{
|
||||
return $this->funding_instruments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append FundingInstruments to the list.
|
||||
*
|
||||
* @param \PayPal\Api\FundingInstrument $fundingInstrument
|
||||
* @return $this
|
||||
*/
|
||||
public function addFundingInstrument($fundingInstrument)
|
||||
{
|
||||
if (!$this->getFundingInstruments()) {
|
||||
return $this->setFundingInstruments(array($fundingInstrument));
|
||||
} else {
|
||||
return $this->setFundingInstruments(
|
||||
array_merge($this->getFundingInstruments(), array($fundingInstrument))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove FundingInstruments from the list.
|
||||
*
|
||||
* @param \PayPal\Api\FundingInstrument $fundingInstrument
|
||||
* @return $this
|
||||
*/
|
||||
public function removeFundingInstrument($fundingInstrument)
|
||||
{
|
||||
return $this->setFundingInstruments(
|
||||
array_diff($this->getFundingInstruments(), array($fundingInstrument))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Id of user selected funding option for the payment.'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed.
|
||||
* @deprecated Not publicly available
|
||||
* @param string $funding_option_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFundingOptionId($funding_option_id)
|
||||
{
|
||||
$this->funding_option_id = $funding_option_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Id of user selected funding option for the payment.'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed.
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getFundingOptionId()
|
||||
{
|
||||
return $this->funding_option_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default funding option available for the payment
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\FundingOption $funding_option
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFundingOption($funding_option)
|
||||
{
|
||||
$this->funding_option = $funding_option;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default funding option available for the payment
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\FundingOption
|
||||
*/
|
||||
public function getFundingOption()
|
||||
{
|
||||
return $this->funding_option;
|
||||
}
|
||||
|
||||
/**
|
||||
* Instrument type pre-selected by the user outside of PayPal and passed along the payment creation. This param is used in cases such as PayPal Credit Second Button
|
||||
* Valid Values: ["CREDIT", "PAY_UPON_INVOICE"]
|
||||
*
|
||||
* @param string $external_selected_funding_instrument_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternalSelectedFundingInstrumentType($external_selected_funding_instrument_type)
|
||||
{
|
||||
$this->external_selected_funding_instrument_type = $external_selected_funding_instrument_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Instrument type pre-selected by the user outside of PayPal and passed along the payment creation. This param is used in cases such as PayPal Credit Second Button
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalSelectedFundingInstrumentType()
|
||||
{
|
||||
return $this->external_selected_funding_instrument_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Funding option related to default funding option.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\FundingOption $related_funding_option
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRelatedFundingOption($related_funding_option)
|
||||
{
|
||||
$this->related_funding_option = $related_funding_option;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Funding option related to default funding option.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\FundingOption
|
||||
*/
|
||||
public function getRelatedFundingOption()
|
||||
{
|
||||
return $this->related_funding_option;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information related to the Payer.
|
||||
*
|
||||
* @param \PayPal\Api\PayerInfo $payer_info
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerInfo($payer_info)
|
||||
{
|
||||
$this->payer_info = $payer_info;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information related to the Payer.
|
||||
*
|
||||
* @return \PayPal\Api\PayerInfo
|
||||
*/
|
||||
public function getPayerInfo()
|
||||
{
|
||||
return $this->payer_info;
|
||||
}
|
||||
|
||||
}
|
||||
453
paypal/PayPal/Api/PayerInfo.php
Normal file
453
paypal/PayPal/Api/PayerInfo.php
Normal file
|
|
@ -0,0 +1,453 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PayerInfo
|
||||
*
|
||||
* A resource representing a information about Payer.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string email
|
||||
* @property string external_remember_me_id
|
||||
* @property string buyer_account_number
|
||||
* @property string salutation
|
||||
* @property string first_name
|
||||
* @property string middle_name
|
||||
* @property string last_name
|
||||
* @property string suffix
|
||||
* @property string payer_id
|
||||
* @property string phone
|
||||
* @property string phone_type
|
||||
* @property string birth_date
|
||||
* @property string tax_id
|
||||
* @property string tax_id_type
|
||||
* @property string country_code
|
||||
* @property \PayPal\Api\Address billing_address
|
||||
*/
|
||||
class PayerInfo extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Email address representing the payer. 127 characters max.
|
||||
*
|
||||
* @param string $email
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Email address representing the payer. 127 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* External Remember Me id representing the 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* External Remember Me id representing the payer
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalRememberMeId()
|
||||
{
|
||||
return $this->external_remember_me_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account Number representing the Payer
|
||||
*
|
||||
* @deprecated Use #setBuyerAccountNumberInstead
|
||||
* @param string $account_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAccountNumber($account_number)
|
||||
{
|
||||
$this->account_number = $account_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account Number representing the Payer
|
||||
*
|
||||
* @deprecated Use #getBuyerAccountNumberInstead
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getAccountNumber()
|
||||
{
|
||||
return $this->account_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account Number representing the Payer
|
||||
*
|
||||
* @param string $buyer_account_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBuyerAccountNumber($buyer_account_number)
|
||||
{
|
||||
$this->buyer_account_number = $buyer_account_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account Number representing the Payer
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBuyerAccountNumber()
|
||||
{
|
||||
return $this->buyer_account_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Salutation of the payer.
|
||||
*
|
||||
* @param string $salutation
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSalutation($salutation)
|
||||
{
|
||||
$this->salutation = $salutation;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Salutation of the payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSalutation()
|
||||
{
|
||||
return $this->salutation;
|
||||
}
|
||||
|
||||
/**
|
||||
* First name of the payer.
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirstName($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* First name of the payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName()
|
||||
{
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Middle name of the payer.
|
||||
*
|
||||
* @param string $middle_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMiddleName($middle_name)
|
||||
{
|
||||
$this->middle_name = $middle_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Middle name of the payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMiddleName()
|
||||
{
|
||||
return $this->middle_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last name of the payer.
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastName($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last name of the payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName()
|
||||
{
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Suffix of the payer.
|
||||
*
|
||||
* @param string $suffix
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSuffix($suffix)
|
||||
{
|
||||
$this->suffix = $suffix;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Suffix of the payer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSuffix()
|
||||
{
|
||||
return $this->suffix;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal assigned encrypted Payer ID.
|
||||
*
|
||||
* @param string $payer_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerId($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal assigned encrypted Payer ID.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerId()
|
||||
{
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone number representing the payer. 20 characters max.
|
||||
*
|
||||
* @param string $phone
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhone($phone)
|
||||
{
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone number representing the payer. 20 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone()
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone type
|
||||
* Valid Values: ["HOME", "WORK", "MOBILE", "OTHER"]
|
||||
*
|
||||
* @param string $phone_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhoneType($phone_type)
|
||||
{
|
||||
$this->phone_type = $phone_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPhoneType()
|
||||
{
|
||||
return $this->phone_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Birth date of the Payer in ISO8601 format (yyyy-mm-dd).
|
||||
*
|
||||
* @param string $birth_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBirthDate($birth_date)
|
||||
{
|
||||
$this->birth_date = $birth_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Birth date of the Payer in ISO8601 format (yyyy-mm-dd).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBirthDate()
|
||||
{
|
||||
return $this->birth_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payer’s tax ID. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @param string $tax_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTaxId($tax_id)
|
||||
{
|
||||
$this->tax_id = $tax_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payer’s tax ID. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTaxId()
|
||||
{
|
||||
return $this->tax_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payer’s 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
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTaxIdType($tax_id_type)
|
||||
{
|
||||
$this->tax_id_type = $tax_id_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payer’s tax ID type. Allowed values: `BR_CPF` or `BR_CNPJ`. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTaxIdType()
|
||||
{
|
||||
return $this->tax_id_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Two-letter registered country code of the payer to identify the buyer country.
|
||||
*
|
||||
* @param string $country_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCountryCode($country_code)
|
||||
{
|
||||
$this->country_code = $country_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Two-letter registered country code of the payer to identify the buyer country.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCountryCode()
|
||||
{
|
||||
return $this->country_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing address of the 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 Payer.
|
||||
*
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
public function getBillingAddress()
|
||||
{
|
||||
return $this->billing_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated [DEPRECATED] Use shipping address present in purchase unit or at root level of checkout Session.
|
||||
*
|
||||
* @param \PayPal\Api\ShippingAddress $shipping_address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShippingAddress($shipping_address)
|
||||
{
|
||||
$this->shipping_address = $shipping_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated [DEPRECATED] Use shipping address present in purchase unit or at root level of checkout Session.
|
||||
*
|
||||
* @return \PayPal\Api\ShippingAddress
|
||||
*/
|
||||
public function getShippingAddress()
|
||||
{
|
||||
return $this->shipping_address;
|
||||
}
|
||||
|
||||
}
|
||||
691
paypal/PayPal/Api/Payment.php
Normal file
691
paypal/PayPal/Api/Payment.php
Normal file
|
|
@ -0,0 +1,691 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Core\PayPalConstants;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Payment
|
||||
*
|
||||
* Lets you create, process and manage payments.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string intent
|
||||
* @property \PayPal\Api\Payer payer
|
||||
* @property \PayPal\Api\Transaction[] transactions
|
||||
* @property string state
|
||||
* @property string experience_profile_id
|
||||
* @property string note_to_payer
|
||||
* @property \PayPal\Api\Payee $payee
|
||||
* @property \PayPal\Api\RedirectUrls redirect_urls
|
||||
* @property string failure_reason
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class Payment extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* Identifier of the payment resource created.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the payment resource created.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment intent.
|
||||
* Valid Values: ["sale", "authorize", "order"]
|
||||
*
|
||||
* @param string $intent
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIntent($intent)
|
||||
{
|
||||
$this->intent = $intent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment intent.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIntent()
|
||||
{
|
||||
return $this->intent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Source of the funds for this payment represented by a PayPal account or a direct credit card.
|
||||
*
|
||||
* @param \PayPal\Api\Payer $payer
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayer($payer)
|
||||
{
|
||||
$this->payer = $payer;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Source of the funds for this payment represented by a PayPal account or a direct credit card.
|
||||
*
|
||||
* @return \PayPal\Api\Payer
|
||||
*/
|
||||
public function getPayer()
|
||||
{
|
||||
return $this->payer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information that the merchant knows about the payer. This information is not definitive and only serves as a hint to the UI or any pre-processing logic.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\PotentialPayerInfo $potential_payer_info
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPotentialPayerInfo($potential_payer_info)
|
||||
{
|
||||
$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.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\PotentialPayerInfo
|
||||
*/
|
||||
public function getPotentialPayerInfo()
|
||||
{
|
||||
return $this->potential_payer_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Receiver of funds for this payment.
|
||||
* @param \PayPal\Api\Payee $payee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayee($payee)
|
||||
{
|
||||
$this->payee = $payee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Receiver of funds for this payment.
|
||||
* @return \PayPal\Api\Payee
|
||||
*/
|
||||
public function getPayee()
|
||||
{
|
||||
return $this->payee;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the cart to execute the payment.
|
||||
* @deprecated Not publicly available
|
||||
* @param string $cart
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCart($cart)
|
||||
{
|
||||
$this->cart = $cart;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the cart to execute the payment.
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getCart()
|
||||
{
|
||||
return $this->cart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transactional details including the amount and item details.
|
||||
*
|
||||
* @param \PayPal\Api\Transaction[] $transactions
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTransactions($transactions)
|
||||
{
|
||||
$this->transactions = $transactions;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transactional details including the amount and item details.
|
||||
*
|
||||
* @return \PayPal\Api\Transaction[]
|
||||
*/
|
||||
public function getTransactions()
|
||||
{
|
||||
return $this->transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Transactions to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Transaction $transaction
|
||||
* @return $this
|
||||
*/
|
||||
public function addTransaction($transaction)
|
||||
{
|
||||
if (!$this->getTransactions()) {
|
||||
return $this->setTransactions(array($transaction));
|
||||
} else {
|
||||
return $this->setTransactions(
|
||||
array_merge($this->getTransactions(), array($transaction))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Transactions from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Transaction $transaction
|
||||
* @return $this
|
||||
*/
|
||||
public function removeTransaction($transaction)
|
||||
{
|
||||
return $this->setTransactions(
|
||||
array_diff($this->getTransactions(), array($transaction))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Applicable for advanced payments like multi seller payment (MSP) to support partial failures
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Error[] $failed_transactions
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFailedTransactions($failed_transactions)
|
||||
{
|
||||
$this->failed_transactions = $failed_transactions;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Applicable for advanced payments like multi seller payment (MSP) to support partial failures
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Error[]
|
||||
*/
|
||||
public function getFailedTransactions()
|
||||
{
|
||||
return $this->failed_transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append FailedTransactions to the list.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Error $error
|
||||
* @return $this
|
||||
*/
|
||||
public function addFailedTransaction($error)
|
||||
{
|
||||
if (!$this->getFailedTransactions()) {
|
||||
return $this->setFailedTransactions(array($error));
|
||||
} else {
|
||||
return $this->setFailedTransactions(
|
||||
array_merge($this->getFailedTransactions(), array($error))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove FailedTransactions from the list.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Error $error
|
||||
* @return $this
|
||||
*/
|
||||
public function removeFailedTransaction($error)
|
||||
{
|
||||
return $this->setFailedTransactions(
|
||||
array_diff($this->getFailedTransactions(), array($error))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Collection of PayPal generated billing agreement tokens.
|
||||
* @deprecated Not publicly available
|
||||
* @param string[] $billing_agreement_tokens
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBillingAgreementTokens($billing_agreement_tokens)
|
||||
{
|
||||
$this->billing_agreement_tokens = $billing_agreement_tokens;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Collection of PayPal generated billing agreement tokens.
|
||||
* @deprecated Not publicly available
|
||||
* @return string[]
|
||||
*/
|
||||
public function getBillingAgreementTokens()
|
||||
{
|
||||
return $this->billing_agreement_tokens;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append BillingAgreementTokens to the list.
|
||||
* @deprecated Not publicly available
|
||||
* @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.
|
||||
* @deprecated Not publicly available
|
||||
* @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.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\PaymentInstruction $payment_instruction
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentInstruction($payment_instruction)
|
||||
{
|
||||
$this->payment_instruction = $payment_instruction;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Instructions for the payer to complete this payment.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\PaymentInstruction
|
||||
*/
|
||||
public function getPaymentInstruction()
|
||||
{
|
||||
return $this->payment_instruction;
|
||||
}
|
||||
|
||||
/**
|
||||
* The state of the payment, authorization, or order transaction. The value is:<ul><li><code>created</code>. The transaction was successfully created.</li><li><code>approved</code>. The buyer approved the transaction.</li><li><code>failed</code>. The transaction request failed.</li></ul>
|
||||
* Valid Values: ["created", "approved", "failed", "partially_completed", "in_progress"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The state of the payment, authorization, or order transaction. The value is:<ul><li><code>created</code>. The transaction was successfully created.</li><li><code>approved</code>. The buyer approved the transaction.</li><li><code>failed</code>. The transaction request failed.</li></ul>
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal generated identifier for the merchant's payment experience profile. Refer to [this](https://developer.paypal.com/docs/api/#payment-experience) link to create experience profile ID.
|
||||
*
|
||||
* @param string $experience_profile_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExperienceProfileId($experience_profile_id)
|
||||
{
|
||||
$this->experience_profile_id = $experience_profile_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal generated identifier for the merchant's payment experience profile. Refer to [this](https://developer.paypal.com/docs/api/#payment-experience) link to create experience profile ID.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExperienceProfileId()
|
||||
{
|
||||
return $this->experience_profile_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRedirectUrls($redirect_urls)
|
||||
{
|
||||
$this->redirect_urls = $redirect_urls;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set of redirect URLs you provide only for PayPal-based payments.
|
||||
*
|
||||
* @return \PayPal\Api\RedirectUrls
|
||||
*/
|
||||
public function getRedirectUrls()
|
||||
{
|
||||
return $this->redirect_urls;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment creation time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment update time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment update time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Approval Link
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getApprovalLink()
|
||||
{
|
||||
return $this->getLink(PayPalConstants::APPROVAL_URL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get token from Approval Link
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getToken()
|
||||
{
|
||||
$parameter_name = "token";
|
||||
parse_str(parse_url($this->getApprovalLink(), PHP_URL_QUERY), $query);
|
||||
return !isset($query[$parameter_name]) ? null : $query[$parameter_name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and processes a payment. In the JSON request body, include a `payment` object with the intent, payer, and transactions. For PayPal payments, include redirect URLs in the `payment` object.
|
||||
*
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Payment
|
||||
*/
|
||||
public function create($apiContext = null, $restCall = null)
|
||||
{
|
||||
$payLoad = $this->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/payment",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows details for a payment, by ID.
|
||||
*
|
||||
* @param string $paymentId
|
||||
* @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 Payment
|
||||
*/
|
||||
public static function get($paymentId, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($paymentId, 'paymentId');
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/payment/$paymentId",
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new Payment();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Partially updates a payment, by ID. You can update the amount, shipping address, invoice ID, and custom data. You cannot 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.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return boolean
|
||||
*/
|
||||
public function update($patchRequest, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($patchRequest, 'patchRequest');
|
||||
$payLoad = $patchRequest->toJSON();
|
||||
self::executeCall(
|
||||
"/v1/payments/payment/{$this->getId()}",
|
||||
"PATCH",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes, or completes, a PayPal payment that the payer has approved. You can optionally update selective payment information when you execute a payment.
|
||||
*
|
||||
* @param PaymentExecution $paymentExecution
|
||||
* @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 Payment
|
||||
*/
|
||||
public function execute($paymentExecution, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($paymentExecution, 'paymentExecution');
|
||||
$payLoad = $paymentExecution->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/payment/{$this->getId()}/execute",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* List payments that were made to the merchant who issues the request. Payments can be in any state.
|
||||
*
|
||||
* @param array $params
|
||||
* @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 PaymentHistory
|
||||
*/
|
||||
public static function all($params, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($params, 'params');
|
||||
$payLoad = "";
|
||||
$allowedParams = array(
|
||||
'count' => 1,
|
||||
'start_id' => 1,
|
||||
'start_index' => 1,
|
||||
'start_time' => 1,
|
||||
'end_time' => 1,
|
||||
'payee_id' => 1,
|
||||
'sort_by' => 1,
|
||||
'sort_order' => 1,
|
||||
);
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/payment?" . http_build_query(array_intersect_key($params, $allowedParams)),
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new PaymentHistory();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
}
|
||||
482
paypal/PayPal/Api/PaymentCard.php
Normal file
482
paypal/PayPal/Api/PaymentCard.php
Normal file
|
|
@ -0,0 +1,482 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PaymentCard
|
||||
*
|
||||
* A payment card that can fund a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string number
|
||||
* @property string type
|
||||
* @property string expire_month
|
||||
* @property string expire_year
|
||||
* @property string start_month
|
||||
* @property string start_year
|
||||
* @property string cvv2
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* @property string billing_country
|
||||
* @property \PayPal\Api\Address billing_address
|
||||
* @property string external_customer_id
|
||||
* @property string status
|
||||
* @property string card_product_class
|
||||
* @property string valid_until
|
||||
* @property string issue_number
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class PaymentCard extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The ID of a credit card to save for later use.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of a credit card to save for later use.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The card number.
|
||||
*
|
||||
* @param string $number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNumber($number)
|
||||
{
|
||||
$this->number = $number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The card number.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNumber()
|
||||
{
|
||||
return $this->number;
|
||||
}
|
||||
|
||||
/**
|
||||
* The card type.
|
||||
* Valid Values: ["VISA", "AMEX", "SOLO", "JCB", "STAR", "DELTA", "DISCOVER", "SWITCH", "MAESTRO", "CB_NATIONALE", "CONFINOGA", "COFIDIS", "ELECTRON", "CETELEM", "CHINA_UNION_PAY", "MASTERCARD"]
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The card type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The two-digit expiry month for the card.
|
||||
*
|
||||
* @param string $expire_month
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireMonth($expire_month)
|
||||
{
|
||||
$this->expire_month = $expire_month;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The two-digit expiry month for the card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExpireMonth()
|
||||
{
|
||||
return $this->expire_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* The four-digit expiry year for the card.
|
||||
*
|
||||
* @param string $expire_year
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireYear($expire_year)
|
||||
{
|
||||
$this->expire_year = $expire_year;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The four-digit expiry year for the card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExpireYear()
|
||||
{
|
||||
return $this->expire_year;
|
||||
}
|
||||
|
||||
/**
|
||||
* The two-digit start month for the card. Required for UK Maestro cards.
|
||||
*
|
||||
* @param string $start_month
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStartMonth($start_month)
|
||||
{
|
||||
$this->start_month = $start_month;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The two-digit start month for the card. Required for UK Maestro cards.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStartMonth()
|
||||
{
|
||||
return $this->start_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* The four-digit start year for the card. Required for UK Maestro cards.
|
||||
*
|
||||
* @param string $start_year
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStartYear($start_year)
|
||||
{
|
||||
$this->start_year = $start_year;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The four-digit start year for the card. Required for UK Maestro cards.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStartYear()
|
||||
{
|
||||
return $this->start_year;
|
||||
}
|
||||
|
||||
/**
|
||||
* The validation code for the card. Supported for payments but not for saving payment cards for future use.
|
||||
*
|
||||
* @param string $cvv2
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCvv2($cvv2)
|
||||
{
|
||||
$this->cvv2 = $cvv2;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The validation code for the card. Supported for payments but not for saving payment cards for future use.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCvv2()
|
||||
{
|
||||
return $this->cvv2;
|
||||
}
|
||||
|
||||
/**
|
||||
* The first name of the card holder.
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFirstName($first_name)
|
||||
{
|
||||
$this->first_name = $first_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The first name of the card holder.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName()
|
||||
{
|
||||
return $this->first_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The last name of the card holder.
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastName($last_name)
|
||||
{
|
||||
$this->last_name = $last_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The last name of the card holder.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName()
|
||||
{
|
||||
return $this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The two-letter country code.
|
||||
*
|
||||
* @param string $billing_country
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBillingCountry($billing_country)
|
||||
{
|
||||
$this->billing_country = $billing_country;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The two-letter country code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBillingCountry()
|
||||
{
|
||||
return $this->billing_country;
|
||||
}
|
||||
|
||||
/**
|
||||
* The billing address for the card.
|
||||
*
|
||||
* @param \PayPal\Api\Address $billing_address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBillingAddress($billing_address)
|
||||
{
|
||||
$this->billing_address = $billing_address;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The billing address for the card.
|
||||
*
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
public function getBillingAddress()
|
||||
{
|
||||
return $this->billing_address;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the customer who owns this card account. The facilitator generates and provides this ID. Required when you create or use a stored funding instrument in the PayPal vault.
|
||||
*
|
||||
* @param string $external_customer_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternalCustomerId($external_customer_id)
|
||||
{
|
||||
$this->external_customer_id = $external_customer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the customer who owns this card account. The facilitator generates and provides this ID. Required when you create or use a stored funding instrument in the PayPal vault.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalCustomerId()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The state of the funding instrument.
|
||||
* Valid Values: ["EXPIRED", "ACTIVE"]
|
||||
*
|
||||
* @param string $status
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStatus($status)
|
||||
{
|
||||
$this->status = $status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The state of the funding instrument.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* The product class of the financial instrument issuer.
|
||||
* Valid Values: ["CREDIT", "DEBIT", "GIFT", "PAYPAL_PREPAID", "PREPAID", "UNKNOWN"]
|
||||
*
|
||||
* @param string $card_product_class
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCardProductClass($card_product_class)
|
||||
{
|
||||
$this->card_product_class = $card_product_class;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The product class of the financial instrument issuer.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCardProductClass()
|
||||
{
|
||||
return $this->card_product_class;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time until when this instrument can be used fund a payment.
|
||||
*
|
||||
* @param string $valid_until
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValidUntil($valid_until)
|
||||
{
|
||||
$this->valid_until = $valid_until;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time until when this instrument can be used fund a payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValidUntil()
|
||||
{
|
||||
return $this->valid_until;
|
||||
}
|
||||
|
||||
/**
|
||||
* The one- to two-digit card issue number. Required for UK Maestro cards.
|
||||
*
|
||||
* @param string $issue_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIssueNumber($issue_number)
|
||||
{
|
||||
$this->issue_number = $issue_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The one- to two-digit card issue number. Required for UK Maestro cards.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIssueNumber()
|
||||
{
|
||||
return $this->issue_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
* @param \PayPal\Api\Links[] $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Links to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function addLink($links)
|
||||
{
|
||||
if (!$this->getLinks()) {
|
||||
return $this->setLinks(array($links));
|
||||
} else {
|
||||
return $this->setLinks(
|
||||
array_merge($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Links from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function removeLink($links)
|
||||
{
|
||||
return $this->setLinks(
|
||||
array_diff($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
162
paypal/PayPal/Api/PaymentCardToken.php
Normal file
162
paypal/PayPal/Api/PaymentCardToken.php
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PaymentCardToken
|
||||
*
|
||||
* A resource representing a payment card that can be used to fund a payment.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string payment_card_id
|
||||
* @property string external_customer_id
|
||||
* @property string last4
|
||||
* @property string type
|
||||
* @property int expire_month
|
||||
* @property int expire_year
|
||||
*/
|
||||
class PaymentCardToken extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* ID of a previously saved Payment Card resource.
|
||||
*
|
||||
* @param string $payment_card_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentCardId($payment_card_id)
|
||||
{
|
||||
$this->payment_card_id = $payment_card_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of a previously saved Payment Card resource.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentCardId()
|
||||
{
|
||||
return $this->payment_card_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unique identifier of the payer used when saving this payment card.
|
||||
*
|
||||
* @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 used when saving this payment card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalCustomerId()
|
||||
{
|
||||
return $this->external_customer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last 4 digits of the card number from the saved card.
|
||||
*
|
||||
* @param string $last4
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLast4($last4)
|
||||
{
|
||||
$this->last4 = $last4;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Last 4 digits of the card number from the saved card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLast4()
|
||||
{
|
||||
return $this->last4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the Card.
|
||||
* Valid Values: ["VISA", "AMEX", "SOLO", "JCB", "STAR", "DELTA", "DISCOVER", "SWITCH", "MAESTRO", "CB_NATIONALE", "CONFINOGA", "COFIDIS", "ELECTRON", "CETELEM", "CHINA_UNION_PAY", "MASTERCARD"]
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the Card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expiry month from the saved card with value 1 - 12.
|
||||
*
|
||||
* @param int $expire_month
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireMonth($expire_month)
|
||||
{
|
||||
$this->expire_month = $expire_month;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expiry month from the saved card with value 1 - 12.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpireMonth()
|
||||
{
|
||||
return $this->expire_month;
|
||||
}
|
||||
|
||||
/**
|
||||
* Four digit expiry year from the saved card, represented as YYYY format.
|
||||
*
|
||||
* @param int $expire_year
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpireYear($expire_year)
|
||||
{
|
||||
$this->expire_year = $expire_year;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Four digit expiry year from the saved card, represented as YYYY format.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpireYear()
|
||||
{
|
||||
return $this->expire_year;
|
||||
}
|
||||
|
||||
}
|
||||
239
paypal/PayPal/Api/PaymentDefinition.php
Normal file
239
paypal/PayPal/Api/PaymentDefinition.php
Normal file
|
|
@ -0,0 +1,239 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PaymentDefinition
|
||||
*
|
||||
* Resource representing payment definition scheduling information.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string name
|
||||
* @property string type
|
||||
* @property string frequency_interval
|
||||
* @property string frequency
|
||||
* @property string cycles
|
||||
* @property \PayPal\Api\Currency amount
|
||||
* @property \PayPal\Api\ChargeModel[] charge_models
|
||||
*/
|
||||
class PaymentDefinition extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Identifier of the payment_definition. 128 characters max.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the payment_definition. 128 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the payment definition. 128 characters max.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the payment definition. 128 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the payment definition. Allowed values: `TRIAL`, `REGULAR`.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the payment definition. Allowed values: `TRIAL`, `REGULAR`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* How frequently the customer should be charged.
|
||||
*
|
||||
* @param string $frequency_interval
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFrequencyInterval($frequency_interval)
|
||||
{
|
||||
$this->frequency_interval = $frequency_interval;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* How frequently the customer should be charged.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFrequencyInterval()
|
||||
{
|
||||
return $this->frequency_interval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Frequency of the payment definition offered. Allowed values: `WEEK`, `DAY`, `YEAR`, `MONTH`.
|
||||
*
|
||||
* @param string $frequency
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFrequency($frequency)
|
||||
{
|
||||
$this->frequency = $frequency;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Frequency of the payment definition offered. Allowed values: `WEEK`, `DAY`, `YEAR`, `MONTH`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFrequency()
|
||||
{
|
||||
return $this->frequency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of cycles in this payment definition.
|
||||
*
|
||||
* @param string $cycles
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCycles($cycles)
|
||||
{
|
||||
$this->cycles = $cycles;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of cycles in this payment definition.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCycles()
|
||||
{
|
||||
return $this->cycles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount that will be charged at the end of each cycle for this payment definition.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount that will be charged at the end of each cycle for this payment definition.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of charge_models for this payment definition.
|
||||
*
|
||||
* @param \PayPal\Api\ChargeModel[] $charge_models
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setChargeModels($charge_models)
|
||||
{
|
||||
$this->charge_models = $charge_models;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of charge_models for this payment definition.
|
||||
*
|
||||
* @return \PayPal\Api\ChargeModel[]
|
||||
*/
|
||||
public function getChargeModels()
|
||||
{
|
||||
return $this->charge_models;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append ChargeModels to the list.
|
||||
*
|
||||
* @param \PayPal\Api\ChargeModel $chargeModel
|
||||
* @return $this
|
||||
*/
|
||||
public function addChargeModel($chargeModel)
|
||||
{
|
||||
if (!$this->getChargeModels()) {
|
||||
return $this->setChargeModels(array($chargeModel));
|
||||
} else {
|
||||
return $this->setChargeModels(
|
||||
array_merge($this->getChargeModels(), array($chargeModel))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove ChargeModels from the list.
|
||||
*
|
||||
* @param \PayPal\Api\ChargeModel $chargeModel
|
||||
* @return $this
|
||||
*/
|
||||
public function removeChargeModel($chargeModel)
|
||||
{
|
||||
return $this->setChargeModels(
|
||||
array_diff($this->getChargeModels(), array($chargeModel))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
188
paypal/PayPal/Api/PaymentDetail.php
Normal file
188
paypal/PayPal/Api/PaymentDetail.php
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PaymentDetail
|
||||
*
|
||||
* Invoicing payment information.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string type
|
||||
* @property string transaction_id
|
||||
* @property string transaction_type
|
||||
* @property string date
|
||||
* @property string method
|
||||
* @property string note
|
||||
* @property \PayPal\Api\Currency amount
|
||||
*/
|
||||
class PaymentDetail extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The PayPal payment detail. Indicates whether payment was made in an invoicing flow through PayPal or externally. In the case of the mark-as-paid API, the supported payment type is `EXTERNAL`. For backward compatibility, the `PAYPAL` payment type is still supported.
|
||||
* Valid Values: ["PAYPAL", "EXTERNAL"]
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The PayPal payment detail. Indicates whether payment was made in an invoicing flow through PayPal or externally. In the case of the mark-as-paid API, the supported payment type is `EXTERNAL`. For backward compatibility, the `PAYPAL` payment type is still supported.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The PayPal payment transaction ID. Required with the `PAYPAL` payment type.
|
||||
*
|
||||
* @param string $transaction_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTransactionId($transaction_id)
|
||||
{
|
||||
$this->transaction_id = $transaction_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The PayPal payment transaction ID. Required with the `PAYPAL` payment type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTransactionId()
|
||||
{
|
||||
return $this->transaction_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the transaction.
|
||||
* Valid Values: ["SALE", "AUTHORIZATION", "CAPTURE"]
|
||||
*
|
||||
* @param string $transaction_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTransactionType($transaction_type)
|
||||
{
|
||||
$this->transaction_type = $transaction_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTransactionType()
|
||||
{
|
||||
return $this->transaction_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date when the invoice was paid. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @param string $date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDate($date)
|
||||
{
|
||||
$this->date = $date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date when the invoice was paid. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDate()
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
/**
|
||||
* The payment mode or method. Required with the `EXTERNAL` payment type.
|
||||
* Valid Values: ["BANK_TRANSFER", "CASH", "CHECK", "CREDIT_CARD", "DEBIT_CARD", "PAYPAL", "WIRE_TRANSFER", "OTHER"]
|
||||
*
|
||||
* @param string $method
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMethod($method)
|
||||
{
|
||||
$this->method = $method;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The payment mode or method. Required with the `EXTERNAL` payment type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMethod()
|
||||
{
|
||||
return $this->method;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional. A note associated with the payment.
|
||||
*
|
||||
* @param string $note
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNote($note)
|
||||
{
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional. A note associated with the payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote()
|
||||
{
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount to record as payment against invoice. If you omit this parameter, the total invoice amount is recorded as payment.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount to record as payment against invoice. If you omit this parameter, the total invoice amount is recorded as payment.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
}
|
||||
118
paypal/PayPal/Api/PaymentExecution.php
Normal file
118
paypal/PayPal/Api/PaymentExecution.php
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PaymentExecution
|
||||
*
|
||||
* Let's you execute a PayPal Account based Payment resource with the payer_id obtained from web approval url.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string payer_id
|
||||
* @property \PayPal\Api\Transaction[] transactions
|
||||
*/
|
||||
class PaymentExecution extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The ID of the Payer, passed in the `return_url` by PayPal.
|
||||
*
|
||||
* @param string $payer_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayerId($payer_id)
|
||||
{
|
||||
$this->payer_id = $payer_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID of the Payer, passed in the `return_url` by PayPal.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayerId()
|
||||
{
|
||||
return $this->payer_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Carrier account id for a carrier billing payment. For a carrier billing payment, payer_id is not applicable.
|
||||
* @deprecated Not publicly available
|
||||
* @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.
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getCarrierAccountId()
|
||||
{
|
||||
return $this->carrier_account_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transactional details including the amount and item details.
|
||||
*
|
||||
* @param \PayPal\Api\Transaction[] $transactions
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTransactions($transactions)
|
||||
{
|
||||
$this->transactions = $transactions;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transactional details including the amount and item details.
|
||||
*
|
||||
* @return \PayPal\Api\Transaction[]
|
||||
*/
|
||||
public function getTransactions()
|
||||
{
|
||||
return $this->transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Transactions to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Transaction $transaction
|
||||
* @return $this
|
||||
*/
|
||||
public function addTransaction($transaction)
|
||||
{
|
||||
if (!$this->getTransactions()) {
|
||||
return $this->setTransactions(array($transaction));
|
||||
} else {
|
||||
return $this->setTransactions(
|
||||
array_merge($this->getTransactions(), array($transaction))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Transactions from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Transaction $transaction
|
||||
* @return $this
|
||||
*/
|
||||
public function removeTransaction($transaction)
|
||||
{
|
||||
return $this->setTransactions(
|
||||
array_diff($this->getTransactions(), array($transaction))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
119
paypal/PayPal/Api/PaymentHistory.php
Normal file
119
paypal/PayPal/Api/PaymentHistory.php
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PaymentHistory
|
||||
*
|
||||
* List of Payments made by the seller.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Payment[] payments
|
||||
* @property int count
|
||||
* @property string next_id
|
||||
*/
|
||||
class PaymentHistory extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* A list of Payment resources
|
||||
*
|
||||
* @param \PayPal\Api\Payment[] $payments
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayments($payments)
|
||||
{
|
||||
$this->payments = $payments;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of Payment resources
|
||||
*
|
||||
* @return \PayPal\Api\Payment[]
|
||||
*/
|
||||
public function getPayments()
|
||||
{
|
||||
return $this->payments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Payments to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Payment $payment
|
||||
* @return $this
|
||||
*/
|
||||
public function addPayment($payment)
|
||||
{
|
||||
if (!$this->getPayments()) {
|
||||
return $this->setPayments(array($payment));
|
||||
} else {
|
||||
return $this->setPayments(
|
||||
array_merge($this->getPayments(), array($payment))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Payments from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Payment $payment
|
||||
* @return $this
|
||||
*/
|
||||
public function removePayment($payment)
|
||||
{
|
||||
return $this->setPayments(
|
||||
array_diff($this->getPayments(), array($payment))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. Maximum value: 20.
|
||||
*
|
||||
* @param int $count
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCount($count)
|
||||
{
|
||||
$this->count = $count;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. Maximum value: 20.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCount()
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
*
|
||||
* @param string $next_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNextId($next_id)
|
||||
{
|
||||
$this->next_id = $next_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the next element to get the next range of results.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNextId()
|
||||
{
|
||||
return $this->next_id;
|
||||
}
|
||||
|
||||
}
|
||||
190
paypal/PayPal/Api/PaymentInstruction.php
Normal file
190
paypal/PayPal/Api/PaymentInstruction.php
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* Class PaymentInstruction
|
||||
*
|
||||
* Contain details of how and when the payment should be made to PayPal in cases of manual bank transfer.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string reference_number
|
||||
* @property string instruction_type
|
||||
* @property \PayPal\Api\RecipientBankingInstruction recipient_banking_instruction
|
||||
* @property \PayPal\Api\Currency amount
|
||||
* @property string payment_due_date
|
||||
* @property string note
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class PaymentInstruction extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* ID of payment instruction
|
||||
*
|
||||
* @param string $reference_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReferenceNumber($reference_number)
|
||||
{
|
||||
$this->reference_number = $reference_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of payment instruction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReferenceNumber()
|
||||
{
|
||||
return $this->reference_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of payment instruction
|
||||
* Valid Values: ["MANUAL_BANK_TRANSFER", "PAY_UPON_INVOICE"]
|
||||
*
|
||||
* @param string $instruction_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInstructionType($instruction_type)
|
||||
{
|
||||
$this->instruction_type = $instruction_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of payment instruction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInstructionType()
|
||||
{
|
||||
return $this->instruction_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recipient bank Details.
|
||||
*
|
||||
* @param \PayPal\Api\RecipientBankingInstruction $recipient_banking_instruction
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRecipientBankingInstruction($recipient_banking_instruction)
|
||||
{
|
||||
$this->recipient_banking_instruction = $recipient_banking_instruction;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recipient bank Details.
|
||||
*
|
||||
* @return \PayPal\Api\RecipientBankingInstruction
|
||||
*/
|
||||
public function getRecipientBankingInstruction()
|
||||
{
|
||||
return $this->recipient_banking_instruction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount to be transferred
|
||||
*
|
||||
* @param \PayPal\Api\Currency $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount to be transferred
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date by which payment should be received
|
||||
*
|
||||
* @param string $payment_due_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentDueDate($payment_due_date)
|
||||
{
|
||||
$this->payment_due_date = $payment_due_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Date by which payment should be received
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentDueDate()
|
||||
{
|
||||
return $this->payment_due_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional text regarding payment handling
|
||||
*
|
||||
* @param string $note
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNote($note)
|
||||
{
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional text regarding payment handling
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote()
|
||||
{
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a payment instruction by passing the payment_id in the request URI. Use this request if you are implementing a solution that includes delayed payment like Pay Upon Invoice (PUI).
|
||||
*
|
||||
* @param string $paymentId
|
||||
* @param 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 PaymentInstruction
|
||||
*/
|
||||
public static function get($paymentId, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($paymentId, 'paymentId');
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/payment/$paymentId/payment-instruction",
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new PaymentInstruction();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
}
|
||||
88
paypal/PayPal/Api/PaymentOptions.php
Normal file
88
paypal/PayPal/Api/PaymentOptions.php
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PaymentOptions
|
||||
*
|
||||
* Payment options requested for this purchase unit
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string allowed_payment_method
|
||||
*/
|
||||
class PaymentOptions extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Payment method requested for this purchase unit
|
||||
* Valid Values: ["UNRESTRICTED", "INSTANT_FUNDING_SOURCE", "IMMEDIATE_PAY"]
|
||||
*
|
||||
* @param string $allowed_payment_method
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAllowedPaymentMethod($allowed_payment_method)
|
||||
{
|
||||
$this->allowed_payment_method = $allowed_payment_method;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment method requested for this purchase unit
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAllowedPaymentMethod()
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
65
paypal/PayPal/Api/PaymentSummary.php
Normal file
65
paypal/PayPal/Api/PaymentSummary.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PaymentSummary
|
||||
*
|
||||
* Payment/Refund break up
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Currency paypal
|
||||
* @property \PayPal\Api\Currency other
|
||||
*/
|
||||
class PaymentSummary extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Total Amount paid/refunded via PayPal.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $paypal
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaypal($paypal)
|
||||
{
|
||||
$this->paypal = $paypal;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total Amount paid/refunded via PayPal.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getPaypal()
|
||||
{
|
||||
return $this->paypal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total Amount paid/refunded via other sources.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $other
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOther($other)
|
||||
{
|
||||
$this->other = $other;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total Amount paid/refunded via other sources.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getOther()
|
||||
{
|
||||
return $this->other;
|
||||
}
|
||||
|
||||
}
|
||||
66
paypal/PayPal/Api/PaymentTerm.php
Normal file
66
paypal/PayPal/Api/PaymentTerm.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PaymentTerm
|
||||
*
|
||||
* The payment term of the invoice. If you specify `term_type`, you cannot specify `due_date` and vice versa.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string term_type
|
||||
* @property string due_date
|
||||
*/
|
||||
class PaymentTerm extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The terms by which the invoice payment is due.
|
||||
* Valid Values: ["DUE_ON_RECEIPT", "DUE_ON_DATE_SPECIFIED", "NET_10", "NET_15", "NET_30", "NET_45", "NET_60", "NET_90", "NO_DUE_DATE"]
|
||||
*
|
||||
* @param string $term_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTermType($term_type)
|
||||
{
|
||||
$this->term_type = $term_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The terms by which the invoice payment is due.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTermType()
|
||||
{
|
||||
return $this->term_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date when the invoice payment is due. This date must be a future date. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @param string $due_date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDueDate($due_date)
|
||||
{
|
||||
$this->due_date = $due_date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date when the invoice payment is due. This date must be a future date. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDueDate()
|
||||
{
|
||||
return $this->due_date;
|
||||
}
|
||||
|
||||
}
|
||||
166
paypal/PayPal/Api/Payout.php
Normal file
166
paypal/PayPal/Api/Payout.php
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Transport\PayPalRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* Class Payout
|
||||
*
|
||||
* This object represents a set of payouts that includes status data for the payouts. This object enables you to create a payout using a POST request.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\PayoutSenderBatchHeader sender_batch_header
|
||||
* @property \PayPal\Api\PayoutItem[] items
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class Payout extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* The original batch header as provided by the payment sender.
|
||||
*
|
||||
* @param \PayPal\Api\PayoutSenderBatchHeader $sender_batch_header
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSenderBatchHeader($sender_batch_header)
|
||||
{
|
||||
$this->sender_batch_header = $sender_batch_header;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original batch header as provided by the payment sender.
|
||||
*
|
||||
* @return \PayPal\Api\PayoutSenderBatchHeader
|
||||
*/
|
||||
public function getSenderBatchHeader()
|
||||
{
|
||||
return $this->sender_batch_header;
|
||||
}
|
||||
|
||||
/**
|
||||
* An array of payout items (that is, a set of individual payouts).
|
||||
*
|
||||
* @param \PayPal\Api\PayoutItem[] $items
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setItems($items)
|
||||
{
|
||||
$this->items = $items;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An array of payout items (that is, a set of individual payouts).
|
||||
*
|
||||
* @return \PayPal\Api\PayoutItem[]
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Items to the list.
|
||||
*
|
||||
* @param \PayPal\Api\PayoutItem $payoutItem
|
||||
* @return $this
|
||||
*/
|
||||
public function addItem($payoutItem)
|
||||
{
|
||||
if (!$this->getItems()) {
|
||||
return $this->setItems(array($payoutItem));
|
||||
} else {
|
||||
return $this->setItems(
|
||||
array_merge($this->getItems(), array($payoutItem))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Items from the list.
|
||||
*
|
||||
* @param \PayPal\Api\PayoutItem $payoutItem
|
||||
* @return $this
|
||||
*/
|
||||
public function removeItem($payoutItem)
|
||||
{
|
||||
return $this->setItems(
|
||||
array_diff($this->getItems(), array($payoutItem))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a payout batch resource by passing a sender_batch_header and an items array to the request URI. The sender_batch_header contains payout parameters that describe the handling of a batch resource while the items array conatins payout items.
|
||||
*
|
||||
* @param array $params
|
||||
* @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 PayoutBatch
|
||||
*/
|
||||
public function create($params = array(), $apiContext = null, $restCall = null)
|
||||
{
|
||||
$params = $params ? $params : array();
|
||||
ArgumentValidator::validate($params, 'params');
|
||||
$payLoad = $this->toJSON();
|
||||
$allowedParams = array(
|
||||
'sync_mode' => 1,
|
||||
);
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/payouts" . "?" . http_build_query(array_intersect_key($params, $allowedParams)),
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new PayoutBatch();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* You can submit a payout with a synchronous API call, which immediately returns the results of a PayPal payment.
|
||||
*
|
||||
* @param ApiContext $apiContext
|
||||
* @param PayPalRestCall $restCall
|
||||
* @return PayoutBatch
|
||||
*/
|
||||
public function createSynchronous($apiContext = null, $restCall = null)
|
||||
{
|
||||
$params = array('sync_mode' => 'true');
|
||||
return $this->create($params, $apiContext, $restCall);
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain the status of a specific batch resource by passing the payout batch ID to the request URI. You can issue this call multiple times to get the current status.
|
||||
*
|
||||
* @param string $payoutBatchId
|
||||
* @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 PayoutBatch
|
||||
*/
|
||||
public static function get($payoutBatchId, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($payoutBatchId, 'payoutBatchId');
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/payouts/$payoutBatchId",
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new PayoutBatch();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
}
|
||||
120
paypal/PayPal/Api/PayoutBatch.php
Normal file
120
paypal/PayPal/Api/PayoutBatch.php
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PayoutBatch
|
||||
*
|
||||
* The PayPal-generated batch status.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\PayoutBatchHeader batch_header
|
||||
* @property \PayPal\Api\PayoutItemDetails[] items
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class PayoutBatch extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* A batch header. Includes the generated batch status.
|
||||
*
|
||||
* @param \PayPal\Api\PayoutBatchHeader $batch_header
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBatchHeader($batch_header)
|
||||
{
|
||||
$this->batch_header = $batch_header;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A batch header. Includes the generated batch status.
|
||||
*
|
||||
* @return \PayPal\Api\PayoutBatchHeader
|
||||
*/
|
||||
public function getBatchHeader()
|
||||
{
|
||||
return $this->batch_header;
|
||||
}
|
||||
|
||||
/**
|
||||
* An array of items in a batch payout.
|
||||
*
|
||||
* @param \PayPal\Api\PayoutItemDetails[] $items
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setItems($items)
|
||||
{
|
||||
$this->items = $items;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An array of items in a batch payout.
|
||||
*
|
||||
* @return \PayPal\Api\PayoutItemDetails[]
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Items to the list.
|
||||
*
|
||||
* @param \PayPal\Api\PayoutItemDetails $payoutItemDetails
|
||||
* @return $this
|
||||
*/
|
||||
public function addItem($payoutItemDetails)
|
||||
{
|
||||
if (!$this->getItems()) {
|
||||
return $this->setItems(array($payoutItemDetails));
|
||||
} else {
|
||||
return $this->setItems(
|
||||
array_merge($this->getItems(), array($payoutItemDetails))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Items from the list.
|
||||
*
|
||||
* @param \PayPal\Api\PayoutItemDetails $payoutItemDetails
|
||||
* @return $this
|
||||
*/
|
||||
public function removeItem($payoutItemDetails)
|
||||
{
|
||||
return $this->setItems(
|
||||
array_diff($this->getItems(), array($payoutItemDetails))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
* @param \PayPal\Api\Links[] $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
}
|
||||
263
paypal/PayPal/Api/PayoutBatchHeader.php
Normal file
263
paypal/PayPal/Api/PayoutBatchHeader.php
Normal file
|
|
@ -0,0 +1,263 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PayoutBatchHeader
|
||||
*
|
||||
* Batch header resource.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string payout_batch_id
|
||||
* @property string batch_status
|
||||
* @property string time_created
|
||||
* @property string time_completed
|
||||
* @property \PayPal\Api\PayoutSenderBatchHeader sender_batch_header
|
||||
* @property \PayPal\Api\Currency amount
|
||||
* @property \PayPal\Api\Currency fees
|
||||
* @property \PayPal\Api\Error errors
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class PayoutBatchHeader extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The PayPal-generated ID for a batch payout.
|
||||
*
|
||||
* @param string $payout_batch_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayoutBatchId($payout_batch_id)
|
||||
{
|
||||
$this->payout_batch_id = $payout_batch_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The PayPal-generated ID for a batch payout.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayoutBatchId()
|
||||
{
|
||||
return $this->payout_batch_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The PayPal-generated batch payout status. If the batch payout passes the preliminary checks, the status is `PENDING`.
|
||||
*
|
||||
* @param string $batch_status
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBatchStatus($batch_status)
|
||||
{
|
||||
$this->batch_status = $batch_status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The PayPal-generated batch payout status. If the batch payout passes the preliminary checks, the status is `PENDING`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBatchStatus()
|
||||
{
|
||||
return $this->batch_status;
|
||||
}
|
||||
|
||||
/**
|
||||
* The time the batch entered processing.
|
||||
*
|
||||
* @param string $time_created
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTimeCreated($time_created)
|
||||
{
|
||||
$this->time_created = $time_created;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The time the batch entered processing.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTimeCreated()
|
||||
{
|
||||
return $this->time_created;
|
||||
}
|
||||
|
||||
/**
|
||||
* The time that processing for the batch was completed.
|
||||
*
|
||||
* @param string $time_completed
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTimeCompleted($time_completed)
|
||||
{
|
||||
$this->time_completed = $time_completed;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The time that processing for the batch was completed.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTimeCompleted()
|
||||
{
|
||||
return $this->time_completed;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original batch header as provided by the payment sender.
|
||||
*
|
||||
* @param \PayPal\Api\PayoutSenderBatchHeader $sender_batch_header
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSenderBatchHeader($sender_batch_header)
|
||||
{
|
||||
$this->sender_batch_header = $sender_batch_header;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The sender-provided batch payout header.
|
||||
*
|
||||
* @return \PayPal\Api\PayoutSenderBatchHeader
|
||||
*/
|
||||
public function getSenderBatchHeader()
|
||||
{
|
||||
return $this->sender_batch_header;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total amount, in U.S. dollars, requested for the applicable payouts.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total amount, in U.S. dollars, requested for the applicable payouts.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total estimate in U.S. dollars for the applicable payouts fees.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $fees
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFees($fees)
|
||||
{
|
||||
$this->fees = $fees;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total estimate in U.S. dollars for the applicable payouts fees.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getFees()
|
||||
{
|
||||
return $this->fees;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Errors
|
||||
*
|
||||
* @param \PayPal\Api\Error $errors
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setErrors($errors)
|
||||
{
|
||||
$this->errors = $errors;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Errors
|
||||
*
|
||||
* @return \PayPal\Api\Error
|
||||
*/
|
||||
public function getErrors()
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
* @param \PayPal\Api\Links[] $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Links to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function addLink($links)
|
||||
{
|
||||
if (!$this->getLinks()) {
|
||||
return $this->setLinks(array($links));
|
||||
} else {
|
||||
return $this->setLinks(
|
||||
array_merge($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Links from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function removeLink($links)
|
||||
{
|
||||
return $this->setLinks(
|
||||
array_diff($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
189
paypal/PayPal/Api/PayoutItem.php
Normal file
189
paypal/PayPal/Api/PayoutItem.php
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Transport\PayPalRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* Class PayoutItem
|
||||
*
|
||||
* A sender-created definition of a payout to a single recipient.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string recipient_type
|
||||
* @property \PayPal\Api\Currency amount
|
||||
* @property string note
|
||||
* @property string receiver
|
||||
* @property string sender_item_id
|
||||
*/
|
||||
class PayoutItem extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* The type of ID that identifies the payment receiver. Value is:<ul><code>EMAIL</code>. Unencrypted email. Value is a string of up to 127 single-byte characters.</li><li><code>PHONE</code>. Unencrypted phone number.<blockquote><strong>Note:</strong> The PayPal sandbox does not support the <code>PHONE</code> recipient type.</blockquote></li><li><code>PAYPAL_ID</code>. Encrypted PayPal account number.</li></ul>If the <code>sender_batch_header</code> includes the <code>recipient_type</code> attribute, any payout item without its own <code>recipient_type</code> attribute uses the <code>recipient_type</code> value from <code>sender_batch_header</code>. If the <code>sender_batch_header</code> omits the <code>recipient_type</code> attribute, each payout item must include its own <code>recipient_type</code> value.
|
||||
*
|
||||
* @param string $recipient_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRecipientType($recipient_type)
|
||||
{
|
||||
$this->recipient_type = $recipient_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of ID that identifies the payment receiver. Value is:<ul><code>EMAIL</code>. Unencrypted email. Value is a string of up to 127 single-byte characters.</li><li><code>PHONE</code>. Unencrypted phone number.<blockquote><strong>Note:</strong> The PayPal sandbox does not support the <code>PHONE</code> recipient type.</blockquote></li><li><code>PAYPAL_ID</code>. Encrypted PayPal account number.</li></ul>If the <code>sender_batch_header</code> includes the <code>recipient_type</code> attribute, any payout item without its own <code>recipient_type</code> attribute uses the <code>recipient_type</code> value from <code>sender_batch_header</code>. If the <code>sender_batch_header</code> omits the <code>recipient_type</code> attribute, each payout item must include its own <code>recipient_type</code> value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRecipientType()
|
||||
{
|
||||
return $this->recipient_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount of money to pay the receiver.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount of money to pay the receiver.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional. A sender-specified note for notifications. Value is any string value.
|
||||
*
|
||||
* @param string $note
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNote($note)
|
||||
{
|
||||
$this->note = $note;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional. A sender-specified note for notifications. Value is any string value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNote()
|
||||
{
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
/**
|
||||
* The receiver of the payment. Corresponds to the `recipient_type` value in the request.
|
||||
*
|
||||
* @param string $receiver
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReceiver($receiver)
|
||||
{
|
||||
$this->receiver = $receiver;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The receiver of the payment. Corresponds to the `recipient_type` value in the request.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReceiver()
|
||||
{
|
||||
return $this->receiver;
|
||||
}
|
||||
|
||||
/**
|
||||
* A sender-specified ID number. Tracks the batch payout in an accounting system.
|
||||
*
|
||||
* @param string $sender_item_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSenderItemId($sender_item_id)
|
||||
{
|
||||
$this->sender_item_id = $sender_item_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A sender-specified ID number. Tracks the batch payout in an accounting system.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSenderItemId()
|
||||
{
|
||||
return $this->sender_item_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain the status of a payout item by passing the item ID to the request URI.
|
||||
*
|
||||
* @param string $payoutItemId
|
||||
* @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 PayoutItemDetails
|
||||
*/
|
||||
public static function get($payoutItemId, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($payoutItemId, 'payoutItemId');
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/payouts-item/$payoutItemId",
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new PayoutItemDetails();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels the unclaimed payment using the items id passed in the request URI. If an unclaimed item is not claimed within 30 days, the funds will be automatically returned to the sender. This call can be used to cancel the unclaimed item prior to the automatic 30-day return.
|
||||
*
|
||||
* @param string $payoutItemId
|
||||
* @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 PayoutItemDetails
|
||||
*/
|
||||
public static function cancel($payoutItemId, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($payoutItemId, 'payoutItemId');
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/payouts-item/$payoutItemId/cancel",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new PayoutItemDetails();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
287
paypal/PayPal/Api/PayoutItemDetails.php
Normal file
287
paypal/PayPal/Api/PayoutItemDetails.php
Normal file
|
|
@ -0,0 +1,287 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PayoutItemDetails
|
||||
*
|
||||
* The payout item status and other details.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string payout_item_id
|
||||
* @property string transaction_id
|
||||
* @property string transaction_status
|
||||
* @property \PayPal\Api\Currency payout_item_fee
|
||||
* @property string payout_batch_id
|
||||
* @property string sender_batch_id
|
||||
* @property \PayPal\Api\PayoutItem payout_item
|
||||
* @property string time_processed
|
||||
* @property \PayPal\Api\Error errors
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class PayoutItemDetails extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The ID for the payout item. Viewable when you show details for a batch payout.
|
||||
*
|
||||
* @param string $payout_item_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayoutItemId($payout_item_id)
|
||||
{
|
||||
$this->payout_item_id = $payout_item_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ID for the payout item. Viewable when you show details for a batch payout.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayoutItemId()
|
||||
{
|
||||
return $this->payout_item_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The PayPal-generated ID for the transaction.
|
||||
*
|
||||
* @param string $transaction_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTransactionId($transaction_id)
|
||||
{
|
||||
$this->transaction_id = $transaction_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The PayPal-generated ID for the transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTransactionId()
|
||||
{
|
||||
return $this->transaction_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The transaction status.
|
||||
*
|
||||
* @param string $transaction_status
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTransactionStatus($transaction_status)
|
||||
{
|
||||
$this->transaction_status = $transaction_status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The transaction status.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTransactionStatus()
|
||||
{
|
||||
return $this->transaction_status;
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount of money, in U.S. dollars, for fees.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $payout_item_fee
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayoutItemFee($payout_item_fee)
|
||||
{
|
||||
$this->payout_item_fee = $payout_item_fee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The amount of money, in U.S. dollars, for fees.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getPayoutItemFee()
|
||||
{
|
||||
return $this->payout_item_fee;
|
||||
}
|
||||
|
||||
/**
|
||||
* The PayPal-generated ID for the batch payout.
|
||||
*
|
||||
* @param string $payout_batch_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayoutBatchId($payout_batch_id)
|
||||
{
|
||||
$this->payout_batch_id = $payout_batch_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The PayPal-generated ID for the batch payout.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPayoutBatchId()
|
||||
{
|
||||
return $this->payout_batch_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* A sender-specified ID number. Tracks the batch payout in an accounting system.
|
||||
*
|
||||
* @param string $sender_batch_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSenderBatchId($sender_batch_id)
|
||||
{
|
||||
$this->sender_batch_id = $sender_batch_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A sender-specified ID number. Tracks the batch payout in an accounting system.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSenderBatchId()
|
||||
{
|
||||
return $this->sender_batch_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The sender-provided information for the payout item.
|
||||
*
|
||||
* @param \PayPal\Api\PayoutItem $payout_item
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPayoutItem($payout_item)
|
||||
{
|
||||
$this->payout_item = $payout_item;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The sender-provided information for the payout item.
|
||||
*
|
||||
* @return \PayPal\Api\PayoutItem
|
||||
*/
|
||||
public function getPayoutItem()
|
||||
{
|
||||
return $this->payout_item;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time when this item was last processed.
|
||||
*
|
||||
* @param string $time_processed
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTimeProcessed($time_processed)
|
||||
{
|
||||
$this->time_processed = $time_processed;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The date and time when this item was last processed.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTimeProcessed()
|
||||
{
|
||||
return $this->time_processed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Errors
|
||||
*
|
||||
* @param \PayPal\Api\Error $errors
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setErrors($errors)
|
||||
{
|
||||
$this->errors = $errors;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Errors
|
||||
*
|
||||
* @return \PayPal\Api\Error
|
||||
*/
|
||||
public function getErrors()
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Links
|
||||
*
|
||||
* @param \PayPal\Api\Links[] $links
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLinks($links)
|
||||
{
|
||||
$this->links = $links;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Links
|
||||
*
|
||||
* @return \PayPal\Api\Links[]
|
||||
*/
|
||||
public function getLinks()
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Links to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function addLink($links)
|
||||
{
|
||||
if (!$this->getLinks()) {
|
||||
return $this->setLinks(array($links));
|
||||
} else {
|
||||
return $this->setLinks(
|
||||
array_merge($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Links from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Links $links
|
||||
* @return $this
|
||||
*/
|
||||
public function removeLink($links)
|
||||
{
|
||||
return $this->setLinks(
|
||||
array_diff($this->getLinks(), array($links))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
107
paypal/PayPal/Api/PayoutSenderBatchHeader.php
Normal file
107
paypal/PayPal/Api/PayoutSenderBatchHeader.php
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class PayoutSenderBatchHeader
|
||||
*
|
||||
* The sender-provided batch header for a batch payout request.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string sender_batch_id
|
||||
* @property string email_subject
|
||||
* @property string recipient_type
|
||||
* @property string batch_status
|
||||
*/
|
||||
class PayoutSenderBatchHeader extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* A sender-specified ID number. Tracks the batch payout in an accounting system.<blockquote><strong>Note:</strong> PayPal prevents duplicate batches from being processed. If you specify a `sender_batch_id` that was used in the last 30 days, the API rejects the request and returns an error message that indicates the duplicate `sender_batch_id` and includes a HATEOAS link to the original batch payout with the same `sender_batch_id`. If you receive a HTTP `5nn` status code, you can safely retry the request with the same `sender_batch_id`. In any case, the API completes a payment only once for a specific `sender_batch_id` that is used within 30 days.</blockquote>
|
||||
*
|
||||
* @param string $sender_batch_id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSenderBatchId($sender_batch_id)
|
||||
{
|
||||
$this->sender_batch_id = $sender_batch_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A sender-specified ID number. Tracks the batch payout in an accounting system.<blockquote><strong>Note:</strong> PayPal prevents duplicate batches from being processed. If you specify a `sender_batch_id` that was used in the last 30 days, the API rejects the request and returns an error message that indicates the duplicate `sender_batch_id` and includes a HATEOAS link to the original batch payout with the same `sender_batch_id`. If you receive a HTTP `5nn` status code, you can safely retry the request with the same `sender_batch_id`. In any case, the API completes a payment only once for a specific `sender_batch_id` that is used within 30 days.</blockquote>
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSenderBatchId()
|
||||
{
|
||||
return $this->sender_batch_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The subject line text for the email that PayPal sends when a payout item completes. The subject line is the same for all recipients. Value is an alphanumeric string with a maximum length of 255 single-byte characters.
|
||||
*
|
||||
* @param string $email_subject
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEmailSubject($email_subject)
|
||||
{
|
||||
$this->email_subject = $email_subject;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The subject line text for the email that PayPal sends when a payout item completes. The subject line is the same for all recipients. Value is an alphanumeric string with a maximum length of 255 single-byte characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmailSubject()
|
||||
{
|
||||
return $this->email_subject;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of ID that identifies the payment receiver. Value is:<ul><code>EMAIL</code>. Unencrypted email. Value is a string of up to 127 single-byte characters.</li><li><code>PHONE</code>. Unencrypted phone number.<blockquote><strong>Note:</strong> The PayPal sandbox does not support the <code>PHONE</code> recipient type.</blockquote></li><li><code>PAYPAL_ID</code>. Encrypted PayPal account number.</li></ul>If the <code>sender_batch_header</code> includes the <code>recipient_type</code> attribute, any payout item without its own <code>recipient_type</code> attribute uses the <code>recipient_type</code> value from <code>sender_batch_header</code>. If the <code>sender_batch_header</code> omits the <code>recipient_type</code> attribute, each payout item must include its own <code>recipient_type</code> value.
|
||||
*
|
||||
* @param string $recipient_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRecipientType($recipient_type)
|
||||
{
|
||||
$this->recipient_type = $recipient_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of ID that identifies the payment receiver. Value is:<ul><code>EMAIL</code>. Unencrypted email. Value is a string of up to 127 single-byte characters.</li><li><code>PHONE</code>. Unencrypted phone number.<blockquote><strong>Note:</strong> The PayPal sandbox does not support the <code>PHONE</code> recipient type.</blockquote></li><li><code>PAYPAL_ID</code>. Encrypted PayPal account number.</li></ul>If the <code>sender_batch_header</code> includes the <code>recipient_type</code> attribute, any payout item without its own <code>recipient_type</code> attribute uses the <code>recipient_type</code> value from <code>sender_batch_header</code>. If the <code>sender_batch_header</code> omits the <code>recipient_type</code> attribute, each payout item must include its own <code>recipient_type</code> value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRecipientType()
|
||||
{
|
||||
return $this->recipient_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This property is unused
|
||||
*/
|
||||
public function setBatchStatus($batch_status)
|
||||
{
|
||||
$this->batch_status = $batch_status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This property is unused
|
||||
*/
|
||||
public function getBatchStatus()
|
||||
{
|
||||
return $this->batch_status;
|
||||
}
|
||||
|
||||
}
|
||||
89
paypal/PayPal/Api/Phone.php
Normal file
89
paypal/PayPal/Api/Phone.php
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class Phone
|
||||
*
|
||||
* Information related to the Payee.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string country_code
|
||||
* @property string national_number
|
||||
* @property string extension
|
||||
*/
|
||||
class Phone extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Country code (from in E.164 format)
|
||||
*
|
||||
* @param string $country_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCountryCode($country_code)
|
||||
{
|
||||
$this->country_code = $country_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Country code (from in E.164 format)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCountryCode()
|
||||
{
|
||||
return $this->country_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* In-country phone number (from in E.164 format)
|
||||
*
|
||||
* @param string $national_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNationalNumber($national_number)
|
||||
{
|
||||
$this->national_number = $national_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* In-country phone number (from in E.164 format)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNationalNumber()
|
||||
{
|
||||
return $this->national_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone extension
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExtension($extension)
|
||||
{
|
||||
$this->extension = $extension;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone extension
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExtension()
|
||||
{
|
||||
return $this->extension;
|
||||
}
|
||||
|
||||
}
|
||||
445
paypal/PayPal/Api/Plan.php
Normal file
445
paypal/PayPal/Api/Plan.php
Normal file
|
|
@ -0,0 +1,445 @@
|
|||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Transport\PayPalRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
|
||||
/**
|
||||
* Class Plan
|
||||
*
|
||||
* Billing plan resource that will be used to create a billing agreement.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string name
|
||||
* @property string description
|
||||
* @property string type
|
||||
* @property string state
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\PaymentDefinition[] payment_definitions
|
||||
* @property \PayPal\Api\Terms[] terms
|
||||
* @property \PayPal\Api\MerchantPreferences merchant_preferences
|
||||
*/
|
||||
class Plan extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* Identifier of the billing plan. 128 characters max.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the billing plan. 128 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the billing plan. 128 characters max.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the billing plan. 128 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the billing plan. 128 characters max.
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of the billing plan. 128 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the billing plan. Allowed values: `FIXED`, `INFINITE`.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the billing plan. Allowed values: `FIXED`, `INFINITE`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status of the billing plan. Allowed values: `CREATED`, `ACTIVE`, `INACTIVE`, and `DELETED`.
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setState($state)
|
||||
{
|
||||
$this->state = $state;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status of the billing plan. Allowed values: `CREATED`, `ACTIVE`, `INACTIVE`, and `DELETED`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time when the billing plan was created. Format YYYY-MM-DDTimeTimezone, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreateTime($create_time)
|
||||
{
|
||||
$this->create_time = $create_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time when the billing plan was created. Format YYYY-MM-DDTimeTimezone, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreateTime()
|
||||
{
|
||||
return $this->create_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time when this billing plan was updated. Format YYYY-MM-DDTimeTimezone, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUpdateTime($update_time)
|
||||
{
|
||||
$this->update_time = $update_time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Time when this billing plan was updated. Format YYYY-MM-DDTimeTimezone, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdateTime()
|
||||
{
|
||||
return $this->update_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of payment definitions for this billing plan.
|
||||
*
|
||||
* @param \PayPal\Api\PaymentDefinition[] $payment_definitions
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaymentDefinitions($payment_definitions)
|
||||
{
|
||||
$this->payment_definitions = $payment_definitions;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of payment definitions for this billing plan.
|
||||
*
|
||||
* @return \PayPal\Api\PaymentDefinition[]
|
||||
*/
|
||||
public function getPaymentDefinitions()
|
||||
{
|
||||
return $this->payment_definitions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append PaymentDefinitions to the list.
|
||||
*
|
||||
* @param \PayPal\Api\PaymentDefinition $paymentDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function addPaymentDefinition($paymentDefinition)
|
||||
{
|
||||
if (!$this->getPaymentDefinitions()) {
|
||||
return $this->setPaymentDefinitions(array($paymentDefinition));
|
||||
} else {
|
||||
return $this->setPaymentDefinitions(
|
||||
array_merge($this->getPaymentDefinitions(), array($paymentDefinition))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove PaymentDefinitions from the list.
|
||||
*
|
||||
* @param \PayPal\Api\PaymentDefinition $paymentDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function removePaymentDefinition($paymentDefinition)
|
||||
{
|
||||
return $this->setPaymentDefinitions(
|
||||
array_diff($this->getPaymentDefinitions(), array($paymentDefinition))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of terms for this billing plan.
|
||||
*
|
||||
* @param \PayPal\Api\Terms[] $terms
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTerms($terms)
|
||||
{
|
||||
$this->terms = $terms;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of terms for this billing plan.
|
||||
*
|
||||
* @return \PayPal\Api\Terms[]
|
||||
*/
|
||||
public function getTerms()
|
||||
{
|
||||
return $this->terms;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Terms to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Terms $terms
|
||||
* @return $this
|
||||
*/
|
||||
public function addTerm($terms)
|
||||
{
|
||||
if (!$this->getTerms()) {
|
||||
return $this->setTerms(array($terms));
|
||||
} else {
|
||||
return $this->setTerms(
|
||||
array_merge($this->getTerms(), array($terms))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Terms from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Terms $terms
|
||||
* @return $this
|
||||
*/
|
||||
public function removeTerm($terms)
|
||||
{
|
||||
return $this->setTerms(
|
||||
array_diff($this->getTerms(), array($terms))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specific preferences such as: set up fee, max fail attempts, autobill amount, and others that are configured for this billing plan.
|
||||
*
|
||||
* @param \PayPal\Api\MerchantPreferences $merchant_preferences
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMerchantPreferences($merchant_preferences)
|
||||
{
|
||||
$this->merchant_preferences = $merchant_preferences;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specific preferences such as: set up fee, max fail attempts, autobill amount, and others that are configured for this billing plan.
|
||||
*
|
||||
* @return \PayPal\Api\MerchantPreferences
|
||||
*/
|
||||
public function getMerchantPreferences()
|
||||
{
|
||||
return $this->merchant_preferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the details for a particular billing plan by passing the billing plan ID to the request URI.
|
||||
*
|
||||
* @param string $planId
|
||||
* @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 Plan
|
||||
*/
|
||||
public static function get($planId, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($planId, 'planId');
|
||||
$payLoad = "";
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/billing-plans/$planId",
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new Plan();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new billing plan by passing the details for the plan, including the plan name, description, and type, to the request URI.
|
||||
*
|
||||
* @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 Plan
|
||||
*/
|
||||
public function create($apiContext = null, $restCall = null)
|
||||
{
|
||||
$payLoad = $this->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/billing-plans/",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$this->fromJson($json);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace specific fields within a billing plan by passing the ID of the billing plan to the request URI. In addition, pass a patch object in the request JSON that specifies the operation to perform, field to update, and new value for each update.
|
||||
*
|
||||
* @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 bool
|
||||
*/
|
||||
public function update($patchRequest, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($patchRequest, 'patchRequest');
|
||||
$payLoad = $patchRequest->toJSON();
|
||||
self::executeCall(
|
||||
"/v1/payments/billing-plans/{$this->getId()}",
|
||||
"PATCH",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a billing plan by passing the ID of the billing plan to the request URI.
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
public function delete($apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
$patchRequest = new PatchRequest();
|
||||
$patch = new Patch();
|
||||
$value = new PayPalModel('{
|
||||
"state":"DELETED"
|
||||
}');
|
||||
$patch->setOp('replace')
|
||||
->setPath('/')
|
||||
->setValue($value);
|
||||
$patchRequest->addPatch($patch);
|
||||
return $this->update($patchRequest, $apiContext, $restCall);
|
||||
}
|
||||
|
||||
/**
|
||||
* List billing plans according to optional query string parameters specified.
|
||||
*
|
||||
* @param array $params
|
||||
* @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 PlanList
|
||||
*/
|
||||
public static function all($params, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($params, 'params');
|
||||
$payLoad = "";
|
||||
$allowedParams = array(
|
||||
'page_size' => 1,
|
||||
'status' => 1,
|
||||
'page' => 1,
|
||||
'total_required' => 1
|
||||
);
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/billing-plans/" . "?" . http_build_query(array_intersect_key($params, $allowedParams)),
|
||||
"GET",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new PlanList();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user