PHP Класс PayPal\Api\Payment

Lets you create, process and manage payments.
Наследование: extends PayPal\Common\PayPalResourceModel
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
addBillingAgreementToken ( string $billingAgreementToken ) Append BillingAgreementTokens to the list.
addFailedTransaction ( Error $error ) Append FailedTransactions to the list.
addTransaction ( Transaction $transaction ) Append Transactions to the list.
all ( array $params, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : PaymentHistory List payments that were made to the merchant who issues the request. Payments can be in any state.
create ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Payment 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.
execute ( PaymentExecution $paymentExecution, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Payment Executes, or completes, a PayPal payment that the payer has approved. You can optionally update selective payment information when you execute a payment.
get ( string $paymentId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Payment Shows details for a payment, by ID.
getApprovalLink ( ) : null | string Get Approval Link
getBillingAgreementTokens ( ) : string[] Collection of PayPal generated billing agreement tokens.
getCart ( ) : string ID of the cart to execute the payment.
getCreateTime ( ) : string Payment creation time as defined in RFC 3339 Section 5.6.
getCreditFinancingOffered ( ) : PayPal\Api\CreditFinancingOffered Credit financing offered to payer on PayPal side. Returned in payment after payer opts-in
getExperienceProfileId ( ) : string PayPal generated identifier for the merchant's payment experience profile. Refer to this link to create experience profile ID.
getFailedTransactions ( ) : Error[] Applicable for advanced payments like multi seller payment (MSP) to support partial failures
getFailureReason ( ) : string Failure reason code returned when the payment failed for some valid reasons.
getId ( ) : string Identifier of the payment resource created.
getIntent ( ) : string Payment intent.
getNoteToPayer ( ) : string free-form field for the use of clients to pass in a message to the payer
getPayee ( ) : Payee Receiver of funds for this payment.
getPayer ( ) : Payer Source of the funds for this payment represented by a PayPal account or a direct credit card.
getPaymentInstruction ( ) : PayPal\Api\PaymentInstruction Instructions for the payer to complete this payment.
getPotentialPayerInfo ( ) : PotentialPayerInfo 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.
getRedirectUrls ( ) : PayPal\Api\RedirectUrls Set of redirect URLs you provide only for PayPal-based payments.
getState ( ) : string The state of the payment, authorization, or order transaction. The value is:
  • created. The transaction was successfully created.
  • approved. The buyer approved the transaction.
  • failed. The transaction request failed.
getTransactions ( ) : Transaction[] Transactional details including the amount and item details.
getUpdateTime ( ) : string Payment update time as defined in RFC 3339 Section 5.6.
removeBillingAgreementToken ( string $billingAgreementToken ) Remove BillingAgreementTokens from the list.
removeFailedTransaction ( Error $error ) Remove FailedTransactions from the list.
removeTransaction ( Transaction $transaction ) Remove Transactions from the list.
setBillingAgreementTokens ( string[] $billing_agreement_tokens ) Collection of PayPal generated billing agreement tokens.
setCart ( string $cart ) ID of the cart to execute the payment.
setCreateTime ( string $create_time ) Payment creation time as defined in RFC 3339 Section 5.6.
setCreditFinancingOffered ( PayPal\Api\CreditFinancingOffered $credit_financing_offered ) Credit financing offered to payer on PayPal side. Returned in payment after payer opts-in
setExperienceProfileId ( string $experience_profile_id ) PayPal generated identifier for the merchant's payment experience profile. Refer to this link to create experience profile ID.
setFailedTransactions ( Error[] $failed_transactions ) Applicable for advanced payments like multi seller payment (MSP) to support partial failures
setFailureReason ( string $failure_reason ) Failure reason code returned when the payment failed for some valid reasons.
setId ( string $id ) Identifier of the payment resource created.
setIntent ( string $intent ) Payment intent.
setNoteToPayer ( string $note_to_payer ) free-form field for the use of clients to pass in a message to the payer
setPayee ( Payee $payee ) Receiver of funds for this payment.
setPayer ( Payer $payer ) Source of the funds for this payment represented by a PayPal account or a direct credit card.
setPaymentInstruction ( PayPal\Api\PaymentInstruction $payment_instruction ) Instructions for the payer to complete this payment.
setPotentialPayerInfo ( PotentialPayerInfo $potential_payer_info ) 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.
setRedirectUrls ( PayPal\Api\RedirectUrls $redirect_urls ) Set of redirect URLs you provide only for PayPal-based payments.
setState ( string $state ) The state of the payment, authorization, or order transaction. The value is:
  • created. The transaction was successfully created.
  • approved. The buyer approved the transaction.
  • failed. The transaction request failed.
Valid Values: ["created", "approved", "failed", "partially_completed", "in_progress"]
setTransactions ( Transaction[] $transactions ) Transactional details including the amount and item details.
setUpdateTime ( string $update_time ) Payment update time as defined in RFC 3339 Section 5.6.
update ( PatchRequest $patchRequest, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : boolean 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.

Описание методов

addBillingAgreementToken() публичный Метод

Append BillingAgreementTokens to the list.
Устаревший: Not publicly available
public addBillingAgreementToken ( string $billingAgreementToken )
$billingAgreementToken string

addFailedTransaction() публичный Метод

Append FailedTransactions to the list.
Устаревший: Not publicly available
public addFailedTransaction ( Error $error )
$error Error

addTransaction() публичный Метод

Append Transactions to the list.
public addTransaction ( Transaction $transaction )
$transaction Transaction

all() публичный статический Метод

List payments that were made to the merchant who issues the request. Payments can be in any state.
public static all ( array $params, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : PaymentHistory
$params array
$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
Результат PaymentHistory

create() публичный Метод

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.
public create ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Payment
$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
Результат Payment

execute() публичный Метод

Executes, or completes, a PayPal payment that the payer has approved. You can optionally update selective payment information when you execute a payment.
public execute ( PaymentExecution $paymentExecution, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Payment
$paymentExecution PaymentExecution
$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
Результат Payment

get() публичный статический Метод

Shows details for a payment, by ID.
public static get ( string $paymentId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Payment
$paymentId 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
Результат Payment

getBillingAgreementTokens() публичный Метод

Collection of PayPal generated billing agreement tokens.
Устаревший: Not publicly available
public getBillingAgreementTokens ( ) : string[]
Результат string[]

getCart() публичный Метод

ID of the cart to execute the payment.
Устаревший: Not publicly available
public getCart ( ) : string
Результат string

getCreateTime() публичный Метод

Payment creation time as defined in RFC 3339 Section 5.6.
public getCreateTime ( ) : string
Результат string

getCreditFinancingOffered() публичный Метод

Credit financing offered to payer on PayPal side. Returned in payment after payer opts-in
Устаревший: Not publicly available
public getCreditFinancingOffered ( ) : PayPal\Api\CreditFinancingOffered
Результат PayPal\Api\CreditFinancingOffered

getExperienceProfileId() публичный Метод

PayPal generated identifier for the merchant's payment experience profile. Refer to this link to create experience profile ID.
public getExperienceProfileId ( ) : string
Результат string

getFailedTransactions() публичный Метод

Applicable for advanced payments like multi seller payment (MSP) to support partial failures
Устаревший: Not publicly available
public getFailedTransactions ( ) : Error[]
Результат Error[]

getFailureReason() публичный Метод

Failure reason code returned when the payment failed for some valid reasons.
public getFailureReason ( ) : string
Результат string

getId() публичный Метод

Identifier of the payment resource created.
public getId ( ) : string
Результат string

getIntent() публичный Метод

Payment intent.
public getIntent ( ) : string
Результат string

getNoteToPayer() публичный Метод

free-form field for the use of clients to pass in a message to the payer
public getNoteToPayer ( ) : string
Результат string

getPayee() публичный Метод

Receiver of funds for this payment.
public getPayee ( ) : Payee
Результат Payee

getPayer() публичный Метод

Source of the funds for this payment represented by a PayPal account or a direct credit card.
public getPayer ( ) : Payer
Результат Payer

getPaymentInstruction() публичный Метод

Instructions for the payer to complete this payment.
Устаревший: Not publicly available
public getPaymentInstruction ( ) : PayPal\Api\PaymentInstruction
Результат PayPal\Api\PaymentInstruction

getPotentialPayerInfo() публичный Метод

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.
Устаревший: Not publicly available
public getPotentialPayerInfo ( ) : PotentialPayerInfo
Результат PotentialPayerInfo

getRedirectUrls() публичный Метод

Set of redirect URLs you provide only for PayPal-based payments.
public getRedirectUrls ( ) : PayPal\Api\RedirectUrls
Результат PayPal\Api\RedirectUrls

getState() публичный Метод

The state of the payment, authorization, or order transaction. The value is:
  • created. The transaction was successfully created.
  • approved. The buyer approved the transaction.
  • failed. The transaction request failed.
public getState ( ) : string
Результат string

getTransactions() публичный Метод

Transactional details including the amount and item details.
public getTransactions ( ) : Transaction[]
Результат Transaction[]

getUpdateTime() публичный Метод

Payment update time as defined in RFC 3339 Section 5.6.
public getUpdateTime ( ) : string
Результат string

removeBillingAgreementToken() публичный Метод

Remove BillingAgreementTokens from the list.
Устаревший: Not publicly available
public removeBillingAgreementToken ( string $billingAgreementToken )
$billingAgreementToken string

removeFailedTransaction() публичный Метод

Remove FailedTransactions from the list.
Устаревший: Not publicly available
public removeFailedTransaction ( Error $error )
$error Error

removeTransaction() публичный Метод

Remove Transactions from the list.
public removeTransaction ( Transaction $transaction )
$transaction Transaction

setBillingAgreementTokens() публичный Метод

Collection of PayPal generated billing agreement tokens.
Устаревший: Not publicly available
public setBillingAgreementTokens ( string[] $billing_agreement_tokens )
$billing_agreement_tokens string[]

setCart() публичный Метод

ID of the cart to execute the payment.
Устаревший: Not publicly available
public setCart ( string $cart )
$cart string

setCreateTime() публичный Метод

Payment creation time as defined in RFC 3339 Section 5.6.
public setCreateTime ( string $create_time )
$create_time string

setCreditFinancingOffered() публичный Метод

Credit financing offered to payer on PayPal side. Returned in payment after payer opts-in
Устаревший: Not publicly available
public setCreditFinancingOffered ( PayPal\Api\CreditFinancingOffered $credit_financing_offered )
$credit_financing_offered PayPal\Api\CreditFinancingOffered

setExperienceProfileId() публичный Метод

PayPal generated identifier for the merchant's payment experience profile. Refer to this link to create experience profile ID.
public setExperienceProfileId ( string $experience_profile_id )
$experience_profile_id string

setFailedTransactions() публичный Метод

Applicable for advanced payments like multi seller payment (MSP) to support partial failures
Устаревший: Not publicly available
public setFailedTransactions ( Error[] $failed_transactions )
$failed_transactions Error[]

setFailureReason() публичный Метод

Valid Values: ["UNABLE_TO_COMPLETE_TRANSACTION", "INVALID_PAYMENT_METHOD", "PAYER_CANNOT_PAY", "CANNOT_PAY_THIS_PAYEE", "REDIRECT_REQUIRED", "PAYEE_FILTER_RESTRICTIONS"]
public setFailureReason ( string $failure_reason )
$failure_reason string

setId() публичный Метод

Identifier of the payment resource created.
public setId ( string $id )
$id string

setIntent() публичный Метод

Valid Values: ["sale", "authorize", "order"]
public setIntent ( string $intent )
$intent string

setNoteToPayer() публичный Метод

free-form field for the use of clients to pass in a message to the payer
public setNoteToPayer ( string $note_to_payer )
$note_to_payer string

setPayee() публичный Метод

Receiver of funds for this payment.
public setPayee ( Payee $payee )
$payee Payee

setPayer() публичный Метод

Source of the funds for this payment represented by a PayPal account or a direct credit card.
public setPayer ( Payer $payer )
$payer Payer

setPaymentInstruction() публичный Метод

Instructions for the payer to complete this payment.
Устаревший: Not publicly available
public setPaymentInstruction ( PayPal\Api\PaymentInstruction $payment_instruction )
$payment_instruction PayPal\Api\PaymentInstruction

setPotentialPayerInfo() публичный Метод

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.
Устаревший: Not publicly available
public setPotentialPayerInfo ( PotentialPayerInfo $potential_payer_info )
$potential_payer_info PotentialPayerInfo

setRedirectUrls() публичный Метод

Set of redirect URLs you provide only for PayPal-based payments.
public setRedirectUrls ( PayPal\Api\RedirectUrls $redirect_urls )
$redirect_urls PayPal\Api\RedirectUrls

setState() публичный Метод

The state of the payment, authorization, or order transaction. The value is:
  • created. The transaction was successfully created.
  • approved. The buyer approved the transaction.
  • failed. The transaction request failed.
Valid Values: ["created", "approved", "failed", "partially_completed", "in_progress"]
public setState ( string $state )
$state string

setTransactions() публичный Метод

Transactional details including the amount and item details.
public setTransactions ( Transaction[] $transactions )
$transactions Transaction[]

setUpdateTime() публичный Метод

Payment update time as defined in RFC 3339 Section 5.6.
public setUpdateTime ( string $update_time )
$update_time string

update() публичный Метод

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.
public update ( PatchRequest $patchRequest, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : boolean
$patchRequest PatchRequest
$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
Результат boolean