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

I am not getting "razorpay_order_id" and "razorpay_signature" in the onPaymentSuccess method. #105

Closed fend-dev closed 3 years ago

fend-dev commented 4 years ago

I am using Xcode 11.5 and using swift 5. I am using following code for the getting "razorpay_order_id" and "razorpay_signature".

`extension ViewController: RazorpayPaymentCompletionProtocolWithData {

func openRazorpayCheckout(){
    //Register RazorpayTestKey
    razorpay = RazorpayCheckout.initWithKey(kRazorpayLiveKey, andDelegateWithData: self)
    let options: [String:Any] = [
        "description": ServerConfig.shared.businessDescription!,
        "order_id": viewModel.model.orderID!,
        "image": ServerConfig.shared.businessImage!,
        "name": ServerConfig.shared.businessName!,
        "prefill": [
            "contact": LoggedInUser.shared.phoneNumber!,
            "email": LoggedInUser.shared.email!
        ]
    ]

    if let rzp = razorpay {
        rzp.open(options)
    } else {
        print("Unable to initialize")
    }
}

func onPaymentError(_ code: Int32, description str: String, andData response: [AnyHashable : Any]?) {
    _ = response!["razorpay_payment_id"]
    _ = response!["razorpay_order_id"]
    _ = response!["razorpay_signature"]
}

func onPaymentSuccess(_ payment_id: String, andData response: [AnyHashable : Any]?) {
    _ = response!["razorpay_payment_id"]
    _ = response!["razorpay_order_id"]
    _ = response!["razorpay_signature"]
}

}`

I am able to get "razorpay_payment_id" in the success method of Razorpay but i am not able to get other two key values. And I am also only able to access Razorpay payment page when i am try it without an order id in checkout page.

Please help me out if i am doing wrong something.

Prajwal625 commented 4 years ago

Hi Ankush, please provide the response for the requirement sent on the ticket "90956" so that we can have the use case checked.

fend-dev commented 4 years ago

Yes @Prajwal625 , I have already sent. Please check.

Dev-iOS-Appbirds commented 4 years ago

check 'order_id' or all parameter in option. i have faced same issue, and issue was in 'order_id'.

Nautiyalsachin commented 3 years ago

Hey @Prajwal625, can you share the options here, in the form of data, I would suggest you to send the hardcoded data first and try with that, if that works then you can switch to your view modal. Let me know if it works for you.

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