WC_Gateway_Paypal_Helper
in package
Helper for PayPal gateway.
Table of Contents
- get_wc_order_from_paypal_custom_id() : WC_Order|null
- Get the WC order from the PayPal custom ID.
- is_orders_v2_migration_eligible() : bool
- Check if the merchant is eligible for migration from WPS to PPCP.
- is_paypal_gateway_available() : bool
- Check if the PayPal gateway is enabled.
- mask_email() : string
- Mask email address before @ keeping the full domain.
- redact_data() : mixed
- Remove PII (Personally Identifiable Information) from data for logging.
Methods
get_wc_order_from_paypal_custom_id()
Get the WC order from the PayPal custom ID.
public
static get_wc_order_from_paypal_custom_id(string $custom_id) : WC_Order|null
Parameters
- $custom_id : string
-
The custom ID string from the PayPal order.
Return values
WC_Order|null —is_orders_v2_migration_eligible()
Check if the merchant is eligible for migration from WPS to PPCP.
public
static is_orders_v2_migration_eligible() : bool
Return values
bool —is_paypal_gateway_available()
Check if the PayPal gateway is enabled.
public
static is_paypal_gateway_available() : bool
Return values
bool —mask_email()
Mask email address before @ keeping the full domain.
public
static mask_email(string $email) : string
Parameters
- $email : string
-
The email address to mask.
Return values
string — The masked email address or original input if invalid.redact_data()
Remove PII (Personally Identifiable Information) from data for logging.
public
static redact_data(mixed $data) : mixed
This function recursively traverses the data array and redacts sensitive information while preserving the structure for debugging purposes.
Parameters
- $data : mixed
-
The data to remove PII from (array, string, or other types).
