Hi @maartenplugwise
Thank you for contacting Payment Plugins. You can use the filter wc_stripe_payment_intent_args to provide a dynamic descriptor.
Example:
add_filter('', function($args, $order){
if ( \in_array( 'card', $args['payment_method_types'] ) ) {
$args['statement_descriptor_suffix'] = 'Plugwise*#' . $order->get_id();
} else {
$args['statement_descriptor'] = 'Plugwise*#' . $order->get_id();
}
return $args;
}, 10, 2);
Kind Regards
Hi Clayton,
Thank you for the quick response with a solution. Would you consider to add this as a standard option in the plugin to set a dynamic statement descriptor? I expect that for all plugin users it would be beneficial that their webshop customers can see the order ID in their bank statement.
Hi @maartenplugwise
We have considered adding dynamic descriptor support. The issue is descriptors are tricky because of all the validations that Stripe performs. The plugin would need to implement checks to ensure the merchant doesn’t enter an invalid descriptor and that could lead the merchant to think there is a plugin issue.
It’s always a balance wanting to support as many advanced options as possible while still ensuring a merchant can’t bring their payments down from a simple config change.
Kind Regards
@mrclayton I added the code and it works (tested with iDeal). The checkout did give a warning that * and # are not allowed (indeed they are not a latin character).
I understand the balance. In this case I don’t think there is a big risk since it is not so difficult to perform this check: Only latin characters, 5-22 characters. And at a link to the stripe documentation for the rules.
UI could show:
– Info of limitations + link to Stripe documentation
– Input field for business name + dropdown of the desired dynamic part, or just only order number.
– A preview field with business name and the latest order number, and the total character length. If you have high order numbers it could hit the character limit.
Hi @maartenplugwise
I’ve made a note to add this in the next release. Rather than a dropdown, I think we will include reserved strings like this:
MyComp {order_id} = MyComp 5573
MyComp {order_number} = MyComp 4-5573
This way the merchant can use dynamic variables to construct the descriptor. The documentation site will cover all of the available dynamic variables.
Kind Regards
@mrclayton Thank you so much for planning to include it in the next release. 👍
Hi @maartenplugwise
Version 3.3.103 has been released. Dynamic variables are now supported for the statement descriptor. https://paymentplugins.com/documentation/stripe/advanced-settings/#statement-descriptor
Kind Regards
@mrclayton I tested the plugin update and it works! I see the order ID on the bank statement. Thank you so much for officially adding this to the plugin.