ojengwa / paystack

A Paystack API wrapper in Python.
https://pythonhosted.org/paystack
BSD 3-Clause "New" or "Revised" License
17 stars 6 forks source link

KEY ERROR #4

Open Olamidun opened 4 years ago

Olamidun commented 4 years ago

keyerror

Hi, thanks for the API wrapper, it is super easy to use. I tried using it for an ecommerce website I am building with django, I integrated it and when I started the server although the pop up to enter card details was displayed, I also received a KeyError saying something about authorization code, can I be told what caused this and the possible solution(s)?. There is an image of the error attached to this issues. Thanks.

ghost commented 3 years ago

I'm also having this exact same problem

GeemlaTech2016 commented 3 years ago

Hi, did anyone figure out how to get past this error?

Olamidun commented 3 years ago

Hi, did anyone figure out how to get past this error?

I didn't.... Had to figure out a way to use the API without a wrapper

simonushie commented 2 years ago

late but someone might find it useful...

Authorization will be automatically generated after the card has been familiarized with paystack

Try authorizing the card with client.authorize() then recurrent charges on that card should be accompanied with the auth_code in the client.verify() call

hence, you will sucessfully pass the keyError exception, you can also pass the auth_code to the client.charge() method if need be

keyerror

Hi, thanks for the API wrapper, it is super easy to use. I tried using it for an ecommerce website I am building with django, I integrated it and when I started the server although the pop up to enter card details was displayed, I also received a KeyError saying something about authorization code, can I be told what caused this and the possible solution(s)?. There is an image of the error attached to this issues. Thanks.

Blaise-93 commented 1 year ago

Hi there @simonushie , thanks for the info, but where you able to pass this error after deployment, cos on my end it is not working

LekiaAnonim commented 1 year ago

To bypass the error, I took only the modules in the paystack folder and commented out the code

self.authorization_code = self._result['data']['authorization']['authorization_code'] in the resoure.py file. You can find this line of code in the TransactionResource class, verify method. Also, commented out the client.charge() in the given example.

Blaise-93 commented 1 year ago

I had sorted this out long time ago sir. Thanks for your help btw. I'd appreciate

On Sat, May 6, 2023, 5:25 PM Lekia Prosper @.***> wrote:

To bypass the error, I took only the modules in the paystack folder and commented out the code self.authorization_code = self._result['data']['authorization']['authorization_code'] in the resoure.py file. You can find this line of code in the TransactionResource class, verify method. Also, commented out the client.charge() in the given example.

— Reply to this email directly, view it on GitHub https://github.com/ojengwa/paystack/issues/4#issuecomment-1537175855, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN5K7K2HSWL2G33PHLVLIVLXEZ3O5ANCNFSM4O6MBCLA . You are receiving this because you commented.Message ID: @.***>