iamraphson / vue-paystack

Paystack Vue Plugin for Vue 2.X

Home Page:https://www.npmjs.com/package/vue-paystack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeScript Support

quenginedev opened this issue Β· comments

Hello guys, I really love the work you guys have done with the Vue Paystack component and I say thank you for making it very easy to accept payment through the front end of an application securely πŸ™‚. I wanted to know if the component will support typescript cause I when I import the plugin inside my app, I keep on getting cannot find the declaration file.

commented

I fixed this issue by creating paystack.d.ts file in the src folder and adding the line declare module vue-paystack inside

hello guys, i notice something, we did not make use of secret key, and is this implementation going to work when using node and vue js

commented

@ajibadeabd i don't use node often, but i would imagine you'd want to make a request from your server with your secret key.
Something like:
Sorry i don't know the Nodejs equivalent

fetch('https://api.paystack.co/transaction/initialize', {
  body: JSON.stringify({
    amount: <amount>,
    email: <email>
  }),
  method: 'POST",
  headers: new Headers({
    'Authorization': `Bearer ${<SECRET_KEY>}`,
    'Content-Type': 'application/json'
  })
})