I was using razorpay payment plugin for my checkout. After adding its integeration in info.plist file I am unable to open my app. It is showing me an error. I am sure that the error is there after adding plugin but dont know how to resolve it. Please Help
Tried with flutter clean but same issue again.
Error output from CocoaPods:
↳
Searching for inspections failed: undefined method `map' for nil:NilClass
Error running pod install
Error launching application on iPhone 13 Pro.
Code Added
Razorpay razorpay = Razorpay();
@override
void initState() {
razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess);
razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _handlePaymentError);
razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, _handleExternalWallet);
super.initState();
}
void _handlePaymentSuccess(PaymentSuccessResponse response) {
// Do something when payment succeeds
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
OrderResultScreen(result: 'Order Sucessfull')));
}
void _handlePaymentError(PaymentFailureResponse response) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
OrderResultScreen(result: 'Payment Failed. Please try again')));
// Do something when payment fails
}
void _handleExternalWallet(ExternalWalletResponse response) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => OrderResultScreen(result: 'Order....')));
// Do something when an external wallet is selected
}
@override
void dispose() {
razorpay.clear();
// TODO: implement dispose
super.dispose();
}
Map orderDetails = {
"id": "rzp_test_86Qc8y8X0jtLa0",
"entity": "order",
"amount": 50000,
"amount_paid": 0,
"amount_due": 50000,
"currency": "INR",
"receipt": "rcptid_11",
"status": "created",
"attempts": 0,
"notes": [],
"created_at": 1566986570
};
CodePudding user response:
This usually happens when you add some new integration to the plist file. Here is an easy way to resolve it. Let me know if this works for you.
Step 1- sudo arch -x86_64 gem install ffi
Step 2- arch -x86_64 pod install