WooCommerce Code Reference

WC_Gateway_Paypal_Notices
in package

Class WC_Gateway_Paypal_Notices.

Tags
since
10.3.0

Table of Contents

PAYPAL_ACCOUNT_RESTRICTION_ISSUES  = array('PAYEE_ACCOUNT_LOCKED_OR_CLOSED', 'PAYEE_ACCOUNT_RESTRICTED')
PayPal account restriction issue codes from PayPal API.
PAYPAL_ACCOUNT_RESTRICTED_NOTICE  = 'paypal_account_restricted'
The name of the notice for PayPal account restriction.
PAYPAL_MIGRATION_NOTICE  = 'paypal_migration_completed'
The name of the notice for PayPal migration.
PAYPAL_UNSUPPORTED_CURRENCY_NOTICE  = 'paypal_unsupported_currency'
The name of the notice for PayPal unsupported currency.
$gateway  : WC_Gateway_Paypal
The PayPal gateway instance.
__construct()  : mixed
Constructor.
add_paypal_migration_notice()  : void
Add notice warning about the migration to PayPal Payments.
add_paypal_migration_notice_on_payments_settings_page()  : void
Add notice warning about the migration to PayPal Payments on the Payments settings page.
add_paypal_notices()  : void
Add PayPal Standard notices.
add_paypal_notices_on_payments_settings_page()  : void
Add PayPal notices on the payments settings page.
clear_account_restriction_flag()  : void
Clear the flag indicating PayPal account restriction.
manage_account_restriction_flag_for_notice()  : void
Handle PayPal order response to manage account restriction notices.
set_account_restriction_flag()  : void
Set the flag indicating PayPal account restriction.
paypal_migration_notice_dismissed()  : bool
Check if the installation notice has been dismissed.
add_paypal_account_restricted_notice()  : void
Add notice warning about PayPal account restriction.
add_paypal_unsupported_currency_notice()  : void
Add notice warning when PayPal does not support the store's currency.
get_dismiss_url()  : string
Get the dismiss URL for a notice.
has_account_restriction_flag()  : bool
Check if there's a flag indicating PayPal account restriction.
is_notice_dismissed()  : bool
Check if the notice has been dismissed.

Constants

Properties

Methods

add_paypal_migration_notice_on_payments_settings_page()

Add notice warning about the migration to PayPal Payments on the Payments settings page.

public add_paypal_migration_notice_on_payments_settings_page() : void
Tags
deprecated
10.4.0

No longer used. Functionality is now handled by add_paypal_notices_on_payments_settings_page().

Return values
void

manage_account_restriction_flag_for_notice()

Handle PayPal order response to manage account restriction notices.

public static manage_account_restriction_flag_for_notice(int|string $http_code, array<string|int, mixed> $response_data, WC_Order $order) : void
Parameters
$http_code : int|string

The HTTP status code from the PayPal API response.

$response_data : array<string|int, mixed>

The decoded response data from the PayPal API.

$order : WC_Order

The WooCommerce order object.

Tags
since
10.4.0
Return values
void

is_notice_dismissed()

Check if the notice has been dismissed.

private is_notice_dismissed(string $notice_name) : bool

User meta keys for notice dismissals:

  • dismissed_paypal_migration_completed_notice
  • dismissed_paypal_account_restricted_notice
  • dismissed_paypal_unsupported_currency_notice

The meta keys are set by WC_Admin_Notices when the notice is dismissed by the user.

Parameters
$notice_name : string

The name of the notice.

Tags
since
10.4.0
Return values
bool