• menard1965

    (@menard1965)


    I have installes Events manager pro and mollie Gateway. When i book an event with 2 plavces amount 1200 € it throws the following error. I dont what to do.

    When i book one place its going through. I use EPS as a payment provider. When i use the TEST mollie key it works.

    Here is the error:

    PHP Fatal error:  Uncaught Mollie\Api\Exceptions\ApiException: Error executing API call (422: Unprocessable Entity): The amount contains an invalid value. Field: amount.value. Documentation: https://docs.mollie.com/overview/handling-errors in /home/al005zfs/www/home/blog/wp-content/plugins/stonehenge-em-mollie/vendor/mollie/mollie-api-php/src/Exceptions/ApiException.php:98
    Stack trace:
    #0 /home/al005zfs/www/home/blog/wp-content/plugins/stonehenge-em-mollie/vendor/mollie/mollie-api-php/src/MollieApiClient.php(498): Mollie\Api\Exceptions\ApiException::createFromResponse(Object(GuzzleHttp\Psr7\Response))
    #1 /home/al005zfs/www/home/blog/wp-content/plugins/stonehenge-em-mollie/vendor/mollie/mollie-api-php/src/MollieApiClient.php(470): Mollie\Api\MollieApiClient->parseResponseBody(Object(GuzzleHttp\Psr7\Response))
    #2 /home/al005zfs/www/home/blog/wp-content/plugins/stonehenge-em-mollie/vendor/mollie/mollie-api-php/src/MollieApiClient.php(418): Mollie\Api\MollieApiClient->performHttpCallToFullUrl('POST', 'https://api.mol...', '{"amoun in /home/al005zfs/www/home/blog/wp-content/plugins/stonehenge-em-mollie/vendor/mollie/mollie-api-php/src/Exceptions/ApiException.php on line 98

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    Hi @menard1965,

    What happens if the amount is below 1000€? Does the error occur then as well? It could be that above 1000 a thousands separator is added, which Mollie cannot handle.

    If the error also occurs with a lower price, please try to enable a second payment method (for example Sofort) in your Mollie Dashboard, please.
    Normally, upon redirection to Mollie, the checkout page would list all available (activated) payment methods for your website. If you only use one, the checkout page could be confused, because it cannot show options (being only one payment method).

    Please let me know.

    Thread Starter menard1965

    (@menard1965)

    I have added 4 mollie payment methods. So the checkout page gives me the screen where i can choose one.

    When the price is below 1000 means when i book one place it works.the checkout oage is showing up i choose payment provider

    When i book 2 places it throws the error and NO checkout oage is shown on the booking oage there is no information that there is something wrong.

    The error i get from debug.log file its the same as above

    Thread Starter menard1965

    (@menard1965)

    What i figured out is:

    In the MolliApiClient.php
    public function performHttpCall($httpMethod, $apiMethod, $httpBody = null)

    I traced the parameters and they are

    httpMethod:{“amount”:{“currency”:”EUR”,”value”:”1,720.00″},”description”:”2 tickets for \u00dcbungst\u00f6rn f\u00fcr den FB2″,”redirectUrl”:”https:\/\/www.blue-2.at\/events\/uebungstoern-fuer-den-fb2-12 …. .. . and so on.

    I realized (what you mentioned already is that the price
    is 1,720.00 so the “,” is wrong at this point.

    How can i solve that
    Cheers
    Michael

    Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    Hi Michael,

    Thank you for your explanations. It turns out that my first thought was indeed correct. “A thousands separator was being added.”

    I will release a public update tonight, but for now the fasted way to solve this for you is to manually edit one line of code.

    In /stonehenge-em-mollie/includes/class-gateway.php go to line 136 and change
    number_format( $EM_Booking->get_price(), 2)
    to:
    number_format( $EM_Booking->get_price(), 2, '.', '' ),

    That will ensure a decimal dot and no thousands separator.

    Kind regards,
    Patrick.

    Thread Starter menard1965

    (@menard1965)

    Thx a lot.
    Your help is really apriciated. I had a meantime soltion build yesterday with JSON_encode and Decode but your Line worked out of tzhe box.
    THX a lot.
    cheers
    Michael

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Mollie is throwinf an error’ is closed to new replies.