Giter VIP home page Giter VIP logo

Comments (3)

mohamedkhairy953 avatar mohamedkhairy953 commented on July 24, 2024

Please share with us which version you use and a snapshot from the integration code

from flutter-sdk-bridge.

ibrafayez avatar ibrafayez commented on July 24, 2024

@mohamedkhairy953 Sure

flutter_paytabs_bridge: ^2.0.3-beta

integration code: (billingDetails & configuration are the same as required in README)
Card Payment:

FlutterPaytabsBridge.startCardPayment(configuration, (event) {

      if (event["status"] == "success") {
        successPayment();
        return;
      } else if (event["status"] == "error") {
        // Handle error here.
        _Result = 'An Error Has Occurred, Please try again later';
      } else if (event["status"] == "event") {
        // Handle events here.
        _Result = 'unsuccessful';
      }

}

ApplePay:(configuration is the same as required in README)

FlutterPaytabsBridge.startApplePayPayment(configuration, (event) {
        if (event["status"] == "success") {
          successPayment();
          return;
        } else if (event["status"] == "error") {
          // Handle error here.
          _Result =  'An Error Has Occurred, Please try again later';
        } else if (event["status"] == "event") {
          // Handle events here.
          _Result = "Something went wrong";
        }
  }

successPayment():

  void successPayment() {
    dispose();
    Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => CreateImageScreen()), (Route<dynamic> route) => false);
  }

NOTE: I removed the setState because of the error

from flutter-sdk-bridge.

MuhamedAdly avatar MuhamedAdly commented on July 24, 2024

Hi @ibrafayez

If you are using StatefulWidget so you should use setState() to update your widget state, And regarding the issue, it is not related to ApplePay functionality, please try to print the event in your startApplePayPayment or try to run our sample app just to make sure the issue not related to PayTabs flutter plugin.

Waiting for your reply

Thanks

from flutter-sdk-bridge.

Related Issues (20)

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.