WC_Gateway_Paypal_PDT_Handler
extends WC_Gateway_Paypal_Response
in package
Handle PDT Responses from PayPal.
Table of Contents
- $identity_token : string
- Identity token for PDT support
- $sandbox : bool
- Sandbox mode
- __construct() : mixed
- Constructor.
- check_response() : mixed
- Check Response for PDT.
- get_paypal_order() : bool|WC_Order
- Get the order from the PayPal 'Custom' variable.
- payment_complete() : mixed
- Complete order, add transaction ID and note.
- payment_on_hold() : mixed
- Hold order and add note.
- validate_transaction() : bool|array
- Validate a PDT transaction to ensure its authentic.
Properties
$identity_token
Identity token for PDT support
protected
string
$identity_token
$sandbox
Sandbox mode
protected
bool
$sandbox
= alse
Methods
__construct()
Constructor.
public
__construct([bool $sandbox = false ][, string $identity_token = '' ]) : mixed
Parameters
- $sandbox : bool = false
-
Whether to use sandbox mode or not.
- $identity_token : string = ''
-
Identity token for PDT support.
Return values
mixedcheck_response()
Check Response for PDT.
public
check_response() : mixed
Return values
mixedget_paypal_order()
Get the order from the PayPal 'Custom' variable.
protected
get_paypal_order(string $raw_custom) : bool|WC_Order
Parameters
- $raw_custom : string
-
JSON Data passed back by PayPal.
Return values
bool|WC_Order — objectpayment_complete()
Complete order, add transaction ID and note.
protected
payment_complete(WC_Order $order[, string $txn_id = '' ][, string $note = '' ]) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $txn_id : string = ''
-
Transaction ID.
- $note : string = ''
-
Payment note.
Return values
mixedpayment_on_hold()
Hold order and add note.
protected
payment_on_hold(WC_Order $order[, string $reason = '' ]) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $reason : string = ''
-
Reason why the payment is on hold.
Return values
mixedvalidate_transaction()
Validate a PDT transaction to ensure its authentic.
protected
validate_transaction(string $transaction) : bool|array
Parameters
- $transaction : string
-
TX ID.