pmpro_braintreeWebhookExit

The Paid Memberships Pro pmpro braintreeWebhookExit function.

Description

pmpro_braintreeWebhookExit(); 

Usage

  1. if ( !function_exists( 'pmpro_braintreeWebhookExit' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/services/braintree-webhook.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = pmpro_braintreeWebhookExit(); 
  7.  

Defined (1)

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

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