WC_Gateway_Paypal_Notices
in package
Class WC_Gateway_Paypal_Notices.
Tags
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
PAYPAL_ACCOUNT_RESTRICTION_ISSUES
PayPal account restriction issue codes from PayPal API.
protected
array<string|int, mixed>
PAYPAL_ACCOUNT_RESTRICTION_ISSUES
= array('PAYEE_ACCOUNT_LOCKED_OR_CLOSED', 'PAYEE_ACCOUNT_RESTRICTED')
Tags
PAYPAL_ACCOUNT_RESTRICTED_NOTICE
The name of the notice for PayPal account restriction.
private
string
PAYPAL_ACCOUNT_RESTRICTED_NOTICE
= 'paypal_account_restricted'
Tags
PAYPAL_MIGRATION_NOTICE
The name of the notice for PayPal migration.
private
string
PAYPAL_MIGRATION_NOTICE
= 'paypal_migration_completed'
Tags
PAYPAL_UNSUPPORTED_CURRENCY_NOTICE
The name of the notice for PayPal unsupported currency.
private
string
PAYPAL_UNSUPPORTED_CURRENCY_NOTICE
= 'paypal_unsupported_currency'
Tags
Properties
$gateway
The PayPal gateway instance.
private
WC_Gateway_Paypal
$gateway
Methods
__construct()
Constructor.
public
__construct() : mixed
Return values
mixed —add_paypal_migration_notice()
Add notice warning about the migration to PayPal Payments.
public
add_paypal_migration_notice() : void
Tags
Return values
void —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
Return values
void —add_paypal_notices()
Add PayPal Standard notices.
public
add_paypal_notices() : void
Tags
Return values
void —add_paypal_notices_on_payments_settings_page()
Add PayPal notices on the payments settings page.
public
add_paypal_notices_on_payments_settings_page() : void
Tags
Return values
void —clear_account_restriction_flag()
Clear the flag indicating PayPal account restriction.
public
static clear_account_restriction_flag() : void
Tags
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
Return values
void —set_account_restriction_flag()
Set the flag indicating PayPal account restriction.
public
static set_account_restriction_flag() : void
Tags
Return values
void —paypal_migration_notice_dismissed()
Check if the installation notice has been dismissed.
protected
static paypal_migration_notice_dismissed() : bool
Tags
Return values
bool —add_paypal_account_restricted_notice()
Add notice warning about PayPal account restriction.
private
add_paypal_account_restricted_notice() : void
Tags
Return values
void —add_paypal_unsupported_currency_notice()
Add notice warning when PayPal does not support the store's currency.
private
add_paypal_unsupported_currency_notice() : void
Tags
Return values
void —get_dismiss_url()
Get the dismiss URL for a notice.
private
get_dismiss_url(string $notice_name) : string
Parameters
- $notice_name : string
-
The name of the notice.
Tags
Return values
string —has_account_restriction_flag()
Check if there's a flag indicating PayPal account restriction.
private
has_account_restriction_flag() : bool
Tags
Return values
bool —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.
