Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Type definition for webhook events #5

Open
waptik opened this issue Oct 30, 2022 · 5 comments
Open

[FEAT] Type definition for webhook events #5

waptik opened this issue Oct 30, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@waptik
Copy link

waptik commented Oct 30, 2022

Is your feature request related to a problem? Please describe.
As for right now, there doesn't to be any type definition for webhook events inside this library that will help validate the incoming webhook events.

Describe the solution you'd like
It'd be great to have a built-in type definition for webhook events in this library. This will save us time of having to manually write our own.

Describe alternatives you've considered
What i've been doing so far is to model the types of each events(charge.success as for now) based on received webhook response or often time cross check supported-events

Additional context
None

@waptik waptik added the enhancement New feature or request label Oct 30, 2022
@damilola-paystack
Copy link
Contributor

Interesting request @waptik. This isn't something we've considered adding to the library, however, do you mind sharing how you'd like this to work? Using the charge.success as an example, how would you want to parse an event in your webhook function if types are available?

@orimdominic
Copy link

@damilola-paystack I think @waptik means having types like what we have here in Stripe Events

@waptik
Copy link
Author

waptik commented Nov 1, 2022

@damilola-paystack I think @waptik means having types like what we have here in Stripe Events

Yup, this is exactly what I meant.
I saw it being used in a project and I thought it'd be great to have the same thing here as part of the library.

@damilola-paystack
Copy link
Contributor

Got it @orimdominic @waptik. I'll look into adding this in an upcoming version. You could also make this your first contribution if you are up for it 😀.

@gray-adeyi
Copy link

@gray-adeyi/paystack-sdk 0.2.4 release is now available with even better type support 🔥 https://www.npmjs.com/package/@gray-adeyi/paystack-sdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants