Skip to content

Commit f7c0fb3

Browse files
add PHP code snippets
1 parent 98db737 commit f7c0fb3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+794
-16
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const sh = `#!/bin/sh
2+
url="https://api.paystack.co/preauthorization"
3+
authorization="Authorization: Bearer YOUR_SECRET_KEY"
4+
5+
curl "$url" -H "$authorization" -X GET`
6+
7+
const js = `const https = require('https')
8+
9+
const options = {
10+
hostname: 'api.paystack.co',
11+
port: 443,
12+
path: '/preauthorization',
13+
method: 'GET',
14+
headers: {
15+
Authorization: 'Bearer SECRET_KEY'
16+
}
17+
}
18+
19+
const req = https.request(options, res => {
20+
let data = ''
21+
22+
res.on('data', (chunk) => {
23+
data += chunk
24+
});
25+
26+
res.on('end', () => {
27+
console.log(JSON.parse(data))
28+
})
29+
}).on('error', error => {
30+
console.error(error)
31+
})
32+
req.end()`
33+
34+
export {sh, js}

src/api/card-preauthorization/list/response.json renamed to dist/api/preauthorization/list/response.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"message": "Preauthorizations retrieved",
77
"data": [
88
{
9-
"domain": "live",
10-
"status": "ongoing",
9+
"domain": "test",
10+
"status": "success",
1111
"reference": "ctbaq5z6fkzsk2f",
1212
"amount": 1200,
1313
"created_at": "2023-08-21T06:30:31.000Z",

0 commit comments

Comments
 (0)