PayPal Payment Integration in Flutter Using WebView

PayPal Payment Gateway Integration in Flutter

Today when we talk about payment integration in the application we can’t ignore Paypal. Paypal is a world-leading payment gateway for business models.

In flutter currently, there is no Paypal SDK till now so after a lot of research I have successfully implemented Paypal using WebView. I have used some of Paypal’s available APIs for Payment which is officially available for integration in websites so I decided to try it in a flutter to accomplish my goal.

Now first we create our application on Paypal.

In this example, we are using mock values by Paypal for testing the payment integration which we call PayPal SandBox.

What is the PayPal sandbox?

The PayPal sandbox is a self-contained, virtual testing environment that simulates the live PayPal production environment. The sandbox provides a shielded space where you can initiate and watch while your apps process PayPal API requests without touching any live PayPal accounts.

Now let’s get to practical work.

First, go to the Paypal developer dashboard

Here you go to the sidebar you will find SANDBOX option from that you select the accounts you will get this screen.

PayPal Sandbox test account

by default, you will get personal and a business account created for you by PayPal if you want to create more accounts you just have to click on create an account.

Now it’s time to create an application. For application go to the My Apps & credentials from side bar you will get this screen.

Add Application to PayPal

from here click create an application.

Add App name and SandBox account

after creating the application successfully you have to get the secret id and client id for that click on the application detail

the client id and secret it

Now let's get to the Flutter part

packages we are using in our application




Its Coding Time

First, we will create a Transaction screen in which we will add our simple example UI and Navigation to pay the payment

Now we will create the services screen in which we will call the Paypal APIs, for now, will use this domain because we are testing If you want to make a real transaction then replace it with

Now it's time to make a payment screen in which we will send the order and payment detail to Paypal.

End results

End results

It's my first blog on medium if I had made any mistake kindly mention in response


We have successfully implemented the PayPal Payment integration in our flutter application using the WebView.

Thank you for reading the article so far, and please let me your feedback. Tell me if you want another article with a more complex example. You can find the above app from my GitHub. If you liked my article, Please do clap and follow me on LinkedIn and Twitter. Thanks…

Source Code




Flutter developer, Mechatronics Engineer, Cats lover

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How a new tool made me not hate programming so much

On houses, debt and software rewrites

Common bottom navigation bar — Flutter

Delete AWS CloudWatch Log Groups Matching Pattern

How to Implement Offline Mode for Your Mobile App?

How to Implement Offline Mode for Your Mobile App

How to know when will my Spring Boot scheduled job will trigger next time

Getting Your Office Ready For COVID-19 With Visitor Management System

The Most Important Thing about a Software is not that it Works

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Arsalan umar

Arsalan umar

Flutter developer, Mechatronics Engineer, Cats lover

More from Medium

Getting waveform data with flutter and FFmpeg

How to create a custom plugin in Flutter ?

How to create a custom plugin in flutter

Understanding Null-Safety in Flutter with Real-world example

What makes Flutter different from other languages and frameworks?