Closed remcotolsma closed 2 years ago
The error
Error validating /redirect/method
was caused by a required parametermethod
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.
Originally posted by @rvdsteege in https://github.com/pronamic/wp-pronamic-pay/issues/276#issuecomment-963959937
Swish Country Code:
SE
Currency:SEK
The Swish payment flow uses a QR code (desktop) or a redirect to the Swish app (redirect URL with
swish://
protocol). Drop-in can handle this for us.FYI, if I just start a Swish payment via the API integration, the following error occurs:
The handling of the
Pending
result code is not implemented.
This one is added to the auto submit list:
TWINT Country Code:
CH
Currency:CHF
Seems to work with our API integration, with
RedirectShopper
result code.
This one is added to the API only list:
Vipps Country Code:
NO
Currency:NOK
Seems to work with our API integration, with
RedirectShopper
result code.
This one is added to the API only list:
China UnionPay I can't remember how this one ended up in the auto-submit list. Seems to work fine with drop-in, without additional input fields. However, with our API integration, I get the following error message:
交易失败 [9200003]Empty req.
I'd suggest just using drop-in for this payment method.
This one is added to the auto submit list:
@rvdsteege How is this looking?
Perfect 👌
Even better than expected: I tested auto submit with a payment method type which does have input fields in drop-in and it seemed the input validation errors which we expected (if additional input fields are added in the future) don't occur (initially at least; if you switch methods the errors will occur, but usually it won't be possible to switch methods in this scenario, as there should only be one method listed — I tried with scheme
payment method type, which results in multiple methods in drop-in).
In https://github.com/pronamic/wp-pronamic-pay-adyen/pull/8 I initially removed the auto submit and
showPayButton
functionality. In the review from @rvdsteege was suggested to add this again:Reüel
Remco
Reüel
We still have to process the above in https://github.com/pronamic/wp-pronamic-pay-adyen/pull/8.