razorpay / razorpay-flutter

Razorpay Flutter Plugin
MIT License
107 stars 147 forks source link

IOS simulator, checkout is not working. #333

Open Rushikesh005 opened 1 year ago

Rushikesh005 commented 1 year ago

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

I'm have been trying to build and run payment gateway example on Mac book Air M2 with the latest razorpay plug in 1.3.5. I have a test api key. I have also created order ID as per payment flow. I have updated options map before calling open(options) accordingly. App gets built and run on IOS simulator (14 pro max). But whenever i press on Pay with Razorpay (nothing is happening). I'm not able to collect any traces with verbose logging as well.

Flutter Version :

Flutter 3.10.4

Xcode Version :

Version 14.3 (14E222b)

Cocoapod Version :

COCOAPODS: 1.12.1

Steps To Reproduce

@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(widget.title), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ const Text( 'Pay with Razorpay', ), ElevatedButton( onPressed: () { print("here"); Razorpay razorpay = Razorpay(); var options = { 'key': 'rzp_test_JBTEftEORusTiZ', 'amount': 100, //in the smallest currency sub-unit. 'name': 'Acme Corp.', 'order_id': 'order_M2B8TQAdSdFL4B', // Generate order_id using Orders API 'description': 'Fine T-Shirt', 'timeout': 60, // in seconds 'prefill': { 'contact': '9123456789', 'email': 'gaurav.kumar@example.com' } }; razorpay.on( Razorpay.EVENT_PAYMENT_ERROR, handlePaymentErrorResponse); razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, handlePaymentSuccessResponse); razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, handleExternalWalletSelected); try { razorpay.open(options); } catch (e) { print(e.toString()); } }, child: const Text("Pay with Razorpay")), ], ), ), floatingActionButton: FloatingActionButton( onPressed: _incrementCounter, tooltip: 'Increment', child: const Icon(Icons.add), ), // This trailing comma makes auto-formatting nicer for build methods. ); }

Expected Results

Open should lead me to checkout page.

Simulator Screenshot - iPhone 14 Pro Max - 2023-06-15 at 17 00 08

Rushikesh005 commented 1 year ago

It seems like issue with the M2 Processor. I can see it works fine on the intel based Mac. Is there a any architecture specific issue?

OutdatedGuy commented 1 year ago

Yo @Rushikesh005, Did you make the required changes for Apple silicon Macs?