Skip to content

fix: handle case-insensitive status check for Hubtel initialization#10

Merged
noelzappy merged 1 commit into
mainfrom
bug/hubtel-gateway
Mar 9, 2026
Merged

fix: handle case-insensitive status check for Hubtel initialization#10
noelzappy merged 1 commit into
mainfrom
bug/hubtel-gateway

Conversation

@noelzappy

Copy link
Copy Markdown
Owner

This pull request makes a minor update to the Hubtel payment adapter to improve robustness in status checking. The change ensures that the status check is case-insensitive, reducing the risk of failures due to unexpected casing in API responses.

Copilot AI review requested due to automatic review settings March 9, 2026 11:59

@noelzappy noelzappy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

lgtm

@noelzappy
noelzappy merged commit 0eb8789 into main Mar 9, 2026
4 of 6 checks passed
@noelzappy
noelzappy deleted the bug/hubtel-gateway branch March 9, 2026 12:00

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

Improves robustness of the Hubtel payment initialization flow by making the gateway status check case-insensitive, reducing failures caused by unexpected casing in Hubtel API responses.

Changes:

  • Update the Hubtel initialization success condition to compare status in a case-insensitive way.

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

);

if (data.status !== 'success') {
if (data.status?.toLowerCase() !== 'success') {

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.

The new case-insensitive status handling is not covered by existing HubtelAdapter tests (current initiatePayment success test uses only lowercase 'success'). Add a unit test where the initiate endpoint returns status values like 'Success'/'SUCCESS' to prevent regressions.

Suggested change
if (data.status?.toLowerCase() !== 'success') {
const normalizedStatus =
typeof data.status === 'string' ? data.status.toLowerCase() : '';
if (normalizedStatus !== 'success') {

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