pmpro_insFailedPayment

Send an email RE a failed payment.

Description

pmpro_insFailedPayment( $last_order ); 

$last_order passed in is the previous order for this subscription.

Parameters (1)

0. $last_order
The last order.

Usage

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

Defined (1)

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

/services/twocheckout-ins.php  
  1. function pmpro_insFailedPayment( $last_order ) { 
  2. //hook to do other stuff when payments fail 
  3. do_action("pmpro_subscription_payment_failed", $last_order); 
  4.  
  5. //create a blankorderfor the email 
  6. $morder = new MemberOrder(); 
  7. $morder->user_id = $last_order->user_id; 
  8.  
  9. // Email the user and ask them to update their creditcardinformation 
  10. $pmproemail = new PMProEmail(); 
  11. $pmproemail->sendBillingFailureEmail($user, $morder); 
  12.  
  13. // Email admin so they are aware of the failure 
  14. $pmproemail = new PMProEmail(); 
  15. $pmproemail->sendBillingFailureAdminEmail(get_bloginfo("admin_email"), $morder); 
  16.  
  17. inslog("Payment failed. Emails sent to " . $user->user_email . " and " . get_bloginfo("admin_email") . "."); 
  18.  
  19. return true;