Giter VIP home page Giter VIP logo

paymob_flutter_lib's People

Contributors

bilalilyas90 avatar nomi1357 avatar

Watchers

 avatar  avatar

paymob_flutter_lib's Issues

Plugin issues with launcher icon in flutter app

hi

i am facing the issue when i change my app launcher icon in flutter app then android default logo shows instead of flutter default logo or my logo that i provides. please help me i am worried about issue.

Best Regards
Ghulam Mustafa

I found issues in payment model on language parameter please fix this

Hi @bilalilyas90 ,

I'm facing this issue on release apk. This issue on payment model. please track issue and update the plugin.

Issue:

' PlatformException(error, Cannot deserialize value of type boolean from String "en": only "true" or "false" recognized I/flutter (32759): at [Source: (String)"{"payment_key":"{key}"[truncated 700 chars]; line: 1, column: 1125] (through reference chain: s9.c["language"]), null, null)'

here is the response that i have gotten from paymob developer support

The error message you're seeing indicates a problem with deserialization of a value in your Flutter app. It appears that the issue lies with deserializing a boolean value from a JSON string. The error message specifically mentions a problem with the "language" field in your JSON response.

Here's the relevant part of the error message for reference:

Cannot deserialize value of type boolean from String "en": only "true" or "false" recognized

To solve this issue, you need to ensure that the JSON response you're receiving from the server is correctly formatted. The "language" field is expected to be a boolean (true or false), but it seems to be a string with the value "en", which is causing the deserialization error.

Here are steps you can take to resolve this issue:

Check the API Response: Examine the API response you're receiving to make sure that the "language" field is sent as a boolean (true or false) and not as a string.

Update Server Response: If the server response is incorrect, you'll need to update the server-side code to send the correct boolean value for the "language" field. Double-check the server-side code that generates the JSON response and ensure that it sends the correct data type for the "language" field.

Update Flutter Code: If you have control over the server and have fixed the API response, make sure your Flutter code is correctly handling the response. Verify that your Dart model classes match the expected structure of the JSON response. If necessary, update your Dart model classes to match the corrected API response.

Handle Edge Cases: If there are specific cases where the "language" field might be missing or in an unexpected format, handle these cases in your Dart code. Use conditional statements to check the data type before attempting to deserialize it.

Debugging: If the issue persists, use print statements or debugging tools to inspect the API response and the point in your Dart code where the deserialization is happening. This can help you pinpoint the exact location of the issue.

Flutter Version: Ensure you are using the latest version of Flutter. Sometimes, issues related to serialization/deserialization are resolved in newer versions of packages or the Flutter framework itself.

By carefully checking the API response and making sure your Flutter code handles it correctly, you should be able to resolve this deserialization error.

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.