white-nl / commerce-mollie-plus

Mollie Klarna integration for Craft Commerce
Other
3 stars 5 forks source link

[Craft/Commerce 4] Bank transfer method fails with error #12

Closed Nellyaa closed 1 year ago

Nellyaa commented 1 year ago

Description

It is impossible to pay via bank transfer. Clicking the big button on the mollie page should take you back to the success URL after payment in Commerce, but fails to do so.

Steps to reproduce

  1. Make bank transfer an available payment method in mollie
  2. Check out with the bank transfer method and get redirected to mollie page with payment information for bank transfer
  3. Press the big blue button for affirmation in the middle, "Continue to website"
  4. Get redirected back to the "fail URL" with the error shown below as flash message.
  5. The cart has NOT been turned into an order! But mollie created an order and sent the customer payment information via email!

Additional info


Zahlungsfehler: {"resource":"order","id":"ord_4c75l8","profileId":"XXXXXXX","method":"banktransfer","amount":{"value":"5.99","currency":"EUR"},"status":"created","isCancelable":true,"metadata":{"transactionId":"03f3d0307dc8402cd42a3bcfec4ac600"},"createdAt":"2022-10-15T16:36:02+00:00","expiresAt":"2022-11-12T16:36:02+00:00","mode":"live","locale":"de_DE","billingAddress":{"streetAndNumber":"XXXXX","postalCode":"XXXXX","city":"XXXX","country":"DE","givenName":"XXXXX","familyName":"XXXX","email":"XXXXX"},"shopperCountryMustMatchBillingCountry":false,"orderNumber":"13f0b646e372102dd1a823de9f9cb4f3","shippingAddress":{"streetAndNumber":"XXXX","postalCode":"XXXXXX","city":"XXXXX","country":"DE","givenName":"XXXX","familyName":"XXXXX","email":"XXXXX"},"redirectUrl":"https:\/\/www.purrint.de\/index.php?p=actions\/commerce\/payments\/complete-payment&commerceTransactionHash=03f3d0307dc8402cd42a3bcfec4ac600","webhookUrl":"https:\/\/www.purrint.de\/index.php?p=actions\/commerce\/webhooks\/process-webhook&gateway=5&commerceTransactionHash=03f3d0307dc8402cd42a3bcfec4ac600","lines":[{"resource":"orderline","id":"odl_2.fu651q","orderId":"ord_4c75l8","name":"Test-Produkt - Test-Product Variant","sku":"T0001","type":"physical","status":"created","metadata":null,"isCancelable":false,"quantity":1,"quantityShipped":0,"amountShipped":{"value":"0.00","currency":"EUR"},"quantityRefunded":0,"amountRefunded":{"value":"0.00","currency":"EUR"},"quantityCanceled":0,"amountCanceled":{"value":"0.00","currency":"EUR"},"shippableQuantity":0,"refundableQuantity":0,"cancelableQuantity":0,"unitPrice":{"value":"1.00","currency":"EUR"},"vatRate":"0.00","vatAmount":{"value":"0.00","currency":"EUR"},"totalAmount":{"value":"1.00","currency":"EUR"},"createdAt":"2022-10-15T16:36:02+00:00"},{"resource":"orderline","id":"odl_2.lxfm9s","orderId":"ord_4c75l8","name":"General Shipping","sku":null,"type":"shipping_fee","status":"created","metadata":null,"isCancelable":false,"quantity":1,"quantityShipped":0,"amountShipped":{"value":"0.00","currency":"EUR"},"quantityRefunded":0,"amountRefunded":{"value":"0.00","currency":"EUR"},"quantityCanceled":0,"amountCanceled":{"value":"0.00","currency":"EUR"},"shippableQuantity":0,"refundableQuantity":0,"cancelableQuantity":0,"unitPrice":{"value":"4.99","currency":"EUR"},"vatRate":"0.00","vatAmount":{"value":"0.00","currency":"EUR"},"totalAmount":{"value":"4.99","currency":"EUR"},"createdAt":"2022-10-15T16:36:02+00:00"}],"_links":{"self":{"href":"https:\/\/api.mollie.com\/v2\/orders\/ord_4c75l8","type":"application\/hal+json"},"dashboard":{"href":"https:\/\/my.mollie.com\/dashboard\/org_15094019\/orders\/ord_4c75l8","type":"text\/html"},"checkout":{"href":"https:\/\/www.mollie.com\/checkout\/order\/4c75l8","type":"text\/html"},"documentation":{"href":"https:\/\/docs.mollie.com\/reference\/v2\/orders-api\/get-order","type":"text\/html"}}}
WHITE-developer commented 1 year ago

Hi @Nellyaa, We'll discuss internally how to best handle the bank transfers, as I saw there was already a discussion about this topic in the Mollie plugin from Craft itself, and come back on this as soon as possible

WHITE-developer commented 1 year ago

Hi @Nellyaa, Just tagged a new release (2.2.0) which adds a setting that defines how to handle the banktransfers.

By default this setting is set to false, and the order won't be marked as completed until the banktransfer is completed, but you will be redirected to the complete page. When you set the setting to true, orders with a pending banktransfer will be marked as completed but stay unpaid until the banktransfer is completed.