Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HyperpayPlugin/pay] MissingPluginException(No implementation found for method start_payment_transaction on channel hyperpay) #9

Closed
lambdatechdev opened this issue Feb 3, 2022 · 2 comments

Comments

@lambdatechdev
Copy link

lambdatechdev commented Feb 3, 2022

Hey,

I have followed the provided documentation step by step (https://pub.dev/packages/hyperpay)
but the plugin is throwing an error on pay() i.e
E[/DartMessenger]()(19361): at io.flutter.embedding.engine.dart.DartMessenger.lambda$handleMessageFromDart$0$DartMessenger(DartMessenger.java:206) E[/DartMessenger]()(19361): at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$6ZD1MYkhaLxyPjtoFDxe45u43DI.run(Unknown Source:12) E[/DartMessenger]()(19361): at android.os.Handler.handleCallback(Handler.java:883) E[/DartMessenger]()(19361): at android.os.Handler.dispatchMessage(Handler.java:100) E[/DartMessenger]()(19361): at android.os.Looper.loop(Looper.java:264) E[/DartMessenger]()(19361): at android.app.ActivityThread.main(ActivityThread.java:7684) E[/DartMessenger]()(19361): at java.lang.reflect.Method.invoke(Native Method) E[/DartMessenger]()(19361): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) E[/DartMessenger]()(19361): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980) [HyperpayPlugin[/pay]()] MissingPluginException(No implementation found for method start_payment_transaction on channel hyperpay)
Code to reproduce:

Init Function:

Future<void> initPaymentSession(
    BrandType brandType,
    double amount,
  ) async {
    CheckoutSettings _checkoutSettings =
        CheckoutSettings(brand: brandType, amount: amount, headers: {
      'Authorization': "Bearer " + accessToken,
    }, additionalParams: {
      'merchantTransactionId': '#123456',
      'invoice_id': "",
      'brand': "$brandType['id']",
    });

    hyperpay.initSession(checkoutSetting: _checkoutSettings);
    sessionCheckoutID = await hyperpay.getCheckoutID;
  }

The Payment Method

CardInfo card = CardInfo(
        holder: holderNameController.text,
        cardNumber: cardNumberController.text.replaceAll(' ', ''),
        cvv: cvvController.text,
        expiryMonth: expiryController.text.split('/')[0],
        expiryYear: '20' + expiryController.text.split('/')[1],
      );

      try {
        // Start transaction
        if (sessionCheckoutID.isEmpty) {
        await initPaymentSession(BrandType.visa, 1);
        }
        print("Asdad");
        final result = await hyperpay.pay(card);

Flutter Doctor Output:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.6 20G165 darwin-x64, locale en-PK)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.63.2)
[✓] Connected device (2 available)

• No issues found!

@pr-Mais
Copy link
Collaborator

pr-Mais commented Feb 3, 2022

What is the API version number are you testing on? is it an emulator?
Could you please try cleaning:

flutter clean

Also, have you opened the project in Android studio and allowed it to sync gradle?

@pr-Mais
Copy link
Collaborator

pr-Mais commented Apr 6, 2022

Without additional information we cannot provide help, if anyone else is going through this issue I will reopen.

@pr-Mais pr-Mais closed this as completed Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants