Closed nilsenpaul closed 1 year ago
Hi @nilsenpaul, Thank you for contacting us.
I just tried to replicate it on a clean craft 4 install, but are unable to replicate this. Could you maybe share you payment form code?
Jup:
<input x-model="cart.gatewayId" type="hidden" name="gatewayId" value="{{ mollieGateway.id }}" />
{% if paymentMethods %}
<div class="relative w-full mb-6 md:w-1/3">
<select x-model="cart.paymentMethod" name="{{ namespace }}[paymentMethod]">
<option value="">Kies een betaalmethode</option>
{% for method in paymentMethods %}
<option value="{{ method.id }}">{{ method.name }}</option>
{% endfor %}
</select>
</div>
{% endif %}```
hmm, at a first sight that looks ok,
I guess your {{ namespace }}
is equal to paymentForm[gatewayhandle]
?
And other methods (iDeal, Pay Now, ...) are working fine?
Is there a transaction getting added in Craft commerce, or do you see a console error/network request in your browser when submitting the form?
Hm, I seem to have been wasting your time. Upon closer inspecting of the transactions, they get a 422 error, because the cart total is higher than maximum:
"Client error:
POST https:\/\/api.mollie.com\/v2\/ordersresulted in a
422 Unprocessable Entityresponse:\n{\u0022status\u0022:422,\u0022title\u0022:\u0022Unprocessable Entity\u0022,\u0022detail\u0022:\u0022The amount is higher than the maximum\u0022,\u0022field\u0022:\u0022payment.amount\u0022,\u0022 (truncated...)\n"
Now to find out what the maximum is ...
{% set paymentMethods = gateway.fetchPaymentMethods({
'resource': 'orders',
'locale': cart.orderLanguage,
'amount': cart.total,
'currency': cart.paymentCurrency,
'billingCountry': cart.billingAddress.countryCode,
}) %}
This will only return the payment methods that match your order https://docs.mollie.com/reference/v2/methods-api/list-methods
Description
We have a working payment form, from which we can request payments for iDeal, Klarna Pay Now and Sofort. Then, we activated
in3
andKlarna Slice It
payment options in Mollie. Those appear in the payment methods, but if we select one of those, we get redirected to the payment form without ever being redirected to Mollie.Steps to reproduce
in3
orKlarna Slice it
payment methodAdditional info