wilburx9 / flutter_paystack

:credit_card: A robust Flutter plugin for making payments via Paystack Payment Gateway. Completely supports Android and iOS
https://pub.dartlang.org/packages/flutter_paystack
Apache License 2.0
206 stars 358 forks source link

Add support for Flutter Web #65

Open DEVSOG12 opened 4 years ago

DEVSOG12 commented 4 years ago

This plugin is not supported for Flutter Web.

DEVSOG12 commented 4 years ago

Is there any Platform specific code that is used in the Plugin. I want to try to add Web Support.

PaulD1980 commented 3 years ago

Is there any Platform specific code that is used in the Plugin. I want to try to add Web Support.

Did you try to make it work with WEB?

DEVSOG12 commented 3 years ago

Is there any Platform specific code that is used in the Plugin. I want to try to add Web Support.

Did you try to make it work with WEB?

I tried but unfortunately, the plugin has a Platform Check (* To check if it's Android or iOS), but looking through the code, there wasn't any platform specific functions that cannot be implemented on Web.

I also thought of embedding paystack's javascript but I was really lazy! :(

I still don't see any reason why I can't work on web!

djade007 commented 3 years ago

I was able to get this to work on web but I had to create a new package for web, then wrap this plugin for mobile.

DEVSOG12 commented 3 years ago

I was able to get this to work on web but I had to create a new package for web, then wrap this plugin for mobile.

Nice Plugin Works fine to me!! @wilburt maybe this can be implemented under flutter_paystack Thanks

wilburx9 commented 3 years ago

Good work @djade007. Is it possible to integrate the changes here and create a PR?

DEVSOG12 commented 3 years ago

@wilburt I have created a PR https://github.com/wilburt/flutter_paystack/pull/94

wilburx9 commented 3 years ago

Thank you @DEVSOG12. I will take a look at the PR.

wilburx9 commented 3 years ago

@djade007 you can also take a look at the PR.

djade007 commented 3 years ago

The web version still only has the checkout option. I wanted to look if it will be possible to also add the Charge Card option on web. So as to make this package consistent.

wilburx9 commented 3 years ago

@djade007 That's a very valid point. I think the major functionality we need from iOS and Android is RSA encryption. And as at the time this package was released, the encrypt package wasn't as mature as it is now.

I will find time to take a look if we can use encrypt instead of Objective-C and Kotlin for encryption. If this works, then we can go full Dart and support web properly otherwise we'll make do of #94.

DEVSOG12 commented 3 years ago

@djade007 I'm not too sure if via the UI the a card can be processed due to the nature of the Paystack JS.https://paystack.com/docs/payments/accept-payments

@wilburt Maybe you could look into finding a way to use RSA encryption on Dart. That would be better.

I also think that the JS package handles the payment well. The Charge Card Option may not be the best in terms of security on Web

djade007 commented 3 years ago

If we can replicate the native encryption it should still be as secure as the Android/iOS SDK.

Pending the time, I'll recommend the web version of the plugin I worked on should still be kept separate. It only exposes the checkout method, so only users who are interested in the default payment popup can use it.

djade007 commented 3 years ago

This is the request data from the normal JS popup. You can see their JS library is also encrypting the card details before it is sent. Screenshot 2021-04-07 at 9 06 49 PM

Ola4606 commented 3 years ago

@wilburt Hope you are still working on support for web, we need it soon, the other plugin for web is still just a JS pop up which is so unreliable(not the plugin the whole Js pop up is unreliable), I prefer the checkout method. Thanks

Ola4606 commented 3 years ago

@djade007 @DEVSOG12 thanks for working with @wilburt to make the web support.

Ola4606 commented 3 years ago

Wooh no one replied @wilburt can you reply please, so we know this issuses is still being worked on as it is really needed

DEVSOG12 commented 3 years ago

@wilburt I'm trying work on the encryption natively on dart. I see that for android you use java. But.. the plugin extends a native channel for both android and iOS. So if we will be changing anything it would be best that we more everything to native dart. Because handling encryption in dart, and then some other things on the native channel may not be the best practice.

Or.. We could make encryption work on dart on for the purpose of flutter web.

DEVSOG12 commented 3 years ago

@wilburt, @djade007 Check out #104 I have written RSA encryption in dart.

KedwithGod commented 2 years ago

Any support for desktop yet?

Princewil commented 1 year ago

Hey guys I implement paystack on web. It also supports various payment methods.

check it out=> https://pub.dev/packages/flutter_paystack_plus