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
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,21 @@ voltax/
To publish a new version of the Node.js SDK to npm:

```bash
# Create and push a release tag (triggers CI to publish to npm)
git tag node-v1.0.0
git push origin node-v1.0.0
cd packages/node

# Patch release (0.0.x) - bug fixes
npm run release:patch

# Minor release (0.x.0) - new features
npm run release:minor

# Major release (x.0.0) - breaking changes
npm run release:major
```

The tag format is `node-v<version>` (e.g., `node-v1.2.3`, `node-v2.0.0-beta.1`). This triggers the release workflow which:
This triggers the release workflow which:
- Runs tests
- Builds the package
- Updates `package.json` version to match the tag
- Creates a GitHub Release with auto-generated changelog
- Publishes to npm and GitHub Packages

Expand Down
9 changes: 6 additions & 3 deletions packages/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@noelzappy/voltax",
"version": "0.2.0",
"version": "0.2.1",
"description": "Voltax Node.js SDK for unified payment gateway integration",
"license": "MIT",
"author": "https://github.com/noelzappy",
Expand Down Expand Up @@ -32,7 +32,10 @@
"typecheck": "tsc --noEmit",
"test": "vitest run",
"lint": "eslint . --fix",
"format": "prettier --write ."
"format": "prettier --write .",
"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\")"
Comment on lines +36 to +38

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

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.
},
"dependencies": {
"axios": "^1.6.0",
Expand All @@ -54,4 +57,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/node/src/providers/hubtel/hubtel.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class HubtelAdapter implements VoltaxProvider<HubtelPaymentDTO> {

try {
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}`,
{
Comment on lines 124 to 126

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

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.
headers: { Authorization: this.authHeader },
},
Expand Down
Loading