initial intellipay implementation
Co-authored-by: Patrick Fic <patrick@thinkimex.com>
This commit is contained in:
36
server/intellipay/intellipay.js
Normal file
36
server/intellipay/intellipay.js
Normal file
@@ -0,0 +1,36 @@
|
||||
const GraphQLClient = require("graphql-request").GraphQLClient;
|
||||
const path = require("path");
|
||||
const queries = require("../graphql-client/queries");
|
||||
const Dinero = require("dinero.js");
|
||||
const qs = require("query-string");
|
||||
const axios = require("axios");
|
||||
require("dotenv").config({
|
||||
path: path.resolve(
|
||||
process.cwd(),
|
||||
`.env.${process.env.NODE_ENV || "development"}`
|
||||
),
|
||||
});
|
||||
|
||||
exports.lightbox_credentials = async (req, res) => {
|
||||
console.log("In API Lightbox Credential route.");
|
||||
try {
|
||||
const options = {
|
||||
method: "POST",
|
||||
headers: { "content-type": "application/x-www-form-urlencoded" },
|
||||
//TODO: Move these to environment variables/database.
|
||||
data: qs.stringify({
|
||||
merchantkey: "3B8068",
|
||||
apikey: "Oepn2B.XqRgzAqHqvOOmYUxD2VW.vGSipi",
|
||||
operatingenv: "businessattended", // add these for EMV Swipe
|
||||
}),
|
||||
url: "https://test.cpteller.com/api/custapi.cfc?method=autoterminal", //added .test
|
||||
};
|
||||
|
||||
const response = await axios(options);
|
||||
|
||||
res.send(response.data);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
res.json({ error });
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user