WC_Gateway_Paypal::manage_account_restriction_status
Handle PayPal order response to manage account restriction notices.
This method is called via the woocommerce_paypal_standard_order_created_response and manages the account restriction flag based on PayPal API responses.
Extensions can disable this feature using the filter: add_filter( woocommerce_paypal_account_restriction_notices_enabled, '__return_false' );
Method of the class: WC_Gateway_Paypal{}
Hooks from the method
Returns
null. Nothing (null).
Usage
$WC_Gateway_Paypal = new WC_Gateway_Paypal(); $WC_Gateway_Paypal->manage_account_restriction_status( $http_code, $response_data, $order ): void;
- $http_code(int|string) (required)
- The HTTP status code from the PayPal API response.
- $response_data(array) (required)
- The decoded response data from the PayPal API.
- $order(WC_Order) (required)
- The WooCommerce order object.
WC_Gateway_Paypal::manage_account_restriction_status() WC Gateway Paypal::manage account restriction status code WC 10.5.0
public function manage_account_restriction_status( $http_code, $response_data, $order ): void {
/**
* Filters whether account restriction notices should be enabled.
*
* This filter allows extensions to opt out of the account restriction notice functionality.
*
* @since 10.4.0
*
* @param bool $enabled Whether account restriction notices are enabled. Default true.
*/
if ( ! apply_filters( 'woocommerce_paypal_account_restriction_notices_enabled', true ) ) {
return;
}
PayPalNotices::manage_account_restriction_flag_for_notice( $http_code, $response_data, $order );
}