Taking payment via Adyen in flutter webapp

437 Views Asked by At

I am trying to build a WebApp using Flutter. I am stuck at a point with payment system integration. I want to use Adyen. Adyen does not provide any direct support to Flutter officially. So I made a webpage where payments can be executed supported by the backend server.

So my webapp can launch a webview and open the payment page inside it. But how can my app know if the payment has gone through or not?

1

There are 1 best solutions below

0
On

An adyen integration completes a payment at the backend, either with the payment request or the additional details request (depending on the payment method used). Your server would know the result of the payment as specified in the resultCode.

You could pass the resultCode directly from your backend to your flutter app by whatever means you currently facilitate backend <-> flutter client communication.

Alternatively, you could use the webview as that communication channel by redirecting to some arbitrary completion page and implementing onPageStarted to look for that url, thus knowing the payment flow was completed.

Though with this approach you will need to make sure you redirect finished payment on client side, refer to example Adyen integration on this.