• Resolved nickfarelli

    (@nickfarelli)


    I had some problems on my site, so installed another checkout plugin (Flux Checkout) instead of Checkout-WC. Had to change / translate some stuff with WPML and did some changes in my funcions.php

    Later, i saw that Mollie Klarna Payments are not working anymore.

    “Error processing checkout. Please try again”.

    The problem: I have undone all changes i did that i can remember. functions.php is the same as before.

    Still, i am having this error. How can i find a solution for this? There seems to be a problem with my name field and “whitespace characters” on my site (auramonaco.de).

    For now, i had to deactivate Mollie Klarna payments with Stripe Klarna, but i do not want that. I just did it so i do not lose my customers.

    klarna: Failed to create Mollie payment object for order 468544: [2025-02-03T15:23:40+0000] Error executing API call (422: Unprocessable Entity): Order line 2 is invalid. The 'name' field should not contain only whitespace characters. Documentation: https://docs.mollie.com/overview/handling-errors. Request body: {"status":422,"title":"Unprocessable Entity","detail":"Order line 2 is invalid. The 'name' field should not contain only whitespace characters","field":"lines.2.name","_links":{"documentation":{"href":"https://docs.mollie.com/overview/handling-errors","type":"text/html"}}}. Field: lines.2.name

    Full Log:

    https://privatebin.syde.com/?0b222de3d55cfb7c#9ErE9MQEXjFvUAZMzpKGbje4UQV6b2DUwaNu2dfBrfaE

    WooCommerce System Report:

    https://privatebin.syde.com/?26746fefe5b2d74a#9RHUWNqvHufcH1tA1ggYELZ8WSTA17gVxcBo361cyGbc

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Femi

    (@femiyb)

    Hi @nickfarelli ,

    It looks like the issue is caused by an empty or whitespace-only name field in one of your order line items (line 2) when processing payments via Mollie Klarna. Since the error message from Mollie’s API states:

    “Order line 2 is invalid. The ‘name’ field should not contain only whitespace characters.”
    (422: Unprocessable Entity)

    • Go to WooCommerce → Orders and open order 468544.
    • Look at the product and shipping items in the order details.
    • Ensure that all item names (including shipping fees, if applicable) are properly filled in.

    Since you modified translations using WPML, it’s possible that:

    • Some product names or shipping labels are missing translations.
    • WPML is sending empty strings or spaces instead of valid names.

    You can try temporarily disabling WPML and testing a checkout.

    If the issue persists, you can switch back to Checkout-WC or use another payment method while troubleshooting.

    Regards,
    Femi.

    Thread Starter nickfarelli

    (@nickfarelli)

    Good day again,

    you were right. Some shipping labels were missing translation. I asked ChatGPT and it gave me instructions how to solve it. I will add the solution here in case someone else encounters the same problem while using WPML.

    🚨 Root Cause Identified: The issue was not with the product, but with the shipping costs (“shipping_fee”)

    The Mollie log shows that the issue was not caused by the product name but by an empty label in the shipping costs.

    🔎 Problematic line in your log:

    {“type”:”shipping_fee”,”name”:” “,”quantity”:1,”vatRate”:19.09,”unitPrice”:{“currency”:”EUR”,”value”:”4.99″},”totalAmount”:{“currency”:”EUR”,”value”:”4.99″},”vatAmount”:{“currency”:”EUR”,”value”:”0.80″},”metadata”:{“order_item_id”:”700757″}}

    Here’s the issue:
    👉 The value "name": " " consists only of a space, which is not accepted by Mollie.
    👉 This means WPML removed or incorrectly translated the shipping fee name during checkout in the original language.

    Solution: Correct the shipping cost name1️⃣ Manually check and fix it

    • Go to WooCommerce > Settings > Shipping
    • Open your shipping zones & methods
    • Change the shipping method name (e.g., from “Standard” to “Standard Shipping”)
    • Save the changes and place a new test order.

    2️⃣ Fix WPML translations for shipping names

    If WPML incorrectly handles the shipping name:

    • Go to WPML > String Translation
    • Search for:
      • "shipping"
      • "Versand"
      • "shipping_fee"
    • If you find an empty or incorrect entry, replace it with "Shipping Costs" or "Standard Shipping"
    • Save and test again.

    Final Solution: Multiple “Shipping” entries contained only a space. I set the correct translation – and now everything works again! 🚀

    • This reply was modified 1 year, 3 months ago by nickfarelli.
    Plugin Support Femi

    (@femiyb)

    Hello @nickfarelli

    I’m glad to learn you were able to resolve the issue.
    And thank you for sharing the steps here for others.

    I will mark this case resolved.

    Regards,
    Femi.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘name field whitespace problem (422 error, error processing checkout)’ is closed to new replies.