forked from LiveCarta/PayPal-PHP-SDK
Update payments API to v1.9
This commit is contained in:
committed by
jaypatel512 and sdcoffey
parent
7c5ea8b997
commit
c2947ff409
@@ -10,11 +10,12 @@ namespace PayPal\Api;
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string phone
|
||||
* @property string type
|
||||
*/
|
||||
class Address extends BaseAddress
|
||||
{
|
||||
/**
|
||||
* Phone number in E.123 format.
|
||||
* Phone number in E.123 format. 50 characters max.
|
||||
*
|
||||
* @param string $phone
|
||||
*
|
||||
@@ -27,7 +28,7 @@ class Address extends BaseAddress
|
||||
}
|
||||
|
||||
/**
|
||||
* Phone number in E.123 format.
|
||||
* Phone number in E.123 format. 50 characters max.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -36,4 +37,26 @@ class Address extends BaseAddress
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ use PayPal\Common\PayPalModel;
|
||||
*
|
||||
* @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
|
||||
|
||||
@@ -13,8 +13,8 @@ use PayPal\Validation\NumericValidator;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string currency
|
||||
* @property string total
|
||||
* @property string currency
|
||||
* @property string total
|
||||
* @property \PayPal\Api\Details details
|
||||
*/
|
||||
class Amount extends PayPalModel
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Authorization
|
||||
@@ -13,21 +13,23 @@ use PayPal\Validation\ArgumentValidator;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string payment_mode
|
||||
* @property string state
|
||||
* @property string reason_code
|
||||
* @property string pending_reason
|
||||
* @property string protection_eligibility
|
||||
* @property string protection_eligibility_type
|
||||
* @property string id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string payment_mode
|
||||
* @property string state
|
||||
* @property string reason_code
|
||||
* @property string pending_reason
|
||||
* @property string protection_eligibility
|
||||
* @property string protection_eligibility_type
|
||||
* @property \PayPal\Api\FmfDetails fmf_details
|
||||
* @property string parent_payment
|
||||
* @property string parent_payment
|
||||
* @property \PayPal\Api\ProcessorResponse processor_response
|
||||
* @property string valid_until
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Links[] links
|
||||
* @property string valid_until
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property string reference_id
|
||||
* @property string receipt_id
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class Authorization extends PayPalResourceModel
|
||||
{
|
||||
@@ -360,11 +362,57 @@ class Authorization extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve details about a previously created authorization by passing the authorization_id in the request URI.
|
||||
* Identifier to the purchase or transaction unit corresponding to this authorization transaction.
|
||||
*
|
||||
* @param string $authorizationId
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @param string $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)
|
||||
@@ -385,11 +433,11 @@ class Authorization extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Capture and process a previously created authorization by passing the authorization_id in the request URI. To use this request, the original payment call must have the intent set to authorize.
|
||||
* Captures and processes an authorization, by ID. To use this call, the original payment call must specify an intent of `authorize`.
|
||||
*
|
||||
* @param Capture $capture
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @param Capture $capture
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Capture
|
||||
*/
|
||||
public function capture($capture, $apiContext = null, $restCall = null)
|
||||
@@ -411,10 +459,10 @@ class Authorization extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Void (cancel) a previously authorized payment by passing the authorization_id in the request URI. Note that a fully captured authorization cannot be voided.
|
||||
* Voids, or cancels, an authorization, by ID. You cannot void a fully captured authorization.
|
||||
*
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Authorization
|
||||
*/
|
||||
public function void($apiContext = null, $restCall = null)
|
||||
@@ -434,10 +482,10 @@ class Authorization extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Reauthorize a PayPal account payment by passing the authorization_id in the request URI. You should reauthorize a payment after the initial 3-day honor period to ensure that funds are still available. Request supports only amount field
|
||||
* Reauthorizes a PayPal account payment, by authorization ID. To ensure that funds are still available, reauthorize a payment after the initial three-day honor period. Supports only the `amount` request parameter.
|
||||
*
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Authorization
|
||||
*/
|
||||
public function reauthorize($apiContext = null, $restCall = null)
|
||||
|
||||
@@ -11,35 +11,34 @@ use PayPal\Common\PayPalModel;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string account_number
|
||||
* @property string account_number_type
|
||||
* @property string routing_number
|
||||
* @property string account_type
|
||||
* @property string account_name
|
||||
* @property string check_type
|
||||
* @property string auth_type
|
||||
* @property string auth_capture_timestamp
|
||||
* @property string bank_name
|
||||
* @property string country_code
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* @property string birth_date
|
||||
* @property string account_number
|
||||
* @property string account_number_type
|
||||
* @property string routing_number
|
||||
* @property string account_type
|
||||
* @property string account_name
|
||||
* @property string check_type
|
||||
* @property string auth_type
|
||||
* @property string auth_capture_timestamp
|
||||
* @property string bank_name
|
||||
* @property string country_code
|
||||
* @property string first_name
|
||||
* @property string last_name
|
||||
* @property string birth_date
|
||||
* @property \PayPal\Api\Address billing_address
|
||||
* @property string state
|
||||
* @property string confirmation_status
|
||||
* @property string payer_id
|
||||
* @property string external_customer_id
|
||||
* @property string merchant_id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property string valid_until
|
||||
* @property string state
|
||||
* @property string confirmation_status
|
||||
* @property string payer_id
|
||||
* @property string external_customer_id
|
||||
* @property string merchant_id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property string valid_until
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class BankAccount extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* ID of the bank account being saved for later use.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $id
|
||||
*
|
||||
@@ -53,7 +52,6 @@ class BankAccount extends PayPalModel
|
||||
|
||||
/**
|
||||
* ID of the bank account being saved for later use.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
@@ -483,7 +481,7 @@ class BankAccount extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchnt.
|
||||
* A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant.
|
||||
*
|
||||
* @param string $merchant_id
|
||||
*
|
||||
@@ -496,7 +494,7 @@ class BankAccount extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchnt.
|
||||
* A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,8 @@ use PayPal\Common\PayPalModel;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @deprecated Used internally only.
|
||||
*
|
||||
* @property string billing_agreement_id
|
||||
*/
|
||||
class Billing extends PayPalModel
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Transport\PayPalRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Capture
|
||||
@@ -13,20 +14,22 @@ use PayPal\Validation\ArgumentValidator;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property bool is_final_capture
|
||||
* @property string state
|
||||
* @property string parent_payment
|
||||
* @property string id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property bool is_final_capture
|
||||
* @property string state
|
||||
* @property string reason_code
|
||||
* @property string parent_payment
|
||||
* @property string invoice_number
|
||||
* @property \PayPal\Api\Currency transaction_fee
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Links[] links
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class Capture extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* ID of the capture transaction.
|
||||
* The ID of the capture transaction.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
@@ -39,7 +42,7 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the capture transaction.
|
||||
* The ID of the capture transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -49,7 +52,7 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being captured. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`.
|
||||
* The amount to capture. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`.
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
@@ -62,7 +65,7 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Amount being captured. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`.
|
||||
* The amount to capture. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`.
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
@@ -72,7 +75,7 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* If set to `true`, all remaining funds held by the authorization will be released in the funding instrument.
|
||||
* Indicates whether to release all remaining funds that the authorization holds in the funding instrument. Default is `false`.
|
||||
*
|
||||
* @param bool $is_final_capture
|
||||
*
|
||||
@@ -85,7 +88,7 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* If set to `true`, all remaining funds held by the authorization will be released in the funding instrument.
|
||||
* Indicates whether to release all remaining funds that the authorization holds in the funding instrument. Default is `false`.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
@@ -95,7 +98,7 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the capture.
|
||||
* The state of the capture.
|
||||
* Valid Values: ["pending", "completed", "refunded", "partially_refunded"]
|
||||
*
|
||||
* @param string $state
|
||||
@@ -109,7 +112,7 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the capture.
|
||||
* The state of the capture.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -119,7 +122,31 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the payment resource on which this transaction is based.
|
||||
* The reason code that describes why the transaction state is pending or reversed.
|
||||
* Valid Values: ["CHARGEBACK", "GUARANTEE", "BUYER_COMPLAINT", "REFUND", "UNCONFIRMED_SHIPPING_ADDRESS", "ECHECK", "INTERNATIONAL_WITHDRAWAL", "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION", "PAYMENT_REVIEW", "REGULATORY_REVIEW", "UNILATERAL", "VERIFICATION_REQUIRED", "TRANSACTION_APPROVED_AWAITING_FUNDING"]
|
||||
*
|
||||
* @param string $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
|
||||
*
|
||||
@@ -132,7 +159,7 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the payment resource on which this transaction is based.
|
||||
* The ID of the payment on which this transaction is based.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -142,7 +169,30 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Transaction fee applicable for this 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
|
||||
*
|
||||
@@ -155,7 +205,7 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Transaction fee applicable for this payment.
|
||||
* The transaction fee for this payment.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
@@ -165,7 +215,7 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Time of capture as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
* The date and time of capture, as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @param string $create_time
|
||||
*
|
||||
@@ -178,7 +228,7 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Time of capture as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
* The date and time of capture, as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -188,7 +238,7 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Time that the resource was last updated.
|
||||
* The date and time when the resource was last updated.
|
||||
*
|
||||
* @param string $update_time
|
||||
*
|
||||
@@ -201,7 +251,7 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Time that the resource was last updated.
|
||||
* The date and time when the resource was last updated.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -211,11 +261,11 @@ class Capture extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve details about a captured payment by passing the capture_id in the request URI.
|
||||
* Shows details for a captured payment, by ID.
|
||||
*
|
||||
* @param string $captureId
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @param string $captureId
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Capture
|
||||
*/
|
||||
public static function get($captureId, $apiContext = null, $restCall = null)
|
||||
@@ -238,6 +288,7 @@ class Capture extends PayPalResourceModel
|
||||
/**
|
||||
* Refund a captured payment by passing the capture_id in the request URI. In addition, include an amount object in the body of the request JSON.
|
||||
*
|
||||
* @deprecated Please use #refundCapturedPayment instead.
|
||||
* @param Refund $refund
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
@@ -261,4 +312,30 @@ class Capture extends PayPalResourceModel
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ use PayPal\Common\PayPalModel;
|
||||
/**
|
||||
* Class CarrierAccount
|
||||
*
|
||||
* Payment Instrument that facilitates carrier billing
|
||||
* Payment instrument that enables carrier billing.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
@@ -20,7 +20,7 @@ use PayPal\Common\PayPalModel;
|
||||
class CarrierAccount extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* ID that identifies the payer<65>s carrier account. Can be used in subsequent REST API calls, e.g. for making payments.
|
||||
* The ID of the carrier account of the payer. Use in subsequent REST API calls. For example, to make payments.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
@@ -33,7 +33,7 @@ class CarrierAccount extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* ID that identifies the payer<65>s carrier account. Can be used in subsequent REST API calls, e.g. for making payments.
|
||||
* The ID of the carrier account of the payer. Use in subsequent REST API calls. For example, to make payments.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -43,7 +43,7 @@ class CarrierAccount extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* The payer<EFBFBD>s phone number in E.164 format.
|
||||
* The phone number of the payer, in E.164 format.
|
||||
*
|
||||
* @param string $phone_number
|
||||
*
|
||||
@@ -56,7 +56,7 @@ class CarrierAccount extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* The payer<EFBFBD>s phone number in E.164 format.
|
||||
* The phone number of the payer, in E.164 format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -66,7 +66,7 @@ class CarrierAccount extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* User identifier as created by the merchant.
|
||||
* The ID of the customer, as created by the merchant.
|
||||
*
|
||||
* @param string $external_customer_id
|
||||
*
|
||||
@@ -79,7 +79,7 @@ class CarrierAccount extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* User identifier as created by the merchant.
|
||||
* The ID of the customer, as created by the merchant.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -89,7 +89,7 @@ class CarrierAccount extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* The method of obtaining the phone number (USER_PROVIDED or READ_FROM_DEVICE).
|
||||
* The method used to obtain the phone number. Value is `READ_FROM_DEVICE` or `USER_PROVIDED`.
|
||||
* Valid Values: ["READ_FROM_DEVICE", "USER_PROVIDED"]
|
||||
*
|
||||
* @param string $phone_source
|
||||
@@ -103,7 +103,7 @@ class CarrierAccount extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* The method of obtaining the phone number (USER_PROVIDED or READ_FROM_DEVICE).
|
||||
* The method used to obtain the phone number. Value is `READ_FROM_DEVICE` or `USER_PROVIDED`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -113,7 +113,7 @@ class CarrierAccount extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* The country where the phone number is registered. Specified in 2-character IS0-3166-1 format.
|
||||
* The ISO 3166-1 alpha-2 country code where the phone number is registered.
|
||||
*
|
||||
* @param \PayPal\Api\CountryCode $country_code
|
||||
*
|
||||
@@ -126,7 +126,7 @@ class CarrierAccount extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* The country where the phone number is registered. Specified in 2-character IS0-3166-1 format.
|
||||
* The ISO 3166-1 alpha-2 country code where the phone number is registered.
|
||||
*
|
||||
* @return \PayPal\Api\CountryCode
|
||||
*/
|
||||
|
||||
@@ -12,17 +12,18 @@ use PayPal\Validation\UrlValidator;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string reference_id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string description
|
||||
* @property string note_to_payee
|
||||
* @property string custom
|
||||
* @property string invoice_number
|
||||
* @property string soft_descriptor
|
||||
* @property string reference_id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property \PayPal\Api\Payee payee
|
||||
* @property string description
|
||||
* @property string note_to_payee
|
||||
* @property string custom
|
||||
* @property string invoice_number
|
||||
* @property string soft_descriptor
|
||||
* @property \PayPal\Api\PaymentOptions payment_options
|
||||
* @property \PayPal\Api\ItemList item_list
|
||||
* @property string notify_url
|
||||
* @property string order_url
|
||||
* @property \PayPal\Api\ItemList item_list
|
||||
* @property string notify_url
|
||||
* @property string order_url
|
||||
*/
|
||||
class CartBase extends PayPalModel
|
||||
{
|
||||
@@ -75,7 +76,6 @@ class CartBase extends PayPalModel
|
||||
/**
|
||||
* Recipient of the funds in this transaction.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Payee $payee
|
||||
*
|
||||
* @return $this
|
||||
@@ -89,7 +89,6 @@ class CartBase extends PayPalModel
|
||||
/**
|
||||
* Recipient of the funds in this transaction.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Payee
|
||||
*/
|
||||
public function getPayee()
|
||||
@@ -98,7 +97,7 @@ class CartBase extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of transaction.
|
||||
* Description of what is being paid for.
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
@@ -111,7 +110,7 @@ class CartBase extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of transaction.
|
||||
* Description of what is being paid for.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -144,7 +143,7 @@ class CartBase extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Free-form field for the use of clients. Only supported when the `payment_method` is set to `paypal`.
|
||||
* free-form field for the use of clients
|
||||
*
|
||||
* @param string $custom
|
||||
*
|
||||
@@ -157,7 +156,7 @@ class CartBase extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Free-form field for the use of clients. Only supported when the `payment_method` is set to `paypal`.
|
||||
* free-form field for the use of clients
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -167,7 +166,7 @@ class CartBase extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoice number used to track the payment. Only supported when the `payment_method` is set to `paypal`.
|
||||
* invoice number to track this payment
|
||||
*
|
||||
* @param string $invoice_number
|
||||
*
|
||||
@@ -180,7 +179,7 @@ class CartBase extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoice number used to track the payment. Only supported when the `payment_method` is set to `paypal`.
|
||||
* invoice number to track this payment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -214,7 +213,6 @@ class CartBase extends PayPalModel
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
@@ -228,7 +226,6 @@ class CartBase extends PayPalModel
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@@ -261,7 +258,7 @@ class CartBase extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Items and related shipping address within a transaction.
|
||||
* List of items being paid for.
|
||||
*
|
||||
* @param \PayPal\Api\ItemList $item_list
|
||||
*
|
||||
@@ -274,7 +271,7 @@ class CartBase extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Items and related shipping address within a transaction.
|
||||
* List of items being paid for.
|
||||
*
|
||||
* @return \PayPal\Api\ItemList
|
||||
*/
|
||||
@@ -333,7 +330,6 @@ class CartBase extends PayPalModel
|
||||
|
||||
/**
|
||||
* List of external funding being applied to the purchase unit. Each external_funding unit should have a unique reference_id
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\ExternalFunding[] $external_funding
|
||||
*
|
||||
@@ -347,7 +343,6 @@ class CartBase extends PayPalModel
|
||||
|
||||
/**
|
||||
* List of external funding being applied to the purchase unit. Each external_funding unit should have a unique reference_id
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\ExternalFunding[]
|
||||
*/
|
||||
@@ -358,7 +353,6 @@ class CartBase extends PayPalModel
|
||||
|
||||
/**
|
||||
* Append ExternalFunding to the list.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\ExternalFunding $externalFunding
|
||||
* @return $this
|
||||
@@ -376,7 +370,6 @@ class CartBase extends PayPalModel
|
||||
|
||||
/**
|
||||
* Remove ExternalFunding from the list.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\ExternalFunding $externalFunding
|
||||
* @return $this
|
||||
|
||||
@@ -7,7 +7,7 @@ use PayPal\Common\PayPalModel;
|
||||
/**
|
||||
* Class CountryCode
|
||||
*
|
||||
* Representation of a country code.
|
||||
* The ISO 3166-1 alpha-2 country code. A complete list of valid codes is available at Wikipedia: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 In particular, note that the country code for Great Britain is GB, not UK as used in that country's top-level domain names.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
|
||||
@@ -331,7 +331,7 @@ class CreditCard extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the funding instrument.
|
||||
* State of the credit card funding instrument.
|
||||
* Valid Values: ["expired", "ok"]
|
||||
*
|
||||
* @param string $state
|
||||
|
||||
@@ -15,8 +15,8 @@ use PayPal\Common\PayPalModel;
|
||||
* @property string payer_id
|
||||
* @property string last4
|
||||
* @property string type
|
||||
* @property int expire_month
|
||||
* @property int expire_year
|
||||
* @property int expire_month
|
||||
* @property int expire_year
|
||||
*/
|
||||
class CreditCardToken extends PayPalModel
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ use PayPal\Validation\NumericValidator;
|
||||
class Currency extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* 3 letter currency code
|
||||
* 3 letter currency code as defined by ISO 4217.
|
||||
*
|
||||
* @param string $currency
|
||||
*
|
||||
@@ -32,7 +32,7 @@ class Currency extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 3 letter currency code
|
||||
* 3 letter currency code as defined by ISO 4217.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ class Currency extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* amount upto 2 decimals represented as string
|
||||
* amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code.
|
||||
*
|
||||
* @param string|double $value
|
||||
*
|
||||
@@ -57,7 +57,7 @@ class Currency extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* amount upto 2 decimals represented as string
|
||||
* amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
||||
@@ -12,13 +12,13 @@ use PayPal\Validation\UrlValidator;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string conversion_date
|
||||
* @property string from_currency
|
||||
* @property string from_amount
|
||||
* @property string to_currency
|
||||
* @property string to_amount
|
||||
* @property string conversion_type
|
||||
* @property bool conversion_type_changeable
|
||||
* @property string conversion_date
|
||||
* @property string from_currency
|
||||
* @property string from_amount
|
||||
* @property string to_currency
|
||||
* @property string to_amount
|
||||
* @property string conversion_type
|
||||
* @property bool conversion_type_changeable
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class CurrencyConversion extends PayPalModel
|
||||
@@ -188,7 +188,6 @@ class CurrencyConversion extends PayPalModel
|
||||
/**
|
||||
* Base URL to web applications endpoint
|
||||
* Valid Values: ["https://www.paypal.com/{country_code}/webapps/xocspartaweb/webflow/sparta/proxwebflow", "https://www.paypal.com/{country_code}/proxflow"]
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $web_url
|
||||
* @throws \InvalidArgumentException
|
||||
@@ -203,7 +202,6 @@ class CurrencyConversion extends PayPalModel
|
||||
|
||||
/**
|
||||
* Base URL to web applications endpoint
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
|
||||
160
lib/PayPal/Api/DetailedRefund.php
Normal file
160
lib/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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -64,7 +64,6 @@ class ErrorDetails extends PayPalModel
|
||||
|
||||
/**
|
||||
* Reference ID of the purchase_unit associated with this error
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $purchase_unit_reference_id
|
||||
*
|
||||
@@ -78,7 +77,6 @@ class ErrorDetails extends PayPalModel
|
||||
|
||||
/**
|
||||
* Reference ID of the purchase_unit associated with this error
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
@@ -89,7 +87,6 @@ class ErrorDetails extends PayPalModel
|
||||
|
||||
/**
|
||||
* PayPal internal error code.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $code
|
||||
*
|
||||
@@ -103,7 +100,6 @@ class ErrorDetails extends PayPalModel
|
||||
|
||||
/**
|
||||
* PayPal internal error code.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,6 @@ 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
|
||||
*
|
||||
@@ -28,7 +27,6 @@ class ExtendedBankAccount extends BankAccount
|
||||
|
||||
/**
|
||||
* Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA).
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,7 @@ use PayPal\Common\PayPalModel;
|
||||
* @property string funding_account_id
|
||||
* @property string display_text
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string funding_instruction
|
||||
*/
|
||||
class ExternalFunding extends PayPalModel
|
||||
{
|
||||
@@ -134,4 +135,27 @@ class ExternalFunding extends PayPalModel
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ class FundingDetail extends PayPalModel
|
||||
|
||||
/**
|
||||
* Processing type of the payment card
|
||||
* Valid Values: ["PINLESS_DEBIT"]
|
||||
* Valid Values: ["CUP_SECURE", "PINLESS_DEBIT"]
|
||||
*
|
||||
* @param string $processing_type
|
||||
*
|
||||
|
||||
@@ -11,9 +11,9 @@ use PayPal\Common\PayPalModel;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\CreditCard credit_card
|
||||
* @property \PayPal\Api\CreditCard credit_card
|
||||
* @property \PayPal\Api\CreditCardToken credit_card_token
|
||||
* @property \PayPal\Api\Billing billing
|
||||
* @property \PayPal\Api\Billing billing
|
||||
*/
|
||||
class FundingInstrument extends PayPalModel
|
||||
{
|
||||
@@ -34,7 +34,6 @@ class FundingInstrument extends PayPalModel
|
||||
* Credit Card instrument.
|
||||
*
|
||||
* @return \PayPal\Api\CreditCard
|
||||
*
|
||||
*/
|
||||
public function getCreditCard()
|
||||
{
|
||||
@@ -89,7 +88,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* Bank Account information.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\ExtendedBankAccount $bank_account
|
||||
*
|
||||
@@ -103,7 +101,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* Bank Account information.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\ExtendedBankAccount
|
||||
*/
|
||||
@@ -114,7 +111,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* Vaulted bank account instrument.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\BankToken $bank_account_token
|
||||
*
|
||||
@@ -128,7 +124,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* Vaulted bank account instrument.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\BankToken
|
||||
*/
|
||||
@@ -139,7 +134,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* PayPal credit funding instrument.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Credit $credit
|
||||
*
|
||||
@@ -153,7 +147,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* PayPal credit funding instrument.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Credit
|
||||
*/
|
||||
@@ -164,7 +157,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* Incentive funding instrument.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Incentive $incentive
|
||||
*
|
||||
@@ -178,7 +170,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* Incentive funding instrument.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Incentive
|
||||
*/
|
||||
@@ -189,7 +180,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* External funding instrument.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\ExternalFunding $external_funding
|
||||
*
|
||||
@@ -203,7 +193,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* External funding instrument.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\ExternalFunding
|
||||
*/
|
||||
@@ -214,7 +203,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* Carrier account token instrument.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\CarrierAccountToken $carrier_account_token
|
||||
*
|
||||
@@ -228,7 +216,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* Carrier account token instrument.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\CarrierAccountToken
|
||||
*/
|
||||
@@ -239,7 +226,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* Carrier account instrument
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\CarrierAccount $carrier_account
|
||||
*
|
||||
@@ -253,7 +239,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* Carrier account instrument
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\CarrierAccount
|
||||
*/
|
||||
@@ -264,7 +249,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* Private Label Card funding instrument. These are store cards provided by merchants to drive business with value to customer with convenience and rewards.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\PrivateLabelCard $private_label_card
|
||||
*
|
||||
@@ -278,7 +262,6 @@ class FundingInstrument extends PayPalModel
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
@@ -11,22 +11,21 @@ use PayPal\Common\PayPalModel;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string funding_mode
|
||||
* @property string funding_instrument_type
|
||||
* @property string soft_descriptor
|
||||
* @property \PayPal\Api\Currency amount
|
||||
* @property \PayPal\Api\Currency negative_balance_amount
|
||||
* @property string legal_text
|
||||
* @property \PayPal\Api\FundingDetail funding_detail
|
||||
* @property string additional_text
|
||||
* @property \PayPal\Api\FundingInstrument extends
|
||||
* @property \PayPal\Api\Links[] links
|
||||
* @property string funding_mode
|
||||
* @property string funding_instrument_type
|
||||
* @property string soft_descriptor
|
||||
* @property \PayPal\Api\Currency amount
|
||||
* @property \PayPal\Api\Currency negative_balance_amount
|
||||
* @property string legal_text
|
||||
* @property \PayPal\Api\FundingDetail funding_detail
|
||||
* @property string additional_text
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class FundingSource extends PayPalModel
|
||||
class FundingSource extends FundingInstrument
|
||||
{
|
||||
/**
|
||||
* specifies funding mode of the instrument
|
||||
* Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
|
||||
* Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK", "PAY_UPON_INVOICE"]
|
||||
*
|
||||
* @param string $funding_mode
|
||||
*
|
||||
@@ -50,7 +49,7 @@ class FundingSource extends PayPalModel
|
||||
|
||||
/**
|
||||
* Instrument type for this funding source
|
||||
* Valid Values: ["BALANCE", "PAYMENT_CARD", "BANK_ACCOUNT", "CREDIT", "INCENTIVE"]
|
||||
* Valid Values: ["BALANCE", "PAYMENT_CARD", "BANK_ACCOUNT", "CREDIT", "INCENTIVE", "EXTERNAL_FUNDING", "TAB"]
|
||||
*
|
||||
* @param string $funding_instrument_type
|
||||
*
|
||||
@@ -119,26 +118,26 @@ class FundingSource extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional amount to be pulled from the instrument to recover a negative balance on the buyer
|
||||
* Additional amount to be pulled from the instrument to recover a negative balance on the buyer's account that is owed to PayPal.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $amount
|
||||
* @param \PayPal\Api\Currency $negative_balance_amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNegativeBalanceAmount($amount)
|
||||
public function setNegativeBalanceAmount($negative_balance_amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
$this->negative_balance_amount = $negative_balance_amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional amount to be pulled from the instrument to recover a negative balance on the buyer
|
||||
* Additional amount to be pulled from the instrument to recover a negative balance on the buyer's account that is owed to PayPal.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
public function getNegativeBalanceAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
return $this->negative_balance_amount;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -215,6 +214,8 @@ class FundingSource extends PayPalModel
|
||||
*
|
||||
* @param \PayPal\Api\FundingInstrument $extends
|
||||
*
|
||||
* @deprecated Unused
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExtends($extends)
|
||||
@@ -226,6 +227,8 @@ class FundingSource extends PayPalModel
|
||||
/**
|
||||
* Gets Extends
|
||||
*
|
||||
* @deprecated Unused
|
||||
*
|
||||
* @return \PayPal\Api\FundingInstrument
|
||||
*/
|
||||
public function getExtends()
|
||||
|
||||
@@ -12,15 +12,15 @@ use PayPal\Validation\UrlValidator;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string code
|
||||
* @property string name
|
||||
* @property string description
|
||||
* @property string id
|
||||
* @property string code
|
||||
* @property string name
|
||||
* @property string description
|
||||
* @property \PayPal\Api\Currency minimum_purchase_amount
|
||||
* @property string logo_image_url
|
||||
* @property string expiry_date
|
||||
* @property string type
|
||||
* @property string terms
|
||||
* @property string logo_image_url
|
||||
* @property string expiry_date
|
||||
* @property string type
|
||||
* @property string terms
|
||||
*/
|
||||
class Incentive extends PayPalModel
|
||||
{
|
||||
|
||||
@@ -11,9 +11,9 @@ use PayPal\Common\PayPalModel;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property int term
|
||||
* @property \PayPal\Api\Currency monthly_payment
|
||||
* @property \PayPal\Api\Currency discount_amount
|
||||
* @property int term
|
||||
* @property \PayPal\Api\Currency monthly_payment
|
||||
* @property \PayPal\Api\Currency discount_amount
|
||||
* @property string discount_percentage
|
||||
*/
|
||||
class InstallmentOption extends PayPalModel
|
||||
|
||||
@@ -22,7 +22,6 @@ use PayPal\Validation\UrlValidator;
|
||||
* @property string currency
|
||||
* @property string tax
|
||||
* @property string url
|
||||
* @property string category
|
||||
*/
|
||||
class Item extends PayPalModel
|
||||
{
|
||||
@@ -218,7 +217,7 @@ class Item extends PayPalModel
|
||||
/**
|
||||
* Category type of the item.
|
||||
* Valid Values: ["DIGITAL", "PHYSICAL"]
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $category
|
||||
*
|
||||
* @return $this
|
||||
@@ -231,7 +230,7 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Category type of the item.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getCategory()
|
||||
@@ -241,7 +240,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Weight of the item.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Measurement $weight
|
||||
*
|
||||
@@ -255,7 +253,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Weight of the item.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Measurement
|
||||
*/
|
||||
@@ -266,7 +263,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Length of the item.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Measurement $length
|
||||
*
|
||||
@@ -280,7 +276,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Length of the item.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Measurement
|
||||
*/
|
||||
@@ -291,7 +286,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Height of the item.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Measurement $height
|
||||
*
|
||||
@@ -305,7 +299,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Height of the item.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Measurement
|
||||
*/
|
||||
@@ -316,7 +309,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Width of the item.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Measurement $width
|
||||
*
|
||||
@@ -330,7 +322,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Width of the item.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Measurement
|
||||
*/
|
||||
@@ -341,7 +332,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal risk determination.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\NameValuePair[] $supplementary_data
|
||||
*
|
||||
@@ -355,7 +345,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal risk determination.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\NameValuePair[]
|
||||
*/
|
||||
@@ -366,7 +355,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Append SupplementaryData to the list.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\NameValuePair $nameValuePair
|
||||
* @return $this
|
||||
@@ -384,7 +372,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Remove SupplementaryData from the list.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\NameValuePair $nameValuePair
|
||||
* @return $this
|
||||
@@ -398,7 +385,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal post-transaction notifications.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\NameValuePair[] $postback_data
|
||||
*
|
||||
@@ -412,7 +398,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Set of optional data used for PayPal post-transaction notifications.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\NameValuePair[]
|
||||
*/
|
||||
@@ -423,7 +408,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Append PostbackData to the list.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\NameValuePair $nameValuePair
|
||||
* @return $this
|
||||
@@ -441,7 +425,6 @@ class Item extends PayPalModel
|
||||
|
||||
/**
|
||||
* Remove PostbackData from the list.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\NameValuePair $nameValuePair
|
||||
* @return $this
|
||||
|
||||
@@ -7,14 +7,14 @@ use PayPal\Common\PayPalModel;
|
||||
/**
|
||||
* Class ItemList
|
||||
*
|
||||
* Items and related shipping address within a transaction.
|
||||
* List of items being paid for.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Item[] items
|
||||
* @property \PayPal\Api\Item[] items
|
||||
* @property \PayPal\Api\ShippingAddress shipping_address
|
||||
* @property string shipping_method
|
||||
* @property string shipping_phone_number
|
||||
* @property string shipping_method
|
||||
* @property string shipping_phone_number
|
||||
*/
|
||||
class ItemList extends PayPalModel
|
||||
{
|
||||
@@ -72,7 +72,7 @@ class ItemList extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping address, if different than the payer address.
|
||||
* Shipping address.
|
||||
*
|
||||
* @param \PayPal\Api\ShippingAddress $shipping_address
|
||||
*
|
||||
@@ -85,7 +85,7 @@ class ItemList extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping address, if different than the payer address.
|
||||
* Shipping address.
|
||||
*
|
||||
* @return \PayPal\Api\ShippingAddress
|
||||
*/
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Order
|
||||
@@ -13,20 +13,20 @@ use PayPal\Validation\ArgumentValidator;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string purchase_unit_reference_id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string payment_mode
|
||||
* @property string state
|
||||
* @property string reason_code
|
||||
* @property string pending_reason
|
||||
* @property string protection_eligibility
|
||||
* @property string protection_eligibility_type
|
||||
* @property string parent_payment
|
||||
* @property string id
|
||||
* @property string reference_id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string payment_mode
|
||||
* @property string state
|
||||
* @property string reason_code
|
||||
* @property string pending_reason
|
||||
* @property string protection_eligibility
|
||||
* @property string protection_eligibility_type
|
||||
* @property string parent_payment
|
||||
* @property \PayPal\Api\FmfDetails fmf_details
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Links[] links
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class Order extends PayPalResourceModel
|
||||
{
|
||||
@@ -56,6 +56,8 @@ class Order extends PayPalResourceModel
|
||||
/**
|
||||
* Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
|
||||
*
|
||||
* @deprecated Use #setReferenceId instead
|
||||
*
|
||||
* @param string $purchase_unit_reference_id
|
||||
*
|
||||
* @return $this
|
||||
@@ -68,6 +70,7 @@ class Order extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
|
||||
* @deprecated Use #getReferenceId instead
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -76,6 +79,29 @@ class Order extends PayPalResourceModel
|
||||
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.
|
||||
*
|
||||
@@ -125,7 +151,7 @@ class Order extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* State of the order transaction.
|
||||
* Valid Values: ["pending", "completed", "refunded", "partially_refunded", "voided"]
|
||||
* Valid Values: ["pending", "completed", "voided", "authorized", "captured"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
@@ -148,7 +174,7 @@ class Order extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed. Only supported when the `payment_method` is set to `paypal`.
|
||||
* Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually. Only supported when the `payment_method` is set to `paypal`.
|
||||
* Valid Values: ["PAYER_SHIPPING_UNCONFIRMED", "MULTI_CURRENCY", "RISK_REVIEW", "REGULATORY_REVIEW", "VERIFICATION_REQUIRED", "ORDER", "OTHER"]
|
||||
*
|
||||
* @param string $reason_code
|
||||
@@ -162,7 +188,7 @@ class Order extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed. Only supported when the `payment_method` is set to `paypal`.
|
||||
* Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -172,7 +198,7 @@ class Order extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* [DEPRECATED] Reason the transaction is in pending state. Use reason_code field above instead.
|
||||
* [DEPRECATED] Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead.
|
||||
* Valid Values: ["payer_shipping_unconfirmed", "multi_currency", "risk_review", "regulatory_review", "verification_required", "order", "other"]
|
||||
*
|
||||
* @param string $pending_reason
|
||||
@@ -186,7 +212,7 @@ class Order extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated [DEPRECATED] Reason the transaction is in pending state. Use reason_code field above instead.
|
||||
* @deprecated [DEPRECATED] Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -336,11 +362,11 @@ class Order extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve details about an order by passing the order_id in the request URI.
|
||||
* Shows details for an order, by ID.
|
||||
*
|
||||
* @param string $orderId
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @param string $orderId
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Order
|
||||
*/
|
||||
public static function get($orderId, $apiContext = null, $restCall = null)
|
||||
@@ -361,11 +387,11 @@ class Order extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Capture a payment. In addition, include the amount of the payment and indicate whether this is a final capture for the given authorization in the body of the request JSON.
|
||||
* Captures a payment for an order, by ID. To use this call, the original payment call must specify an intent of `order`. In the JSON request body, include the payment amount and indicate whether this capture is the final capture for the authorization.
|
||||
*
|
||||
* @param Capture $capture
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @param Capture $capture
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Capture
|
||||
*/
|
||||
public function capture($capture, $apiContext = null, $restCall = null)
|
||||
@@ -387,10 +413,10 @@ class Order extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Void (cancel) an order by passing the order_id in the request URI. Note that an order cannot be voided if payment has already been partially or fully captured.
|
||||
* Voids, or cancels, an order, by ID. You cannot void an order if a payment has already been partially or fully captured.
|
||||
*
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Order
|
||||
*/
|
||||
public function void($apiContext = null, $restCall = null)
|
||||
@@ -410,11 +436,11 @@ class Order extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Authorize an order by passing the order_id in the request URI. In addition, include an amount object in the body of the request JSON.
|
||||
* Authorizes an order, by ID. Include an `amount` object in the JSON request body.
|
||||
*
|
||||
* @param Authorization $authorization Authorization Object with Amount value to be authorized
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @return Authorization
|
||||
*/
|
||||
public function authorize($authorization, $apiContext = null, $restCall = null)
|
||||
|
||||
@@ -7,7 +7,7 @@ use PayPal\Common\PayPalModel;
|
||||
/**
|
||||
* Class Patch
|
||||
*
|
||||
* A JSON Patch object used for doing partial updates to resources.
|
||||
* A JSON patch object that you can use to apply partial updates to resources.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
@@ -43,7 +43,7 @@ class Patch extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* string containing a JSON-Pointer value that references a location within the target document (the target location) where the operation is performed.
|
||||
* A JSON pointer that references a location in the target document where the operation is performed. A `string` value.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
@@ -56,7 +56,7 @@ class Patch extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* string containing a JSON-Pointer value that references a location within the target document (the target location) where the operation is performed.
|
||||
* A JSON pointer that references a location in the target document where the operation is performed. A `string` value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -68,7 +68,7 @@ class Patch extends PayPalModel
|
||||
/**
|
||||
* New value to apply based on the operation.
|
||||
*
|
||||
* @param string $value
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@@ -81,7 +81,7 @@ class Patch extends PayPalModel
|
||||
/**
|
||||
* New value to apply based on the operation.
|
||||
*
|
||||
* @return string
|
||||
* @return mixed
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ use PayPal\Common\PayPalModel;
|
||||
/**
|
||||
* Class PatchRequest
|
||||
*
|
||||
* Request object used for a JSON Patch.
|
||||
* A JSON patch request.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
|
||||
@@ -17,7 +17,7 @@ use PayPal\Common\PayPalModel;
|
||||
class Payee extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
|
||||
* Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receive PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
|
||||
*
|
||||
* @param string $email
|
||||
*
|
||||
@@ -30,7 +30,7 @@ class Payee extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receiver PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
|
||||
* Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receive PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -64,7 +64,6 @@ class Payee extends PayPalModel
|
||||
|
||||
/**
|
||||
* First Name of the Payee.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $first_name
|
||||
*
|
||||
@@ -78,7 +77,6 @@ class Payee extends PayPalModel
|
||||
|
||||
/**
|
||||
* First Name of the Payee.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
@@ -89,7 +87,6 @@ class Payee extends PayPalModel
|
||||
|
||||
/**
|
||||
* Last Name of the Payee.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $last_name
|
||||
*
|
||||
@@ -103,7 +100,6 @@ class Payee extends PayPalModel
|
||||
|
||||
/**
|
||||
* Last Name of the Payee.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
@@ -114,7 +110,6 @@ class Payee extends PayPalModel
|
||||
|
||||
/**
|
||||
* Unencrypted PayPal account Number of the Payee
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $account_number
|
||||
*
|
||||
@@ -128,7 +123,6 @@ class Payee extends PayPalModel
|
||||
|
||||
/**
|
||||
* Unencrypted PayPal account Number of the Payee
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
@@ -138,8 +132,7 @@ class Payee extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet.
|
||||
*
|
||||
* Information related to the Payee.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Phone $phone
|
||||
*
|
||||
@@ -152,8 +145,7 @@ class Payee extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Information related to the Payer. In case of PayPal Wallet payment, this information will be filled in by PayPal after the user approves the payment using their PayPal Wallet.
|
||||
*
|
||||
* Information related to the Payee.
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Phone
|
||||
*/
|
||||
|
||||
@@ -11,11 +11,11 @@ use PayPal\Common\PayPalModel;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string payment_method
|
||||
* @property string status
|
||||
* @property string payment_method
|
||||
* @property string status
|
||||
* @property \PayPal\Api\FundingInstrument[] funding_instruments
|
||||
* @property string funding_option_id
|
||||
* @property \PayPal\Api\PayerInfo payer_info
|
||||
* @property string external_selected_funding_instrument_type
|
||||
* @property \PayPal\Api\PayerInfo payer_info
|
||||
*/
|
||||
class Payer extends PayPalModel
|
||||
{
|
||||
@@ -70,7 +70,6 @@ class Payer extends PayPalModel
|
||||
/**
|
||||
* Type of account relationship payer has with PayPal.
|
||||
* Valid Values: ["BUSINESS", "PERSONAL", "PREMIER"]
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $account_type
|
||||
*
|
||||
@@ -84,7 +83,6 @@ class Payer extends PayPalModel
|
||||
|
||||
/**
|
||||
* Type of account relationship payer has with PayPal.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
@@ -95,7 +93,6 @@ class Payer extends PayPalModel
|
||||
|
||||
/**
|
||||
* Duration since the payer established account relationship with PayPal in days.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $account_age
|
||||
*
|
||||
@@ -109,7 +106,6 @@ class Payer extends PayPalModel
|
||||
|
||||
/**
|
||||
* Duration since the payer established account relationship with PayPal in days.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
@@ -173,7 +169,7 @@ class Payer extends PayPalModel
|
||||
|
||||
/**
|
||||
* 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
|
||||
@@ -186,7 +182,7 @@ class Payer extends PayPalModel
|
||||
|
||||
/**
|
||||
* 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()
|
||||
@@ -196,7 +192,6 @@ class Payer extends PayPalModel
|
||||
|
||||
/**
|
||||
* Default funding option available for the payment
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\FundingOption $funding_option
|
||||
*
|
||||
@@ -210,7 +205,6 @@ class Payer extends PayPalModel
|
||||
|
||||
/**
|
||||
* Default funding option available for the payment
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\FundingOption
|
||||
*/
|
||||
@@ -220,8 +214,31 @@ class Payer extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Funding option related to default funding option.
|
||||
* Instrument type pre-selected by the user outside of PayPal and passed along the payment creation. This param is used in cases such as PayPal Credit Second Button
|
||||
* Valid Values: ["CREDIT", "PAY_UPON_INVOICE"]
|
||||
*
|
||||
* @param string $external_selected_funding_instrument_type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExternalSelectedFundingInstrumentType($external_selected_funding_instrument_type)
|
||||
{
|
||||
$this->external_selected_funding_instrument_type = $external_selected_funding_instrument_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Instrument type pre-selected by the user outside of PayPal and passed along the payment creation. This param is used in cases such as PayPal Credit Second Button
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalSelectedFundingInstrumentType()
|
||||
{
|
||||
return $this->external_selected_funding_instrument_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Funding option related to default funding option.
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\FundingOption $related_funding_option
|
||||
*
|
||||
@@ -235,7 +252,6 @@ class Payer extends PayPalModel
|
||||
|
||||
/**
|
||||
* Funding option related to default funding option.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\FundingOption
|
||||
*/
|
||||
|
||||
@@ -11,22 +11,22 @@ use PayPal\Common\PayPalModel;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string email
|
||||
* @property string external_remember_me_id
|
||||
* @property string salutation
|
||||
* @property string first_name
|
||||
* @property string middle_name
|
||||
* @property string last_name
|
||||
* @property string suffix
|
||||
* @property string payer_id
|
||||
* @property string phone
|
||||
* @property string phone_type
|
||||
* @property string birth_date
|
||||
* @property string tax_id
|
||||
* @property string tax_id_type
|
||||
* @property string country_code
|
||||
* @property \PayPal\Api\Address billing_address
|
||||
* @property \PayPal\Api\ShippingAddress shipping_address
|
||||
* @property string email
|
||||
* @property string external_remember_me_id
|
||||
* @property string buyer_account_number
|
||||
* @property string salutation
|
||||
* @property string first_name
|
||||
* @property string middle_name
|
||||
* @property string last_name
|
||||
* @property string suffix
|
||||
* @property string payer_id
|
||||
* @property string phone
|
||||
* @property string phone_type
|
||||
* @property string birth_date
|
||||
* @property string tax_id
|
||||
* @property string tax_id_type
|
||||
* @property string country_code
|
||||
* @property \PayPal\Api\Address billing_address
|
||||
*/
|
||||
class PayerInfo extends PayPalModel
|
||||
{
|
||||
@@ -79,7 +79,7 @@ class PayerInfo extends PayPalModel
|
||||
/**
|
||||
* Account Number representing the Payer
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @deprecated Use #setBuyerAccountNumberInstead
|
||||
* @param string $account_number
|
||||
*
|
||||
* @return $this
|
||||
@@ -93,6 +93,8 @@ class PayerInfo extends PayPalModel
|
||||
/**
|
||||
* Account Number representing the Payer
|
||||
*
|
||||
* @deprecated Use #getBuyerAccountNumberInstead
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
@@ -101,6 +103,29 @@ class PayerInfo extends PayPalModel
|
||||
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.
|
||||
*
|
||||
@@ -403,7 +428,7 @@ class PayerInfo extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping address of payer PayPal account.
|
||||
* @deprecated [DEPRECATED] Use shipping address present in purchase unit or at root level of checkout Session.
|
||||
*
|
||||
* @param \PayPal\Api\ShippingAddress $shipping_address
|
||||
*
|
||||
@@ -416,7 +441,7 @@ class PayerInfo extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Shipping address of payer PayPal account.
|
||||
* @deprecated [DEPRECATED] Use shipping address present in purchase unit or at root level of checkout Session.
|
||||
*
|
||||
* @return \PayPal\Api\ShippingAddress
|
||||
*/
|
||||
|
||||
@@ -4,9 +4,8 @@ namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Core\PayPalConstants;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Transport\PayPalRestCall;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Payment
|
||||
@@ -15,27 +14,24 @@ use PayPal\Validation\ArgumentValidator;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string intent
|
||||
* @property \PayPal\Api\Payer payer
|
||||
* @property \PayPal\Api\PotentialPayerInfo potential_payer_info
|
||||
* @property \PayPal\Api\Payee payee
|
||||
* @property \PayPal\Api\Transaction[] transactions
|
||||
* @property string[] billing_agreement_tokens
|
||||
* @property \PayPal\Api\PaymentInstruction payment_instruction
|
||||
* @property string state
|
||||
* @property string experience_profile_id
|
||||
* @property string note_to_payer
|
||||
* @property \PayPal\Api\RedirectUrls redirect_urls
|
||||
* @property string failure_reason
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Links[] links
|
||||
* @property string id
|
||||
* @property string intent
|
||||
* @property \PayPal\Api\Payer payer
|
||||
* @property \PayPal\Api\Transaction[] transactions
|
||||
* @property string state
|
||||
* @property string experience_profile_id
|
||||
* @property string note_to_payer
|
||||
* @property \PayPal\Api\Payee $payee
|
||||
* @property \PayPal\Api\RedirectUrls redirect_urls
|
||||
* @property string failure_reason
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class Payment extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* ID of the created payment, the 'transaction ID'
|
||||
* Identifier of the payment resource created.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
@@ -48,7 +44,7 @@ class Payment extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the created payment, the 'transaction ID'
|
||||
* Identifier of the payment resource created.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -106,7 +102,7 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Information that the merchant knows about the payer. This information is not definitive and only serves as a hint to the UI or any pre-processing logic.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\PotentialPayerInfo $potential_payer_info
|
||||
*
|
||||
* @return $this
|
||||
@@ -119,7 +115,7 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Information that the merchant knows about the payer. This information is not definitive and only serves as a hint to the UI or any pre-processing logic.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\PotentialPayerInfo
|
||||
*/
|
||||
public function getPotentialPayerInfo()
|
||||
@@ -128,8 +124,7 @@ class Payment extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Receiver of funds for this payment. **Readonly for PayPal external REST payments.**
|
||||
*
|
||||
* Receiver of funds for this payment.
|
||||
* @param \PayPal\Api\Payee $payee
|
||||
*
|
||||
* @return $this
|
||||
@@ -141,8 +136,7 @@ class Payment extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Receiver of funds for this payment. **Readonly for PayPal external REST payments.**
|
||||
*
|
||||
* Receiver of funds for this payment.
|
||||
* @return \PayPal\Api\Payee
|
||||
*/
|
||||
public function getPayee()
|
||||
@@ -152,7 +146,6 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* ID of the cart to execute the payment.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $cart
|
||||
*
|
||||
@@ -166,7 +159,6 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* ID of the cart to execute the payment.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
@@ -230,7 +222,6 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Applicable for advanced payments like multi seller payment (MSP) to support partial failures
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Error[] $failed_transactions
|
||||
*
|
||||
@@ -244,7 +235,6 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Applicable for advanced payments like multi seller payment (MSP) to support partial failures
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Error[]
|
||||
*/
|
||||
@@ -255,7 +245,6 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Append FailedTransactions to the list.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Error $error
|
||||
* @return $this
|
||||
@@ -273,7 +262,6 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Remove FailedTransactions from the list.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Error $error
|
||||
* @return $this
|
||||
@@ -287,7 +275,7 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Collection of PayPal generated billing agreement tokens.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string[] $billing_agreement_tokens
|
||||
*
|
||||
* @return $this
|
||||
@@ -300,7 +288,7 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Collection of PayPal generated billing agreement tokens.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string[]
|
||||
*/
|
||||
public function getBillingAgreementTokens()
|
||||
@@ -310,7 +298,7 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Append BillingAgreementTokens to the list.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $billingAgreementToken
|
||||
* @return $this
|
||||
*/
|
||||
@@ -327,7 +315,7 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Remove BillingAgreementTokens from the list.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $billingAgreementToken
|
||||
* @return $this
|
||||
*/
|
||||
@@ -340,7 +328,6 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
@@ -354,7 +341,6 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Credit financing offered to payer on PayPal side. Returned in payment after payer opts-in
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\CreditFinancingOffered
|
||||
*/
|
||||
@@ -365,7 +351,7 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Instructions for the payer to complete this payment.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\PaymentInstruction $payment_instruction
|
||||
*
|
||||
* @return $this
|
||||
@@ -378,7 +364,7 @@ class Payment extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Instructions for the payer to complete this payment.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\PaymentInstruction
|
||||
*/
|
||||
public function getPaymentInstruction()
|
||||
@@ -387,7 +373,7 @@ class Payment extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment state.
|
||||
* 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
|
||||
@@ -401,7 +387,7 @@ class Payment extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment state.
|
||||
* 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
|
||||
*/
|
||||
@@ -411,7 +397,7 @@ class Payment extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal generated identifier for the merchant's payment experience profile. Refer to [this](https://developer.paypal.com/webapps/developer/docs/api/#payment-experience) link to create experience profile ID.
|
||||
* 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
|
||||
*
|
||||
@@ -424,7 +410,7 @@ class Payment extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* PayPal generated identifier for the merchant's payment experience profile. Refer to [this](https://developer.paypal.com/webapps/developer/docs/api/#payment-experience) link to create experience profile ID.
|
||||
* 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
|
||||
*/
|
||||
@@ -560,10 +546,10 @@ class Payment extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and process a payment by passing a payment object that includes the intent, payer, and transactions in the body of the request JSON. For PayPal payments, include redirect URLs in the payment object.
|
||||
* 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
|
||||
* @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)
|
||||
@@ -582,11 +568,11 @@ class Payment extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Look up a particular payment resource by passing the payment_id in the request URI.
|
||||
* 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
|
||||
* @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)
|
||||
@@ -607,11 +593,11 @@ class Payment extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this call to partially update the payment resource for the given identifier. Allowed objects are amount, shipping_address, invoice_id and custom. Please note that it is not possible to use patch after execute has been called.
|
||||
* 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
|
||||
* @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)
|
||||
@@ -631,11 +617,11 @@ class Payment extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute (complete) a PayPal payment that has been approved by the payer. Optionally update selective payment information when executing the payment.
|
||||
* 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
|
||||
* @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)
|
||||
@@ -656,11 +642,11 @@ class Payment extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* List payments in any state (created, approved, failed, etc.). Payments returned are the payments made to the merchant issuing the request.
|
||||
* List payments 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
|
||||
* @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)
|
||||
@@ -668,14 +654,14 @@ class Payment extends PayPalResourceModel
|
||||
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,
|
||||
'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)),
|
||||
|
||||
@@ -7,32 +7,33 @@ use PayPal\Common\PayPalModel;
|
||||
/**
|
||||
* Class PaymentCard
|
||||
*
|
||||
* A resource representing a payment card that can be used to fund a payment.
|
||||
* 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 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 valid_until
|
||||
* @property string issue_number
|
||||
* @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
|
||||
{
|
||||
/**
|
||||
* ID of the credit card being saved for later use.
|
||||
* The ID of a credit card to save for later use.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
@@ -45,7 +46,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the credit card being saved for later use.
|
||||
* The ID of a credit card to save for later use.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -55,7 +56,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Card number.
|
||||
* The card number.
|
||||
*
|
||||
* @param string $number
|
||||
*
|
||||
@@ -68,7 +69,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Card number.
|
||||
* The card number.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -78,7 +79,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the Card.
|
||||
* 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
|
||||
@@ -92,7 +93,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of the Card.
|
||||
* The card type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -102,7 +103,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 digit card expiry month.
|
||||
* The two-digit expiry month for the card.
|
||||
*
|
||||
* @param string $expire_month
|
||||
*
|
||||
@@ -115,7 +116,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 digit card expiry month.
|
||||
* The two-digit expiry month for the card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -125,7 +126,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card expiry year
|
||||
* The four-digit expiry year for the card.
|
||||
*
|
||||
* @param string $expire_year
|
||||
*
|
||||
@@ -138,7 +139,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card expiry year
|
||||
* The four-digit expiry year for the card.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -148,7 +149,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 digit card start month. Needed for UK Maestro Card.
|
||||
* The two-digit start month for the card. Required for UK Maestro cards.
|
||||
*
|
||||
* @param string $start_month
|
||||
*
|
||||
@@ -161,7 +162,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 digit card start month. Needed for UK Maestro Card.
|
||||
* The two-digit start month for the card. Required for UK Maestro cards.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -171,7 +172,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card start year. Needed for UK Maestro Card.
|
||||
* The four-digit start year for the card. Required for UK Maestro cards.
|
||||
*
|
||||
* @param string $start_year
|
||||
*
|
||||
@@ -184,7 +185,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 4 digit card start year. Needed for UK Maestro Card.
|
||||
* The four-digit start year for the card. Required for UK Maestro cards.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -194,7 +195,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Card validation code. Only supported when making a Payment but not when saving a payment card for future use.
|
||||
* The validation code for the card. Supported for payments but not for saving payment cards for future use.
|
||||
*
|
||||
* @param string $cvv2
|
||||
*
|
||||
@@ -207,7 +208,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Card validation code. Only supported when making a Payment but not when saving a payment card for future use.
|
||||
* The validation code for the card. Supported for payments but not for saving payment cards for future use.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -217,7 +218,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Card holder's first name.
|
||||
* The first name of the card holder.
|
||||
*
|
||||
* @param string $first_name
|
||||
*
|
||||
@@ -230,7 +231,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Card holder's first name.
|
||||
* The first name of the card holder.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -240,7 +241,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Card holder's last name.
|
||||
* The last name of the card holder.
|
||||
*
|
||||
* @param string $last_name
|
||||
*
|
||||
@@ -253,7 +254,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Card holder's last name.
|
||||
* The last name of the card holder.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -263,7 +264,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 letter country code
|
||||
* The two-letter country code.
|
||||
*
|
||||
* @param string $billing_country
|
||||
*
|
||||
@@ -276,7 +277,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 2 letter country code
|
||||
* The two-letter country code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -286,7 +287,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing Address associated with this card.
|
||||
* The billing address for the card.
|
||||
*
|
||||
* @param \PayPal\Api\Address $billing_address
|
||||
*
|
||||
@@ -299,7 +300,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Billing Address associated with this card.
|
||||
* The billing address for the card.
|
||||
*
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
@@ -309,7 +310,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier of the customer to whom this card account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault.
|
||||
* 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
|
||||
*
|
||||
@@ -322,7 +323,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* A unique identifier of the customer to whom this card account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault.
|
||||
* 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
|
||||
*/
|
||||
@@ -332,7 +333,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the funding instrument.
|
||||
* The state of the funding instrument.
|
||||
* Valid Values: ["EXPIRED", "ACTIVE"]
|
||||
*
|
||||
* @param string $status
|
||||
@@ -346,7 +347,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the funding instrument.
|
||||
* The state of the funding instrument.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -356,7 +357,31 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until this resource can be used fund a payment.
|
||||
* 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
|
||||
*
|
||||
@@ -369,7 +394,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/Time until this resource can be used fund a payment.
|
||||
* The date and time until when this instrument can be used fund a payment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -379,7 +404,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 1-2 digit card issue number. Needed for UK Maestro Card.
|
||||
* The one- to two-digit card issue number. Required for UK Maestro cards.
|
||||
*
|
||||
* @param string $issue_number
|
||||
*
|
||||
@@ -392,7 +417,7 @@ class PaymentCard extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 1-2 digit card issue number. Needed for UK Maestro Card.
|
||||
* The one- to two-digit card issue number. Required for UK Maestro cards.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
||||
@@ -11,8 +11,7 @@ use PayPal\Common\PayPalModel;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string payer_id
|
||||
* @property string carrier_account_id
|
||||
* @property string payer_id
|
||||
* @property \PayPal\Api\Transaction[] transactions
|
||||
*/
|
||||
class PaymentExecution extends PayPalModel
|
||||
@@ -42,7 +41,7 @@ class PaymentExecution extends PayPalModel
|
||||
|
||||
/**
|
||||
* 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
|
||||
@@ -55,7 +54,7 @@ class PaymentExecution extends PayPalModel
|
||||
|
||||
/**
|
||||
* 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()
|
||||
|
||||
@@ -71,7 +71,7 @@ class PaymentHistory extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* 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
|
||||
*
|
||||
@@ -84,7 +84,7 @@ class PaymentHistory extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* 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
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,7 @@ use PayPal\Common\PayPalModel;
|
||||
class PaymentOptions extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Optional payment method type. If specified, the transaction will go through for only instant payment. Only for use with the paypal payment_method, not relevant for the credit_card payment_method.
|
||||
* Payment method requested for this purchase unit
|
||||
* Valid Values: ["UNRESTRICTED", "INSTANT_FUNDING_SOURCE", "IMMEDIATE_PAY"]
|
||||
*
|
||||
* @param string $allowed_payment_method
|
||||
@@ -30,7 +30,7 @@ class PaymentOptions extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional payment method type. If specified, the transaction will go through for only instant payment. Only for use with the paypal payment_method, not relevant for the credit_card payment_method.
|
||||
* Payment method requested for this purchase unit
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -41,7 +41,6 @@ class PaymentOptions extends PayPalModel
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
@@ -55,7 +54,6 @@ class PaymentOptions extends PayPalModel
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@@ -66,7 +64,6 @@ class PaymentOptions extends PayPalModel
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
@@ -80,7 +77,6 @@ class PaymentOptions extends PayPalModel
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ use PayPal\Common\PayPalModel;
|
||||
/**
|
||||
* Class Phone
|
||||
*
|
||||
* Representation of a phone number.
|
||||
* Information related to the Payee.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
@@ -18,7 +18,7 @@ use PayPal\Common\PayPalModel;
|
||||
class Phone extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* The country calling code (CC) as defined by E.164. The combined length of CC+national cannot be more than 15 digits.
|
||||
* Country code (from in E.164 format)
|
||||
*
|
||||
* @param string $country_code
|
||||
*
|
||||
@@ -31,7 +31,7 @@ class Phone extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* The country calling code (CC) as defined by E.164. The combined length of CC+national cannot be more than 15 digits.
|
||||
* Country code (from in E.164 format)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -41,7 +41,7 @@ class Phone extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* The national number as defined by E.164. The combined length of CC+national cannot be more than 15 digits. A national number consists of National Destination Code (NDC) and Subscriber Number (SN).
|
||||
* In-country phone number (from in E.164 format)
|
||||
*
|
||||
* @param string $national_number
|
||||
*
|
||||
@@ -54,7 +54,7 @@ class Phone extends PayPalModel
|
||||
}
|
||||
|
||||
/**
|
||||
* The national number as defined by E.164. The combined length of CC+national cannot be more than 15 digits. A national number consists of National Destination Code (NDC) and Subscriber Number (SN).
|
||||
* In-country phone number (from in E.164 format)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
||||
@@ -11,15 +11,12 @@ use PayPal\Common\PayPalModel;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string email
|
||||
* @property string external_remember_me_id
|
||||
* @property \PayPal\Api\Address billing_address
|
||||
*/
|
||||
class PotentialPayerInfo extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Email address representing the potential payer.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $email
|
||||
*
|
||||
* @return $this
|
||||
@@ -32,7 +29,7 @@ class PotentialPayerInfo extends PayPalModel
|
||||
|
||||
/**
|
||||
* Email address representing the potential payer.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail()
|
||||
@@ -42,7 +39,7 @@ class PotentialPayerInfo extends PayPalModel
|
||||
|
||||
/**
|
||||
* ExternalRememberMe id representing the potential payer
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $external_remember_me_id
|
||||
*
|
||||
* @return $this
|
||||
@@ -55,7 +52,7 @@ class PotentialPayerInfo extends PayPalModel
|
||||
|
||||
/**
|
||||
* ExternalRememberMe id representing the potential payer
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalRememberMeId()
|
||||
@@ -88,7 +85,7 @@ class PotentialPayerInfo extends PayPalModel
|
||||
|
||||
/**
|
||||
* Billing address of the potential payer.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param \PayPal\Api\Address $billing_address
|
||||
*
|
||||
* @return $this
|
||||
@@ -101,7 +98,7 @@ class PotentialPayerInfo extends PayPalModel
|
||||
|
||||
/**
|
||||
* Billing address of the potential payer.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return \PayPal\Api\Address
|
||||
*/
|
||||
public function getBillingAddress()
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Refund
|
||||
@@ -13,16 +13,18 @@ use PayPal\Validation\ArgumentValidator;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string state
|
||||
* @property string reason
|
||||
* @property string sale_id
|
||||
* @property string capture_id
|
||||
* @property string parent_payment
|
||||
* @property string description
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property string id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string state
|
||||
* @property string reason
|
||||
* @property string invoice_number
|
||||
* @property string sale_id
|
||||
* @property string capture_id
|
||||
* @property string parent_payment
|
||||
* @property string description
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property string reason_code
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class Refund extends PayPalResourceModel
|
||||
@@ -120,6 +122,29 @@ class Refund extends PayPalResourceModel
|
||||
return $this->reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Your own invoice or tracking ID number. Character length and limitations: 127 single-byte alphanumeric characters.
|
||||
*
|
||||
* @param string $invoice_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInvoiceNumber($invoice_number)
|
||||
{
|
||||
$this->invoice_number = $invoice_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Your own invoice or tracking ID number. Character length and limitations: 127 single-byte alphanumeric characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInvoiceNumber()
|
||||
{
|
||||
return $this->invoice_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the Sale transaction being refunded.
|
||||
*
|
||||
@@ -259,11 +284,35 @@ class Refund extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve details about a specific refund by passing the refund_id in the request URI.
|
||||
* The reason code for the refund state being pending
|
||||
* Valid Values: ["ECHECK"]
|
||||
*
|
||||
* @param string $refundId
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @param string $reason_code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReasonCode($reason_code)
|
||||
{
|
||||
$this->reason_code = $reason_code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The reason code for the refund state being pending
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReasonCode()
|
||||
{
|
||||
return $this->reason_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows details for a refund, by ID.
|
||||
*
|
||||
* @param string $refundId
|
||||
* @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 static function get($refundId, $apiContext = null, $restCall = null)
|
||||
|
||||
162
lib/PayPal/Api/RefundRequest.php
Normal file
162
lib/PayPal/Api/RefundRequest.php
Normal file
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
|
||||
/**
|
||||
* Class RefundRequest
|
||||
*
|
||||
* A refund transaction.
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string description
|
||||
* @property string refund_source
|
||||
* @property string reason
|
||||
* @property string invoice_number
|
||||
* @property bool refund_advice
|
||||
*/
|
||||
class RefundRequest extends PayPalModel
|
||||
{
|
||||
/**
|
||||
* Details including both refunded amount (to payer) and refunded fee (to payee).
|
||||
*
|
||||
* @param \PayPal\Api\Amount $amount
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Details including both refunded amount (to payer) and refunded fee (to payee).
|
||||
*
|
||||
* @return \PayPal\Api\Amount
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of what is being refunded for. Character length and limitations: 255 single-byte alphanumeric characters.
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of what is being refunded for. Character length and limitations: 255 single-byte alphanumeric characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of PayPal funding source (balance or eCheck) that can be used for auto refund.
|
||||
* Valid Values: ["INSTANT_FUNDING_SOURCE", "ECHECK", "UNRESTRICTED"]
|
||||
*
|
||||
* @param string $refund_source
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRefundSource($refund_source)
|
||||
{
|
||||
$this->refund_source = $refund_source;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of PayPal funding source (balance or eCheck) that can be used for auto refund.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRefundSource()
|
||||
{
|
||||
return $this->refund_source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason description for the Sale transaction being refunded.
|
||||
*
|
||||
* @param string $reason
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setReason($reason)
|
||||
{
|
||||
$this->reason = $reason;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reason description for the Sale transaction being refunded.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReason()
|
||||
{
|
||||
return $this->reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice number that is used to track this payment. Character length and limitations: 127 single-byte alphanumeric characters.
|
||||
*
|
||||
* @param string $invoice_number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setInvoiceNumber($invoice_number)
|
||||
{
|
||||
$this->invoice_number = $invoice_number;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The invoice number that is used to track this payment. Character length and limitations: 127 single-byte alphanumeric characters.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getInvoiceNumber()
|
||||
{
|
||||
return $this->invoice_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flag to indicate that the buyer was already given store credit for a given transaction.
|
||||
*
|
||||
* @param bool $refund_advice
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRefundAdvice($refund_advice)
|
||||
{
|
||||
$this->refund_advice = $refund_advice;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flag to indicate that the buyer was already given store credit for a given transaction.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getRefundAdvice()
|
||||
{
|
||||
return $this->refund_advice;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,11 +11,11 @@ use PayPal\Common\PayPalModel;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property \PayPal\Api\Sale sale
|
||||
* @property \PayPal\Api\Sale sale
|
||||
* @property \PayPal\Api\Authorization authorization
|
||||
* @property \PayPal\Api\Order order
|
||||
* @property \PayPal\Api\Capture capture
|
||||
* @property \PayPal\Api\Refund refund
|
||||
* @property \PayPal\Api\Order order
|
||||
* @property \PayPal\Api\Capture capture
|
||||
* @property \PayPal\Api\Refund refund
|
||||
*/
|
||||
class RelatedResources extends PayPalModel
|
||||
{
|
||||
|
||||
@@ -3,43 +3,43 @@
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
use PayPal\Rest\ApiContext;
|
||||
|
||||
/**
|
||||
* Class Sale
|
||||
*
|
||||
* A sale transaction.
|
||||
* A sale transaction. This is the resource that is returned as a part related resources in Payment
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string purchase_unit_reference_id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string payment_mode
|
||||
* @property string state
|
||||
* @property string reason_code
|
||||
* @property string protection_eligibility
|
||||
* @property string protection_eligibility_type
|
||||
* @property string clearing_time
|
||||
* @property string payment_hold_status
|
||||
* @property string[] payment_hold_reasons
|
||||
* @property \PayPal\Api\Currency transaction_fee
|
||||
* @property \PayPal\Api\Currency receivable_amount
|
||||
* @property string exchange_rate
|
||||
* @property \PayPal\Api\FmfDetails fmf_details
|
||||
* @property string receipt_id
|
||||
* @property string parent_payment
|
||||
* @property string id
|
||||
* @property string purchase_unit_reference_id
|
||||
* @property \PayPal\Api\Amount amount
|
||||
* @property string payment_mode
|
||||
* @property string state
|
||||
* @property string reason_code
|
||||
* @property string protection_eligibility
|
||||
* @property string protection_eligibility_type
|
||||
* @property string clearing_time
|
||||
* @property string payment_hold_status
|
||||
* @property string[] payment_hold_reasons
|
||||
* @property \PayPal\Api\Currency transaction_fee
|
||||
* @property \PayPal\Api\Currency receivable_amount
|
||||
* @property string exchange_rate
|
||||
* @property \PayPal\Api\FmfDetails fmf_details
|
||||
* @property string receipt_id
|
||||
* @property string parent_payment
|
||||
* @property \PayPal\Api\ProcessorResponse processor_response
|
||||
* @property string billing_agreement_id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Links[] links
|
||||
* @property string billing_agreement_id
|
||||
* @property string create_time
|
||||
* @property string update_time
|
||||
* @property \PayPal\Api\Links[] links
|
||||
*/
|
||||
class Sale extends PayPalResourceModel
|
||||
{
|
||||
/**
|
||||
* ID of the sale transaction.
|
||||
* Identifier of the sale transaction.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
@@ -52,7 +52,7 @@ class Sale extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* ID of the sale transaction.
|
||||
* Identifier of the sale transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -62,7 +62,7 @@ class Sale extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the purchased unit associated with this object.
|
||||
* Identifier to the purchase or transaction unit corresponding to this sale transaction.
|
||||
*
|
||||
* @param string $purchase_unit_reference_id
|
||||
*
|
||||
@@ -75,7 +75,7 @@ class Sale extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifier of the purchased unit associated with this object.
|
||||
* Identifier to the purchase or transaction unit corresponding to this sale transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -132,8 +132,8 @@ class Sale extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the sale.
|
||||
* Valid Values: ["completed", "partially_refunded", "pending", "refunded"]
|
||||
* State of the sale transaction.
|
||||
* Valid Values: ["completed", "partially_refunded", "pending", "refunded", "denied"]
|
||||
*
|
||||
* @param string $state
|
||||
*
|
||||
@@ -146,7 +146,7 @@ class Sale extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* State of the sale.
|
||||
* State of the sale transaction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -157,7 +157,7 @@ class Sale extends PayPalResourceModel
|
||||
|
||||
/**
|
||||
* Reason code for the transaction state being Pending or Reversed. Only supported when the `payment_method` is set to `paypal`.
|
||||
* Valid Values: ["CHARGEBACK", "GUARANTEE", "BUYER_COMPLAINT", "REFUND", "UNCONFIRMED_SHIPPING_ADDRESS", "ECHECK", "INTERNATIONAL_WITHDRAWAL", "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION", "PAYMENT_REVIEW", "REGULATORY_REVIEW", "UNILATERAL", "VERIFICATION_REQUIRED"]
|
||||
* Valid Values: ["CHARGEBACK", "GUARANTEE", "BUYER_COMPLAINT", "REFUND", "UNCONFIRMED_SHIPPING_ADDRESS", "ECHECK", "INTERNATIONAL_WITHDRAWAL", "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION", "PAYMENT_REVIEW", "REGULATORY_REVIEW", "UNILATERAL", "VERIFICATION_REQUIRED", "TRANSACTION_APPROVED_AWAITING_FUNDING"]
|
||||
*
|
||||
* @param string $reason_code
|
||||
*
|
||||
@@ -228,7 +228,7 @@ class Sale extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Expected clearing time for eCheck transactions. Only supported when the `payment_method` is set to `paypal`.
|
||||
* Expected clearing time for eCheck Transactions. Returned when payment is made with eCheck. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @param string $clearing_time
|
||||
*
|
||||
@@ -241,7 +241,7 @@ class Sale extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Expected clearing time for eCheck transactions. Only supported when the `payment_method` is set to `paypal`.
|
||||
* Expected clearing time for eCheck Transactions. Returned when payment is made with eCheck. Only supported when the `payment_method` is set to `paypal`.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -328,7 +328,7 @@ class Sale extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Transaction fee charged by PayPal for this transaction.
|
||||
* Transaction fee applicable for this payment.
|
||||
*
|
||||
* @param \PayPal\Api\Currency $transaction_fee
|
||||
*
|
||||
@@ -341,7 +341,7 @@ class Sale extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Transaction fee charged by PayPal for this transaction.
|
||||
* Transaction fee applicable for this payment.
|
||||
*
|
||||
* @return \PayPal\Api\Currency
|
||||
*/
|
||||
@@ -558,11 +558,11 @@ class Sale extends PayPalResourceModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve details about a sale transaction by passing the sale_id in the request URI. This request returns only the sales that were created via the REST API.
|
||||
* Shows details for a sale, by ID. Returns only sales that were created through the REST API.
|
||||
*
|
||||
* @param string $saleId
|
||||
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
|
||||
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
|
||||
* @param string $saleId
|
||||
* @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 Sale
|
||||
*/
|
||||
public static function get($saleId, $apiContext = null, $restCall = null)
|
||||
@@ -585,6 +585,7 @@ class Sale extends PayPalResourceModel
|
||||
/**
|
||||
* Refund a completed payment by passing the sale_id in the request URI. In addition, include an empty JSON payload in the request body for a full refund. For a partial refund, include an amount object in the request body.
|
||||
*
|
||||
* @deprecated Please use #refundSale 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
|
||||
@@ -608,4 +609,29 @@ class Sale extends PayPalResourceModel
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refunds a sale, by ID. For a full refund, include an empty payload in the JSON request body. For a partial refund, 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 refundSale($refundRequest, $apiContext = null, $restCall = null)
|
||||
{
|
||||
ArgumentValidator::validate($this->getId(), "Id");
|
||||
ArgumentValidator::validate($refundRequest, 'refundRequest');
|
||||
$payLoad = $refundRequest->toJSON();
|
||||
$json = self::executeCall(
|
||||
"/v1/payments/sale/{$this->getId()}/refund",
|
||||
"POST",
|
||||
$payLoad,
|
||||
null,
|
||||
$apiContext,
|
||||
$restCall
|
||||
);
|
||||
$ret = new DetailedRefund();
|
||||
$ret->fromJson($json);
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,16 +9,13 @@ namespace PayPal\Api;
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property string id
|
||||
* @property string recipient_name
|
||||
* @property bool default_address
|
||||
* @property bool preferred_address
|
||||
*/
|
||||
class ShippingAddress extends Address
|
||||
{
|
||||
/**
|
||||
* Address ID assigned in PayPal system.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param string $id
|
||||
*
|
||||
* @return $this
|
||||
@@ -31,7 +28,7 @@ class ShippingAddress extends Address
|
||||
|
||||
/**
|
||||
* Address ID assigned in PayPal system.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return string
|
||||
*/
|
||||
public function getId()
|
||||
@@ -64,7 +61,7 @@ class ShippingAddress extends Address
|
||||
|
||||
/**
|
||||
* Default shipping address of the Payer.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param bool $default_address
|
||||
*
|
||||
* @return $this
|
||||
@@ -77,7 +74,7 @@ class ShippingAddress extends Address
|
||||
|
||||
/**
|
||||
* Default shipping address of the Payer.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return bool
|
||||
*/
|
||||
public function getDefaultAddress()
|
||||
@@ -87,7 +84,7 @@ class ShippingAddress extends Address
|
||||
|
||||
/**
|
||||
* Shipping Address marked as preferred by Payer.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @param bool $preferred_address
|
||||
*
|
||||
* @return $this
|
||||
@@ -100,7 +97,7 @@ class ShippingAddress extends Address
|
||||
|
||||
/**
|
||||
* Shipping Address marked as preferred by Payer.
|
||||
*
|
||||
* @deprecated Not publicly available
|
||||
* @return bool
|
||||
*/
|
||||
public function getPreferredAddress()
|
||||
|
||||
@@ -40,7 +40,7 @@ class Transaction extends TransactionBase
|
||||
* Identifier to the purchase unit corresponding to this sale transaction
|
||||
*
|
||||
* @param string $purchase_unit_reference_id
|
||||
*
|
||||
* @deprecated Use #setReferenceId instead
|
||||
* @return $this
|
||||
*/
|
||||
public function setPurchaseUnitReferenceId($purchase_unit_reference_id)
|
||||
@@ -52,6 +52,7 @@ class Transaction extends TransactionBase
|
||||
/**
|
||||
* Identifier to the purchase unit corresponding to this sale transaction
|
||||
*
|
||||
* @deprecated Use #getReferenceId instead
|
||||
* @return string
|
||||
*/
|
||||
public function getPurchaseUnitReferenceId()
|
||||
|
||||
@@ -29,8 +29,8 @@ $card->setType("visa")
|
||||
->setExpireYear("2019")
|
||||
->setCvv2("012")
|
||||
->setFirstName("Joe")
|
||||
->setLastName("Shopper")
|
||||
->setBillingCountry("US");
|
||||
->setBillingCountry("US")
|
||||
->setLastName("Shopper");
|
||||
|
||||
// ### FundingInstrument
|
||||
// A resource representing a Payer's funding instrument.
|
||||
|
||||
@@ -13,17 +13,15 @@ class AddressTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Address
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"line1":"TestSample","line2":"TestSample","city":"TestSample","country_code":"TestSample","postal_code":"TestSample","state":"TestSample","phone":"TestSample","normalization_status":"TestSample","status":"TestSample"}';
|
||||
return '{"line1":"TestSample","line2":"TestSample","city":"TestSample","country_code":"TestSample","postal_code":"TestSample","state":"TestSample","phone":"TestSample","normalization_status":"TestSample","status":"TestSample","type":"TestSample"}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Address
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class AddressTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Address
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
@@ -50,6 +47,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNotNull($obj->getPhone());
|
||||
$this->assertNotNull($obj->getNormalizationStatus());
|
||||
$this->assertNotNull($obj->getStatus());
|
||||
$this->assertNotNull($obj->getType());
|
||||
$this->assertEquals(self::getJson(), $obj->toJson());
|
||||
return $obj;
|
||||
}
|
||||
@@ -69,5 +67,6 @@ class AddressTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($obj->getPhone(), "TestSample");
|
||||
$this->assertEquals($obj->getNormalizationStatus(), "TestSample");
|
||||
$this->assertEquals($obj->getStatus(), "TestSample");
|
||||
$this->assertEquals($obj->getType(), "TestSample");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ class AmountTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Amount
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class AmountTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Amount
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class AmountTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Amount
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -14,17 +14,15 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Authorization
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"id":"TestSample","amount":' . AmountTest::getJson() . ',"payment_mode":"TestSample","state":"TestSample","reason_code":"TestSample","pending_reason":"TestSample","protection_eligibility":"TestSample","protection_eligibility_type":"TestSample","fmf_details":' . FmfDetailsTest::getJson() . ',"parent_payment":"TestSample","valid_until":"TestSample","create_time":"TestSample","update_time":"TestSample","links":' . LinksTest::getJson() . '}';
|
||||
return '{"id":"TestSample","amount":' .AmountTest::getJson() . ',"payment_mode":"TestSample","state":"TestSample","reason_code":"TestSample","pending_reason":"TestSample","protection_eligibility":"TestSample","protection_eligibility_type":"TestSample","fmf_details":' .FmfDetailsTest::getJson() . ',"parent_payment":"TestSample","valid_until":"TestSample","create_time":"TestSample","update_time":"TestSample","reference_id":"TestSample","receipt_id":"TestSample","links":' .LinksTest::getJson() . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Authorization
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -35,7 +33,6 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Authorization
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
@@ -55,6 +52,8 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNotNull($obj->getValidUntil());
|
||||
$this->assertNotNull($obj->getCreateTime());
|
||||
$this->assertNotNull($obj->getUpdateTime());
|
||||
$this->assertNotNull($obj->getReferenceId());
|
||||
$this->assertNotNull($obj->getReceiptId());
|
||||
$this->assertNotNull($obj->getLinks());
|
||||
$this->assertEquals(self::getJson(), $obj->toJson());
|
||||
return $obj;
|
||||
@@ -79,6 +78,8 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($obj->getValidUntil(), "TestSample");
|
||||
$this->assertEquals($obj->getCreateTime(), "TestSample");
|
||||
$this->assertEquals($obj->getUpdateTime(), "TestSample");
|
||||
$this->assertEquals($obj->getReferenceId(), "TestSample");
|
||||
$this->assertEquals($obj->getReceiptId(), "TestSample");
|
||||
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
||||
}
|
||||
|
||||
@@ -95,13 +96,12 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
AuthorizationTest::getJson()
|
||||
AuthorizationTest::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->get("authorizationId", $mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider mockProvider
|
||||
* @param Authorization $obj
|
||||
@@ -115,14 +115,13 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
CaptureTest::getJson()
|
||||
CaptureTest::getJson()
|
||||
));
|
||||
$capture = CaptureTest::getObject();
|
||||
|
||||
$result = $obj->capture($capture, $mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider mockProvider
|
||||
* @param Authorization $obj
|
||||
@@ -136,13 +135,12 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
self::getJson()
|
||||
self::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->void($mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider mockProvider
|
||||
* @param Authorization $obj
|
||||
@@ -156,7 +154,7 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
self::getJson()
|
||||
self::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->reauthorize($mockApiContext, $mockPPRestCall);
|
||||
@@ -167,8 +165,8 @@ class AuthorizationTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$obj = self::getObject();
|
||||
$mockApiContext = $this->getMockBuilder('ApiContext')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
return array(
|
||||
array($obj, $mockApiContext),
|
||||
array($obj, null)
|
||||
|
||||
@@ -13,17 +13,15 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object BankAccount
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"id":"TestSample","account_number":"TestSample","account_number_type":"TestSample","routing_number":"TestSample","account_type":"TestSample","account_name":"TestSample","check_type":"TestSample","auth_type":"TestSample","auth_capture_timestamp":"TestSample","bank_name":"TestSample","country_code":"TestSample","first_name":"TestSample","last_name":"TestSample","birth_date":"TestSample","billing_address":' . AddressTest::getJson() . ',"state":"TestSample","confirmation_status":"TestSample","payer_id":"TestSample","external_customer_id":"TestSample","merchant_id":"TestSample","create_time":"TestSample","update_time":"TestSample","valid_until":"TestSample","links":' . LinksTest::getJson() . '}';
|
||||
return '{"id":"TestSample","account_number":"TestSample","account_number_type":"TestSample","routing_number":"TestSample","account_type":"TestSample","account_name":"TestSample","check_type":"TestSample","auth_type":"TestSample","auth_capture_timestamp":"TestSample","bank_name":"TestSample","country_code":"TestSample","first_name":"TestSample","last_name":"TestSample","birth_date":"TestSample","billing_address":' .AddressTest::getJson() . ',"state":"TestSample","confirmation_status":"TestSample","payer_id":"TestSample","external_customer_id":"TestSample","merchant_id":"TestSample","create_time":"TestSample","update_time":"TestSample","valid_until":"TestSample","links":' .LinksTest::getJson() . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return BankAccount
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class BankAccountTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return BankAccount
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class BankTokenTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object BankToken
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class BankTokenTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return BankToken
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class BankTokenTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return BankToken
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -14,17 +14,15 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Capture
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"id":"TestSample","amount":' . AmountTest::getJson() . ',"is_final_capture":true,"state":"TestSample","parent_payment":"TestSample","transaction_fee":' . CurrencyTest::getJson() . ',"create_time":"TestSample","update_time":"TestSample","links":' . LinksTest::getJson() . '}';
|
||||
return '{"id":"TestSample","amount":' .AmountTest::getJson() . ',"is_final_capture":true,"state":"TestSample","reason_code":"TestSample","parent_payment":"TestSample","invoice_number":"TestSample","transaction_fee":' .CurrencyTest::getJson() . ',"create_time":"TestSample","update_time":"TestSample","links":' .LinksTest::getJson() . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Capture
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -35,7 +33,6 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Capture
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
@@ -46,7 +43,9 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNotNull($obj->getAmount());
|
||||
$this->assertNotNull($obj->getIsFinalCapture());
|
||||
$this->assertNotNull($obj->getState());
|
||||
$this->assertNotNull($obj->getReasonCode());
|
||||
$this->assertNotNull($obj->getParentPayment());
|
||||
$this->assertNotNull($obj->getInvoiceNumber());
|
||||
$this->assertNotNull($obj->getTransactionFee());
|
||||
$this->assertNotNull($obj->getCreateTime());
|
||||
$this->assertNotNull($obj->getUpdateTime());
|
||||
@@ -65,7 +64,9 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($obj->getAmount(), AmountTest::getObject());
|
||||
$this->assertEquals($obj->getIsFinalCapture(), true);
|
||||
$this->assertEquals($obj->getState(), "TestSample");
|
||||
$this->assertEquals($obj->getReasonCode(), "TestSample");
|
||||
$this->assertEquals($obj->getParentPayment(), "TestSample");
|
||||
$this->assertEquals($obj->getInvoiceNumber(), "TestSample");
|
||||
$this->assertEquals($obj->getTransactionFee(), CurrencyTest::getObject());
|
||||
$this->assertEquals($obj->getCreateTime(), "TestSample");
|
||||
$this->assertEquals($obj->getUpdateTime(), "TestSample");
|
||||
@@ -85,13 +86,12 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
CaptureTest::getJson()
|
||||
CaptureTest::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->get("captureId", $mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider mockProvider
|
||||
* @param Capture $obj
|
||||
@@ -117,8 +117,8 @@ class CaptureTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$obj = self::getObject();
|
||||
$mockApiContext = $this->getMockBuilder('ApiContext')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
return array(
|
||||
array($obj, $mockApiContext),
|
||||
array($obj, null)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace PayPal\Test\Api;
|
||||
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Api\CartBase;
|
||||
|
||||
/**
|
||||
@@ -13,17 +14,15 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object CartBase
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"reference_id":"TestSample","amount":' . AmountTest::getJson() . ',"payee":' . PayeeTest::getJson() . ',"description":"TestSample","note_to_payee":"TestSample","custom":"TestSample","invoice_number":"TestSample","soft_descriptor":"TestSample","soft_descriptor_city":"TestSample","payment_options":' . PaymentOptionsTest::getJson() . ',"item_list":' . ItemListTest::getJson() . ',"notify_url":"http://www.google.com","order_url":"http://www.google.com","external_funding":' . ExternalFundingTest::getJson() . '}';
|
||||
return '{"reference_id":"TestSample","amount":' .AmountTest::getJson() . ',"payee":' .PayeeTest::getJson() . ',"description":"TestSample","note_to_payee":"TestSample","custom":"TestSample","invoice_number":"TestSample","soft_descriptor":"TestSample","soft_descriptor_city":"TestSample","payment_options":' .PaymentOptionsTest::getJson() . ',"item_list":' .ItemListTest::getJson() . ',"notify_url":"http://www.google.com","order_url":"http://www.google.com","external_funding":' .ExternalFundingTest::getJson() . ',"type":"TestSample"}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return CartBase
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +33,6 @@ class CartBaseTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return CartBase
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -23,7 +23,6 @@ class CreditCardTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return CreditCard
|
||||
*/
|
||||
public static function getObject()
|
||||
|
||||
68
tests/PayPal/Test/Api/DetailedRefundTest.php
Normal file
68
tests/PayPal/Test/Api/DetailedRefundTest.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Test\Api;
|
||||
|
||||
use PayPal\Api\DetailedRefund;
|
||||
|
||||
/**
|
||||
* Class DetailedRefund
|
||||
*
|
||||
* @package PayPal\Test\Api
|
||||
*/
|
||||
class DetailedRefundTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object DetailedRefund
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"custom":"TestSample","invoice_number":"TestSample","refund_to_payer":' .CurrencyTest::getJson() . ',"refund_to_external_funding":' .ExternalFundingTest::getJson() . ',"refund_from_transaction_fee":' .CurrencyTest::getJson() . ',"refund_from_received_amount":' .CurrencyTest::getJson() . ',"total_refunded_amount":' .CurrencyTest::getJson() . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
* @return DetailedRefund
|
||||
*/
|
||||
public static function getObject()
|
||||
{
|
||||
return new DetailedRefund(self::getJson());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
* @return DetailedRefund
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
{
|
||||
$obj = new DetailedRefund(self::getJson());
|
||||
$this->assertNotNull($obj);
|
||||
$this->assertNotNull($obj->getCustom());
|
||||
$this->assertNotNull($obj->getInvoiceNumber());
|
||||
$this->assertNotNull($obj->getRefundToPayer());
|
||||
$this->assertNotNull($obj->getRefundToExternalFunding());
|
||||
$this->assertNotNull($obj->getRefundFromTransactionFee());
|
||||
$this->assertNotNull($obj->getRefundFromReceivedAmount());
|
||||
$this->assertNotNull($obj->getTotalRefundedAmount());
|
||||
$this->assertEquals(self::getJson(), $obj->toJson());
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testSerializationDeserialization
|
||||
* @param DetailedRefund $obj
|
||||
*/
|
||||
public function testGetters($obj)
|
||||
{
|
||||
$this->assertEquals($obj->getCustom(), "TestSample");
|
||||
$this->assertEquals($obj->getInvoiceNumber(), "TestSample");
|
||||
$this->assertEquals($obj->getRefundToPayer(), CurrencyTest::getObject());
|
||||
$this->assertEquals($obj->getRefundToExternalFunding(), ExternalFundingTest::getObject());
|
||||
$this->assertEquals($obj->getRefundFromTransactionFee(), CurrencyTest::getObject());
|
||||
$this->assertEquals($obj->getRefundFromReceivedAmount(), CurrencyTest::getObject());
|
||||
$this->assertEquals($obj->getTotalRefundedAmount(), CurrencyTest::getObject());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -23,7 +23,6 @@ class ErrorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Error
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +33,6 @@ class ErrorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Error
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class ExtendedBankAccountTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object ExtendedBankAccount
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class ExtendedBankAccountTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return ExtendedBankAccount
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class ExtendedBankAccountTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return ExtendedBankAccount
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class FmfDetailsTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object FmfDetails
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class FmfDetailsTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return FmfDetails
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class FmfDetailsTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return FmfDetails
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class FundingDetailTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object FundingDetail
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class FundingDetailTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return FundingDetail
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class FundingDetailTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return FundingDetail
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object FundingInstrument
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return FundingInstrument
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return FundingInstrument
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
@@ -53,7 +50,6 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNotNull($obj->getCarrierAccount());
|
||||
$this->assertNotNull($obj->getPrivateLabelCard());
|
||||
$this->assertNotNull($obj->getBilling());
|
||||
$this->assertNotNull($obj->getAlternatePayment());
|
||||
$this->assertEquals(self::getJson(), $obj->toJson());
|
||||
return $obj;
|
||||
}
|
||||
@@ -76,6 +72,5 @@ class FundingInstrumentTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($obj->getCarrierAccount(), CarrierAccountTest::getObject());
|
||||
$this->assertEquals($obj->getPrivateLabelCard(), PrivateLabelCardTest::getObject());
|
||||
$this->assertEquals($obj->getBilling(), BillingTest::getObject());
|
||||
$this->assertEquals($obj->getAlternatePayment(), AlternatePaymentTest::getObject());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ class FundingOptionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object FundingOption
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class FundingOptionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return FundingOption
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class FundingOptionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return FundingOption
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,17 +13,15 @@ class FundingSourceTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object FundingSource
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"funding_mode":"TestSample","funding_instrument_type":"TestSample","soft_descriptor":"TestSample","amount":' . CurrencyTest::getJson() . ',"legal_text":"TestSample","funding_detail":' . FundingDetailTest::getJson() . ',"additional_text":"TestSample","extends":' . FundingInstrumentTest::getJson() . ',"links":' . LinksTest::getJson() . '}';
|
||||
return '{"funding_mode":"TestSample","funding_instrument_type":"TestSample","soft_descriptor":"TestSample","amount":' .CurrencyTest::getJson() . ',"negative_balance_amount":' .CurrencyTest::getJson() . ',"legal_text":"TestSample","terms":"TestSample","funding_detail":' .FundingDetailTest::getJson() . ',"additional_text":"TestSample","links":' .LinksTest::getJson() . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return FundingSource
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class FundingSourceTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return FundingSource
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
@@ -45,10 +42,10 @@ class FundingSourceTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNotNull($obj->getFundingInstrumentType());
|
||||
$this->assertNotNull($obj->getSoftDescriptor());
|
||||
$this->assertNotNull($obj->getAmount());
|
||||
$this->assertNotNull($obj->getNegativeBalanceAmount());
|
||||
$this->assertNotNull($obj->getLegalText());
|
||||
$this->assertNotNull($obj->getFundingDetail());
|
||||
$this->assertNotNull($obj->getAdditionalText());
|
||||
$this->assertNotNull($obj->getExtends());
|
||||
$this->assertNotNull($obj->getLinks());
|
||||
$this->assertEquals(self::getJson(), $obj->toJson());
|
||||
return $obj;
|
||||
@@ -64,10 +61,10 @@ class FundingSourceTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($obj->getFundingInstrumentType(), "TestSample");
|
||||
$this->assertEquals($obj->getSoftDescriptor(), "TestSample");
|
||||
$this->assertEquals($obj->getAmount(), CurrencyTest::getObject());
|
||||
$this->assertEquals($obj->getNegativeBalanceAmount(), CurrencyTest::getObject());
|
||||
$this->assertEquals($obj->getLegalText(), "TestSample");
|
||||
$this->assertEquals($obj->getFundingDetail(), FundingDetailTest::getObject());
|
||||
$this->assertEquals($obj->getAdditionalText(), "TestSample");
|
||||
$this->assertEquals($obj->getExtends(), FundingInstrumentTest::getObject());
|
||||
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ class IncentiveTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Incentive
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class IncentiveTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Incentive
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class IncentiveTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Incentive
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class InstallmentInfoTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object InstallmentInfo
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class InstallmentInfoTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return InstallmentInfo
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class InstallmentInfoTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return InstallmentInfo
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class InstallmentOptionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object InstallmentOption
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class InstallmentOptionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return InstallmentOption
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class InstallmentOptionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return InstallmentOption
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class ItemListTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object ItemList
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class ItemListTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return ItemList
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class ItemListTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return ItemList
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class ItemTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Item
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class ItemTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Item
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class ItemTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Item
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class MeasurementTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Measurement
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class MeasurementTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Measurement
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class MeasurementTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Measurement
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class NameValuePairTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object NameValuePair
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class NameValuePairTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return NameValuePair
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class NameValuePairTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return NameValuePair
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -14,17 +14,15 @@ class OrderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Order
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"id":"TestSample","purchase_unit_reference_id":"TestSample","amount":' . AmountTest::getJson() . ',"payment_mode":"TestSample","state":"TestSample","reason_code":"TestSample","pending_reason":"TestSample","protection_eligibility":"TestSample","protection_eligibility_type":"TestSample","parent_payment":"TestSample","fmf_details":' . FmfDetailsTest::getJson() . ',"create_time":"TestSample","update_time":"TestSample","links":' . LinksTest::getJson() . '}';
|
||||
return '{"id":"TestSample","reference_id":"TestSample","amount":' .AmountTest::getJson() . ',"payment_mode":"TestSample","state":"TestSample","reason_code":"TestSample","pending_reason":"TestSample","protection_eligibility":"TestSample","protection_eligibility_type":"TestSample","parent_payment":"TestSample","fmf_details":' .FmfDetailsTest::getJson() . ',"create_time":"TestSample","update_time":"TestSample","links":' .LinksTest::getJson() . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Order
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -35,7 +33,6 @@ class OrderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Order
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
@@ -43,7 +40,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase
|
||||
$obj = new Order(self::getJson());
|
||||
$this->assertNotNull($obj);
|
||||
$this->assertNotNull($obj->getId());
|
||||
$this->assertNotNull($obj->getPurchaseUnitReferenceId());
|
||||
$this->assertNotNull($obj->getReferenceId());
|
||||
$this->assertNotNull($obj->getAmount());
|
||||
$this->assertNotNull($obj->getPaymentMode());
|
||||
$this->assertNotNull($obj->getState());
|
||||
@@ -67,7 +64,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase
|
||||
public function testGetters($obj)
|
||||
{
|
||||
$this->assertEquals($obj->getId(), "TestSample");
|
||||
$this->assertEquals($obj->getPurchaseUnitReferenceId(), "TestSample");
|
||||
$this->assertEquals($obj->getReferenceId(), "TestSample");
|
||||
$this->assertEquals($obj->getAmount(), AmountTest::getObject());
|
||||
$this->assertEquals($obj->getPaymentMode(), "TestSample");
|
||||
$this->assertEquals($obj->getState(), "TestSample");
|
||||
@@ -95,13 +92,12 @@ class OrderTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
OrderTest::getJson()
|
||||
OrderTest::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->get("orderId", $mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider mockProvider
|
||||
* @param Order $obj
|
||||
@@ -115,14 +111,13 @@ class OrderTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
CaptureTest::getJson()
|
||||
CaptureTest::getJson()
|
||||
));
|
||||
$capture = CaptureTest::getObject();
|
||||
|
||||
$result = $obj->capture($capture, $mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider mockProvider
|
||||
* @param Order $obj
|
||||
@@ -136,13 +131,12 @@ class OrderTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
self::getJson()
|
||||
self::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->void($mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider mockProvider
|
||||
* @param Order $obj
|
||||
@@ -156,7 +150,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
AuthorizationTest::getJson()
|
||||
AuthorizationTest::getJson()
|
||||
));
|
||||
|
||||
$authorization = new Authorization();
|
||||
@@ -168,8 +162,8 @@ class OrderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$obj = self::getObject();
|
||||
$mockApiContext = $this->getMockBuilder('ApiContext')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
return array(
|
||||
array($obj, $mockApiContext),
|
||||
array($obj, null)
|
||||
|
||||
@@ -13,17 +13,15 @@ class PayeeTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Payee
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"email":"TestSample","merchant_id":"TestSample","first_name":"TestSample","last_name":"TestSample","account_number":"TestSample","phone":' . PhoneTest::getJson() . '}';
|
||||
return '{"email":"TestSample","merchant_id":"TestSample","first_name":"TestSample","last_name":"TestSample","account_number":"TestSample","phone":' .PhoneTest::getJson() . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Payee
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class PayeeTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Payee
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,17 +13,15 @@ class PayerInfoTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object PayerInfo
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"email":"TestSample","external_remember_me_id":"TestSample","account_number":"TestSample","salutation":"TestSample","first_name":"TestSample","middle_name":"TestSample","last_name":"TestSample","suffix":"TestSample","payer_id":"TestSample","phone":"TestSample","phone_type":"TestSample","birth_date":"TestSample","tax_id":"TestSample","tax_id_type":"TestSample","country_code":"TestSample","billing_address":' . AddressTest::getJson() . ',"shipping_address":' . ShippingAddressTest::getJson() . '}';
|
||||
return '{"email":"TestSample","external_remember_me_id":"TestSample","buyer_account_number":"TestSample","salutation":"TestSample","first_name":"TestSample","middle_name":"TestSample","last_name":"TestSample","suffix":"TestSample","payer_id":"TestSample","phone":"TestSample","phone_type":"TestSample","birth_date":"TestSample","tax_id":"TestSample","tax_id_type":"TestSample","country_code":"TestSample","billing_address":' .AddressTest::getJson() . ',"shipping_address":' .ShippingAddressTest::getJson() . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return PayerInfo
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class PayerInfoTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return PayerInfo
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
@@ -43,7 +40,7 @@ class PayerInfoTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNotNull($obj);
|
||||
$this->assertNotNull($obj->getEmail());
|
||||
$this->assertNotNull($obj->getExternalRememberMeId());
|
||||
$this->assertNotNull($obj->getAccountNumber());
|
||||
$this->assertNotNull($obj->getBuyerAccountNumber());
|
||||
$this->assertNotNull($obj->getSalutation());
|
||||
$this->assertNotNull($obj->getFirstName());
|
||||
$this->assertNotNull($obj->getMiddleName());
|
||||
@@ -70,7 +67,7 @@ class PayerInfoTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$this->assertEquals($obj->getEmail(), "TestSample");
|
||||
$this->assertEquals($obj->getExternalRememberMeId(), "TestSample");
|
||||
$this->assertEquals($obj->getAccountNumber(), "TestSample");
|
||||
$this->assertEquals($obj->getBuyerAccountNumber(), "TestSample");
|
||||
$this->assertEquals($obj->getSalutation(), "TestSample");
|
||||
$this->assertEquals($obj->getFirstName(), "TestSample");
|
||||
$this->assertEquals($obj->getMiddleName(), "TestSample");
|
||||
|
||||
@@ -13,17 +13,15 @@ class PayerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Payer
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"payment_method":"TestSample","status":"TestSample","account_type":"TestSample","account_age":"TestSample","funding_instruments":' . FundingInstrumentTest::getJson() . ',"funding_option_id":"TestSample","funding_option":' . FundingOptionTest::getJson() . ',"related_funding_option":' . FundingOptionTest::getJson() . ',"payer_info":' . PayerInfoTest::getJson() . '}';
|
||||
return '{"payment_method":"TestSample","status":"TestSample","account_type":"TestSample","account_age":"TestSample","funding_instruments":' .FundingInstrumentTest::getJson() . ',"funding_option_id":"TestSample","funding_option":' .FundingOptionTest::getJson() . ',"external_selected_funding_instrument_type":"TestSample","related_funding_option":' .FundingOptionTest::getJson() . ',"payer_info":' .PayerInfoTest::getJson() . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Payer
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class PayerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Payer
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
@@ -48,6 +45,7 @@ class PayerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNotNull($obj->getFundingInstruments());
|
||||
$this->assertNotNull($obj->getFundingOptionId());
|
||||
$this->assertNotNull($obj->getFundingOption());
|
||||
$this->assertNotNull($obj->getExternalSelectedFundingInstrumentType());
|
||||
$this->assertNotNull($obj->getRelatedFundingOption());
|
||||
$this->assertNotNull($obj->getPayerInfo());
|
||||
$this->assertEquals(self::getJson(), $obj->toJson());
|
||||
@@ -67,6 +65,7 @@ class PayerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($obj->getFundingInstruments(), FundingInstrumentTest::getObject());
|
||||
$this->assertEquals($obj->getFundingOptionId(), "TestSample");
|
||||
$this->assertEquals($obj->getFundingOption(), FundingOptionTest::getObject());
|
||||
$this->assertEquals($obj->getExternalSelectedFundingInstrumentType(), "TestSample");
|
||||
$this->assertEquals($obj->getRelatedFundingOption(), FundingOptionTest::getObject());
|
||||
$this->assertEquals($obj->getPayerInfo(), PayerInfoTest::getObject());
|
||||
}
|
||||
|
||||
@@ -13,17 +13,15 @@ class PaymentCardTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object PaymentCard
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"id":"TestSample","number":"TestSample","type":"TestSample","expire_month":123,"expire_year":123,"start_month":"TestSample","start_year":"TestSample","cvv2":"TestSample","first_name":"TestSample","last_name":"TestSample","billing_country":"TestSample","billing_address":' . AddressTest::getJson() . ',"external_customer_id":"TestSample","status":"TestSample","valid_until":"TestSample","issue_number":"TestSample","links":' . LinksTest::getJson() . '}';
|
||||
return '{"id":"TestSample","number":"TestSample","type":"TestSample","expire_month":"123","expire_year":"123","start_month":"TestSample","start_year":"TestSample","cvv2":"TestSample","first_name":"TestSample","last_name":"TestSample","billing_country":"TestSample","billing_address":' .AddressTest::getJson() . ',"external_customer_id":"TestSample","status":"TestSample","card_product_class":"TestSample","valid_until":"TestSample","issue_number":"TestSample","links":' .LinksTest::getJson() . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return PaymentCard
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class PaymentCardTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return PaymentCard
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
@@ -55,6 +52,7 @@ class PaymentCardTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNotNull($obj->getBillingAddress());
|
||||
$this->assertNotNull($obj->getExternalCustomerId());
|
||||
$this->assertNotNull($obj->getStatus());
|
||||
$this->assertNotNull($obj->getCardProductClass());
|
||||
$this->assertNotNull($obj->getValidUntil());
|
||||
$this->assertNotNull($obj->getIssueNumber());
|
||||
$this->assertNotNull($obj->getLinks());
|
||||
@@ -71,8 +69,8 @@ class PaymentCardTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($obj->getId(), "TestSample");
|
||||
$this->assertEquals($obj->getNumber(), "TestSample");
|
||||
$this->assertEquals($obj->getType(), "TestSample");
|
||||
$this->assertEquals($obj->getExpireMonth(), 123);
|
||||
$this->assertEquals($obj->getExpireYear(), 123);
|
||||
$this->assertEquals($obj->getExpireMonth(), "TestSample");
|
||||
$this->assertEquals($obj->getExpireYear(), "TestSample");
|
||||
$this->assertEquals($obj->getStartMonth(), "TestSample");
|
||||
$this->assertEquals($obj->getStartYear(), "TestSample");
|
||||
$this->assertEquals($obj->getCvv2(), "TestSample");
|
||||
@@ -82,6 +80,7 @@ class PaymentCardTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($obj->getBillingAddress(), AddressTest::getObject());
|
||||
$this->assertEquals($obj->getExternalCustomerId(), "TestSample");
|
||||
$this->assertEquals($obj->getStatus(), "TestSample");
|
||||
$this->assertEquals($obj->getCardProductClass(), "TestSample");
|
||||
$this->assertEquals($obj->getValidUntil(), "TestSample");
|
||||
$this->assertEquals($obj->getIssueNumber(), "TestSample");
|
||||
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
||||
|
||||
@@ -13,7 +13,6 @@ class PaymentExecutionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object PaymentExecution
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class PaymentExecutionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return PaymentExecution
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class PaymentExecutionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return PaymentExecution
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class PaymentHistoryTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object PaymentHistory
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class PaymentHistoryTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return PaymentHistory
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class PaymentHistoryTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return PaymentHistory
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class PaymentOptionsTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object PaymentOptions
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class PaymentOptionsTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return PaymentOptions
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class PaymentOptionsTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return PaymentOptions
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace PayPal\Test\Api;
|
||||
|
||||
use PayPal\Api\object;
|
||||
use PayPal\Api\Payment;
|
||||
|
||||
/**
|
||||
@@ -14,7 +13,6 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Payment
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -24,7 +22,6 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Payment
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -35,7 +32,6 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Payment
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
@@ -105,13 +101,12 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
self::getJson()
|
||||
self::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->create($mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider mockProvider
|
||||
* @param Payment $obj
|
||||
@@ -125,13 +120,12 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
PaymentTest::getJson()
|
||||
PaymentTest::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->get("paymentId", $mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider mockProvider
|
||||
* @param Payment $obj
|
||||
@@ -152,7 +146,6 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
|
||||
$result = $obj->update($patchRequest, $mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider mockProvider
|
||||
* @param Payment $obj
|
||||
@@ -166,14 +159,13 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
self::getJson()
|
||||
self::getJson()
|
||||
));
|
||||
$paymentExecution = PaymentExecutionTest::getObject();
|
||||
|
||||
$result = $obj->execute($paymentExecution, $mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider mockProvider
|
||||
* @param Payment $obj
|
||||
@@ -187,7 +179,7 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
PaymentHistoryTest::getJson()
|
||||
PaymentHistoryTest::getJson()
|
||||
));
|
||||
$params = array();
|
||||
|
||||
@@ -199,8 +191,8 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$obj = self::getObject();
|
||||
$mockApiContext = $this->getMockBuilder('ApiContext')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
return array(
|
||||
array($obj, $mockApiContext),
|
||||
array($obj, null)
|
||||
|
||||
@@ -13,7 +13,6 @@ class PhoneTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Phone
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class PhoneTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Phone
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class PhoneTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Phone
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class RecipientBankingInstructionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object RecipientBankingInstruction
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class RecipientBankingInstructionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return RecipientBankingInstruction
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class RecipientBankingInstructionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return RecipientBankingInstruction
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class RedirectUrlsTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object RedirectUrls
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class RedirectUrlsTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return RedirectUrls
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class RedirectUrlsTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return RedirectUrls
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
@@ -66,7 +63,6 @@ class RedirectUrlsTest extends \PHPUnit_Framework_TestCase
|
||||
$obj = new RedirectUrls();
|
||||
$obj->setReturnUrl(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage CancelUrl is not a fully qualified URL
|
||||
|
||||
66
tests/PayPal/Test/Api/RefundRequestTest.php
Normal file
66
tests/PayPal/Test/Api/RefundRequestTest.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Test\Api;
|
||||
|
||||
use PayPal\Api\RefundRequest;
|
||||
|
||||
/**
|
||||
* Class RefundRequest
|
||||
*
|
||||
* @package PayPal\Test\Api
|
||||
*/
|
||||
class RefundRequestTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object RefundRequest
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"amount":' .AmountTest::getJson() . ',"description":"TestSample","refund_type":"TestSample","refund_source":"TestSample","reason":"TestSample","invoice_number":"TestSample","refund_advice":true,"is_non_platform_transaction":"TestSample"}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
* @return RefundRequest
|
||||
*/
|
||||
public static function getObject()
|
||||
{
|
||||
return new RefundRequest(self::getJson());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
* @return RefundRequest
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
{
|
||||
$obj = new RefundRequest(self::getJson());
|
||||
$this->assertNotNull($obj);
|
||||
$this->assertNotNull($obj->getAmount());
|
||||
$this->assertNotNull($obj->getDescription());
|
||||
$this->assertNotNull($obj->getRefundSource());
|
||||
$this->assertNotNull($obj->getReason());
|
||||
$this->assertNotNull($obj->getInvoiceNumber());
|
||||
$this->assertNotNull($obj->getRefundAdvice());
|
||||
$this->assertEquals(self::getJson(), $obj->toJson());
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testSerializationDeserialization
|
||||
* @param RefundRequest $obj
|
||||
*/
|
||||
public function testGetters($obj)
|
||||
{
|
||||
$this->assertEquals($obj->getAmount(), AmountTest::getObject());
|
||||
$this->assertEquals($obj->getDescription(), "TestSample");
|
||||
$this->assertEquals($obj->getRefundSource(), "TestSample");
|
||||
$this->assertEquals($obj->getReason(), "TestSample");
|
||||
$this->assertEquals($obj->getInvoiceNumber(), "TestSample");
|
||||
$this->assertEquals($obj->getRefundAdvice(), true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -13,17 +13,15 @@ class RefundTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Refund
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"id":"TestSample","amount":' . AmountTest::getJson() . ',"state":"TestSample","reason":"TestSample","sale_id":"TestSample","capture_id":"TestSample","parent_payment":"TestSample","description":"TestSample","create_time":"TestSample","update_time":"TestSample","links":' . LinksTest::getJson() . '}';
|
||||
return '{"id":"TestSample","amount":' .AmountTest::getJson() . ',"state":"TestSample","reason":"TestSample","invoice_number":"TestSample","sale_id":"TestSample","capture_id":"TestSample","parent_payment":"TestSample","description":"TestSample","create_time":"TestSample","update_time":"TestSample","reason_code":"TestSample","links":' .LinksTest::getJson() . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Refund
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class RefundTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Refund
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
@@ -45,12 +42,14 @@ class RefundTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNotNull($obj->getAmount());
|
||||
$this->assertNotNull($obj->getState());
|
||||
$this->assertNotNull($obj->getReason());
|
||||
$this->assertNotNull($obj->getInvoiceNumber());
|
||||
$this->assertNotNull($obj->getSaleId());
|
||||
$this->assertNotNull($obj->getCaptureId());
|
||||
$this->assertNotNull($obj->getParentPayment());
|
||||
$this->assertNotNull($obj->getDescription());
|
||||
$this->assertNotNull($obj->getCreateTime());
|
||||
$this->assertNotNull($obj->getUpdateTime());
|
||||
$this->assertNotNull($obj->getReasonCode());
|
||||
$this->assertNotNull($obj->getLinks());
|
||||
$this->assertEquals(self::getJson(), $obj->toJson());
|
||||
return $obj;
|
||||
@@ -66,12 +65,14 @@ class RefundTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($obj->getAmount(), AmountTest::getObject());
|
||||
$this->assertEquals($obj->getState(), "TestSample");
|
||||
$this->assertEquals($obj->getReason(), "TestSample");
|
||||
$this->assertEquals($obj->getInvoiceNumber(), "TestSample");
|
||||
$this->assertEquals($obj->getSaleId(), "TestSample");
|
||||
$this->assertEquals($obj->getCaptureId(), "TestSample");
|
||||
$this->assertEquals($obj->getParentPayment(), "TestSample");
|
||||
$this->assertEquals($obj->getDescription(), "TestSample");
|
||||
$this->assertEquals($obj->getCreateTime(), "TestSample");
|
||||
$this->assertEquals($obj->getUpdateTime(), "TestSample");
|
||||
$this->assertEquals($obj->getReasonCode(), "TestSample");
|
||||
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
|
||||
}
|
||||
|
||||
@@ -88,7 +89,7 @@ class RefundTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
RefundTest::getJson()
|
||||
RefundTest::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->get("refundId", $mockApiContext, $mockPPRestCall);
|
||||
@@ -99,8 +100,8 @@ class RefundTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$obj = self::getObject();
|
||||
$mockApiContext = $this->getMockBuilder('ApiContext')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
return array(
|
||||
array($obj, $mockApiContext),
|
||||
array($obj, null)
|
||||
|
||||
@@ -13,7 +13,6 @@ class RelatedResourcesTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object RelatedResources
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class RelatedResourcesTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return RelatedResources
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class RelatedResourcesTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return RelatedResources
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -13,7 +13,6 @@ class SaleTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object Sale
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class SaleTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Sale
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class SaleTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Sale
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
@@ -110,13 +107,12 @@ class SaleTest extends \PHPUnit_Framework_TestCase
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
SaleTest::getJson()
|
||||
SaleTest::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->get("saleId", $mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider mockProvider
|
||||
* @param Sale $obj
|
||||
|
||||
@@ -13,7 +13,6 @@ class ShippingAddressTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* Gets Json String of Object ShippingAddress
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getJson()
|
||||
@@ -23,7 +22,6 @@ class ShippingAddressTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return ShippingAddress
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +32,6 @@ class ShippingAddressTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return ShippingAddress
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -23,7 +23,6 @@ class TransactionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Gets Object Instance with Json data filled in
|
||||
*
|
||||
* @return Transaction
|
||||
*/
|
||||
public static function getObject()
|
||||
@@ -34,7 +33,6 @@ class TransactionTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* Tests for Serialization and Deserialization Issues
|
||||
*
|
||||
* @return Transaction
|
||||
*/
|
||||
public function testSerializationDeserialization()
|
||||
|
||||
@@ -23,8 +23,9 @@
|
||||
"payment_method": "credit_card",
|
||||
"funding_instruments": [
|
||||
{
|
||||
"credit_card": {
|
||||
"payment_card": {
|
||||
"number": "4160285494148633",
|
||||
"billing_country": "US",
|
||||
"type": "visa",
|
||||
"expire_month": 11,
|
||||
"expire_year": 2018,
|
||||
|
||||
Reference in New Issue
Block a user