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

Error on clicking payment method (Flutter android) #1

Open
akashrajkn opened this issue Nov 10, 2019 · 5 comments
Open

Error on clicking payment method (Flutter android) #1

akashrajkn opened this issue Nov 10, 2019 · 5 comments

Comments

@akashrajkn
Copy link

Hi,

First of all, thank you for making the plugin :)

Mollie version: v0.8.1
Flutter: 1.9.1+hotfix.2

I am able to display the widget. However, when I click a payment method, I get the following error:

E/flutter (30468): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: NoSuchMethodError: The method '[]' was called on null.
E/flutter (30468): Receiver: null
E/flutter (30468): Tried calling: []("currency")
E/flutter (30468): #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
E/flutter (30468): #1      new MollieOrderResponse.build (package:mollie/src/mollieorder.dart:79:33)
E/flutter (30468): #2      OrderHandler.create (package:mollie/internal/orderhandler.dart:24:32)
E/flutter (30468): <asynchronous suspension>

How do I resolve this?

@Oni22
Copy link
Owner

Oni22 commented Nov 10, 2019

Hi akashrajkn thanks for your request :)
I couldn't recreate your issue. Can you explain your issue more in detail? So when I understand it correctly you are using the MollieCheckout widget right? And It looks like you are using the client method, so you are calling the api directly from your app? Please add your code to your answer.

@akashrajkn
Copy link
Author

@Oni22 Sorry for the late reply. Yes, I am using the client method. I am using the example code from the readme (this was just to make sure browser redirect works). But on clicking a payment type, I get the above error.

@Oni22
Copy link
Owner

Oni22 commented Nov 18, 2019

Please show me your code I need more details

@aronfds
Copy link

aronfds commented Jun 11, 2020

hi ....
can you be more informative how to add this to appdelagate.swift in flutter ..
my app is having a adaptive platform..
i want to integrate ideal payment feature...

override func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
if (url.host! == "payment-return") {

        let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
        controller.pushRoute("paymentDone");

        return true;
    }

    return false;
}

this code,

import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)

}

}

is already there in my appdelagate.swift file ..how to go about

@Gastrolize
Copy link

It is because your MollieProductRequest has Missing Fields or are incorrect. The Response is an error, but this Framework does not do any error handling so this Framework always thinks it getting a success Response.
Im facing this problem right now too.

Do a this:

`Future create(MollieOrderRequest order) async {
var res =
await http.post(_apiEndpoint, headers: _headers, body: order.toJson());

print(res.body); // <---- add this line to get all errors from Mollie
return MollieOrderResponse.build(json.decode(res.body));

}`

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

4 participants