MemberMouse uses filters to accomplish descriptions for Stripe transactions. Filters are functions that WordPress passes data through, at certain points in execution, just before taking some action with the data. MemberMouse defines its own set of filters that you can learn more about by reading this article.

MemberMouse includes the description in Stripe for all rebills. Initial payments, however, are treated differently than rebills as far as descriptions go. 


For the initial payment you will only see the order ID passed:

For example, Payment for order# 10043 


For rebill payments, you will see the order ID and product description:

For example, Payment for order# 10043, item: Digital Membership 


However, there may be times when you may need the description to be present in Stripe in the initial payments as well. 


If you'd like to change the description for the initial payment, follow the instructions provided in the mm_stripe_billing_statement_descriptor WordPress filter in MemberMouse WordPress FiltersHere's an example where we used the example filter in the mm_stripe_billing_statement_descriptor section of that article, with a standard WordPress plugin header. The below example is simply setting the custom initial and rebill descriptions to include both the order number and the product description:



<?php

/*

* Plugin Name: Stripe Description Filter

* Plugin URI:

* Description: Stripe Description Addon

* Version: 1.0.0

* Author: Your Name

*/

add_filter('mm_stripe_billing_statement_descriptor', function($descriptor, $order){ 

   $descriptor= "Order # ".$order->orderNumber;

   if(isset($order->orderProducts) && is_array($order->orderProducts)){

        $descriptor.= ", Description: ".array_pop($order->orderProducts)->description;

   }

   return$descriptor;

},1,2);

?>



In this case you'll see something like the following in Stripe: 

Order# 10043, Description: Basic Membership


Add that to a .php file in your plugins folder, and then activate it as you would any other plugin.