AlgyJr / MpesaSDK

Swift SDK for the M-Pesa Vodacom Mozambique REST API
MIT License
16 stars 1 forks source link

getting crash #7

Open debabrataroy718 opened 2 years ago

debabrataroy718 commented 2 years ago

Hi, I am getting crash on SecKeyCreateWithData method. key = SecKeyCreateWithData(keyData as CFData, keyDict as CFDictionary, &error)

Error Log: [seckey] SecKeyCreate init(RSAPublicKey) failed: -50

Please let me know if you any other information.

Thanks

AlgyJr commented 2 years ago

Hi @debabrataroy718 ,

I'm on my way home, I'll check it ASAP...

By the way thanks!

AlgyJr commented 2 years ago

@debabrataroy718 could you share a screenshot of your console when getting this error? Cuz I can't replicate the error you're getting to Understand what is happing exactly.

I look forward to hearing from you.

debabrataroy718 commented 2 years ago

Hi @AlgyJr , Thanks for the reply. I have attached screenshot please check. Screenshot 2022-04-13 at 11 11 07 AM

AlgyJr commented 2 years ago

Hoo alright, I have replicated that error yesterday, and I noticed that I'm forcing the unwrapping there without check if nil.

But if it is trying to return nil your API Key or Public Key is malformed.

Have you created your account and got your API Key and Public Key on M-Pesa for Developers Platform website ?

AlgyJr commented 2 years ago

Please try to check your API Key and Public Key.

I'll fix the force unwrap there on the next version that is coming soon.

Thanks for you attention and opening this issue.

AlgyJr commented 2 years ago

Hi @debabrataroy718 , any news?

waweruk commented 2 years ago

Hi @AlgyJr

I can see the SDK has been tagged for Mozambique. Is this not possible to use for Kenya with reference to this website - https://developer.safaricom.co.ke/

AlgyJr commented 2 years ago

Hi @waweruk ,

Unfortunately no, is not possible to be used for M-Pesa Safaricom Kenya.