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

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

Open
RanvijayChouhan12 opened this issue May 29, 2024 · 3 comments

Comments

@RanvijayChouhan12
Copy link

RanvijayChouhan12 commented May 29, 2024

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"));

@matrix125
Copy link

Please use this version: "globalpayments-api": "3.5.1-fix-4".
A fix is being worked on and may be released this Thursday 5/30.

@RanvijayChouhan12
Copy link
Author

Thanks Above Solved the Previous Issue

but Now i am getting some new Error

const config = new ServicesConfig()
^

TypeError: ServicesConfig is not a constructor
at Object. (/Users/ranvijay/Desktop/RV/test_Global_Pay/index.ts:37:16)
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 Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49

My CODE 👍🏻 

const config = new ServicesConfig()
.setServiceUrl(Environment.Sandbox)
.setLicenseId("") // Replace with your License ID
.setSiteId("") // Replace with your Site ID
.setMerchantId("") // Replace with your Merchant ID
.setPassword("");

Also if you could help me , Which Fileld will have What Values and Where i can get them

thanks,

@matrix125
Copy link

matrix125 commented May 30, 2024

Hi,

Going forward, please send all inquiries to the developers group directly.
https://developer.heartlandpaymentsystems.com/Support

Specifically: [email protected]

With regards to your issue. Use the below.

const config = new PorticoConfig();
config.secretApiKey = "skapi_cert_your secret api key"
config.developerId = '000000'; // your dev id, if you started the cert process and received one, else use these values
config.versionNumber = '0000'; // your dev version id, if you started the cert process and received one, else use these values
config.serviceUrl = 'https://cert.api2.heartlandportico.com';
ServicesContainer.configureService(config);

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