Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bill Validation Not Responding With Expected Data #120

Open
Promise111 opened this issue May 8, 2023 · 1 comment
Open

Bill Validation Not Responding With Expected Data #120

Promise111 opened this issue May 8, 2023 · 1 comment

Comments

@Promise111
Copy link

Have you read our Code of Conduct? By filing an Issue, you are expected to comply with it, including treating everyone with respect.

Description

I am trying to validate a bill service(airtime) using "flw.Bills.validate(payload)" and expect to return success (200) or bad request (400), instead i just get a 200 status with the following response {status:"error", data: null}. After reading through the "rave.base.js" file, I think the issue is that even though the query parameters are already on the path, the logic still concatenates the query parameters to the path with the query parameters.
rave.base.js line 54 - 61:
if (requestMethod === 'GET') {
delete payload.method;
if (includeQueryParams == true) {
delete payload.excludeQuery;
requestOptions.uri = path;
} else {
const queryParams = querystring.stringify(payload);
requestOptions.uri = path += ${queryParams};
} else {
requestOptions.uri = path;
}

Steps to Reproduce

Just attempt to validate bill service.

Expected behaviour

for airtime validation, I expect a status of 200 with the following response:
{
"status": "success",
"message": "Item validated successfully",
"data": {
"response_code": "00",
"address": null,
"response_message": "Successful",
"name": "MTN",
"biller_code": "BIL099",
"customer": "08167689237,08167689237",
"product_code": "AT099",
"email": null,
"fee": 0,
"maximum": 0,
"minimum": 0
}
}

Actual behaviour

Instead I get status code 200 and the following response:
{
"status": "error",
"data": null
}

Reproduces how often

I get the error a 100% of the time, I had to alter code I should normally not alter to get the desired result.

Configuration

  • API Version: v3
  • Environment: live and test mode
  • Browser:
  • Language: [ Node 18 ]

Additional Information

@michaelnji
Copy link

Has this been fixed?

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

No branches or pull requests

2 participants