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
type 'String' is not a subtype of type 'Map<dynamic, dynamic>?' in type cast #289
Comments
It's because you are probably testing this in your emulator. This plugin only works in real devices. |
Greeting msai0109 Problem: Solution:
WHY ? |
here, i am trying to create subscription. |
I am still facing this issue, |
Greeting HarshitSingh1509 Problem: Solution:
|
Ok, so just take the orderID, paymentId, and signature, then verify it in the RazorpayPay Payment SDK in onSuccessResponse, and then send the credentials returned by the razorpay SDK to backend, and then work accordingly |
@HarshitSingh1509 were you able to get any workaround for this problem? |
@HarshitSingh1509 Please provide more of your code, to get over the problem. |
@Akshiiitsaxena I have downgraded the version of razorpay and everything went well!! |
@HarshitSingh1509 Yes the version can also solve the problem, but the point to note is that in the above code, orderId is not used in the Razorpay SDK, if this is continued then we won't get orderID, paymentId, and signature, and then we cant verify whether the order is valid or not, so the point is orderId should be present. |
Description
Facing issue when I am trying to launch the razorpay checkout activity using "razorpay.open(options)".its showing razorpay loading screen and closing razorpay screen immediately.
Flutter Version :
Flutter 3.0.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ee4e09cce0 (7 months ago) • 2022-05-09 16:45:18 -0700
Engine • revision d1b9a6938a
Tools • Dart 2.17.0 • DevTools 2.12.2
Xcode Version :
14.1 (14B47b)
LOG:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'String' is not a subtype of type 'Map<dynamic, dynamic>?' in type cast
#0 PaymentFailureResponse.fromMap (package:razorpay_flutter/razorpay_flutter.dart:150:44)
#1 Razorpay._handleResult (package:razorpay_flutter/razorpay_flutter.dart:72:42)
#2 Razorpay.open (package:razorpay_flutter/razorpay_flutter.dart:54:5)
E/ActivityThread( 2973): Activity com.razorpay.CheckoutActivity has leaked IntentReceiver com.razorpay.E$_q$@3d138fb that was originally registered here. Are you missing a call to unregisterReceiver()?
E/ActivityThread( 2973): android.app.IntentReceiverLeaked: Activity com.razorpay.CheckoutActivity has leaked IntentReceiver com.razorpay.E$_q$@3d138fb that was originally registered here. Are you missing a call to unregisterReceiver()?
at android.app.LoadedApk$ReceiverDispatcher.(LoadedApk.java:1717)
at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:1494)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1757)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1723)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:736)
at com.razorpay.O$_M$.onFinish(CheckoutPresenterImpl.java:889)
at android.os.CountDownTimer$1.handleMessage(CountDownTimer.java:142)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7839)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Options :
var options = {
'key': 'xxxxxxxxxxxx',
'amount': 9900,
'name': 'RazorPay Flutter',
'prefill': {'contact': '1234567890', 'email': 'test@example.com'},
'retry': {'enabled': true, 'max_count': 1},
'send_sms_hash': true,
'subscription_id': 'sub_id',
'external': {
'wallets': ['paytm']
}
};
The text was updated successfully, but these errors were encountered: