PayPal WooCommerce Hooks Library

PayPal for WooCommerce provides a number of hooks so that you can interact with the plugin.  The following list displays the names of the hooks available as well as a simple sample of how to set it up.

PayPal Express Checkout Filter Hooks

angelleye_ec_error_email_notify_subject

Set a custom subject for the email notification that is sent to site admin when a PayPal Express Checkout API error occurs.

add_filter( 'angelleye_ec_error_email_notify_subject', 'my_subject_function', 10, 1);
function my_subject_function($subject) {
    $subject = 'This is my custom subject line.';
    return $subject;
}
angelleye_ec_error_email_notify_message

Set a custom message in the email notification that is sent to site admin when a PayPal Express Checkout API error occurs.

add_filter( 'angelleye_ec_error_email_notify_message', 'my_function', 10, 5 );
function my_function($message, $ErrorCode, $ErrorSeverityCode, $ErrorShortMsg, $ErrorLongMsg) {
    $message = "$ErrorCode - $ErrorLongMsg";
    return $message;
}
angelleye_ec_display_type_message

Set a custom error message to be displayed back to the user when a PayPal Express Checkout API error occurs.

add_filter( 'angelleye_ec_display_type_message', 'my_function', 10, 3 );
function my_function($error_display_type_message, $ErrorCode, $ErrorLongMsg) {
    $error_display_type_message = "Please contact us and let us know you received error code $ErrorCode";
    return $error_display_type_message;
}
angelleye_ec_refund_message

Display a custom message if a PayPal Express Checkout API error occurs when refunding an order.

add_filter( 'angelleye_ec_refund_message', 'my_error_message', 10, 3 );
function my_error_message($L_LONGMESSAGE, $L_ERRORCODE, $PayPalResult) {
    $message = "A refund error occured: $L_ERRORCODE - $L_LONGMESSAGE";
    return $message;
}
angelleye_ec_checkout_icon

Replace the logo used for Express Checkout on the WooCommerce checkout page.


add_filter('angelleye_ec_checkout_icon', 'angelleye_change_express_checkout_icon', 10, 1);
function angelleye_change_express_checkout_icon($icon_url) {
 $icon_url = '<img src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/cc-badges-ppmcvdam.png" alt="Credit Card Badges">';
 return $icon_url;
}

PayPal Payments Pro DoDirectPayment Filter Hooks

angelleye_pc_error_email_notify_subject

Display a custom subject for the email sent to the site admin if a PayPal Pro DoDirectPayment API error occurs.

add_filter( 'angelleye_pc_error_email_notify_subject', 'my_custom_subject', 10, 3 );
function my_custom_subject($subject, $error_code, $long_message) {
    $subject = "This is my custom email subject for error $error_code";
    return $subject;
}
angelleye_pc_error_email_notify_message

Display a custom message in the email sent to the site admin if a PayPal Pro DoDirectPayment API error occurs.

add_filter( 'angelleye_pc_error_email_notify_message', 'my_custom_message', 10, 3 );
function angelleye_pc_error_email_notify_message_own($message, $error_code, $long_message) {
    $message = "The error was $error_code - $long_message";
    return $message;
}
angelleye_pc_display_type_notice

Display a custom message to the user when a PayPal Payments Pro DoDirectPayment API error occurs.

add_filter( 'angelleye_pc_display_type_notice', 'my_custom_message', 10, 3 );
function angelleye_pc_display_type_notice_own($pc_display_type_notice, $error_code, $long_message) {
    $my_custom_message = "Please contact us and let us know you received error $error_code";
    return $my_custom_message;
}
angelleye_pc_refund_message

Display a custom message if a PayPal Payments Pro DoDirectPayment API error occurs when refunding an order.

add_filter( 'angelleye_pc_refund_message', 'my_custom_error_message', 10, 3 );
function my_custom_error_message($L_LONGMESSAGE, $L_ERRORCODE, $PayPalResult) {
    $message = "When refunding, the error $L_ERRORCODE occurred.";
    return $message;
}

PayPal Payments Pro PayFlow Filter Hooks

ae_pppf_custom_parameter

Add data into the COMMENT1 field available in the PayPal Manager (PayFlow) account transaction details.

add_filter( 'ae_pppf_custom_parameter', 'own_ae_pppf_custom_parameter', 10, 2);
function own_ae_pppf_custom_parameter($customer_note , $order) {
    return $order->get_order_number();
}
ae_pppf_comment2_parameter

Add data into the COMMENT2 field available in the PayPal Manager (PayFlow) account transaction details.

add_filter( 'ae_pppf_comment2_parameter', 'own_ae_pppf_comment2_parameter', 10, 2);
function own_ae_pppf_comment2_parameter($empty, $order) {
    return 'My Website';
}
AngellEYE PayPal Newsletter Signup

Subscribe To Our Newsletter

Join our list for the latest promotions, news, and updates from AngellEYE and PayPal!

You have Successfully Subscribed!

Pin It on Pinterest