pmpro_twocheckoutExit

Output inslog and exit;.

Description

pmpro_twocheckoutExit( (constant) $redirect = false ); 

Parameters (1)

0. $redirect — Optional. (constant) => false
The redirect.

Usage

  1. if ( !function_exists( 'pmpro_twocheckoutExit' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/services/twocheckout-ins.php'; 
  3.  
  4. // The redirect. 
  5. $redirect = false; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pmpro_twocheckoutExit($redirect); 
  9.  

Defined (1)

The function is defined in the following location(s).

/services/twocheckout-ins.php  
  1. function pmpro_twocheckoutExit($redirect = false) 
  2. global $logstr; 
  3. //echo $logstr; 
  4.  
  5. $logstr = var_export($_REQUEST, true) . "Logged On: " . date_i18n("m/d/Y H:i:s") . "\n" . $logstr . "\n-------------\n"; 
  6.  
  7. //log in file or email? 
  8. if(defined('PMPRO_INS_DEBUG') && PMPRO_INS_DEBUG === "log") 
  9. //file 
  10. $loghandle = fopen(dirname(__FILE__) . "/../logs/ipn.txt", "a+"); 
  11. fwrite($loghandle, $logstr); 
  12. fclose($loghandle); 
  13. elseif(defined('PMPRO_INS_DEBUG')) 
  14. //email 
  15. if(strpos(PMPRO_INS_DEBUG, "@")) 
  16. $log_email = PMPRO_INS_DEBUG; //constant defines a specific email address 
  17. else 
  18. $log_email = get_option("admin_email"); 
  19.  
  20. wp_mail($log_email, get_option("blogname") . " 2Checkout INS Log", nl2br($logstr)); 
  21.  
  22. if(!empty($redirect)) 
  23. wp_redirect($redirect); 
  24.  
  25. exit;