Merged in release/2025-03-28 (pull request #2218)
IO-3176 IntelliPay Payment Method Mapping
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import { Alert, Form, Switch } from "antd";
|
import { Alert, Form, Select, Switch } from "antd";
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
|
|
||||||
@@ -39,6 +38,92 @@ export function ShopInfoIntellipay({bodyshop, form}) {
|
|||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow header={t("bodyshop.fields.intellipay_config.payment_type")}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.intellipay_config.payment_map.visa")}
|
||||||
|
name={["intellipay_config", "payment_map", "visa"]}
|
||||||
|
>
|
||||||
|
<Select showSearch>
|
||||||
|
{bodyshop.md_payment_types.map((item, idx) => (
|
||||||
|
<Select.Option key={idx} value={item}>
|
||||||
|
{item}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.intellipay_config.payment_map.mast")}
|
||||||
|
name={["intellipay_config", "payment_map", "mast"]}
|
||||||
|
>
|
||||||
|
<Select showSearch>
|
||||||
|
{bodyshop.md_payment_types.map((item, idx) => (
|
||||||
|
<Select.Option key={idx} value={item}>
|
||||||
|
{item}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.intellipay_config.payment_map.amex")}
|
||||||
|
name={["intellipay_config", "payment_map", "amex"]}
|
||||||
|
>
|
||||||
|
<Select showSearch>
|
||||||
|
{bodyshop.md_payment_types.map((item, idx) => (
|
||||||
|
<Select.Option key={idx} value={item}>
|
||||||
|
{item}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.intellipay_config.payment_map.disc")}
|
||||||
|
name={["intellipay_config", "payment_map", "disc"]}
|
||||||
|
>
|
||||||
|
<Select showSearch>
|
||||||
|
{bodyshop.md_payment_types.map((item, idx) => (
|
||||||
|
<Select.Option key={idx} value={item}>
|
||||||
|
{item}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.intellipay_config.payment_map.dnrs")}
|
||||||
|
name={["intellipay_config", "payment_map", "dnrs"]}
|
||||||
|
>
|
||||||
|
<Select showSearch>
|
||||||
|
{bodyshop.md_payment_types.map((item, idx) => (
|
||||||
|
<Select.Option key={idx} value={item}>
|
||||||
|
{item}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.intellipay_config.payment_map.jcb")}
|
||||||
|
name={["intellipay_config", "payment_map", "jcb"]}
|
||||||
|
>
|
||||||
|
<Select showSearch>
|
||||||
|
{bodyshop.md_payment_types.map((item, idx) => (
|
||||||
|
<Select.Option key={idx} value={item}>
|
||||||
|
{item}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.intellipay_config.payment_map.intr")}
|
||||||
|
name={["intellipay_config", "payment_map", "intr"]}
|
||||||
|
>
|
||||||
|
<Select showSearch>
|
||||||
|
{bodyshop.md_payment_types.map((item, idx) => (
|
||||||
|
<Select.Option key={idx} value={item}>
|
||||||
|
{item}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -334,7 +334,17 @@
|
|||||||
},
|
},
|
||||||
"intellipay_config": {
|
"intellipay_config": {
|
||||||
"cash_discount_percentage": "Cash Discount %",
|
"cash_discount_percentage": "Cash Discount %",
|
||||||
"enable_cash_discount": "Enable Cash Discounting"
|
"enable_cash_discount": "Enable Cash Discounting",
|
||||||
|
"payment_type": "Payment Type Map",
|
||||||
|
"payment_map": {
|
||||||
|
"amex": "American Express",
|
||||||
|
"disc": "Discover",
|
||||||
|
"dnrs": "Diners",
|
||||||
|
"intr": "Interac",
|
||||||
|
"jcb": "JCB",
|
||||||
|
"mast": "MasterCard",
|
||||||
|
"visa": "Visa"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"invoice_federal_tax_rate": "Invoices - Federal Tax Rate",
|
"invoice_federal_tax_rate": "Invoices - Federal Tax Rate",
|
||||||
"invoice_local_tax_rate": "Invoices - Local Tax Rate",
|
"invoice_local_tax_rate": "Invoices - Local Tax Rate",
|
||||||
|
|||||||
@@ -334,7 +334,17 @@
|
|||||||
},
|
},
|
||||||
"intellipay_config": {
|
"intellipay_config": {
|
||||||
"cash_discount_percentage": "",
|
"cash_discount_percentage": "",
|
||||||
"enable_cash_discount": ""
|
"enable_cash_discount": "",
|
||||||
|
"payment_type": "",
|
||||||
|
"payment_map": {
|
||||||
|
"amex": "American Express",
|
||||||
|
"disc": "Discover",
|
||||||
|
"dnrs": "Diners",
|
||||||
|
"intr": "Interac",
|
||||||
|
"jcb": "JCB",
|
||||||
|
"mast": "MasterCard",
|
||||||
|
"visa": "Visa"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"invoice_federal_tax_rate": "",
|
"invoice_federal_tax_rate": "",
|
||||||
"invoice_local_tax_rate": "",
|
"invoice_local_tax_rate": "",
|
||||||
|
|||||||
@@ -334,7 +334,17 @@
|
|||||||
},
|
},
|
||||||
"intellipay_config": {
|
"intellipay_config": {
|
||||||
"cash_discount_percentage": "",
|
"cash_discount_percentage": "",
|
||||||
"enable_cash_discount": ""
|
"enable_cash_discount": "",
|
||||||
|
"payment_type": "",
|
||||||
|
"payment_map": {
|
||||||
|
"amex": "American Express",
|
||||||
|
"disc": "Discover",
|
||||||
|
"dnrs": "Diners",
|
||||||
|
"intr": "Interac",
|
||||||
|
"jcb": "JCB",
|
||||||
|
"mast": "MasterCard",
|
||||||
|
"visa": "Visa"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"invoice_federal_tax_rate": "",
|
"invoice_federal_tax_rate": "",
|
||||||
"invoice_local_tax_rate": "",
|
"invoice_local_tax_rate": "",
|
||||||
|
|||||||
@@ -371,6 +371,7 @@ exports.postback = async (req, res) => {
|
|||||||
iprequest: values,
|
iprequest: values,
|
||||||
decodedComment
|
decodedComment
|
||||||
};
|
};
|
||||||
|
const ipMapping = req.body?.bodyshop?.intellipay_config?.payment_map;
|
||||||
|
|
||||||
logger.log("intellipay-postback-received", "DEBUG", req.user?.email, null, logResponseMeta);
|
logger.log("intellipay-postback-received", "DEBUG", req.user?.email, null, logResponseMeta);
|
||||||
|
|
||||||
@@ -417,7 +418,7 @@ exports.postback = async (req, res) => {
|
|||||||
amount: p.amount,
|
amount: p.amount,
|
||||||
transactionid: values.authcode,
|
transactionid: values.authcode,
|
||||||
payer: "Customer",
|
payer: "Customer",
|
||||||
type: values.cardtype,
|
type: ipMapping[(values.cardtype || "").toLowerCase()] || values.cardtype,
|
||||||
jobid: p.jobid,
|
jobid: p.jobid,
|
||||||
date: moment(Date.now()),
|
date: moment(Date.now()),
|
||||||
payment_responses: {
|
payment_responses: {
|
||||||
@@ -481,7 +482,7 @@ exports.postback = async (req, res) => {
|
|||||||
amount: values.total,
|
amount: values.total,
|
||||||
transactionid: values.authcode,
|
transactionid: values.authcode,
|
||||||
payer: "Customer",
|
payer: "Customer",
|
||||||
type: values.cardtype,
|
type: ipMapping[(values.cardtype || "").toLowerCase()] || values.cardtype,
|
||||||
jobid: values.invoice,
|
jobid: values.invoice,
|
||||||
date: moment(Date.now())
|
date: moment(Date.now())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user