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
- $receiver_email : string
- Receiver email address to validate.
- $sandbox : bool
- Sandbox mode
- __construct() : mixed
- Constructor.
- check_response() : mixed
- Check Response for PDT, taking the order id from the request.
- check_response_for_order() : mixed
- Check Response for PDT.
- set_receiver_email() : mixed
- Set receiver email to enable more strict validation.
- 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<string|int, mixed>
- Validate a PDT transaction to ensure its authentic.
Properties
$identity_token
Identity token for PDT support
protected
string
$identity_token
$receiver_email
Receiver email address to validate.
protected
string
$receiver_email
$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
mixed —check_response()
Check Response for PDT, taking the order id from the request.
public
check_response() : mixed
Tags
Return values
mixed —check_response_for_order()
Check Response for PDT.
public
check_response_for_order(mixed $wc_order_id) : mixed
Parameters
- $wc_order_id : mixed
-
The order id to check the response against.
Tags
Return values
mixed —set_receiver_email()
Set receiver email to enable more strict validation.
public
set_receiver_email([string $receiver_email = '' ]) : mixed
Parameters
- $receiver_email : string = ''
-
Email to receive PDT notification from.
Return values
mixed —get_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
mixed —payment_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
mixed —validate_transaction()
Validate a PDT transaction to ensure its authentic.
protected
validate_transaction(string $transaction) : bool|array<string|int, mixed>
Parameters
- $transaction : string
-
TX ID.