IO-2920 Update checkfee method to get CC amount based on new information.

This commit is contained in:
Patrick Fic
2024-11-25 14:08:38 -08:00
parent 268b1ba9c1
commit 225b57fd58
7 changed files with 10955 additions and 10822 deletions

View File

@@ -14,7 +14,7 @@ require("dotenv").config({
path: path.resolve(process.cwd(), `.env.${process.env.NODE_ENV || "development"}`)
});
const domain = process.env.NODE_ENV ? "secure" : "test";
const domain = process.env.NODE_ENV ? "secure" : "secure";
const { SecretsManagerClient, GetSecretValueCommand } = require("@aws-sdk/client-secrets-manager");
const { InstanceRegion } = require("../utils/instanceMgr");
@@ -151,6 +151,7 @@ exports.generate_payment_url = async (req, res) => {
//Reference: https://intellipay.com/dist/webapi26.html#operation/fee
exports.checkfee = async (req, res) => {
// Requires amount, bodyshop.imexshopid, and state? to get data.
logger.log("intellipay-fee-check", "DEBUG", req.user?.email, null, null);
//If there's no amount, there can't be a fee. Skip the call.
@@ -171,7 +172,12 @@ exports.checkfee = async (req, res) => {
method: "fee",
...shopCredentials,
amount: req.body.amount,
paymenttype: `"CC"`
paymenttype: `CC`,
cardnum: "4111111111111111", //Not needed per documentation, but incorrect values come back without it.
state:
req.body.bodyshop?.state && req.body.bodyshop.state?.length === 2
? req.body.bodyshop.state.toUpperCase()
: "ZZ" //Same as above
},
{ sort: false } //ColdFusion Query Strings depend on order. This preserves it.
),