-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
37 lines (29 loc) · 825 Bytes
/
Copy pathindex.js
File metadata and controls
37 lines (29 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const https = require('follow-redirects').https;
const fs = require('fs');
let options = {
'method': 'POST',
'hostname': 'api.paystack.co',
'path': '/dedicated_account',
'headers': {
'authorization': 'Bearer SEECRET_KEY',
'content-type': 'application/json',
'user-agent': 'Paystack-Developers-Hub'
},
'maxRedirects': 20
};
let req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
let postData = JSON.stringify({"customer":481193,"preferred_bank":"titan-paystack", "split_code": "SPL_e7jnRLtzla"});
req.write(postData);
req.end();