pronamic / wp-pronamic-pay

The Pronamic Pay plugin allows you to easily accept payments with payment methods like credit card, iDEAL, Bancontact and Sofort through a variety of payment providers on your WordPress website.
https://pronamicpay.com
34 stars 14 forks source link

Adyen → Swish payment: Error validating /redirect/method #276

Closed remcotolsma closed 2 years ago

remcotolsma commented 2 years ago

After upgrade to GF 2.5 and latest Pronamic Pay we get an error when trying to go on with Swish payment. "Error validating /redirect/method: The property method is required"

I have read changelogs but can't find a reason.. Please help.

Internal HelpScout ticket: https://secure.helpscout.net/conversation/1674494041/22902/

I believe this issue is fixed in https://github.com/wp-pay-gateways/adyen/commit/454a25ec153f6dd9e96d25a9951287375442188e.

I'm not quite sure what the problem was yet, but didn't quite understand the showPayButton logic either, is that a phenomenon from Adyen?

rvdsteege commented 2 years ago

The error Error validating /redirect/method was caused by a required parameter method in https://github.com/wp-pay-gateways/adyen/blob/1d4763d1f554992c324ebedd1b0a1fb680dff858/json-schemas/redirect.json — I've removed this parameter in https://github.com/wp-pay-gateways/adyen/commit/454a25ec153f6dd9e96d25a9951287375442188e as this parameter is not always available apparently — for example with the Swish payment method.

After that change, the payment was started correctly via the direct API integration. However, this now resulted in an URL with a custom protocol (something like swishapp://) to redirect to the Swish app. That should work if the Swish app is installed on mobile, but can not be handled on desktop. Therefore, I've updated the Swish payment method to use the drop-in.

Using the drop-in results in a single payment method on the payment page and needs an extra click to submit the payment form, which is confusing as the payment method had already been selected during checkout/on the form. That is why I'm not showing the submit button with showPayButton: false (see https://docs.adyen.com/online-payments/web-drop-in/optional-configuration#optional-drop-in-configuration) and auto-submit the drop-in for this payment method. The QR code will now be shown without any further user interaction needed.

Alternatively, we could use the API integration and need to display the QR code ourselves, instead of handling this through the drop-in.

remcotolsma commented 2 years ago

This issue has been resolved, for more information about auto submit and showPayButton see https://github.com/pronamic/wp-pronamic-pay-adyen/issues/9.