I am building an reactjs app and I am planning to use Mollie using this rep but something goes wrong with using the fs functions in the code of mollie-api-node.
Im getting the following error:
Uncaught TypeError: fs.readFileSync is not a function
at Client.module.exports.Client.callRest (bundle.js:69617)
at Payments.module.exports.Base.create (bundle.js:75793)
at Object. (bundle.js:10888)
at webpack_require (bundle.js:556)
at fn (bundle.js:87)
at Object. (bundle.js:591)
at webpack_require (bundle.js:556)
at bundle.js:579
at bundle.js:582
using the following code:
var Mollie = require("mollie-api-node");
var mollie = new Mollie.API.Client;
mollie.setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM");
mollie.payments.create({
amount: 10.00,
description: "My first API payment",
redirectUrl: "https://webshop.example.org/order/12345/",
webhookUrl: "https://webshop.example.org/mollie-webhook/"
}, function (payment) {
mollie.response.writeHead(302, { Location: payment.getPaymentUrl() })
});
Hi Guys,
I am building an reactjs app and I am planning to use Mollie using this rep but something goes wrong with using the fs functions in the code of mollie-api-node.
Im getting the following error:
Uncaught TypeError: fs.readFileSync is not a function at Client.module.exports.Client.callRest (bundle.js:69617) at Payments.module.exports.Base.create (bundle.js:75793) at Object. (bundle.js:10888)
at webpack_require (bundle.js:556)
at fn (bundle.js:87)
at Object. (bundle.js:591)
at webpack_require (bundle.js:556)
at bundle.js:579
at bundle.js:582
using the following code:
Is there anyone with a similar problem?
Thanks!