Giter Site home page Giter Site logo

checkout-sdk-flutter's Issues

onPaymentResult callback not firing in both android/ios

Describe the bug
onPaymentResult is a callback that is supposed to be triggered when any payment is made. But my payment is done and the user is redirected to the target URL but can't see any onPaymentResult callback

To Reproduce
Steps to reproduce the behavior:
just use the example from the package repo you get no callbacks

Expected behavior
When the payment is triggered, it should get a callback

Device Information (please complete the following information):

  • Device: [iPhone 15 pro max - physical device] [redmi 10 prime] (should not matter)
  • OS: [iOS 17.4.1] [Android 13 - miui 14.0.7]
  • Browser [webview - ig]
  • Version [latest]

The SDK don't feels like Mobile. Also due to less practical documentation, hard to figure it out.

Describe the bug
I am using this SDK to migrate from the old deprecated khalti_flutter. But this SDK is using web view for payment. Being a passionate mobile developer, I think showing a web view on mobile doesn't feel so good to the user. I understand that in things like payment, security is a major concern over user experience, but still, there could be a path where we might consider both. In the end, mobile is all about giving users some functionality with the best user experience.

Also since this is a new way, there are no mentors to guide us about how to implement this SDK. So making some medium posts, or even better some YouTube videos could be very helpful. This might sound like a small concern, but no matter how good a system is, if there is no proper visual examples how can someone use it? On the Khalti website, there is documentation but I don't think it's enough, I couldn't understand it, maybe not other users could, plus they have no one to guide, them since its something new.

My bug report might not feel like a bug report, but its a feedback to the package to use Mobile UI and make some proper documentation.

You can ignore this paragraph but, the flutter version required to support this SDK is too high, due to which I have to download the GitHub repo reduce the version, and make it run. I will update my flutter version later ;-)

**Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.16.9, on Microsoft Windows [Version 10.0.22631.3296], locale en-IN)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
X cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[!] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.4)
X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components:
MSVC v142 - VS 2019 C++ x64/x86 build tools
- If there are multiple build tool versions available, install the latest
C++ CMake tools for Windows
Windows 10 SDK
[√] Android Studio (version 2022.2)
[√] VS Code (version 1.86.1)
[√] Connected device (4 available)
[√] Network resources

! Doctor found issues in 2 categories.

Facing same issues regarding not triggered onPaymentResult call back function .

          Facing same issues regarding not triggered onPaymentResult call back function .
  khalti = await Khalti.init(
      enableDebugging: true,
      payConfig: payConfig,
      onPaymentResult: (paymentResult, khalti) {
        log('Payment Result: $paymentResult');
        log(paymentResult.toString());
        setState(() {
          this.paymentResult = paymentResult;
        });
        khalti.close(context);
      },
      onMessage: (
        khalti, {
        description,
        statusCode,
        event,
        needsPaymentConfirmation,
      }) async {
        log(
          'Description: $description, Status Code: $statusCode, Event: $event, NeedsPaymentConfirmation: $needsPaymentConfirmation',
        );
        khalti.close(context);
      },
      onReturn: () => log('Successfully redirected to return_url.'),
    );
    khalti != null ? khalti?.open(context) : "";

Flutter doctor

[√] Flutter (Channel stable, 3.19.3, on Microsoft Windows [Version 10.0.22631.3447], locale en-GB)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2023.1)
[√] VS Code (version 1.88.1)
[√] Connected device (4 available)
[√] Network resources

! Doctor found issues in 1 category.

And also, when any user wants to return from the Pay With Khalti View without proceeding with payment, how can I identify it? Is there anything I'm missing in the docs?

Originally posted by @Hritik602 in #3 (comment)

SDK Version Dependency problem

image

our application is in older version of flutter. Its hard for us to upgrade instantly as there are lots of dependency in the project. So what could we do please help.
Thank you!

Version not compatible with the latest firebase dependencies

Because firebase_crashlytics >=3.5.3 depends on firebase_core ^2.30.1 which depends on firebase_core_web ^2.16.0, firebase_crashlytics >=3.5.3 requires firebase_core_web ^2.16.0.
And because firebase_core_web >=2.12.0 depends on web ^0.5.1, firebase_crashlytics >=3.5.3 requires web ^0.5.1.
Because package_info_plus 5.0.1 depends on web >=0.3.0 <0.5.0 and no versions of package_info_plus match >5.0.1 <6.0.0, package_info_plus ^5.0.1 requires web >=0.3.0 <0.5.0.
Thus, firebase_crashlytics >=3.5.3 is incompatible with package_info_plus ^5.0.1.
And because khalti_checkout_core 1.0.0-dev.3 depends on package_info_plus ^5.0.1 and no versions of khalti_checkout_core match >1.0.0-dev.3 <2.0.0, firebase_crashlytics >=3.5.3 is incompatible with khalti_checkout_core ^1.0.0-dev.3.
And because khalti_checkout_flutter 1.0.0-dev.4 depends on khalti_checkout_core ^1.0.0-dev.3 and no versions of khalti_checkout_flutter match >1.0.0-dev.4 <2.0.0, firebase_crashlytics >=3.5.3 is incompatible with khalti_checkout_flutter ^1.0.0-dev.4.
So, because bhumi_earth_app depends on both khalti_checkout_flutter ^1.0.0-dev.4 and firebase_crashlytics ^3.5.4, version solving failed.

You can try the following suggestion to make the pubspec resolve:

  • Consider downgrading your constraint on firebase_crashlytics: flutter pub add firebase_crashlytics:^3.4.18

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.