kehers / paystack

Nodejs API wrapper for Paystack
147 stars 76 forks source link

Requesting autorization code when charging with card #29

Open Oluwatemilorun opened 6 years ago

Oluwatemilorun commented 6 years ago

Hi I get this error when i try to charge with card Required Parameters Ommited - authorization_code

But according to paystack doc for charge, its not a required param when charging with card - https://developers.paystack.co/reference#charge

screen shot 2018-08-20 at 15 09 38

I'm i doing this wrong? Please help out.

Oluwatemilorun commented 6 years ago

Just went through your code and disabled the default params check so i can proceed and i got another error { status: false, message: 'Invalid transaction reference' }

I discovered that the method Paystack.transaction.charge() has an endpoint of https://api.paystack.co/transaction/charge_authorization which is different from that on paystack docs https://api.paystack.co/charge

subomi commented 6 years ago

@Oluwatemilorun Thanks for this issue! Please can you send in a PR to this effect?

Oluwatemilorun commented 6 years ago

30

@Subomi just did... check it out.

subomi commented 6 years ago

@Oluwatemilorun There seems to be so much incompatibility with current code. Can you take some time to read current code so you can follow whats already avaliable. So we can test and merge this .

Oluwatemilorun commented 6 years ago

@Subomi i just wrote a different module and attached it to the core paystack. Same implementation with all other resource. But can you please point out where the compatibility failed?

gray-adeyi commented 5 days ago

Hi! try out this package. It's not yet a major release but it supports typescript and other JavaScript runtime like bun and Deno https://www.npmjs.com/package/@gray-adeyi/paystack-sdk