Overview
  • Namespace
  • Class

Namespaces

  • PayPal
    • Api
    • Auth
    • Cache
    • Common
    • Converter
    • Core
    • Exception
    • Handler
    • Log
    • Rest
    • Security
    • Transport
    • Validation

Classes

  • Address
  • Agreement
  • AgreementDetails
  • AgreementStateDescriptor
  • AgreementTransaction
  • AgreementTransactions
  • AlternatePayment
  • Amount
  • Authorization
  • BankAccount
  • BankAccountsList
  • BankToken
  • BaseAddress
  • Billing
  • BillingAgreementToken
  • BillingInfo
  • CancelNotification
  • Capture
  • CarrierAccount
  • CarrierAccountToken
  • CartBase
  • ChargeModel
  • Cost
  • CountryCode
  • CreateProfileResponse
  • Credit
  • CreditCard
  • CreditCardHistory
  • CreditCardList
  • CreditCardToken
  • CreditFinancingOffered
  • Currency
  • CurrencyConversion
  • CustomAmount
  • DetailedRefund
  • Details
  • Error
  • ErrorDetails
  • ExtendedBankAccount
  • ExternalFunding
  • FileAttachment
  • FlowConfig
  • FmfDetails
  • FundingDetail
  • FundingInstrument
  • FundingOption
  • FundingSource
  • FuturePayment
  • HyperSchema
  • Image
  • Incentive
  • InputFields
  • InstallmentInfo
  • InstallmentOption
  • Invoice
  • InvoiceAddress
  • InvoiceItem
  • InvoiceNumber
  • InvoiceSearchResponse
  • Item
  • ItemList
  • Links
  • Measurement
  • MerchantInfo
  • MerchantPreferences
  • Metadata
  • NameValuePair
  • Notification
  • OpenIdAddress
  • OpenIdError
  • OpenIdSession
  • OpenIdTokeninfo
  • OpenIdUserinfo
  • Order
  • OverrideChargeModel
  • Participant
  • Patch
  • PatchRequest
  • Payee
  • Payer
  • PayerInfo
  • Payment
  • PaymentCard
  • PaymentCardToken
  • PaymentDefinition
  • PaymentDetail
  • PaymentExecution
  • PaymentHistory
  • PaymentInstruction
  • PaymentOptions
  • PaymentSummary
  • PaymentTerm
  • Payout
  • PayoutBatch
  • PayoutBatchHeader
  • PayoutItem
  • PayoutItemDetails
  • PayoutSenderBatchHeader
  • Phone
  • Plan
  • PlanList
  • PotentialPayerInfo
  • Presentation
  • PrivateLabelCard
  • ProcessorResponse
  • RecipientBankingInstruction
  • RedirectUrls
  • Refund
  • RefundDetail
  • RefundRequest
  • RelatedResources
  • Sale
  • Search
  • ShippingAddress
  • ShippingCost
  • ShippingInfo
  • Tax
  • Template
  • TemplateData
  • Templates
  • TemplateSettings
  • TemplateSettingsMetadata
  • Terms
  • Transaction
  • TransactionBase
  • Transactions
  • VerifyWebhookSignature
  • VerifyWebhookSignatureResponse
  • Webhook
  • WebhookEvent
  • WebhookEventList
  • WebhookEventType
  • WebhookEventTypeList
  • WebhookList
  • WebProfile

Class Sale

Class Sale

A sale transaction. This is the resource that is returned as a part related resources in Payment

PayPal\Common\PayPalModel
Extended by PayPal\Common\PayPalResourceModel implements PayPal\Rest\IResource
Extended by PayPal\Api\Sale
Namespace: PayPal\Api
Package: PayPal\Api
Located at PayPal/Api/Sale.php

Methods summary

public
# setId( string $id )

Identifier of the sale transaction.

Identifier of the sale transaction.

Parameters

$id

Returns


$this
public string
# getId( )

Identifier of the sale transaction.

Identifier of the sale transaction.

Returns

string
public
# setPurchaseUnitReferenceId( string $purchase_unit_reference_id )

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

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

Parameters

$purchase_unit_reference_id

Returns


$this
public string
# getPurchaseUnitReferenceId( )

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

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

Returns

string
public
# setAmount( PayPal\Api\Amount $amount )

Amount being collected.

Amount being collected.

Parameters

$amount

Returns


$this
public PayPal\Api\Amount
# getAmount( )

Amount being collected.

Amount being collected.

Returns

PayPal\Api\Amount
public
# setPaymentMode( string $payment_mode )

Specifies payment mode of the transaction. Only supported when the payment_method is set to paypal. Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]

Specifies payment mode of the transaction. Only supported when the payment_method is set to paypal. Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]

Parameters

$payment_mode

Returns


$this
public string
# getPaymentMode( )

Specifies payment mode of the transaction. Only supported when the payment_method is set to paypal.

Specifies payment mode of the transaction. Only supported when the payment_method is set to paypal.

Returns

string
public
# setState( string $state )

State of the sale transaction. Valid Values: ["completed", "partially_refunded", "pending", "refunded", "denied"]

State of the sale transaction. Valid Values: ["completed", "partially_refunded", "pending", "refunded", "denied"]

Parameters

$state

Returns


$this
public string
# getState( )

State of the sale transaction.

State of the sale transaction.

Returns

string
public
# setReasonCode( string $reason_code )

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", "TRANSACTION_APPROVED_AWAITING_FUNDING"]

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", "TRANSACTION_APPROVED_AWAITING_FUNDING"]

Parameters

$reason_code

Returns


$this
public string
# getReasonCode( )

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. Only supported when the payment_method is set to paypal.

Returns

string
public
# setProtectionEligibility( string $protection_eligibility )

The level of seller protection in force for the transaction. Only supported when the payment_method is set to paypal. Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]

The level of seller protection in force for the transaction. Only supported when the payment_method is set to paypal. Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"]

Parameters

$protection_eligibility

Returns


$this
public string
# getProtectionEligibility( )

The level of seller protection in force for the transaction. Only supported when the payment_method is set to paypal.

The level of seller protection in force for the transaction. Only supported when the payment_method is set to paypal.

Returns

string
public
# 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. Valid Values: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"]

The kind of seller protection in force for the transaction. It is returned only when protection_eligibility is ELIGIBLE or PARTIALLY_ELIGIBLE. Only supported when the payment_method is set to paypal. Valid Values: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"]

Parameters

$protection_eligibility_type

Returns


$this
public string
# getProtectionEligibilityType( )

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.

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.

Returns

string
public
# 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.

Expected clearing time for eCheck Transactions. Returned when payment is made with eCheck. Only supported when the payment_method is set to paypal.

Parameters

$clearing_time

Returns


$this
public string
# getClearingTime( )

Expected clearing time for eCheck Transactions. Returned when payment is made with eCheck. 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.

Returns

string
public
# 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"]

Status of the Recipient Fund. For now, it will be returned only when fund status is held Valid Values: ["HELD"]

Parameters

$payment_hold_status

Returns


$this
public string
# getPaymentHoldStatus( )

Status of the Recipient Fund. For now, it will be returned only when fund status is held

Status of the Recipient Fund. For now, it will be returned only when fund status is held

Returns

string
public
# setPaymentHoldReasons( string[] $payment_hold_reasons )

Reasons for PayPal holding recipient fund. It is set only if payment hold status is held

Reasons for PayPal holding recipient fund. It is set only if payment hold status is held

Parameters

$payment_hold_reasons

Returns


$this
public string[]
# getPaymentHoldReasons( )

Reasons for PayPal holding recipient fund. It is set only if payment hold status is held

Reasons for PayPal holding recipient fund. It is set only if payment hold status is held

Returns

string[]
public
# addPaymentHoldReason( string $string )

Append PaymentHoldReasons to the list.

Append PaymentHoldReasons to the list.

Parameters

$string

Returns


$this
public
# removePaymentHoldReason( string $string )

Remove PaymentHoldReasons from the list.

Remove PaymentHoldReasons from the list.

Parameters

$string

Returns


$this
public
# setTransactionFee( PayPal\Api\Currency $transaction_fee )

Transaction fee applicable for this payment.

Transaction fee applicable for this payment.

Parameters

$transaction_fee

Returns


$this
public PayPal\Api\Currency
# getTransactionFee( )

Transaction fee applicable for this payment.

Transaction fee applicable for this payment.

Returns

PayPal\Api\Currency
public
# 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.

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.

Parameters

$receivable_amount

Returns


$this
public PayPal\Api\Currency
# getReceivableAmount( )

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.

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.

Returns

PayPal\Api\Currency
public
# 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.

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.

Parameters

$exchange_rate

Returns


$this
public string
# getExchangeRate( )

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.

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.

Returns

string
public
# setFmfDetails( PayPal\Api\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.

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.

Parameters

$fmf_details

Returns


$this
public PayPal\Api\FmfDetails
# getFmfDetails( )

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.

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.

Returns

PayPal\Api\FmfDetails
public
# setReceiptId( string $receipt_id )

Receipt id is a payment identification number returned for guest users to identify the payment.

Receipt id is a payment identification number returned for guest users to identify the payment.

Parameters

$receipt_id

Returns


$this
public string
# getReceiptId( )

Receipt id is a payment identification number returned for guest users to identify the payment.

Receipt id is a payment identification number returned for guest users to identify the payment.

Returns

string
public
# setParentPayment( string $parent_payment )

ID of the payment resource on which this transaction is based.

ID of the payment resource on which this transaction is based.

Parameters

$parent_payment

Returns


$this
public string
# getParentPayment( )

ID of the payment resource on which this transaction is based.

ID of the payment resource on which this transaction is based.

Returns

string
public
# 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.

Response codes returned by the processor concerning the submitted payment. Only supported when the payment_method is set to credit_card.

Parameters

$processor_response

Returns


$this
public PayPal\Api\ProcessorResponse
# getProcessorResponse( )

Response codes returned by the processor concerning the submitted payment. Only supported when the payment_method is set to credit_card.

Response codes returned by the processor concerning the submitted payment. Only supported when the payment_method is set to credit_card.

Returns

PayPal\Api\ProcessorResponse
public
# setBillingAgreementId( string $billing_agreement_id )

ID of the billing agreement used as reference to execute this transaction.

ID of the billing agreement used as reference to execute this transaction.

Parameters

$billing_agreement_id

Returns


$this
public string
# getBillingAgreementId( )

ID of the billing agreement used as reference to execute this transaction.

ID of the billing agreement used as reference to execute this transaction.

Returns

string
public
# setCreateTime( string $create_time )

Time of sale as defined in RFC 3339 Section 5.6

Time of sale as defined in RFC 3339 Section 5.6

Parameters

$create_time

Returns


$this
public string
# getCreateTime( )

Time of sale as defined in RFC 3339 Section 5.6

Time of sale as defined in RFC 3339 Section 5.6

Returns

string
public
# setUpdateTime( string $update_time )

Time the resource was last updated in UTC ISO8601 format.

Time the resource was last updated in UTC ISO8601 format.

Parameters

$update_time

Returns


$this
public string
# getUpdateTime( )

Time the resource was last updated in UTC ISO8601 format.

Time the resource was last updated in UTC ISO8601 format.

Returns

string
public static PayPal\Api\Sale
# get( string $saleId, PayPal\Rest\ApiContext $apiContext = null, PayPalRestCall $restCall = null )

Shows details for a sale, by ID. Returns only sales that were created through the REST API.

Shows details for a sale, by ID. Returns only sales that were created through the REST API.

Parameters

$saleId
$apiContext
is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall
is the Rest Call Service that is used to make rest calls

Returns

PayPal\Api\Sale
public PayPal\Api\Refund
# refund( PayPal\Api\Refund $refund, PayPal\Rest\ApiContext $apiContext = null, PayPalRestCall $restCall = null )

Refund a completed payment by passing the sale_id in the request URI. In addition, include an empty JSON payload in the request body for a full refund. For a partial refund, include an amount object in the request body.

Refund a completed payment by passing the sale_id in the request URI. In addition, include an empty JSON payload in the request body for a full refund. For a partial refund, include an amount object in the request body.

Deprecated

Please use #refundSale instead.

Parameters

$refund
$apiContext
is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall
is the Rest Call Service that is used to make rest calls

Returns

PayPal\Api\Refund
public PayPal\Api\DetailedRefund
# refundSale( PayPal\Api\RefundRequest $refundRequest, PayPal\Rest\ApiContext $apiContext = null, PayPalRestCall $restCall = null )

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.

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.

Parameters

$refundRequest
$apiContext
is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall
is the Rest Call Service that is used to make rest calls

Returns

PayPal\Api\DetailedRefund

Methods inherited from PayPal\Common\PayPalResourceModel

addLink(), executeCall(), getLink(), getLinks(), removeLink(), setLinks(), updateAccessToken()

Methods inherited from PayPal\Common\PayPalModel

__construct(), __get(), __isset(), __set(), __toString(), __unset(), fromArray(), fromJson(), getList(), setCredential(), toArray(), toJSON()

Properties summary

Properties inherited from PayPal\Common\PayPalModel

$credential

API documentation generated by ApiGen