WC_Gateway_Paypal_IPN_Handler
extends WC_Gateway_Paypal_Response
in package
WC_Gateway_Paypal_IPN_Handler class.
Table of Contents
- $receiver_email : string
- Receiver email address to validate.
- $sandbox : bool
- Sandbox mode
- __construct() : mixed
- Constructor.
- check_response() : mixed
- Check for PayPal IPN Response.
- valid_response() : mixed
- There was a valid response.
- validate_ipn() : mixed
- Check PayPal IPN validity.
- 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.
- payment_status_canceled_reversal() : mixed
- Handle a cancelled reversal.
- payment_status_completed() : mixed
- Handle a completed payment.
- payment_status_denied() : mixed
- Handle a denied payment.
- payment_status_expired() : mixed
- Handle an expired payment.
- payment_status_failed() : mixed
- Handle a failed payment.
- payment_status_paid_cancelled_order() : mixed
- When a user cancelled order is marked paid.
- payment_status_pending() : mixed
- Handle a pending payment.
- payment_status_refunded() : mixed
- Handle a refunded order.
- payment_status_reversed() : mixed
- Handle a reversal.
- payment_status_voided() : mixed
- Handle a voided payment.
- save_paypal_meta_data() : mixed
- Save important data from the IPN to the order.
- send_ipn_email_notification() : mixed
- Send a notification to the user handling orders.
- validate_amount() : mixed
- Check payment amount from IPN matches the order.
- validate_currency() : mixed
- Check currency from IPN matches the order.
- validate_receiver_email() : mixed
- Check receiver email from PayPal. If the receiver email in the IPN is different than what is stored in.
- validate_transaction_type() : mixed
- Check for a valid transaction type.
Properties
$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 $receiver_email = '' ]) : mixed
Parameters
- $sandbox : bool = false
-
Use sandbox or not.
- $receiver_email : string = ''
-
Email to receive IPN from.
Return values
mixed —check_response()
Check for PayPal IPN Response.
public
check_response() : mixed
Return values
mixed —valid_response()
There was a valid response.
public
valid_response(array<string|int, mixed> $posted) : mixed
Parameters
- $posted : array<string|int, mixed>
-
Post data after wp_unslash.
Return values
mixed —validate_ipn()
Check PayPal IPN validity.
public
validate_ipn() : mixed
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 —payment_status_canceled_reversal()
Handle a cancelled reversal.
protected
payment_status_canceled_reversal(WC_Order $order, array<string|int, mixed> $posted) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $posted : array<string|int, mixed>
-
Posted data.
Return values
mixed —payment_status_completed()
Handle a completed payment.
protected
payment_status_completed(WC_Order $order, array<string|int, mixed> $posted) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $posted : array<string|int, mixed>
-
Posted data.
Return values
mixed —payment_status_denied()
Handle a denied payment.
protected
payment_status_denied(WC_Order $order, array<string|int, mixed> $posted) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $posted : array<string|int, mixed>
-
Posted data.
Return values
mixed —payment_status_expired()
Handle an expired payment.
protected
payment_status_expired(WC_Order $order, array<string|int, mixed> $posted) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $posted : array<string|int, mixed>
-
Posted data.
Return values
mixed —payment_status_failed()
Handle a failed payment.
protected
payment_status_failed(WC_Order $order, array<string|int, mixed> $posted) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $posted : array<string|int, mixed>
-
Posted data.
Return values
mixed —payment_status_paid_cancelled_order()
When a user cancelled order is marked paid.
protected
payment_status_paid_cancelled_order(WC_Order $order, array<string|int, mixed> $posted) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $posted : array<string|int, mixed>
-
Posted data.
Return values
mixed —payment_status_pending()
Handle a pending payment.
protected
payment_status_pending(WC_Order $order, array<string|int, mixed> $posted) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $posted : array<string|int, mixed>
-
Posted data.
Return values
mixed —payment_status_refunded()
Handle a refunded order.
protected
payment_status_refunded(WC_Order $order, array<string|int, mixed> $posted) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $posted : array<string|int, mixed>
-
Posted data.
Return values
mixed —payment_status_reversed()
Handle a reversal.
protected
payment_status_reversed(WC_Order $order, array<string|int, mixed> $posted) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $posted : array<string|int, mixed>
-
Posted data.
Return values
mixed —payment_status_voided()
Handle a voided payment.
protected
payment_status_voided(WC_Order $order, array<string|int, mixed> $posted) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $posted : array<string|int, mixed>
-
Posted data.
Return values
mixed —save_paypal_meta_data()
Save important data from the IPN to the order.
protected
save_paypal_meta_data(WC_Order $order, array<string|int, mixed> $posted) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $posted : array<string|int, mixed>
-
Posted data.
Return values
mixed —send_ipn_email_notification()
Send a notification to the user handling orders.
protected
send_ipn_email_notification(string $subject, string $message) : mixed
Parameters
- $subject : string
-
Email subject.
- $message : string
-
Email message.
Return values
mixed —validate_amount()
Check payment amount from IPN matches the order.
protected
validate_amount(WC_Order $order, int $amount) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $amount : int
-
Amount to validate.
Return values
mixed —validate_currency()
Check currency from IPN matches the order.
protected
validate_currency(WC_Order $order, string $currency) : mixed
Parameters
- $order : WC_Order
-
Order object.
- $currency : string
-
Currency code.
Return values
mixed —validate_receiver_email()
Check receiver email from PayPal. If the receiver email in the IPN is different than what is stored in.
protected
validate_receiver_email(WC_Order $order, string $receiver_email) : mixed
WooCommerce -> Settings -> Checkout -> PayPal, it will log an error about it.
Parameters
- $order : WC_Order
-
Order object.
- $receiver_email : string
-
Email to validate.
Return values
mixed —validate_transaction_type()
Check for a valid transaction type.
protected
validate_transaction_type(string $txn_type) : mixed
Parameters
- $txn_type : string
-
Transaction type.