globalpayments / node-sdk

GNU General Public License v2.0
23 stars 26 forks source link

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

Open RanvijayChouhan12 opened 1 month ago

RanvijayChouhan12 commented 1 month ago

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:

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

Hi,

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

Specifically: developers@heartland.us

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