Skip to content

Cannot find module '../../test/Integration/Gateways/Terminals/RequestIdProvider' #71

Description

@RanvijayChouhan12

Looks Like test Folder is Missing in the modules,

i checked the Node-modules but didn't find test Folder anywhere

Please Help with this

ERROR :

Error: Cannot find module '../../test/Integration/Gateways/Terminals/RequestIdProvider'
Require stack:

  • /Users/ranvijay/Desktop/RV/test_Global_Pay/node_modules/globalpayments-api/lib/src/Gateways/RestGateway.js
  • /Users/ranvijay/Desktop/RV/test_Global_Pay/node_modules/globalpayments-api/lib/src/Gateways/GpApiConnector.js
  • /Users/ranvijay/Desktop/RV/test_Global_Pay/node_modules/globalpayments-api/lib/src/Gateways/index.js
  • /Users/ranvijay/Desktop/RV/test_Global_Pay/node_modules/globalpayments-api/lib/src/index.js
  • /Users/ranvijay/Desktop/RV/test_Global_Pay/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object. (/Users/ranvijay/Desktop/RV/test_Global_Pay/node_modules/globalpayments-api/lib/src/Gateways/RestGateway.js:4:29)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/Users/ranvijay/Desktop/RV/test_Global_Pay/node_modules/globalpayments-api/lib/src/Gateways/RestGateway.js',
    '/Users/ranvijay/Desktop/RV/test_Global_Pay/node_modules/globalpayments-api/lib/src/Gateways/GpApiConnector.js',
    '/Users/ranvijay/Desktop/RV/test_Global_Pay/node_modules/globalpayments-api/lib/src/Gateways/index.js',
    '/Users/ranvijay/Desktop/RV/test_Global_Pay/node_modules/globalpayments-api/lib/src/index.js',
    '/Users/ranvijay/Desktop/RV/test_Global_Pay/index.js'
    ]
    }

MY CODE 🥇

const express = require("express");
const GlobalPayments = require("globalpayments-api");
const app = express();

app.use(express.json());

app.post("/create-payment", async (req, res) => {
try {
const { cardNumber, expiry, cvv, amount } = req.body;
const response = await GlobalPayments.cards.charge({
cardNumber,
expiry,
cvv,
amount,
currency: "USD",
});

if (response.isSuccessful) {
  res.json({ transactionId: response.transactionId });
} else {
  res.status(400).json({ message: response.message });
}

} catch (error) {
res.status(500).json({ message: error.message });
}
});

app.listen(3000, () => console.log("Server running on port 3000"));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions