PHP Class PayPal\Api\Sale

Inheritance: extends PayPal\Common\PPModel, implements PayPal\Rest\IResource
Show file Open project: paypal/rest-api-sdk-php Class Usage Examples

Public Methods

Method Description
addPaymentHoldReason ( string $string ) Append PaymentHoldReasons to the list.
get ( string $saleId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Sale Shows details for a sale, by ID. Returns only sales that were created through the REST API.
getAmount ( ) : Amount Amount being collected.
getBillingAgreementId ( ) : string ID of the billing agreement used as reference to execute this transaction.
getClearingTime ( ) : string Expected clearing time for eCheck Transactions. Returned when payment is made with eCheck. Only supported when the payment_method is set to paypal.
getCreateTime ( ) : string Time of sale as defined in RFC 3339 Section 5.6
getExchangeRate ( ) : string Exchange rate applied for this transaction. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
getFmfDetails ( ) : FmfDetails Fraud Management Filter (FMF) details applied for the payment that could result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. See Fraud Management Filters Summary for more information.
getId ( ) : string Identifier of the sale transaction.
getParentPayment ( ) : string ID of the payment resource on which this transaction is based.
getPaymentHoldReasons ( ) : string[] Reasons for PayPal holding recipient fund. It is set only if payment hold status is held
getPaymentHoldStatus ( ) : string Status of the Recipient Fund. For now, it will be returned only when fund status is held
getPaymentMode ( ) : string Specifies payment mode of the transaction. Only supported when the payment_method is set to paypal.
getProcessorResponse ( ) : PayPal\Api\ProcessorResponse Response codes returned by the processor concerning the submitted payment. Only supported when the payment_method is set to credit_card.
getProtectionEligibility ( ) : string The level of seller protection in force for the transaction. Only supported when the payment_method is set to paypal.
getProtectionEligibilityType ( ) : string The kind of seller protection in force for the transaction. It is returned only when protection_eligibility is ELIGIBLE or PARTIALLY_ELIGIBLE. Only supported when the payment_method is set to paypal.
getPurchaseUnitReferenceId ( ) : string Identifier to the purchase or transaction unit corresponding to this sale transaction.
getReasonCode ( ) : string Reason code for the transaction state being Pending or Reversed. Only supported when the payment_method is set to paypal.
getReceiptId ( ) : string Receipt id is a payment identification number returned for guest users to identify the payment.
getReceivableAmount ( ) : PayPal\Api\Currency Net amount the merchant receives for this transaction in their receivable currency. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
getState ( ) : string State of the sale transaction.
getTransactionFee ( ) : PayPal\Api\Currency Transaction fee applicable for this payment.
getUpdateTime ( ) : string Time the resource was last updated in UTC ISO8601 format.
refund ( Refund $refund, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Refund 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.
refundSale ( RefundRequest $refundRequest, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : DetailedRefund 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.
removePaymentHoldReason ( string $string ) Remove PaymentHoldReasons from the list.
setAmount ( Amount $amount ) Amount being collected.
setBillingAgreementId ( string $billing_agreement_id ) ID of the billing agreement used as reference to execute this transaction.
setClearingTime ( string $clearing_time ) Expected clearing time for eCheck Transactions. Returned when payment is made with eCheck. Only supported when the payment_method is set to paypal.
setCreateTime ( string $create_time ) Time of sale as defined in RFC 3339 Section 5.6
setExchangeRate ( string $exchange_rate ) Exchange rate applied for this transaction. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
setFmfDetails ( FmfDetails $fmf_details ) Fraud Management Filter (FMF) details applied for the payment that could result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. See Fraud Management Filters Summary for more information.
setId ( string $id ) Identifier of the sale transaction.
setParentPayment ( string $parent_payment ) ID of the payment resource on which this transaction is based.
setPaymentHoldReasons ( string[] $payment_hold_reasons ) Reasons for PayPal holding recipient fund. It is set only if payment hold status is held
setPaymentHoldStatus ( string $payment_hold_status ) Status of the Recipient Fund. For now, it will be returned only when fund status is held Valid Values: ["HELD"]
setPaymentMode ( string $payment_mode ) Specifies payment mode of the transaction. Only supported when the payment_method is set to paypal.
setProcessorResponse ( PayPal\Api\ProcessorResponse $processor_response ) Response codes returned by the processor concerning the submitted payment. Only supported when the payment_method is set to credit_card.
setProtectionEligibility ( string $protection_eligibility ) The level of seller protection in force for the transaction. Only supported when the payment_method is set to paypal.
setProtectionEligibilityType ( string $protection_eligibility_type ) The kind of seller protection in force for the transaction. It is returned only when protection_eligibility is ELIGIBLE or PARTIALLY_ELIGIBLE. Only supported when the payment_method is set to paypal.
setPurchaseUnitReferenceId ( string $purchase_unit_reference_id ) Identifier to the purchase or transaction unit corresponding to this sale transaction.
setReasonCode ( string $reason_code ) Reason code for the transaction state being Pending or Reversed. Only supported when the payment_method is set to paypal.
setReceiptId ( string $receipt_id ) Receipt id is a payment identification number returned for guest users to identify the payment.
setReceivableAmount ( PayPal\Api\Currency $receivable_amount ) Net amount the merchant receives for this transaction in their receivable currency. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
setState ( string $state ) State of the sale transaction.
setTransactionFee ( PayPal\Api\Currency $transaction_fee ) Transaction fee applicable for this payment.
setUpdateTime ( string $update_time ) Time the resource was last updated in UTC ISO8601 format.

Method Details

addPaymentHoldReason() public method

Append PaymentHoldReasons to the list.
public addPaymentHoldReason ( string $string )
$string string

get() public static method

Shows details for a sale, by ID. Returns only sales that were created through the REST API.
public static get ( string $saleId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Sale
$saleId string
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPalRestCall is the Rest Call Service that is used to make rest calls
return Sale

getAmount() public method

Amount being collected.
public getAmount ( ) : Amount
return Amount

getBillingAgreementId() public method

ID of the billing agreement used as reference to execute this transaction.
public getBillingAgreementId ( ) : string
return string

getClearingTime() public method

Expected clearing time for eCheck Transactions. Returned when payment is made with eCheck. Only supported when the payment_method is set to paypal.
public getClearingTime ( ) : string
return string

getCreateTime() public method

Time of sale as defined in RFC 3339 Section 5.6
public getCreateTime ( ) : string
return string

getExchangeRate() public method

Exchange rate applied for this transaction. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
public getExchangeRate ( ) : string
return string

getFmfDetails() public method

Fraud Management Filter (FMF) details applied for the payment that could result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. See Fraud Management Filters Summary for more information.
public getFmfDetails ( ) : FmfDetails
return FmfDetails

getId() public method

Identifier of the sale transaction.
public getId ( ) : string
return string

getParentPayment() public method

ID of the payment resource on which this transaction is based.
public getParentPayment ( ) : string
return string

getPaymentHoldReasons() public method

Reasons for PayPal holding recipient fund. It is set only if payment hold status is held
public getPaymentHoldReasons ( ) : string[]
return string[]

getPaymentHoldStatus() public method

Status of the Recipient Fund. For now, it will be returned only when fund status is held
public getPaymentHoldStatus ( ) : string
return string

getPaymentMode() public method

Specifies payment mode of the transaction. Only supported when the payment_method is set to paypal.
public getPaymentMode ( ) : string
return string

getProcessorResponse() public method

Response codes returned by the processor concerning the submitted payment. Only supported when the payment_method is set to credit_card.
public getProcessorResponse ( ) : PayPal\Api\ProcessorResponse
return PayPal\Api\ProcessorResponse

getProtectionEligibility() public method

The level of seller protection in force for the transaction. Only supported when the payment_method is set to paypal.
public getProtectionEligibility ( ) : string
return string

getProtectionEligibilityType() public method

The kind of seller protection in force for the transaction. It is returned only when protection_eligibility is ELIGIBLE or PARTIALLY_ELIGIBLE. Only supported when the payment_method is set to paypal.

getPurchaseUnitReferenceId() public method

Identifier to the purchase or transaction unit corresponding to this sale transaction.

getReasonCode() public method

Reason code for the transaction state being Pending or Reversed. Only supported when the payment_method is set to paypal.
public getReasonCode ( ) : string
return string

getReceiptId() public method

Receipt id is a payment identification number returned for guest users to identify the payment.
public getReceiptId ( ) : string
return string

getReceivableAmount() public method

Net amount the merchant receives for this transaction in their receivable currency. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
public getReceivableAmount ( ) : PayPal\Api\Currency
return PayPal\Api\Currency

getState() public method

State of the sale transaction.
public getState ( ) : string
return string

getTransactionFee() public method

Transaction fee applicable for this payment.
public getTransactionFee ( ) : PayPal\Api\Currency
return PayPal\Api\Currency

getUpdateTime() public method

Time the resource was last updated in UTC ISO8601 format.
public getUpdateTime ( ) : string
return string

refund() public method

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.
Deprecation: Please use #refundSale instead.
public refund ( Refund $refund, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Refund
$refund Refund
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPalRestCall is the Rest Call Service that is used to make rest calls
return Refund

refundSale() public method

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.
public refundSale ( RefundRequest $refundRequest, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : DetailedRefund
$refundRequest RefundRequest
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPalRestCall is the Rest Call Service that is used to make rest calls
return DetailedRefund

removePaymentHoldReason() public method

Remove PaymentHoldReasons from the list.
public removePaymentHoldReason ( string $string )
$string string

setAmount() public method

Amount being collected.
public setAmount ( Amount $amount )
$amount Amount

setBillingAgreementId() public method

ID of the billing agreement used as reference to execute this transaction.
public setBillingAgreementId ( string $billing_agreement_id )
$billing_agreement_id string

setClearingTime() public method

Expected clearing time for eCheck Transactions. Returned when payment is made with eCheck. Only supported when the payment_method is set to paypal.
public setClearingTime ( string $clearing_time )
$clearing_time string

setCreateTime() public method

Time of sale as defined in RFC 3339 Section 5.6
public setCreateTime ( string $create_time )
$create_time string

setExchangeRate() public method

Exchange rate applied for this transaction. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
public setExchangeRate ( string $exchange_rate )
$exchange_rate string

setFmfDetails() public method

Fraud Management Filter (FMF) details applied for the payment that could result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. See Fraud Management Filters Summary for more information.
public setFmfDetails ( FmfDetails $fmf_details )
$fmf_details FmfDetails

setId() public method

Identifier of the sale transaction.
public setId ( string $id )
$id string

setParentPayment() public method

ID of the payment resource on which this transaction is based.
public setParentPayment ( string $parent_payment )
$parent_payment string

setPaymentHoldReasons() public method

Reasons for PayPal holding recipient fund. It is set only if payment hold status is held
public setPaymentHoldReasons ( string[] $payment_hold_reasons )
$payment_hold_reasons string[]

setPaymentHoldStatus() public method

Status of the Recipient Fund. For now, it will be returned only when fund status is held Valid Values: ["HELD"]
public setPaymentHoldStatus ( string $payment_hold_status )
$payment_hold_status string

setPaymentMode() public method

Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
public setPaymentMode ( string $payment_mode )
$payment_mode string

setProcessorResponse() public method

Response codes returned by the processor concerning the submitted payment. Only supported when the payment_method is set to credit_card.
public setProcessorResponse ( PayPal\Api\ProcessorResponse $processor_response )
$processor_response PayPal\Api\ProcessorResponse

setProtectionEligibility() public method

Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]
public setProtectionEligibility ( string $protection_eligibility )
$protection_eligibility string

setProtectionEligibilityType() public method

Valid Values: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"]
public setProtectionEligibilityType ( string $protection_eligibility_type )
$protection_eligibility_type string

setPurchaseUnitReferenceId() public method

Identifier to the purchase or transaction unit corresponding to this sale transaction.
public setPurchaseUnitReferenceId ( string $purchase_unit_reference_id )
$purchase_unit_reference_id string

setReasonCode() public method

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"]
public setReasonCode ( string $reason_code )
$reason_code string

setReceiptId() public method

Receipt id is a payment identification number returned for guest users to identify the payment.
public setReceiptId ( string $receipt_id )
$receipt_id string

setReceivableAmount() public method

Net amount the merchant receives for this transaction in their receivable currency. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer.
public setReceivableAmount ( PayPal\Api\Currency $receivable_amount )
$receivable_amount PayPal\Api\Currency

setState() public method

Valid Values: ["completed", "partially_refunded", "pending", "refunded", "denied"]
public setState ( string $state )
$state string

setTransactionFee() public method

Transaction fee applicable for this payment.
public setTransactionFee ( PayPal\Api\Currency $transaction_fee )
$transaction_fee PayPal\Api\Currency

setUpdateTime() public method

Time the resource was last updated in UTC ISO8601 format.
public setUpdateTime ( string $update_time )
$update_time string