payu-intrepos / Documentations

Documentation to integrate PayU SDKs
26 stars 10 forks source link

How to get data from PUCBWebVCDelegate protocol response? #32

Open anmolmalhotra opened 6 years ago

anmolmalhotra commented 6 years ago

The payUResponse comes as Any in PUCBWebVCDelegate protocol and when I try to change Any to [String: Any] it doesn't do that.

Here's the code:

func payUSuccessResponse(_ payUResponse: Any!, surlResponse: Any!) {

        if payUResponse != nil {
            print(payUResponse)
        }

        if let response = payUResponse as? [String: Any] {

            print(response)

            if let id = response["id"] as? Int {
                print("ID", id)

                createBooking(with: "\(id)", and: false)
            }
        }
    }

It is failing at if let response =. Can you tell me how I am going to fetch id from payUResponse?

karthikmandava7 commented 6 years ago

@anmolmalhotra Have you got the solution for this ? I'm also facing same issue...