jigneshkaila

Error Message Hooks #345

Jan 2nd, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.75 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  *   Error Message Hooks #345
  5.  */
  6.  
  7.  
  8.     //Express Checkout
  9.  
  10.         //Email Notification hook:
  11.    
  12.             //angelleye_ec_error_email_notify_message
  13.  
  14.                         add_filter( 'angelleye_ec_error_email_notify_message', 'angelleye_ec_error_email_notify_message_own', 10, 5 );
  15.                         function angelleye_ec_error_email_notify_message_own($message, $ErrorCode, $ErrorSeverityCode, $ErrorShortMsg, $ErrorLongMsg) {
  16.                             return $message;
  17.                         }
  18.                        
  19.                         //angelleye_ec_error_email_notify_subject
  20.                        
  21.                         add_filter( 'angelleye_ec_error_email_notify_subject', 'angelleye_ec_error_email_notify_subject_own', 10, 1);
  22.                         function angelleye_ec_error_email_notify_subject_own($subject) {
  23.                             return $subject;
  24.                         }
  25.    
  26.         //Fron-End error hook:
  27.    
  28.             //angelleye_ec_display_type_message
  29.                        
  30.                         add_filter( 'angelleye_ec_display_type_message', 'angelleye_ec_display_type_message_own', 10, 3 );
  31.                         function angelleye_ec_display_type_message_own($error_display_type_message, $ErrorCode, $ErrorLongMsg) {
  32.                             return $error_display_type_message;
  33.                         }
  34.                        
  35.             //angelleye_ec_refund_message
  36.                        
  37.                         add_filter( 'angelleye_ec_refund_message', 'angelleye_ec_refund_message_own', 10, 3 );
  38.                         function angelleye_ec_refund_message_own($L_LONGMESSAGE, $L_ERRORCODE, $PayPalResult) {
  39.                             return $L_LONGMESSAGE;
  40.                         }
  41.    
  42.  
  43.     //PayPal Pro
  44.  
  45.         //Email Notification hook:
  46.    
  47.             //angelleye_pc_error_email_notify_message
  48.                        
  49.                         add_filter( 'angelleye_pc_error_email_notify_message', 'angelleye_pc_error_email_notify_message_own', 10, 3 );
  50.                         function angelleye_pc_error_email_notify_message_own($message, $error_code, $long_message) {
  51.                             return $message;
  52.                         }
  53.                        
  54.             //angelleye_pc_error_email_notify_subject
  55.                        
  56.                         add_filter( 'angelleye_pc_error_email_notify_subject', 'angelleye_pc_error_email_notify_subject_own', 10, 3 );
  57.                         function angelleye_pc_error_email_notify_subject_own($subject, $error_code, $long_message) {
  58.                             return $subject;
  59.                         }
  60.                        
  61.            
  62.         //Fron-End error hook:
  63.    
  64.             //angelleye_pc_display_type_notice
  65.                        
  66.                         add_filter( 'angelleye_pc_display_type_notice', 'angelleye_pc_display_type_notice_own', 10, 3 );
  67.                         function angelleye_pc_display_type_notice_own($pc_display_type_notice, $error_code, $long_message) {
  68.                             return $pc_display_type_notice;
  69.                         }
  70.                          
  71.             //angelleye_pc_display_type_error
  72.                        
  73.                         add_filter( 'angelleye_pc_display_type_error', 'angelleye_pc_display_type_error_own', 10, 3 );
  74.                         function angelleye_pc_display_type_error_own($pc_display_type_notice, $error_code, $long_message) {
  75.                             return $pc_display_type_notice;
  76.                         }
  77.    
  78.         //Refund Request error hook:
  79.        
  80.             //angelleye_pc_refund_message
  81.                        
  82.                         add_filter( 'angelleye_pc_refund_message', 'angelleye_pc_refund_message_own', 10, 3 );
  83.                         function angelleye_pc_refund_message_own($L_LONGMESSAGE, $L_ERRORCODE, $PayPalResult) {
  84.                             return $L_LONGMESSAGE;
  85.                         }
  86.  
  87.            
  88.     //PayPal PayFlow
  89.  
  90.        
  91.         //Email Notification hook:
  92.        
  93.             //angelleye_fc_error_email_notify_msg
  94.                        
  95.                         add_filter( 'angelleye_fc_error_email_notify_msg', 'angelleye_fc_error_email_notify_msg_own', 10, 1 );
  96.                         function angelleye_fc_error_email_notify_msg_own($message) {
  97.                             return $message;
  98.                         }
  99.                        
  100.             //angelleye_fc_error_email_notify_subject
  101.                        
  102.                         add_filter( 'angelleye_fc_error_email_notify_subject', 'angelleye_fc_error_email_notify_subject_own', 10, 1 );
  103.                         function angelleye_fc_error_email_notify_subject($subject) {
  104.                             return $subject;
  105.                         }
  106.        
  107.         //Fron-End error hook:
  108.        
  109.             //angelleye_fc_empty_response
  110.                        
  111.                         add_filter( 'angelleye_fc_empty_response', 'angelleye_fc_empty_response_own', 10, 2);
  112.                         function angelleye_fc_empty_response_own($error_message, $PayPalResult) {
  113.                             return $error_message;
  114.                         }
  115.                        
  116.                        
  117.             //angelleye_fc_dp_error_display_type
  118.                         add_filter( 'angelleye_fc_dp_error_display_type', 'angelleye_fc_dp_error_display_type_own', 10, 4);
  119.                         function angelleye_fc_dp_error_display_type_own($fc_error_display_type, $RESULT, $RESPMSG, $PayPalResult) {
  120.                             return $fc_error_display_type;
  121.                         }
  122.                        
  123.            
  124.            
  125.         //Refund Request error hook:
  126.        
  127.             //angelleye_fc_refund_error
  128.                        
  129.                         add_filter( 'angelleye_fc_refund_error', 'angelleye_fc_refund_error_own', 10, 2);
  130.                         function angelleye_fc_refund_error_own($RESPMSG, $PayPalResult) {
  131.                             return $RESPMSG;
  132.                         }
  133.                        
  134.                        
  135.  
  136.  
  137. add_filter('angelleye_pc_display_type_notice', 'angelleye_pc_display_type_notice_function', 10, 3);
  138. function angelleye_pc_display_type_notice_function($pc_display_type_notice, $error_code, $long_message) {
  139.     $error_code_array = array('15005', '15006', '15007', '10752');
  140.     if (in_array($error_code, $error_code_array)) {
  141.         $pc_display_type_notice = 'Payment declined by your financial institution. Please contact your financial institution to resolve this issue.';
  142.     } elseif ($error_code == '10527') {
  143.         $pc_display_type_notice = 'Payment Declined - Credit card number is invalid or the type of credit card selected is incorrect.';
  144.     } else {
  145.         $pc_display_type_notice .= ' Payment Declined - Incorrect billing address or credit card information. Please fix and try again.';
  146.     }
  147.     return $pc_display_type_notice;
  148. }                        
  149. ?>
Add Comment
Please, Sign In to add comment