PHP Class PayPal\Api\Order

An order transaction.
Inheritance: extends PayPal\Common\PayPalResourceModel
显示文件 Open project: paypal/rest-api-sdk-php Class Usage Examples

Public Methods

Method Description
authorize ( Authorization $authorization, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Authorization Authorizes an order, by ID. Include an amount object in the JSON request body.
capture ( Capture $capture, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Capture 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.
get ( string $orderId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Order Shows details for an order, by ID.
getAmount ( ) : Amount Amount being collected.
getCreateTime ( ) : string Time the resource was created in UTC ISO8601 format.
getFmfDetails ( ) : FmfDetails Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action.
getId ( ) : string Identifier of the order transaction.
getParentPayment ( ) : string ID of the Payment resource that this transaction is based on.
getPaymentMode ( ) : string specifies payment mode of the transaction
getPendingReason ( ) : string
getProtectionEligibility ( ) : string The level of seller protection in force for the transaction.
getProtectionEligibilityType ( ) : string The kind of seller protection in force for the transaction. This property is returned only when the protection_eligibility property is set to ELIGIBLEor PARTIALLY_ELIGIBLE. Only supported when the payment_method is set to paypal. Allowed values:
ITEM_NOT_RECEIVED_ELIGIBLE- Sellers are protected against claims for items not received.
UNAUTHORIZED_PAYMENT_ELIGIBLE- Sellers are protected against claims for unauthorized payments.
One or both of the allowed values can be returned.
getPurchaseUnitReferenceId ( ) : string Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
getReasonCode ( ) : string 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.
getReferenceId ( ) : string Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
getState ( ) : string State of the order transaction.
getUpdateTime ( ) : string Time the resource was last updated in UTC ISO8601 format.
setAmount ( Amount $amount ) Amount being collected.
setCreateTime ( string $create_time ) Time the resource was created in UTC ISO8601 format.
setFmfDetails ( FmfDetails $fmf_details ) Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action.
setId ( string $id ) Identifier of the order transaction.
setParentPayment ( string $parent_payment ) ID of the Payment resource that this transaction is based on.
setPaymentMode ( string $payment_mode ) specifies payment mode of the transaction Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
setPendingReason ( string $pending_reason ) [DEPRECATED] Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead.
setProtectionEligibility ( string $protection_eligibility ) The level of seller protection in force for the transaction.
setProtectionEligibilityType ( string $protection_eligibility_type ) The kind of seller protection in force for the transaction. This property is returned only when the protection_eligibility property is set to ELIGIBLEor PARTIALLY_ELIGIBLE. Only supported when the payment_method is set to paypal. Allowed values:
ITEM_NOT_RECEIVED_ELIGIBLE- Sellers are protected against claims for items not received.
UNAUTHORIZED_PAYMENT_ELIGIBLE- Sellers are protected against claims for unauthorized payments.
One or both of the allowed values can be returned.
setPurchaseUnitReferenceId ( string $purchase_unit_reference_id ) Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
setReasonCode ( string $reason_code ) 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.
setReferenceId ( string $reference_id ) Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
setState ( string $state ) State of the order transaction.
setUpdateTime ( string $update_time ) Time the resource was last updated in UTC ISO8601 format.
void ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Order Voids, or cancels, an order, by ID. You cannot void an order if a payment has already been partially or fully captured.

Method Details

authorize() public method

Authorizes an order, by ID. Include an amount object in the JSON request body.
public authorize ( Authorization $authorization, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Authorization
$authorization Authorization Authorization Object with Amount value to be authorized
$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 Authorization

capture() public method

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.
public capture ( Capture $capture, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Capture
$capture Capture
$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 Capture

get() public static method

Shows details for an order, by ID.
public static get ( string $orderId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Order
$orderId 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 Order

getAmount() public method

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

getCreateTime() public method

Time the resource was created in UTC ISO8601 format.
public getCreateTime ( ) : string
return string

getFmfDetails() public method

Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action.
public getFmfDetails ( ) : FmfDetails
return FmfDetails

getId() public method

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

getParentPayment() public method

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

getPaymentMode() public method

specifies payment mode of the transaction
public getPaymentMode ( ) : string
return string

getPendingReason() public method

Deprecation: [DEPRECATED] Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead.
public getPendingReason ( ) : string
return string

getProtectionEligibility() public method

The level of seller protection in force for the transaction.
public getProtectionEligibility ( ) : string
return string

getProtectionEligibilityType() public method

The kind of seller protection in force for the transaction. This property is returned only when the protection_eligibility property is set to ELIGIBLEor PARTIALLY_ELIGIBLE. Only supported when the payment_method is set to paypal. Allowed values:
ITEM_NOT_RECEIVED_ELIGIBLE- Sellers are protected against claims for items not received.
UNAUTHORIZED_PAYMENT_ELIGIBLE- Sellers are protected against claims for unauthorized payments.
One or both of the allowed values can be returned.

getPurchaseUnitReferenceId() public method

Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
Deprecation: Use #getReferenceId instead

getReasonCode() public method

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.
public getReasonCode ( ) : string
return string

getReferenceId() public method

Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
public getReferenceId ( ) : string
return string

getState() public method

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

getUpdateTime() public method

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

setAmount() public method

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

setCreateTime() public method

Time the resource was created in UTC ISO8601 format.
public setCreateTime ( string $create_time )
$create_time string

setFmfDetails() public method

Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action.
public setFmfDetails ( FmfDetails $fmf_details )
$fmf_details FmfDetails

setId() public method

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

setParentPayment() public method

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

setPaymentMode() public method

specifies payment mode of the transaction Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"]
public setPaymentMode ( string $payment_mode )
$payment_mode string

setPendingReason() public method

Valid Values: ["payer_shipping_unconfirmed", "multi_currency", "risk_review", "regulatory_review", "verification_required", "order", "other"]
public setPendingReason ( string $pending_reason )
$pending_reason string

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 unit associated with this object. Obsolete. Use one in cart_base.
Deprecation: Use #setReferenceId instead
public setPurchaseUnitReferenceId ( string $purchase_unit_reference_id )
$purchase_unit_reference_id string

setReasonCode() public method

Valid Values: ["PAYER_SHIPPING_UNCONFIRMED", "MULTI_CURRENCY", "RISK_REVIEW", "REGULATORY_REVIEW", "VERIFICATION_REQUIRED", "ORDER", "OTHER"]
public setReasonCode ( string $reason_code )
$reason_code string

setReferenceId() public method

Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
public setReferenceId ( string $reference_id )
$reference_id string

setState() public method

Valid Values: ["pending", "completed", "voided", "authorized", "captured"]
public setState ( string $state )
$state string

setUpdateTime() public method

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

void() public method

Voids, or cancels, an order, by ID. You cannot void an order if a payment has already been partially or fully captured.
public void ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Order
$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 Order