Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
391 changes: 217 additions & 174 deletions dist/paystack.yaml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/assets/openapi/components/schemas/TransferBase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ properties:
reason:
description: The reason or narration for the transfer.
type: string
example:
amount: 120000
recipient: RCP_gd9vgag7n5lr5ix
reference: acv_9ee55786-2323-4760-98e2-6380c9cb3f68
9 changes: 8 additions & 1 deletion src/assets/openapi/components/schemas/TransferBulk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ required:
- transfers
properties:
source:
description: Where should we transfer from? Only balance is allowed for now
description: The source of funds for the transfer.
type: string
default: balance
currency:
description: Specify the currency of the transfer.
type: string
Expand All @@ -20,3 +21,9 @@ properties:
type: array
items:
$ref: ./TransferBase.yaml
example:
source: balance
transfers:
- amount: 120000
recipient: RCP_gd9vgag7n5lr5ix
reference: acv_9ee55786-2323-4760-98e2-6380c9cb3f68
3 changes: 3 additions & 0 deletions src/assets/openapi/components/schemas/TransferFinalize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ properties:
otp:
description: OTP sent to business phone to verify transfer
type: string
example:
transfer_code: TRF_vsyqdmlzble3uii
otp: "928783"
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ properties:
otp:
description: OTP sent to business phone to verify disabling OTP requirement
type: string
example:
otp: "928783"
7 changes: 3 additions & 4 deletions src/assets/openapi/components/schemas/TransferInitiate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ allOf:
- type: object
required:
- source
- amount
- recipient
- reference
properties:
source:
description: The origin of the funds to send from
description: The source of funds to send from
type: string
default: balance
currency:
Expand All @@ -21,3 +18,5 @@ allOf:
- ZAR
- KES
- GHS
example:
source: balance
4 changes: 4 additions & 0 deletions src/assets/openapi/components/schemas/TransferResendOTP.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ properties:
default: transfer
enum:
- disable_otp
- resend_otp
- transfer
example:
transfer_code: TRF_vsyqdmlzble3uii
reason: resend_otp
18 changes: 9 additions & 9 deletions src/assets/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ tags:
description: |
A collection of endpoints for automating sending money to beneficiaries
x-product-name: Transfers
- name: Balance
description: >
A collection of endpoints gaining insights into the amount on an
integration
x-product-name: Balance
- name: Product
description: |
A collection of endpoints for creating and managing inventories
Expand All @@ -110,11 +115,6 @@ tags:
description: |
A collection of endpoints for gaining insights into payouts
x-product-name: Settlements
- name: Balance
description: >
A collection of endpoints gaining insights into the amount on an
integration
x-product-name: Balance
- name: Integration
description: |
A collection of endpoints for managing some settings on an integration
Expand Down Expand Up @@ -298,6 +298,10 @@ paths:
$ref: paths/transfer_disable_otp_finalize.yaml
/transfer/enable_otp:
$ref: paths/transfer_enable_otp.yaml
/balance:
$ref: paths/balance.yaml
/balance/ledger:
$ref: paths/balance_ledger.yaml
/product:
$ref: paths/product.yaml
/product/{id}:
Expand Down Expand Up @@ -350,10 +354,6 @@ paths:
$ref: paths/settlement.yaml
/settlement/{id}/transaction:
$ref: paths/settlement_{id}_transaction.yaml
/balance:
$ref: paths/balance.yaml
/balance/ledger:
$ref: paths/balance_ledger.yaml
/integration/payment_session_timeout:
$ref: paths/integration_payment_session_timeout.yaml
/refund:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/openapi/paths/balance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ get:
- Balance
summary: Fetch Balance
operationId: balance_fetch
description: You can only transfer from what you have
description: Fetch the available balance on your integration
responses:
'200':
description: ''
Expand Down
1 change: 1 addition & 0 deletions src/assets/openapi/paths/balance_ledger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ get:
tags:
- Balance
summary: Balance Ledger
description: Fetch all pay-ins and pay-outs that occured on your integration
operationId: balance_ledger
parameters:
- in: query
Expand Down
5 changes: 4 additions & 1 deletion src/assets/openapi/paths/transfer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ post:
tags:
- Transfer
summary: Initiate Transfer
description: Send money to your customers
operationId: transfer_initiate
requestBody:
content:
Expand All @@ -13,7 +14,7 @@ post:
$ref: ../components/schemas/TransferInitiate.yaml
responses:
'200':
description: ''
description: 'Successful operation'
content:
application/json:
schema:
Expand All @@ -26,13 +27,15 @@ get:
tags:
- Transfer
summary: List Transfers
description: List the transfers made on your integration
operationId: transfer_list
parameters:
- in: query
name: use_cursor
description: A flag to indicate if cursor based pagination should be used
schema:
type: boolean
example: true
- in: query
name: next
description: >
Expand Down
4 changes: 4 additions & 0 deletions src/assets/openapi/paths/transfer_bulk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ post:
tags:
- Transfer
summary: Initiate Bulk Transfer
description: |
Batch multiple transfers in a single request.

You need to disable the Transfers OTP requirement to use this endpoint.
operationId: transfer_bulk
requestBody:
content:
Expand Down
5 changes: 4 additions & 1 deletion src/assets/openapi/paths/transfer_disable_otp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ post:
tags:
- Transfer
summary: Disable OTP for Transfers
description: |
This is used in the event that you want to be able to complete transfers programmatically without use of OTPs.
No arguments required. You will get an OTP to complete the request.
operationId: transfer_disableOtp
responses:
'200':
description: ''
description: 'Successful response'
content:
application/json:
schema:
Expand Down
3 changes: 2 additions & 1 deletion src/assets/openapi/paths/transfer_disable_otp_finalize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ post:
tags:
- Transfer
summary: Finalize Disabling OTP for Transfers
description: Finalize the request to disable OTP on your transfers
operationId: transfer_disableOtpFinalize
requestBody:
content:
Expand All @@ -13,7 +14,7 @@ post:
$ref: ../components/schemas/TransferFinalizeDisableOTP.yaml
responses:
'200':
description: ''
description: 'Successful response'
content:
application/json:
schema:
Expand Down
5 changes: 4 additions & 1 deletion src/assets/openapi/paths/transfer_enable_otp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ post:
tags:
- Transfer
summary: Enable OTP requirement for Transfers
description: |
In the event that a customer wants to stop being able to complete transfers programmatically, this endpoint helps turn OTP requirement back on.
No arguments required.
operationId: transfer_enableOtp
responses:
'200':
description: ''
description: 'Successful response'
content:
application/json:
schema:
Expand Down
2 changes: 2 additions & 0 deletions src/assets/openapi/paths/transfer_export.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ get:
tags:
- Transfer
summary: Export Transfers
description: Export a list of transfers carried out on your integration
operationId: transfer_exportTransfer
parameters:
- in: query
Expand All @@ -25,6 +26,7 @@ get:
- blocked
- rejected
- received
example: success
- in: query
name: from
schema:
Expand Down
1 change: 1 addition & 0 deletions src/assets/openapi/paths/transfer_finalize_transfer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ post:
tags:
- Transfer
summary: Finalize Transfer
description: Finalize an initiated transfer
operationId: transfer_finalize
requestBody:
content:
Expand Down
1 change: 1 addition & 0 deletions src/assets/openapi/paths/transfer_resend_otp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ post:
tags:
- Transfer
summary: Resend OTP for Transfer
description: Generates and send a new OTP to customer in the event they are having trouble receiving one.
operationId: transfer_resendOtp
requestBody:
content:
Expand Down
3 changes: 3 additions & 0 deletions src/assets/openapi/paths/transfer_verify_{reference}.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ get:
tags:
- Transfer
summary: Verify Transfer
description: Verify the status of a transfer on your integration
operationId: transfer_verify
parameters:
- name: reference
description: Transfer reference
in: path
required: true
schema:
type: string
example: acv_9ee55786-2323-4760-98e2-6380c9cb3f67
responses:
'200':
description: ''
Expand Down
4 changes: 3 additions & 1 deletion src/assets/openapi/paths/transfer_{code}.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ parameters:
required: true
schema:
type: string
example: TRF_1ptvuv321ahaa7q
get:
tags:
- Transfer
summary: Fetch Transfer
description: Get details of a transfer on your integration
operationId: transfer_fetch
responses:
'200':
description: ''
description: 'Succesful operation'
content:
application/json:
schema:
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path'
import open from 'open';

const app = express()
const port = 3031
const port = 7070

const __dirname = new URL('.', import.meta.url).pathname;
const file = fs.readFileSync(path.join(__dirname, '../dist/paystack.yaml'), 'utf8')
Expand Down
Loading