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

not getting razorpay_signature this protocol not working RazorpayPaymentCompletionProtocolWithData #143

Closed virendrapatil0 closed 2 years ago

virendrapatil0 commented 2 years ago

Description

Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest Razorpay pod release to make sure your issue has not already been fixed.

Razorpay pod Version :

Open podfile for checking the razorpay-pod version if it's not mentioned their then open podfile.lock and copy the pod version here.

Xcode Version :

Open Xcode > Go to About Xcode > copy the Xcode version here.

What you did:

What happened:

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

1. 2.

Suggested solution:

Code example, screenshot, or link to a repository:

Please provide a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

virendrapatil0 commented 2 years ago

I am using pod 'razorpay-pod', '~> 1.1.12' Xcode 13.1, iOS deployment target - 12.0

  1. add the Protocol RazorpayPaymentCompletionProtocolWithData

extension PaymentDepositVC: RazorpayPaymentCompletionProtocolWithData {

func onPaymentError(_ code: Int32, description str: String, andData response: [AnyHashable : Any]?) {
    print("error: ", code)
    self.presentAlert(withTitle: "Alert", message: str)

}
func onPaymentSuccess(_ payment_id: String, andData response: [AnyHashable : Any]?) {
    print("success: ", payment_id)
    self.presentAlert(withTitle: "Success", message: "Payment Succeeded")

}

}

2 . Pass proper parameter payment form method and if payment success but not trigger in this Protocol method.

Simulator Screen Shot - iPhone 11 Pro Max - 2022-01-28 at 10 49 56

  1. i am not getting the razorpay_signature
virendrapatil0 commented 2 years ago

Hello Please let me know any changes

ramprasadAnand commented 2 years ago

Hi @virendrapatil0 can you please share the code to know how you are initialising the razorpay instance ?

ramprasadAnand commented 2 years ago

@virendrapatil0 if you want to get the callback to RazorpayPaymentCompletionProtocolWithData protocol methods you have to initialise our razorpay instance as given below.

razorpay = RazorpayCheckout.initWithKey("rzp_test_pNufDOOeGRM3hI", andDelegateWithData: self)

in your case you are delegating to RazorpayPaymentCompletionProtocol protocol, this is the reason you are not getting callback to RazorpayPaymentCompletionProtocolWithData methods.

virendrapatil0 commented 2 years ago

Issue Solve Thanks

ramprasadAnand commented 2 years ago

Closing the issue as it got resolved.