Skip to content

Conversation

@PiusKariuki
Copy link
Collaborator

Summary

Create an adaptor for the Monnify API

Fixes #1450

Details

Add technical details of what you've changed (and why).

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to
know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our
Responsible AI Policy

Review Checklist

Before merging, the reviewer should check the following items:

  • Does the PR do what it claims to do?
  • If this is a new adaptor, added the adaptor on marketing website ?
  • If this PR includes breaking changes, do we need to update any jobs in
    production? Is it safe to release?
  • Are there any unit tests?
  • Is there a changeset associated with this PR? Should there be? Note that
    dev only changes don't need a changeset.
  • Have you ticked a box under AI Usage?

},
"type": "object",
"additionalProperties": true,
"required": ["baseUrl","password", "username"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be secretKey and apiKey

* @property {object} query - An object of query parameters to be encoded into the URL.
* @property {object} headers - An object of headers to append to the request.
* @property {string} parseAs - Parse the response body as json, text or stream. By default will use the response headers.
* @property {number} timeout - Request timeout in ms. Default: 300 seconds.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean this up and remove the items that are not needed for this adaptor

const { baseUrl } = configuration;

if(!access_token)
access_token = await getAccessToken(configuration, options.headers)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can write access_token back to state, and in the config, have it as optional.
Has there been an instance where people just give their access_token? if yest then we check if there is no token, then secret and apikey, else vice versa

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hunterachieng

  • RE: Writing to state:

Yes I think that is a better way of doing it.

  • RE: Giving your access token while configuring an adaptor

The issue is the token is short lived, 25 minutes . It doesn't make sense having it in config for this reason since you would have to edit it every 25 minutes and monnify doesn't provide a refresh token.

it('makes a successful GET request', async () => {
testServer
.intercept({
path: '/api/v2/disbursements/search-transactions?pageNo=0&pageSize=10&sourceAccountNumber=4864192954',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the query object here instead of placing them in the url as a string?

"unsorted": false,
"empty": false
},
"pageNumber": 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have these pagination options.

   "pageNumber": 0,
          "pageSize": 10,
          "offset": 0,
          
          ```
      We could implement pagination. Say we fetch all disbursments in batches, but if we have `offset` or `pageSize`, we respect them

@martalovescoffee
Copy link
Collaborator

  1. @PiusKariuki , can you share sandbox access and give a propper testing guidelines please?

…nses

  Implemented requestWithPagination function to automatically fetch all pages when no pagination params are provided, while respecting explicit pageSize/pageNo parameters when specified. Includes validation for max pageSize of 1000 and comprehensive test coverage.
@PiusKariuki PiusKariuki requested review from hunterachieng and mtuchi and removed request for hunterachieng December 17, 2025 17:59
@PiusKariuki
Copy link
Collaborator Author

@mtuchi you can review this at your own time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Moniepoint adaptor

4 participants