Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on successful payment - webview "The operation couldn’t be completed NSURLErrorDomain error -999" #187

Open
Sumitarvikar opened this issue Apr 18, 2023 · 0 comments

Comments

@Sumitarvikar
Copy link

Xcode: Version 13.2.1 (12D4e)
Razorpay SDK: Razorpay pod version - '1.3.1'
Swift: 5.4

************************************issue *********************************************

issue - most of time working fine on successful payment but randomly getting error on successful payment - webview error The operation couldn’t be completed NSURLErrorDomain error -999

***************************************code to open razorpay ***************************

private func showPaymentForm(amount : Double , orderId : String){

    let accountEmail = UserDefaultsManager.getParentUserData()?.email
    let accountPhone =  UserDefaultsManager.getParentUserData()?.mobile
    let options: [AnyHashable:Any] = [
        "prefill": [
            "contact": accountPhone,
            "email": accountEmail
        ],
        "image": "",
        "amount" : amount,
        "name": "Docterz",
        "order_id" : orderId ,
        "theme": [
            "color": UIColor.blue.toHexString()
        ]
        // follow link for more options - https://razorpay.com/docs/payment-gateway/web-integration/standard/checkout-form/
    ]
    razorpay = RazorpayCheckout.initWithKey(APIConstant.KURL.KRazorpayURL, andDelegate: self)
    if let rzp = razorpay {
        rzp.open(options, displayController: (delegate?.viewController ?? delegate?.viewController.navigationController)!)
    }
    else{
        print("Unable to initialize")
    }
}

}

**************************success and failure method **************************************************

extension BillingViewModel : RazorpayPaymentCompletionProtocol {
func onPaymentError(_ code: Int32, description str: String) {
    if code != 2 {
       //Showing alert

//Getting Errow here : "The operation couldn’t be completed NSURLErrorDomain error -999"
// code parameter received - 0
Helper.shared.showAlert("FAILURE \n (str)", vc: delegate!.viewController)
}
}

func onPaymentSuccess(_ payment_id: String) {
  // navigating to successful screen
    self.transpherOrderToPatner(patnerId: patnerId ?? 0, ClinicId: clinicId ?? 0 , paymentId:payment_id)
}

}

****************************** note ***************************
please help as soon as possible we stuck on production release .

66123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant