Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Error Message Hooks #345
- */
- //Express Checkout
- //Email Notification hook:
- //angelleye_ec_error_email_notify_message
- add_filter( 'angelleye_ec_error_email_notify_message', 'angelleye_ec_error_email_notify_message_own', 10, 5 );
- function angelleye_ec_error_email_notify_message_own($message, $ErrorCode, $ErrorSeverityCode, $ErrorShortMsg, $ErrorLongMsg) {
- return $message;
- }
- //angelleye_ec_error_email_notify_subject
- add_filter( 'angelleye_ec_error_email_notify_subject', 'angelleye_ec_error_email_notify_subject_own', 10, 1);
- function angelleye_ec_error_email_notify_subject_own($subject) {
- return $subject;
- }
- //Fron-End error hook:
- //angelleye_ec_display_type_message
- add_filter( 'angelleye_ec_display_type_message', 'angelleye_ec_display_type_message_own', 10, 3 );
- function angelleye_ec_display_type_message_own($error_display_type_message, $ErrorCode, $ErrorLongMsg) {
- return $error_display_type_message;
- }
- //angelleye_ec_refund_message
- add_filter( 'angelleye_ec_refund_message', 'angelleye_ec_refund_message_own', 10, 3 );
- function angelleye_ec_refund_message_own($L_LONGMESSAGE, $L_ERRORCODE, $PayPalResult) {
- return $L_LONGMESSAGE;
- }
- //PayPal Pro
- //Email Notification hook:
- //angelleye_pc_error_email_notify_message
- add_filter( 'angelleye_pc_error_email_notify_message', 'angelleye_pc_error_email_notify_message_own', 10, 3 );
- function angelleye_pc_error_email_notify_message_own($message, $error_code, $long_message) {
- return $message;
- }
- //angelleye_pc_error_email_notify_subject
- add_filter( 'angelleye_pc_error_email_notify_subject', 'angelleye_pc_error_email_notify_subject_own', 10, 3 );
- function angelleye_pc_error_email_notify_subject_own($subject, $error_code, $long_message) {
- return $subject;
- }
- //Fron-End error hook:
- //angelleye_pc_display_type_notice
- add_filter( 'angelleye_pc_display_type_notice', 'angelleye_pc_display_type_notice_own', 10, 3 );
- function angelleye_pc_display_type_notice_own($pc_display_type_notice, $error_code, $long_message) {
- return $pc_display_type_notice;
- }
- //angelleye_pc_display_type_error
- add_filter( 'angelleye_pc_display_type_error', 'angelleye_pc_display_type_error_own', 10, 3 );
- function angelleye_pc_display_type_error_own($pc_display_type_notice, $error_code, $long_message) {
- return $pc_display_type_notice;
- }
- //Refund Request error hook:
- //angelleye_pc_refund_message
- add_filter( 'angelleye_pc_refund_message', 'angelleye_pc_refund_message_own', 10, 3 );
- function angelleye_pc_refund_message_own($L_LONGMESSAGE, $L_ERRORCODE, $PayPalResult) {
- return $L_LONGMESSAGE;
- }
- //PayPal PayFlow
- //Email Notification hook:
- //angelleye_fc_error_email_notify_msg
- add_filter( 'angelleye_fc_error_email_notify_msg', 'angelleye_fc_error_email_notify_msg_own', 10, 1 );
- function angelleye_fc_error_email_notify_msg_own($message) {
- return $message;
- }
- //angelleye_fc_error_email_notify_subject
- add_filter( 'angelleye_fc_error_email_notify_subject', 'angelleye_fc_error_email_notify_subject_own', 10, 1 );
- function angelleye_fc_error_email_notify_subject($subject) {
- return $subject;
- }
- //Fron-End error hook:
- //angelleye_fc_empty_response
- add_filter( 'angelleye_fc_empty_response', 'angelleye_fc_empty_response_own', 10, 2);
- function angelleye_fc_empty_response_own($error_message, $PayPalResult) {
- return $error_message;
- }
- //angelleye_fc_dp_error_display_type
- add_filter( 'angelleye_fc_dp_error_display_type', 'angelleye_fc_dp_error_display_type_own', 10, 4);
- function angelleye_fc_dp_error_display_type_own($fc_error_display_type, $RESULT, $RESPMSG, $PayPalResult) {
- return $fc_error_display_type;
- }
- //Refund Request error hook:
- //angelleye_fc_refund_error
- add_filter( 'angelleye_fc_refund_error', 'angelleye_fc_refund_error_own', 10, 2);
- function angelleye_fc_refund_error_own($RESPMSG, $PayPalResult) {
- return $RESPMSG;
- }
- add_filter('angelleye_pc_display_type_notice', 'angelleye_pc_display_type_notice_function', 10, 3);
- function angelleye_pc_display_type_notice_function($pc_display_type_notice, $error_code, $long_message) {
- $error_code_array = array('15005', '15006', '15007', '10752');
- if (in_array($error_code, $error_code_array)) {
- $pc_display_type_notice = 'Payment declined by your financial institution. Please contact your financial institution to resolve this issue.';
- } elseif ($error_code == '10527') {
- $pc_display_type_notice = 'Payment Declined - Credit card number is invalid or the type of credit card selected is incorrect.';
- } else {
- $pc_display_type_notice .= ' Payment Declined - Incorrect billing address or credit card information. Please fix and try again.';
- }
- return $pc_display_type_notice;
- }
- ?>
Add Comment
Please, Sign In to add comment