Git Product home page Git Product logo

Comments (2)

rizdaprasetya avatar rizdaprasetya commented on July 21, 2024 1

Hi @yogithesymbian I don't think the issue is coming from Midtrans library. From your log the error TypeError: Converting circular structure to JSON is thrown by: node_modules/express/lib/response.js:1123:12 it is from Express library. Maybe your Express backend is unable to handle malformed HTTP response or something. Which you can check from your implementation of this line of code to know what function call produce the issue:

/src/controllers/notification.controller.js:55:26

apiClient.transaction.notification(notificationJson) will work properly if the notificationJson is a JSON object (or string) that have the correct attributes as example here: https://docs.midtrans.com/en/after-payment/http-notification?id=sample-for-various-payment-methods

From your example, the req.body value is:

[{"statusResponse":"1"},{"transaction_time":"2","no":"3"},"yogi","as"]

Which is not a valid Midtrans notification JSON.

If you want to get a valid Midtrans notification JSON to test, I suggest you setup your Sandbox account to send HTTP notification to your backend: https://docs.midtrans.com/en/after-payment/http-notification?id=configuring-http-notifications-on-map

Then perform a sandbox test payment: https://docs.midtrans.com/en/technical-reference/sandbox-test

from midtrans-nodejs-client.

yogithesymbian avatar yogithesymbian commented on July 21, 2024 1

Hi @rizdaprasetya thanks in advance
i dunno why but i have test right now and its work .
last week i have tried with three value for the notificationJson variable

stringify(req.body); // notificationJson value
JSON.stringify({ ...req.body }); // notificationJson value
req.body; // notificationJson value // now its work dunno why how error is came on yesterday , i didnt touch anything .

from midtrans-nodejs-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.