Skip to content

Commit b929534

Browse files
Chore: Update README and runtime
1 parent e69e374 commit b929534

4 files changed

Lines changed: 33 additions & 45 deletions

File tree

README.md

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
1-
## paystack
1+
## Paystack Node.js Library
22

3-
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
3+
A Node client library for consuming the Paystack API
44

5-
Environment
6-
* Node.js
7-
* Webpack
8-
* Browserify
5+
## Prerequisite
6+
Your need to [create a Paystack account](https://dashboard.paystack.com/#/signup), if you don't have one already, to get your test and
7+
live secret keys.
98

10-
Language level
11-
* ES5 - you must have a Promises/A+ library installed
12-
* ES6
13-
14-
Module system
15-
* CommonJS
16-
* ES6 module system
17-
18-
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))
19-
20-
### Building
21-
22-
To build and compile the typescript sources to javascript use:
9+
## Installation
2310
```
24-
npm install
25-
npm run build
11+
npm install @paystack/node --save
2612
```
2713

28-
### Consuming
29-
30-
navigate to the folder of your consuming project and run one of the following commands.
31-
14+
## Usage
15+
Import and initialize the library:
16+
```
17+
import Paystack from '@paystack/node'
18+
const paystack = new Paystack("sk_test_xxxxxx")
19+
```
3220

21+
Initiate a request and parse response:
3322
```
34-
npm install paystack --save
23+
paystack.customer.fetch({code: "CUS_o9rf5kuwei3lt4vl"})
24+
.then(customer => console.log(customer))
25+
.catch(error => console.log(error))
3526
```
27+
28+
## Issues
29+
Kindly [open an issue](https://github.com/PaystackOSS/paystack-node/issues) if you discover any bug or have problems using this library.
30+
31+
## License
32+
This repository is made available under the MIT license. Kindly read the [LICENSE](https://github.com/PaystackOSS/paystack-node/blob/main/LICENSE) file for more information.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
{
2-
"name": "paystack",
3-
"version": "1.0.0-beta.1",
2+
"name": "@paystack/node",
3+
"version": "1.0.0-beta.2",
44
"description": "Paystack API wrapper for Node",
55
"author": "Paystack <integrations@paystack.com> (https://paystack.com/docs)",
66
"keywords": [
77
"paystack",
88
"payment",
99
"cards",
10-
"charge",
10+
"charge",
1111
"recurring payment",
1212
"subscriptions",
1313
"transfers",
1414
"single transfers",
15-
"bulk transfers",
16-
"send money",
15+
"bulk transfers",
16+
"send money",
1717
"multi splits"
1818
],
19-
"homepage": "https://github.com/PaystackOSS/paystack-node",
20-
"bugs": {
21-
"url": "https://github.com/PaystackOSS/paystack-node/issues"
22-
},
19+
"homepage": "https://github.com/owner/project",
20+
"bugs": "https://github.com/owner/project/issues",
2321
"license": "MIT",
2422
"main": "./lib/index.js",
2523
"typings": "./lib/index.d.ts",
@@ -30,12 +28,5 @@
3028
"devDependencies": {
3129
"@types/node": "^15.0.3",
3230
"typescript": "^3.6"
33-
},
34-
"directories": {
35-
"lib": "lib"
36-
},
37-
"repository": {
38-
"type": "git",
39-
"url": "git+https://github.com/PaystackOSS/paystack-node.git"
4031
}
4132
}

src/runtime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class BaseAPI {
5555
path: tempPath,
5656
headers: {
5757
"authorization": `Bearer ${this.apiKey}`,
58-
"paystack-version": `paystack - 0.5.1`
58+
"paystack-version": `@paystack/node - 1.0.0-beta.2`
5959
}
6060
}
6161

0 commit comments

Comments
 (0)