Skip to content

Commit b9b82e3

Browse files
Merge pull request #96 from PaystackOSS/feat/preauth
update preauth API
2 parents 2873457 + 832dea6 commit b9b82e3

File tree

8 files changed

+32
-8
lines changed

8 files changed

+32
-8
lines changed

dist/api/preauthorization/list/response.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,17 @@
4545
"status": false,
4646
"message": "An error occurred"
4747
}
48+
},
49+
"404": {
50+
"description": "404 Not Found",
51+
"data": {
52+
"status": false,
53+
"message": "No preauthorized transaction exists for the reference provided",
54+
"meta": {
55+
"nextStep": "Try again later"
56+
},
57+
"type": "api_error",
58+
"code": "unknown"
59+
}
4860
}
4961
}

dist/api/preauthorization/verify/requests.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const sh = `#!/bin/sh
2-
url="https://api.paystack.co/preauthorization/verify/:reference"
2+
url="https://api.paystack.co/preauthorization/:reference"
33
authorization="Authorization: Bearer YOUR_SECRET_KEY"
44
55
curl "$url" -H "$authorization" -X GET`
@@ -9,7 +9,7 @@ const js = `const https = require('https')
99
const options = {
1010
hostname: 'api.paystack.co',
1111
port: 443,
12-
path: '/preauthorization/verify/:reference',
12+
path: '/preauthorization/:reference',
1313
method: 'GET',
1414
headers: {
1515
Authorization: 'Bearer SECRET_KEY'
@@ -35,7 +35,7 @@ const php = `<?php
3535
$curl = curl_init();
3636
3737
curl_setopt_array($curl, array(
38-
CURLOPT_URL => "https://api.paystack.co/preauthorization/verify/:reference",
38+
CURLOPT_URL => "https://api.paystack.co/preauthorization/:reference",
3939
CURLOPT_RETURNTRANSFER => true,
4040
CURLOPT_ENCODING => "",
4141
CURLOPT_MAXREDIRS => 10,

dist/api/preauthorization/verify/response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"amount": 1600,
1313
"created_at": "2023-08-24T19:00:18.000Z",
1414
"released_at": null,
15-
"scheduled_release_date": "2023-08-25T19:00:26.000Z",
15+
"expiry_date": "2023-08-25T19:00:26.000Z",
1616
"currency": "ZAR",
1717
"metadata": null,
1818
"fees": 100,

src/api/preauthorization/list/response.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,17 @@
4545
"status": false,
4646
"message": "An error occurred"
4747
}
48+
},
49+
"404": {
50+
"description": "404 Not Found",
51+
"data": {
52+
"status": false,
53+
"message": "No preauthorized transaction exists for the reference provided",
54+
"meta": {
55+
"nextStep": "Try again later"
56+
},
57+
"type": "api_error",
58+
"code": "unknown"
59+
}
4860
}
4961
}

src/api/preauthorization/verify/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const https = require('https')
33
const options = {
44
hostname: 'api.paystack.co',
55
port: 443,
6-
path: '/preauthorization/verify/:reference',
6+
path: '/preauthorization/:reference',
77
method: 'GET',
88
headers: {
99
Authorization: 'Bearer SECRET_KEY'

src/api/preauthorization/verify/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
$curl = curl_init();
33

44
curl_setopt_array($curl, array(
5-
CURLOPT_URL => "https://api.paystack.co/preauthorization/verify/:reference",
5+
CURLOPT_URL => "https://api.paystack.co/preauthorization/:reference",
66
CURLOPT_RETURNTRANSFER => true,
77
CURLOPT_ENCODING => "",
88
CURLOPT_MAXREDIRS => 10,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
url="https://api.paystack.co/preauthorization/verify/:reference"
2+
url="https://api.paystack.co/preauthorization/:reference"
33
authorization="Authorization: Bearer YOUR_SECRET_KEY"
44

55
curl "$url" -H "$authorization" -X GET

src/api/preauthorization/verify/response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"amount": 1600,
1313
"created_at": "2023-08-24T19:00:18.000Z",
1414
"released_at": null,
15-
"scheduled_release_date": "2023-08-25T19:00:26.000Z",
15+
"expiry_date": "2023-08-25T19:00:26.000Z",
1616
"currency": "ZAR",
1717
"metadata": null,
1818
"fees": 100,

0 commit comments

Comments
 (0)