For those that are looking for this information, you can use the following code to hook the stripe payment intent to change the description:
function give_stripe_custom_payment_meta( $charge_args ) {
$charge_args['description'] = 'Custom Description';
return $charge_args;
}
add_filter( 'give_stripe_create_intent_args', 'give_stripe_custom_payment_meta', 10 );
You can also combine this with some code to set the description based on on the fund defined:
function give_stripe_custom_payment_meta( $charge_args ) {
// Sanitize the input posted data to the form.
$posted_data = give_clean( filter_input_array( INPUT_POST ) );
// Check the selected fund and set the description accordingly
if( isset( $posted_data['give-selected-fund'] ) ){
switch( $posted_data['give-selected-fund'] ){
case 1:
$charge_args['description'] = 'Donations - General Fund';
break;
case 2:
$charge_args['description'] = 'Donations - Other Fund';
break;
default:
$charge_args['description'] = 'Donations - Other Designation'; // default description in case neither 1 nor 2 is selected
}
} else {
$charge_args['description'] = 'Donations - General Fund'; // default description in case 'give-selected-fund' isn't set
}
return $charge_args;
}
add_filter( 'give_stripe_create_intent_args', 'give_stripe_custom_payment_meta', 10 );