Node-v3 icon indicating copy to clipboard operation
Node-v3 copied to clipboard

Bill Validation Not Responding With Expected Data

Open Promise111 opened this issue 2 years ago • 1 comments

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

Promise111 avatar May 08 '23 06:05 Promise111

Has this been fixed?

michaelnji avatar Jul 12 '24 15:07 michaelnji

Hi @Promise111 @michaelnji

Thank you for flagging this. This has been fixed. Kindly retry your request.

Dekunledev avatar Feb 18 '25 22:02 Dekunledev