Closed synio-wesley closed 3 years ago
Ok, upon further research it looks like there is a _create_payment
action, but it doesn't allow to change the $data
.. perhaps it would be better to make this a filter?
For now, I was able to solve the problem by using the woocommerce_{$gateway}_args
filter, but I need to add it to all the gateways.. It doesn't feel like the best solution.
foreach (\Mollie_WC_Plugin::$GATEWAYS as $gateway) {
$gateway = strtolower($gateway);
add_filter("woocommerce_{$gateway}_args", function ($data, $order) {
$data['description'] = __('Custom text', 'text-domain') . ' ' . $order->id;
return $data;
}, 10, 2);
}
Hi @synio-wesley, In case this is still relevant for you or anyone else, we recently integrated a feature to set a different payment description when using the payments API. It's not fully customizable and only works with payments, but we may expand the functionality in the future depending on the feedback we receive. Kind regards, Niklas
Hello,
Hope that you'll make this editable in both API (Payment & Order) with an input text field with all {orderNumber} {storeName} etc available.
Thanks to @synio-wesley for his workaround !
@InpsydeNiklas I'd like to second the request of @jicao to have these {variables} work with the Order API as well. Any chance this will be on the roadmap?
It looks like it's not possible to change the description to something else. One of my clients has requested a custom description. Would it be accepted if I would add a PR where the payment_description can be filtered in WP so I can handle it in custom code?
Something like:
apply_filters(Mollie_WC_Plugin::PLUGIN_ID . '_payment_description', $payment_description, $order, $customer_id);