Giter Site home page Giter Site logo

paystack's People

Contributors

ewdave avatar ibrahimlawal avatar kehers avatar sauban avatar subomi avatar theslyone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paystack's Issues

v2.0.0 Features

Open discussion and contributions

Version 2.0.0 Features Proposal

  • Promisified api
  • One object passed containing args and post data
  • pipeling, like when downloading large csv files from paystack. Perfomance upgrade
//API Example Usage
paystack.customer.update({
	id: 900,
	data: {
		firstname: 'Subomi',
		lastname: 'Oluwalana',
		email: '[email protected]',
		phone: 2348077886076
	}
}).then(JSON.parse)
  .then(callback);	

Improve on the documentation

I don't seem to understand how i can verify a transaction initiated on the front end of my site using this api how to i pass the reference generated by paystack to paystack.transaction.verify

Transaction Verification Failed

I keep getting the response:

{ status: false, message: 'Transaction reference not found' }

whenever i try to use the transaction.verify method.

Please can you look into it.

Verify Transaction No Authorization Header was found

When i try to validate a transaction from sever side it doesn't work,
I have set my header correctly and noting seem to work all i keep getting is no authorization header found
and please the documentation needs a little more work
Thanks
image

Not able to create plan with amount less than 10000

Hello. I am just using this api for the first time and I can't seem to create any plan for amount below 10000. I do not know why.

My code is the same thing as the documentation only that the amount is different

paystack.plan.create({ name: 'API', amount: 1000, interval: 'weekly' })

This does not create the plan. How come am the first one to notice this issue all this while??

How to pass callback for successful payment

Hello. I am trying to pass a callback or handle some sort of function when there is a successful or failed payment. Here is my code:

paystack.transaction.initialize({ email: ${req.query.email}, amount: req.query.amount * 100, interval: ${req.query.interval}`,
currency: 'NGN',
plan: response.data.plan_code,
callback: function(response) {

                        var reference = response.reference;
                        console.log('Payment complete! Reference: ' + reference);
                       
                      },
                })
                .then(response => {
                    if (response.status) {
                        res.send({ success:true, url: response.data.authorization_url })   
                    }else{
                        res.send({ success:false, url: null })
                    }
                }).catch(err => {
                    console.log(err)
                    res.send({ success:false,url:null })
                })`

The callback isn't working unfortunately. I have no idea why. I need to navigate to another screen after a cancelled or successful payment.

charge_token has been discontinued

Executed charge_token method with params token and email and got this error.

Error => status=false, message=charge_token has been discontinued. Please use our SDKs' chargeCard function instead. Thank you for chosing Paystack!

There is not any method named "chargeCard" mentioned in the API documentation.

Is this still maintained?

I am seeing multiple PRs and Issues. I will be starting to use this library for a client.
@kehers, if you need any help in maintaining this, I'll be happy to maintain this for you.
If you are not interested in maintaining this anymore, or you don't have time enough. I'll fork this.

Let me know your thoughts. Feel free to reach out.
Twitter: @Rohithzr
Mail: [email protected]

Library Maintenance

The last commit to this library been months ago, there are no stable releases. I want to contribute to this module, But i want to know whats up first?

Logical reason

return new Paystack(key);

Am just curious, is this an attempt to create a singleton? I tried finding the purpose of returning an instance of probably already created object but could not justify it

The subaccount get method not working

What to get a subaccount using the subaccount code. This, paystack.subaccount.get({id_or_slug}) is the code I use and didn't work. I keep getting the error with this expression - type error, ```
if(!body){
...
}

from paystack/index.  What is the way to do this?

Library Maintenance

The last commit to this library been months ago, there are no stable releases. I want to contribute to this module, But i want to know whats up first?

Functions are asynchronous and cannot return a value

Hi, i've been using your api and i noticed the functions are asynchronous and cannot return a value. They can only be displayed in the console log. e.g

paystack.transaction.initialize({
reference: "123445566" ,
amount: 10000,
email: "[email protected]"
} , function(error,body){
if(!error){
console.log(body)
}else{
console.log(error)
}
})

the body cannot be returned so as to extract the redirect URL.

TypeScript support

TypeScript is unable to resolve the package from node_modules.

This is my code

import * as paystack from "paystack";

I get the following error

Could not find a declaration file for module 'paystack'. 'c:/Users/timolin/.../node_modules/paystack/index.js' implicitly has an 'any' type.

I can get around this by creating a paystack.d.ts inside my secondary @types directory, but I don't get auto-completion.

Please is there any plans to add TypeScript support?

How to pass callback_url manually

Hi, Thanks for the amazing lib.

How do I pass a callback_url manually? For example, a company that owns two financial products (a loan and a savings app), they use two different domain names. Passing the callback url in the paystack dashboard isn't really enough. Please help

Npm Library Outdated

Npm library has a version of 1.4.1 while the master branch on github has one of 2.0.1

Provide helper for handling Paystack events.

I think the library should provide an easy way for handling Paystack events. I'd propose something like an express middleware that allows the user to define handlers for the different events, the middleware should also verify the signature before calling the event handler.

Here's an example of what it could look like in practice:

const paystack = require('paystack')('secret_key');

const events = paystack.events();

// register handler for different events
events.setHandler('charge.success', (req, res) => {
    const event = req.body;
    // handle event
    res.send(200);
});

// register as express middleware
app.use('/my/webhook/url', events);

That's just a suggestion to illustrate the general idea, it doesn't have to be exactly as that. For instance the handler could just receive the event body and a callback or return a promise.

Verify Transaction

The reference code is not being recognized on the verify method

/*
Verify transaction
*/
verify: {
method: 'get',
endpoint: [root, '/verify/{reference}'].join(''),
args: ['reference']
},

Please check this method .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.