From 832dea6bb5f5e74c9e520f159edd74f8ca61a70d Mon Sep 17 00:00:00 2001 From: andrew-paystack Date: Wed, 26 Feb 2025 13:01:36 +0300 Subject: [PATCH] update preauth API --- dist/api/preauthorization/list/response.json | 12 ++++++++++++ dist/api/preauthorization/verify/requests.js | 6 +++--- dist/api/preauthorization/verify/response.json | 2 +- src/api/preauthorization/list/response.json | 12 ++++++++++++ src/api/preauthorization/verify/index.js | 2 +- src/api/preauthorization/verify/index.php | 2 +- src/api/preauthorization/verify/index.sh | 2 +- src/api/preauthorization/verify/response.json | 2 +- 8 files changed, 32 insertions(+), 8 deletions(-) diff --git a/dist/api/preauthorization/list/response.json b/dist/api/preauthorization/list/response.json index 5bd53ab..843db8d 100644 --- a/dist/api/preauthorization/list/response.json +++ b/dist/api/preauthorization/list/response.json @@ -45,5 +45,17 @@ "status": false, "message": "An error occurred" } + }, + "404": { + "description": "404 Not Found", + "data": { + "status": false, + "message": "No preauthorized transaction exists for the reference provided", + "meta": { + "nextStep": "Try again later" + }, + "type": "api_error", + "code": "unknown" + } } } \ No newline at end of file diff --git a/dist/api/preauthorization/verify/requests.js b/dist/api/preauthorization/verify/requests.js index 3582882..97babe9 100644 --- a/dist/api/preauthorization/verify/requests.js +++ b/dist/api/preauthorization/verify/requests.js @@ -1,5 +1,5 @@ const sh = `#!/bin/sh -url="https://api.paystack.co/preauthorization/verify/:reference" +url="https://api.paystack.co/preauthorization/:reference" authorization="Authorization: Bearer YOUR_SECRET_KEY" curl "$url" -H "$authorization" -X GET` @@ -9,7 +9,7 @@ const js = `const https = require('https') const options = { hostname: 'api.paystack.co', port: 443, - path: '/preauthorization/verify/:reference', + path: '/preauthorization/:reference', method: 'GET', headers: { Authorization: 'Bearer SECRET_KEY' @@ -35,7 +35,7 @@ const php = ` "https://api.paystack.co/preauthorization/verify/:reference", + CURLOPT_URL => "https://api.paystack.co/preauthorization/:reference", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, diff --git a/dist/api/preauthorization/verify/response.json b/dist/api/preauthorization/verify/response.json index ae4f7f2..0f3a59b 100644 --- a/dist/api/preauthorization/verify/response.json +++ b/dist/api/preauthorization/verify/response.json @@ -12,7 +12,7 @@ "amount": 1600, "created_at": "2023-08-24T19:00:18.000Z", "released_at": null, - "scheduled_release_date": "2023-08-25T19:00:26.000Z", + "expiry_date": "2023-08-25T19:00:26.000Z", "currency": "ZAR", "metadata": null, "fees": 100, diff --git a/src/api/preauthorization/list/response.json b/src/api/preauthorization/list/response.json index 5bd53ab..843db8d 100644 --- a/src/api/preauthorization/list/response.json +++ b/src/api/preauthorization/list/response.json @@ -45,5 +45,17 @@ "status": false, "message": "An error occurred" } + }, + "404": { + "description": "404 Not Found", + "data": { + "status": false, + "message": "No preauthorized transaction exists for the reference provided", + "meta": { + "nextStep": "Try again later" + }, + "type": "api_error", + "code": "unknown" + } } } \ No newline at end of file diff --git a/src/api/preauthorization/verify/index.js b/src/api/preauthorization/verify/index.js index ba17c80..db8e94f 100644 --- a/src/api/preauthorization/verify/index.js +++ b/src/api/preauthorization/verify/index.js @@ -3,7 +3,7 @@ const https = require('https') const options = { hostname: 'api.paystack.co', port: 443, - path: '/preauthorization/verify/:reference', + path: '/preauthorization/:reference', method: 'GET', headers: { Authorization: 'Bearer SECRET_KEY' diff --git a/src/api/preauthorization/verify/index.php b/src/api/preauthorization/verify/index.php index 2dc4fc6..82f2702 100644 --- a/src/api/preauthorization/verify/index.php +++ b/src/api/preauthorization/verify/index.php @@ -2,7 +2,7 @@ $curl = curl_init(); curl_setopt_array($curl, array( - CURLOPT_URL => "https://api.paystack.co/preauthorization/verify/:reference", + CURLOPT_URL => "https://api.paystack.co/preauthorization/:reference", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, diff --git a/src/api/preauthorization/verify/index.sh b/src/api/preauthorization/verify/index.sh index 3decea1..7efd57f 100644 --- a/src/api/preauthorization/verify/index.sh +++ b/src/api/preauthorization/verify/index.sh @@ -1,5 +1,5 @@ #!/bin/sh -url="https://api.paystack.co/preauthorization/verify/:reference" +url="https://api.paystack.co/preauthorization/:reference" authorization="Authorization: Bearer YOUR_SECRET_KEY" curl "$url" -H "$authorization" -X GET \ No newline at end of file diff --git a/src/api/preauthorization/verify/response.json b/src/api/preauthorization/verify/response.json index ae4f7f2..0f3a59b 100644 --- a/src/api/preauthorization/verify/response.json +++ b/src/api/preauthorization/verify/response.json @@ -12,7 +12,7 @@ "amount": 1600, "created_at": "2023-08-24T19:00:18.000Z", "released_at": null, - "scheduled_release_date": "2023-08-25T19:00:26.000Z", + "expiry_date": "2023-08-25T19:00:26.000Z", "currency": "ZAR", "metadata": null, "fees": 100,