PHP 클래스 PayPal\Api\Payment

Lets you create, process and manage payments.
상속: extends PayPal\Common\PayPalResourceModel
파일 보기 프로젝트 열기: paypal/rest-api-sdk-php 1 사용 예제들

공개 메소드들

메소드 설명
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