The gform_mollie_payment_description filter allows you to modify the payment description sent to Mollie when processing a Gravity Forms payment.
Usage
add_filter('gform_mollie_payment_description', 'your_function_name', 10, 5);
Parameters
- $description (string) – The payment description.
- $strings (array) – Contains the Entry ID and Products, which are used to create the description.
- $entry (array) – The entry object currently being processed.
- $submission_data (Submission Data) – Contains the form title, payment amount, setup fee amount, trial amount, line items created using the submitted pricing field values, and any discounts from coupons.
- $feed (array) – The feed object currently being processed.
More information
See Gravity Forms Docs: gform_mollie_payment_description
Examples
Remove the entry ID
Remove the entry ID from the payment description:
add_filter('gform_mollie_payment_description', 'remove_entry_id', 10, 2); function remove_entry_id($description, $strings) { unset($strings['entry_id']); return implode(', ', $strings); }
Include a field value
Append the value of a form field to the payment description:
add_filter('gform_mollie_payment_description', 'append_field_value', 10, 3); function append_field_value($description, $strings, $entry) { return $description . ', Name: ' . rgar($entry, '1.3') . ' ' . rgar($entry, '1.6'); }
Add a custom prefix
Add a custom prefix to the payment description:
add_filter('gform_mollie_payment_description', 'add_custom_prefix', 10, 1); function add_custom_prefix($description) { return 'Custom Prefix - ' . $description; }
Add a custom suffix
Add a custom suffix to the payment description:
add_filter('gform_mollie_payment_description', 'add_custom_suffix', 10, 1); function add_custom_suffix($description) { return $description . ' - Custom Suffix'; }
Modify the products description
Modify the products description in the payment description:
add_filter('gform_mollie_payment_description', 'modify_products_description', 10, 2); function modify_products_description($description, $strings) { $strings['products'] = 'New Products: Product X, Product Y, Product Z'; return implode(', ', $strings); }
Note: The code should be placed in the functions.php
file of your active theme.