You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the `settle-sdk-node` NPM package to you project.
54
22
55
-
`npm i settle-sdk-node`
23
+
```bash
24
+
npm i settle-sdk-node
25
+
```
56
26
57
-
##Config
27
+
### Step 2 — Configure the SDK
58
28
59
29
In your projects **root folder**, create a file named `config.js` containing the following code:
60
30
@@ -76,15 +46,24 @@ module.exports = {
76
46
}
77
47
```
78
48
79
-
##Usage
49
+
### Step 3 — Initialize the Handler Function
80
50
81
-
```js
82
-
merchant.api_keys.list().then(success, failure)
51
+
```js title="Handler Example"
52
+
const { handler } =require('settle-sdk-node')
53
+
app.use(handler('sandbox'))
54
+
app.post( '/', ( req, res, next ) => {
55
+
console.log( 'Settle says:\n%s', req.body );
56
+
res.sendStatus( 200 );
57
+
});
83
58
```
84
59
85
-
##Client Example
60
+
### Step 4 — Using Client Functions
86
61
87
-
```js
62
+
```js title="Basic Client Function usage"
63
+
method.function().then(success, failure)
64
+
```
65
+
#####
66
+
```js title="List all API Keys Example"
88
67
constsettle=require('settle-sdk-node');
89
68
constmerchant=settle.merchant;
90
69
@@ -96,21 +75,23 @@ merchant.api_keys.list()
96
75
});
97
76
```
98
77
99
-
## Handler Example
78
+
> For a full overview of all available **Client Functions**, see our article on [how to use Client Functions in the Settle SDK for Node.js](./ZG9jOjM0ODQwMjA4-using-the-client-functions).
The **SDK** is **Open Source**, licensed under the **Apache 2** license. If you would like to **contribute** to the **SDK**, please feel free to **fork the repo and send us a pull request**. Or if you have a comment, question, or suggestion for improvements, please [raise an issue](https://github.com/SettleAPI/settle-sdk-node/issues).
0 commit comments