razorpay / razorpay-pod

:iphone: CocoaPod implementation of Razorpay's Payment SDK. Refer for instructions:
https://docs.razorpay.com/v1/page/ios-integration
MIT License
21 stars 18 forks source link

Crash when razorpay.open second time. #78

Closed O-mkar closed 3 years ago

O-mkar commented 4 years ago

the second time when I run function razorpay.open it crashes.

 func showPaymentForm(){
        let options: [String:Any] = [
                    "amount": "100", //This is in currency subunits. 100 = 100 paise= INR 1.
                    "currency": "INR",//We support more that 92 international currencies.
                    "description": "purchase description",
                    "order_id": "order_DMnnq4okfdOVVF",
                    "image": "https://url-to-image.png",
                    "name": "Test",
                    "prefill": [
                        "contact": "9797979797",
                        "email": "foo@bar.com"
                    ],
                    "theme": [
                        "color": "#F37254"
                    ]
                ]

        razorpay.open(options, display: self.navigationController ?? UINavigationController())
    }

IDE Specs

XCode 11.0 razorpay-pod 1.1.2

Retro Steps

1) On button, click open the payment page with razorpay.open. 2) Click the close button which will cancel the payment. 3) Now try again opening the payment page with a button click, it should crash.

Screenshots

Screenshot 2019-09-28 at 9 12 15 AM

mohsinalimat commented 4 years ago

Remove order_id from main dict and put below code.

let options: [String:Any] = [ "amount": "100", //This is in currency subunits. 100 = 100 paise= INR 1. "currency": "INR",//We support more that 92 international currencies. "description": "purchase description", "image": "https://url-to-image.png", "name": "Test", "prefill": [ "contact": "9797979797", "email": "foo@bar.com" ], "notes": [ "order_id": "order_DMnnq4okfdOVVF", ], "theme": [ "color": "#F37254" ] ]

O-mkar commented 4 years ago

Remove order_id from main dict and put below code.

Still Crashes, Its always the second time, it works fine on simulator it only crashed on device

mohsinalimat commented 4 years ago

In my app doesn't crash Please send me video

Nautiyalsachin commented 3 years ago

Looks like you guys have sorted this out, Thanks @mohsinalimat, for the help here.

closing this issue now, feel free to either re-open the issue or create a new issue if you have any additional queries.