WooCommerce Code Reference

WC_Gateway_Paypal_Helper
in package

Helper for PayPal gateway.

Tags
deprecated
10.5.0

Use Automattic\WooCommerce\Gateways\PayPal\Helper instead. This class will be removed in 11.0.0.

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.
update_addresses_in_order()  : void
Update the addresses in the order.

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.

Tags
deprecated
10.5.0

Use Automattic\WooCommerce\Gateways\PayPal\Helper::get_wc_order_from_paypal_custom_id() instead.

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
Tags
deprecated
10.5.0

Use Automattic\WooCommerce\Gateways\PayPal\Helper::is_orders_v2_migration_eligible() instead.

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.

Tags
deprecated
10.5.0

Use Automattic\WooCommerce\Gateways\PayPal\Helper::mask_email() instead.

Return values
stringThe 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).

Tags
deprecated
10.5.0

Use Automattic\WooCommerce\Gateways\PayPal\Helper::redact_data() instead.

Return values
mixedThe data with PII redacted.

update_addresses_in_order()

Update the addresses in the order.

public static update_addresses_in_order(WC_Order|null $order, array<string|int, mixed> $paypal_order_details) : void
Parameters
$order : WC_Order|null

The order object.

$paypal_order_details : array<string|int, mixed>

The PayPal order details.

Tags
deprecated
10.5.0

Use Automattic\WooCommerce\Gateways\PayPal\Helper::update_addresses_in_order() instead.

Return values
void