Skip to content

Bug/hubtel gateway#12

Merged
noelzappy merged 2 commits into
mainfrom
bug/hubtel-gateway
Mar 9, 2026
Merged

Bug/hubtel gateway#12
noelzappy merged 2 commits into
mainfrom
bug/hubtel-gateway

Conversation

@noelzappy

Copy link
Copy Markdown
Owner

This pull request introduces improvements to the Node.js SDK release process and updates the Hubtel provider to correctly query transaction status by client reference. The most significant changes are the addition of automated release scripts for patch, minor, and major versions, a version bump, and a bug fix for the Hubtel transaction status API call.

Release process improvements:

  • Added release:patch, release:minor, and release:major npm scripts to automate versioning, tagging, and pushing releases for the Node.js SDK in package.json. This streamlines and standardizes the release workflow.
  • Updated the release instructions in README.md to reflect the new automated release scripts, replacing the manual tagging process.

Versioning:

  • Bumped the SDK version from 0.2.0 to 0.2.1 in package.json.

Bug fix:

  • Fixed the Hubtel provider's transaction status API call to include the clientReference query parameter, ensuring the correct transaction is retrieved.

Copilot AI review requested due to automatic review settings March 9, 2026 14:06
@noelzappy
noelzappy merged commit b618c85 into main Mar 9, 2026
4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Node.js SDK release workflow ergonomics and fixes Hubtel transaction verification to query by clientReference.

Changes:

  • Fix Hubtel verifyTransaction to include clientReference when querying transaction status.
  • Add npm scripts to automate patch/minor/major releases (version bump, commit, tag, push).
  • Bump Node SDK version from 0.2.0 to 0.2.1 and update release instructions in the root README.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
packages/node/src/providers/hubtel/hubtel.adapter.ts Adjusts Hubtel transaction status lookup to query by clientReference.
packages/node/package.json Bumps SDK version and adds automated release scripts.
README.md Updates release documentation to use the new npm release scripts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 124 to 126
const { data } = await axios.get<HubtelAPIResponse<HubtelTransaction>>(
`https://api-txnstatus.hubtel.com/transactions/${this.merchantAccount}/status`,
`https://api-txnstatus.hubtel.com/transactions/${this.merchantAccount}/status?clientReference=${reference}`,
{

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

Building the URL by string-interpolating reference into the query string can break when the reference contains reserved characters (e.g. &, ?, #, spaces) and can also allow unintended extra query params. Prefer passing clientReference via axios params (or at least encodeURIComponent(reference)) so it’s correctly encoded.

Copilot uses AI. Check for mistakes.
Comment on lines 124 to 126
const { data } = await axios.get<HubtelAPIResponse<HubtelTransaction>>(
`https://api-txnstatus.hubtel.com/transactions/${this.merchantAccount}/status`,
`https://api-txnstatus.hubtel.com/transactions/${this.merchantAccount}/status?clientReference=${reference}`,
{

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

There are existing HubtelAdapter tests, but none assert the verifyTransaction request URL/params. Since this change fixes which transaction is queried, please add/adjust a test to assert axios.get is called with clientReference (ideally via params) so regressions are caught.

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +38
"release:patch": "npm version patch --no-git-tag-version && git add package.json && git commit -m \"chore: release v$(node -p \"require('./package.json').version\")\" && git tag node-v$(node -p \"require('./package.json').version\") && git push && git push origin node-v$(node -p \"require('./package.json').version\")",
"release:minor": "npm version minor --no-git-tag-version && git add package.json && git commit -m \"chore: release v$(node -p \"require('./package.json').version\")\" && git tag node-v$(node -p \"require('./package.json').version\") && git push && git push origin node-v$(node -p \"require('./package.json').version\")",
"release:major": "npm version major --no-git-tag-version && git add package.json && git commit -m \"chore: release v$(node -p \"require('./package.json').version\")\" && git tag node-v$(node -p \"require('./package.json').version\") && git push && git push origin node-v$(node -p \"require('./package.json').version\")"

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

npm version ... will also update package-lock.json when it exists (it does in this package), but this script only stages package.json. That leaves the lockfile modified but uncommitted after running the release script. Consider staging/committing package-lock.json too, or configuring the command to avoid touching the lockfile.

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +38
"release:patch": "npm version patch --no-git-tag-version && git add package.json && git commit -m \"chore: release v$(node -p \"require('./package.json').version\")\" && git tag node-v$(node -p \"require('./package.json').version\") && git push && git push origin node-v$(node -p \"require('./package.json').version\")",
"release:minor": "npm version minor --no-git-tag-version && git add package.json && git commit -m \"chore: release v$(node -p \"require('./package.json').version\")\" && git tag node-v$(node -p \"require('./package.json').version\") && git push && git push origin node-v$(node -p \"require('./package.json').version\")",
"release:major": "npm version major --no-git-tag-version && git add package.json && git commit -m \"chore: release v$(node -p \"require('./package.json').version\")\" && git tag node-v$(node -p \"require('./package.json').version\") && git push && git push origin node-v$(node -p \"require('./package.json').version\")"

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

These release scripts rely on POSIX shell features ($(...) command substitution and && chaining), so they won’t work in Windows’ default npm script shell. If maintainers release from different OSes, consider moving the logic into a small Node.js script (or a cross-platform tool) and reusing it for patch/minor/major to avoid triplicated long commands.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants