title: Why do I get this error using Razorpay with Flutter=> Uncaught TypeError:window.getDeviceDetails is not a function and BAD_REQUEST_ERROR?
body: <p>I get the following error while using razorpay-flutter plugin for my flutter app:</p>
  <pre><code>I/chromium(13226): [INFO:CONSOLE(1)] &quot;Uncaught TypeError: window.getDeviceDetails is not a function&quot;, source: https://api.razorpay.com/v1/checkout/public?version=1.5.16&amp;platform=android&amp;library=checkoutjs (1)
  I/flutter (13226): Payment Error : 1 {&quot;code&quot;:&quot;BAD_REQUEST_ERROR&quot;,&quot;description&quot;:&quot;The id provided does not exist&quot;,&quot;source&quot;:null,&quot;step&quot;:null,&quot;reason&quot;:null,&quot;metadata&quot;:{}}
  </code></pre>
  <p>Description
  Below is my complete Razorpay related code:</p>
  <p><em><strong>Please note that if I remove the order ID from the options map below then it works fine,</strong></em> i.e. if I remove</p>
  <pre><code>'order_id': 'order_EMBFqjDHEEn80l',
  </code></pre>
  <p>from the code given below then, it works fine.</p>
  <pre><code>
    FirebaseUser currentUser;
    DocumentSnapshot userDataFromFirebase;
  
  
    @override
    void initState(){
      super.initState();
  
      razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, successHandler);
      razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, failureHandler);
      razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, externalWalletHandler);
  
    }
  
    @override
    void dispose() {
      super.dispose();
  
      razorpay.clear();
    }
  
    void openCheckout(double totalPrice) async{
  
      // finding current user
      currentUser = await FirebaseAuth.instance.currentUser();
      await Firestore.instance.collection('users').getDocuments().then((value){
        for(DocumentSnapshot documentSnapshot in value.documents){
          if(documentSnapshot.documentID == currentUser.phoneNumber.toString().substring(3)){
            userDataFromFirebase = documentSnapshot;
            break;
          }
        }
      });
  
      var options = {
        'key': 'rzp_test_CphmkEBGNw9BME', // my razorpay API test key
        'amount': totalPrice*100,
        'currency': 'INR',
        'name': 'Company name',
        'description': 'Payment to company',
        //'razorpay_order_id': 'order_EMBFqjDHEEn80l', // I used this as well but it didn't work
        'order_id': 'order_EMBFqjDHEEn80l', // just a random order ID for checking purposes (REMOVING THIS THE CODE WORKS FINE)
        'prefill': {
          'contact': ('+91'+ (await userDataFromFirebase.data['phoneNumber']).toString()).toString(),
          'email': (await userDataFromFirebase.data['email']).toString()
        },
      };
  
      try{
        razorpay.open(options);
      }
      catch(e){
        print(e.toString());
      }
    }
  
    void successHandler(PaymentSuccessResponse response) {
      Toast.show(&quot;SUCCESS: &quot; + response.paymentId, context,duration: Toast.LENGTH_LONG, gravity: Toast.BOTTOM);
  
      razorpay.clear();
    }
  
    void failureHandler(PaymentFailureResponse response) {
      print('Payment Error : ${response.code.toString()} ${response.message.toString()}');
      Toast.show(&quot;ERROR: &quot; + response.code.toString() + &quot; - &quot; + response.message, context,duration: Toast.LENGTH_LONG, gravity: Toast.BOTTOM);
  
      razorpay.clear();
    }
  
    void externalWalletHandler(ExternalWalletResponse response) {
      print('External wallet ${response.walletName}');
  
      Toast.show(&quot;EXTERNAL_WALLET: &quot; + response.walletName, context,duration: Toast.LENGTH_LONG, gravity: Toast.BOTTOM);
  
      razorpay.clear();
    }
  
  </code></pre>
  <p>This is my complete response when I run the app:</p>
  <pre><code>
  Launching lib/main.dart on Lenovo K33a42 in debug mode...
  Running Gradle task 'assembleDebug'...
  Plugin project :firebase_auth_web not found. Please update settings.gradle.
  Plugin project :firebase_core_web not found. Please update settings.gradle.
  Plugin project :cloud_firestore_web not found. Please update settings.gradle.
  ✓ Built build/app/outputs/flutter-apk/app-debug.apk.
  Installing build/app/outputs/flutter-apk/app.apk...
  Waiting for Lenovo K33a42 to report its views...
  Debug service listening on ws://127.0.0.1:36739/ZEVgbycZ38c=/ws
  Syncing files to device Lenovo K33a42...
  I/BiChannelGoogleApi(13226): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzao@35edc86
  W/DynamiteModule(13226): Local module descriptor class for providerinstaller not found.
  I/DynamiteModule(13226): Considering local module providerinstaller:0 and remote module providerinstaller:0
  W/ProviderInstaller(13226): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
  V/NativeCrypto(13226): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 286 native methods...
  D/NetworkSecurityConfig(13226): No Network Security Config specified, using platform default
  I/ProviderInstaller(13226): Installed default security provider GmsCore_OpenSSL
  W/art     (13226): Before Android 4.1, method double java.util.concurrent.ThreadLocalRandom.internalNextDouble(double, double) would have incorrectly overridden the package-private method in java.util.Random
  W/art     (13226): Before Android 4.1, method int java.util.concurrent.ThreadLocalRandom.internalNextInt(int, int) would have incorrectly overridden the package-private method in java.util.Random
  W/art     (13226): Before Android 4.1, method long java.util.concurrent.ThreadLocalRandom.internalNextLong(long, long) would have incorrectly overridden the package-private method in java.util.Random
  I/BiChannelGoogleApi(13226): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzao@35edc86
  D/FirebaseAuth(13226): Notifying id token listeners about user ( Iw8VCX0JHXaQmdsUYh6amXg0OrA2 ).
  D/FirebaseAuth(13226): Notifying id token listeners about user ( Iw8VCX0JHXaQmdsUYh6amXg0OrA2 ).
  V/BoostFramework(13226): mAcquireFunc method = public int com.qualcomm.qti.Performance.perfLockAcquire(int,int[])
  V/BoostFramework(13226): mReleaseFunc method = public int com.qualcomm.qti.Performance.perfLockRelease()
  V/BoostFramework(13226): mAcquireTouchFunc method = public int com.qualcomm.qti.Performance.perfLockAcquireTouch(android.view.MotionEvent,android.util.DisplayMetrics,int,int[])
  V/BoostFramework(13226): mIOPStart method = public int com.qualcomm.qti.Performance.perfIOPrefetchStart(int,java.lang.String)
  V/BoostFramework(13226): mIOPStop method = public int com.qualcomm.qti.Performance.perfIOPrefetchStop()
  V/BoostFramework(13226): BoostFramework() : mPerf = com.qualcomm.qti.Performance@6e0b20
  I/flutter (13226): pressed add
  I/flutter (13226): pressed cart
  I/flutter (13226): clicked on Proceed to pay
  I/art     (13226): Do partial code cache collection, code=23KB, data=30KB
  I/art     (13226): After code cache collection, code=19KB, data=28KB
  I/art     (13226): Increasing code cache capacity to 128KB
  I/WebViewFactory(13226): Loading com.android.chrome version 84.0.4147.125 (code 414712570)
  I/cr_LibraryLoader(13226): Loaded native library version number &quot;84.0.4147.125&quot;
  I/cr_CachingUmaRecorder(13226): Flushed 5 samples from 5 histograms.
  W/ResourceType(13226): Failure getting entry for 0x7f130588 (t=18 e=1416) (error -2147483647)
  W/ResourceType(13226): Attempt to retrieve bag 0x7f0c0000 which is invalid or in a cycle.
  I/DpmTcmClient(13226): RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
  W/cr_media(13226): Requires BLUETOOTH permission
  E/libEGL  (13226): validate_display:99 error 3008 (EGL_BAD_DISPLAY)
  I/chromium(13226): [INFO:CONSOLE(1)] &quot;Uncaught TypeError: window.getDeviceDetails is not a function&quot;, source: https://api.razorpay.com/v1/checkout/public?version=1.5.16&amp;platform=android&amp;library=checkoutjs (1)
  I/flutter (13226): Payment Error : 1 {&quot;code&quot;:&quot;BAD_REQUEST_ERROR&quot;,&quot;description&quot;:&quot;The id provided does not exist&quot;,&quot;source&quot;:null,&quot;step&quot;:null,&quot;reason&quot;:null,&quot;metadata&quot;:{}}
  
  </code></pre>
  <p>Expected Results:</p>
  <p>I expect it to successfully complete the payment process and return the correct payment ID and Order ID.</p>
  <p>I have opened an issue on the Github page of <code>razorpay_flutter</code> as well please check it out and help me solve this issue.</p>
  <p><strong>Issue on Github page: <a href="https://github.com/razorpay/razorpay-flutter/issues/98" rel="nofollow noreferrer">https://github.com/razorpay/razorpay-flutter/issues/98</a></strong></p>