PayFabric for Sage Intacct Installation Guide

Guide for installing PayFabric into your Sage Intacct environment

Prerequisites

  • Platform Services
  • User must be a user with system administrator permissions
  • Ability to install from XML (user must be a user with system administrator permissions.)

 

Add ajax to web services authorizations

The Sender ID ajax must be added to web services authorizations for the PayFabric application to work.

  1. Go to Company > Setup > Company > Security Tab
  2. Edit page
  3. Scroll down to the web services authorizations section
  4. Click on Add
  5. And the Sender ID = ajax
  6. Save the Change. 

 

Install XML package

  1. Login to Intacct as user satisfying the precondition
  2. Navigate to Platform Services > Platform tools > Applications
  3. Under ‘Custom Applications’, click the ‘Install from XML’ option
  4. Click ‘Choose File’
  5. Use the file explorer to locate the solution file

    After the solution has been loaded, click the install button.

  6. Should display a ‘Loading…’ icon on the top of page
  7. Wait for the install to complete
  8. Verify that there were no errors during the install process.
  9. Refresh Page to verify PayFabric has been added into the applications menu.

 

 

Add PayFabric functionality to receive a Payment Page

  1. Login to Intacct as user satisfying the precondition
  2. Navigate to Accounts Receivable > Receive payments - New!
  3. Click the ‘Add’ button on this page
  4. Subsequently, click More Actions > Edit this page 
  5. Under Available components, drag the Lookup Transaction onto the page.
  6. Under create, drag a new < Script Component > below the lookup
  7. Click the Edit button for the script component
  8. Add the below content 

 

Receive a Payment Page custom code:

<link rel="stylesheet" type="text/css" href="../resources/thirdparty/yui/css/button.css" />

<link rel="stylesheet" type="text/css" href="../resources/thirdparty/yui/css/container.css" />

<link rel="stylesheet" type="text/css" href="../resources/thirdparty/yui/css/resize.css" />

<link rel="stylesheet" type="text/css" href="../resources/thirdparty/yui/css/skin.css" />

<div class="btn-group">

    <button id="PF_process_button_dropdown" class="btn btn-primary btn-menu dropdown-toggle" data-toggle="dropdown" disabled>

        PayFabric

        <i class="fa fa-angle-down"></i>

    </button>

    <ul class="dropdown-menu">

        <li>

            <a href="javascript:void(0);" id="Sale">Sale</a>

        </li>

    </ul>

</div>

<script type="text/javascript" src="../resources/js/platform/pt_dialog.js"></script>

<script type="text/javascript" src="../resources/js/platform/pt_listView.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/yahoo-dom-event.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/animation.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/dragdrop.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/utilities.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/button.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/container.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/resize.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/logger.js"></script>

<script>

    var PFTransactionType;

    var PFFullCustomer;

    var PFCustomerNumber;

    var PFAmount;

    var PFCurrency;

    var PFTransactionResult;

    var PFAlreadyPaidAmount = 0.0;

    const formatter = new Intl.NumberFormat("en-US", { minimumFractionDigits: 2 });

    jq(document).ready(function () {

        jq("#pageContent .qx-page-header .navbar-right .btn-toolbar").prepend(jq("#PF_process_button_dropdown").parent());

        jq("#rbi_L_RPF_transaction").closest(".qx-tab").hide();

        jq("#PF_process_button_dropdown + ul li a").click(function () {

            PFTransactionType = jq(this).attr("id");

            PFFullCustomer = getValueOrText("#_obj__CUSTOMERID");

            PFCustomerNumber = PFFullCustomer.substring(0, PFFullCustomer.indexOf("--"));

            PFAmount = jq("#_obj__TRX_AMOUNTTOPAY").val();

            PFCurrency = PFCurrency == null || PFCurrency == "" ? getValueOrText("#_obj__FINANCIALACCOUNTCURRENCY") : PFCurrency;

            openTransactionProcess();

        });

        if (jq("#_obj__CUSTOMERID").is("input")) {

            if (getValueOrText("#_obj__CUSTOMERID") !== "") {

                jq("#PF_process_button_dropdown").prop("disabled", false);

            }

            trackPageChange(jq("#paymentInfoSection_li_0")[0]);

            trackPageChange(jq("#paymentInfoSection_li_1")[0]);

            trackPageChange(jq("#paymentInfoSection_li_2")[0]);

        } else {

            jq("#PF_process_button_dropdown").prop("disabled", false);

        }

    });

 

    function getTransactions() {

        var trxs = jq("#_obj__RPF_TRANSACTION").val().split(",");

        if (trxs != null && trxs.length > 0) {

            var api = new API_Session();

            var sageCallback = function (responseText) {

                var responseJson = JSON.parse(responseText);

                if (PFTransactionResult != null) {

                    jq("#rbe_yuiDialog").css("width", "");

                    jq("#rbe_yuiDialog").css("height", "");

                    jq("#rbe_yuiDialog .bd").css("height", "");

                    jq("#rbe_yuiDialog_mask").css("display", "block");

                    rbf_showInfoDialog2("PayFabric Transaction Result", PFTransactionResult, 200, 300);

                    editor.data.view.DOCNUMBER = responseJson[0].name;

                    PFTransactionResult = null;

                }

            };

            api.ip_readByQuery(

                "PF_transaction",

                "PF_transaction_amount, PF_transaction_type, PF_transaction_state, RPF_gateway, PF_walletid, PF_account_number, PF_credit_card_type, RLOCATIONENTITY, name, id",

                "PF_transaction_status = 'Approved' and ID in (" + trxs + ")",

                100,

                "json",

                sageCallback

            );

        }

    }

 

    MutationObserver = window.MutationObserver || window.WebKitMutationObserver;

    function trackChange(element) {

        var observer = new MutationObserver(function (mutations, observer) {

            if (mutations[0].attributeName == "value") {

                jq(element).trigger("change");

            }

        });

        observer.observe(element, {

            attributes: true,

        });

    }

    var hasCustomer = false;

    var hasAmount = false;

    function trackPageChange(element) {

        var observer = new MutationObserver(function (mutations, observer) {

            jq("#_obj__CUSTOMERID").on("change", function () {

                var customer = jq(this).val();

                hasCustomer = customer != "" && customer != null;

                var amount = jq("#_obj__TRX_AMOUNTTOPAY").val();

                hasAmount = amount != "" && amount != null;

                jq("#PF_process_button_dropdown").prop("disabled", !(hasCustomer && hasAmount));

            });

            jq("#_obj__TRX_AMOUNTTOPAY").on("change", function () {

                var amount = jq(this).val();

                hasAmount = amount != "" && amount != null;

                var customer = jq("#_obj__CUSTOMERID").val();

                hasCustomer = customer != "" && customer != null;

                jq("#PF_process_button_dropdown").prop("disabled", !(hasCustomer && hasAmount));

            });

            if ((PFCurrency == "" || PFCurrency == null) && jq("#_obj__FINANCIALACCOUNTCURRENCY").length === 0) {

                var api = new API_Session();

                var sageCallback = function (responseText) {

                    var responseJson = JSON.parse(responseText);

                    if (responseJson.length > 0) {

                        PFCurrency = responseJson[0].CODE;

                    }

                };

                api.ip_readByQuery("TRXCURRENCIES", "CODE", "", 1, "json", sageCallback);

            }

            jq("#rbi_L_RPF_transaction").closest(".qx-tab").hide();

            trackChange(jq("#_obj__RPF_TRANSACTION")[0]);

            jq("#_obj__RPF_TRANSACTION").on("change", getTransactions);

        });

        observer.observe(element, {

            childList: true,

            subtree: true,

        });

    }

 

    function openTransactionProcess() {

        if (jq("#rbi_F_RPF_transaction tr:first-child td:nth-child(3) a").length > 0) {

            jq("#rbi_F_RPF_transaction tr:first-child td:nth-child(3) a").click();

        } else {

            rbf_doQuickRelCreate("rbf_selectObject", "{!#OBJ_ID.PF_transaction!}", 13382, 10147, 0, "New Transaction", "{!#OBJ_ID.ARINVOICE!}", 1);

        }

    }

 

    function rbf_doQuickRelCreate(funcName, objDefId, pageId, fieldId, returnId, popupPrompt, objDefId2, objDef2IsStd) {

        if (objDef2IsStd) {

            // if !objDef2->isPlatform()

            stdEd = "&stdEditor=1";

        } else {

            stdEd = "";

        }

  1. Under the Script component info section, input any value into the Name field. Eg. PayFabric
  2. Click the save button on the popup
  3. Back on the main page editor form, click the save button.
  4. Verify that the PayFabric option is available in the top right.

 

 

Add PayFabric functionality to receive Advances Page

 

Precondition: Login user must be a user with system administrator permissions.

  1. Login to Intacct as user satisfying the precondition
  2. Navigate to Accounts Receivable > Advances
  3. Click the ‘Add’ button on this page
  4. Subsequently, click More Actions > Edit this page 
  5. Under create, drag a new < Script Component onto the page
  6. Click the Edit button for the script component

Add the below content 

<link rel="stylesheet" type="text/css" href="../resources/thirdparty/yui/css/button.css" />

<link rel="stylesheet" type="text/css" href="../resources/thirdparty/yui/css/container.css" />

<link rel="stylesheet" type="text/css" href="../resources/thirdparty/yui/css/resize.css" />

<link rel="stylesheet" type="text/css" href="../resources/thirdparty/yui/css/skin.css" />

<div class="btn-group">

    <button id="PF_process_button_dropdown" class="btn btn-primary btn-menu dropdown-toggle" data-toggle="dropdown" disabled>

        PayFabric

        <i class="fa fa-angle-down"></i>

    </button>

    <ul class="dropdown-menu">

        <li>

            <a href="javascript:void(0);" id="Sale">Sale</a>

        </li>

    </ul>

</div>

<tr style="display: none">

    <td class="rbs_rightLabelWide" id="rbi_L_RPF_transaction">Transactions&nbsp;</td>

    <td class="rbs_leftDataColWide" id="rbi_F_RPF_transaction">

        <table>

            <tbody>

                <tr>

                    <td nowrap="" style="border: 0px; background-color: inherit">

                        <table cellpadding="0">

                            <tbody>

                                <tr>

                                    <td id="rbs_selectorCell" style="border: 0px; background-color: inherit">

                                        <input

                                            type="text"

                                            class="form-control"

                                            size="20"

                                            tabindex="1"

                                            id="txt_obj__RPF_TRANSACTION"

                                            viewpageid="13383"

                                            onfocus="new AutoSuggestControl(this, 15010, 0);"

                                            fieldname="name"

                                            suggtype="rObj"

                                            isstandard="false"

                                            ismultiple="true"

                                            autocomplete="off"

                                        />

                                        <script type="text/javascript" src="../resources/js/platform/pt_selector.js"></script>

                                        <script type="text/javascript" src="../resources/js/platform/pt_relatedAutoSuggest.js"></script>

                                    </td>

                                </tr>

                                <tr>

                                    <td style="border: 0px; background-color: inherit">

                                        <table class="overflowitems">

                                            <tbody id="rtable__obj__RPF_TRANSACTION"></tbody>

                                        </table>

                                    </td>

                                </tr>

                            </tbody>

                        </table>

                        <input type="hidden" id="_obj__RPF_TRANSACTION" value="" name="_obj__RPF_TRANSACTION" />

                    </td>

                    <td class="top" nowrap="" style="background-color: inherit; border-width: 0px">

                        <a

                            href="#undefined"

                            onclick="window.open('pt_selector.phtml?.sess=' + window.sess + '&amp;.op=3801&amp;act=clean&amp;pageId=13385&amp;viewPageId=13383&amp;selectorViewId=0&amp;inputName=_obj__RPF_TRANSACTION&amp;multiSel=true', 'Selector', 'WIDTH=600, HEIGHT=400, RESIZABLE=YES, SCROLLBARS=YES, TOOLBAR=NO, LEFT=20, TOP=20').focus(); return false;"

                        >

                            <img src="../resources/images/platform/lookup.gif" alt="Lookup" width="16" height="16" border="0" align="absmiddle"

                        /></a>

                    </td>

                    <td class="top" nowrap="" style="background-color: inherit; border-width: 0px">

                        <a

                            href="#undefined"

                            onclick="return rbf_doQuickRelCreate('rbf_selectObject', '{!#OBJ_ID.PF_transaction!}', 13382, 10147, 0, 'New Transaction', '{!#OBJ_ID.ARADVANCE!}', 1)"

                            ><img src="../resources/images/platform/addicon.gif" alt="Add record" width="16" height="16" border="0" align="absmiddle"

                        /></a>

                    </td>

                </tr>

            </tbody>

        </table>

    </td>

</tr>

<script type="text/javascript" src="../resources/js/platform/pt_dialog.js"></script>

<script type="text/javascript" src="../resources/js/platform/pt_listView.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/yahoo-dom-event.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/animation.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/dragdrop.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/utilities.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/button.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/container.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/resize.js"></script>

<script type="text/javascript" src="../resources/thirdparty/yui/logger.js"></script>

<script>

    var PFTransactionType;

    var PFFullCustomer;

    var PFCustomerNumber;

    var PFAmount;

    var PFCurrency;

    var PFTransactionResult;

    var PFAlreadyPaidAmount = 0.0;

    const formatter = new Intl.NumberFormat("en-US", { minimumFractionDigits: 2 });

    jq(document).ready(function () {

        jq("#pageContent .qx-page-header .navbar-right .btn-toolbar").prepend(jq("#PF_process_button_dropdown").parent());

        jq("#rbi_L_RPF_transaction").closest(".qx-tab").hide();

        jq("#PF_process_button_dropdown + ul li a").click(function () {

            PFTransactionType = jq(this).attr("id");

            PFFullCustomer = getValueOrText("#_obj__CUSTOMERID");

            PFCustomerNumber = PFFullCustomer.substring(0, PFFullCustomer.indexOf("--"));

            PFAmount = jq("#tfooter__obj__ITEMS [id*='_obj__TRX_AMOUNT']").text();

            PFCurrency = PFCurrency == null || PFCurrency == "" ? getValueOrText("#_obj__FINANCIALACCOUNTCURRENCY") : PFCurrency;

            openTransactionProcess();

        });

        if (jq("#_obj__CUSTOMERID").is("input")) {

            if (getValueOrText("#_obj__CUSTOMERID") !== "") {

                jq("#PF_process_button_dropdown").prop("disabled", false);

            }

            jq("#_obj__CUSTOMERID").on("change", function () {

                var customer = jq(this).val();

                hasCustomer = customer != "" && customer != null;

                jq("#PF_process_button_dropdown").prop("disabled", !hasCustomer);

            });

        } else {

            jq("#PF_process_button_dropdown").prop("disabled", false);

        }

 

        if ((PFCurrency == "" || PFCurrency == null) && jq("#_obj__FINANCIALACCOUNTCURRENCY").length === 0) {

            var api = new API_Session();

            var sageCallback = function (responseText) {

                var responseJson = JSON.parse(responseText);

                if (responseJson.length > 0) {

                    PFCurrency = responseJson[0].CODE;

                }

            };

            api.ip_readByQuery("TRXCURRENCIES", "CODE", "", 1, "json", sageCallback);

        }

        jq("#rbi_L_RPF_transaction").closest(".qx-tab").hide();

        trackChange(jq("#_obj__RPF_TRANSACTION")[0]);

        jq("#_obj__RPF_TRANSACTION").on("change", getTransactions);

    });

 

    function getTransactions() {

        var trxs = jq("#_obj__RPF_TRANSACTION").val().split(",");

        if (trxs != null && trxs.length > 0) {

            var api = new API_Session();

            var sageCallback = function (responseText) {

                var responseJson = JSON.parse(responseText);

                if (PFTransactionResult != null) {

                    jq("#rbe_yuiDialog").css("width", "");

                    jq("#rbe_yuiDialog").css("height", "");

                    jq("#rbe_yuiDialog .bd").css("height", "");

                    jq("#rbe_yuiDialog_mask").css("display", "block");

                    rbf_showInfoDialog2("PayFabric Transaction Result", PFTransactionResult, 200, 300);

                    jq("#_obj__DOCNUMBER").val(responseJson[0].name + "-" + responseJson[0].id);

                    editor.data.view.DOCNUMBER = responseJson[0].name + "-" + responseJson[0].id;

                    PFTransactionResult = null;

                }

            };

            api.ip_readByQuery(

                "PF_transaction",

                "PF_transaction_amount, PF_transaction_type, PF_transaction_state, RPF_gateway, PF_walletid, PF_account_number, PF_credit_card_type, RLOCATIONENTITY, name, id",

                "PF_transaction_status = 'Approved' and ID in (" + trxs + ")",

                100,

                "json",

                sageCallback

            );

        }

    }

 

    MutationObserver = window.MutationObserver || window.WebKitMutationObserver;

    function trackChange(element) {

        var observer = new MutationObserver(function (mutations, observer) {

            if (mutations[0].attributeName == "value") {

                jq(element).trigger("change");

            }

        });

        observer.observe(element, {

            attributes: true,

        });

    }

 

    function openTransactionProcess() {

        if (jq("#rbi_F_RPF_transaction tr:first-child td:nth-child(3) a").length > 0) {

            jq("#rbi_F_RPF_transaction tr:first-child td:nth-child(3) a").click();

        } else {

            rbf_doQuickRelCreate("rbf_selectObject", "{!#OBJ_ID.PF_transaction!}", 13382, 10147, 0, "New Transaction", "{!#OBJ_ID.ARADVANCE!}", 1);

        }

    }

 

    function rbf_doQuickRelCreate(funcName, objDefId, pageId, fieldId, returnId, popupPrompt, objDefId2, objDef2IsStd) {

        if (objDef2IsStd) {

            // if !objDef2->isPlatform()

            stdEd = "&stdEditor=1";

        } else {

            stdEd = "";

        }

        var popupURL =

            rbf_getResourceURL("pt_objectQuickCreate.phtml?funcName=" + funcName) +

            "&objDefId=" +

            objDefId +

            "&pageId=" +

            pageId +

            "&fieldId=" +

            fieldId +

            stdEd;

        if (returnId > 0) popupURL += "&returnId=" + returnId;

        if (objDefId2 > 0) popupURL += "&objDefId2=" + objDefId2;

        rbf_showIframeDialog("PayFabric - " + PFTransactionType + " - " + PFFullCustomer, null, "650px", "655px", popupURL, null, true);

        jq("#rbe_yuiDialog_c").css("z-index", 4);

        jq("#rbe_yuiDialog_mask").css("z-index", 3).show();

        return false;

    }

 

    function getValueOrText(selector) {

        if (jq(selector).length > 0) {

            if (jq(selector).is("input")) {

                return jq(selector).val();

            } else {

                return jq(selector).text();

            }

        } else {

            return "";

        }

    }

</script>

 

  1. Open a new Sage Intacct tab and browse to the Account Receivables > Invoices
  2. Click on Add
  3. Place the mouse inside the PayFabric section at the bottom of the page
  4. Right click and select Inspect
  5. Expand each section until you see the highlighted sections

  1. Copy each highlighted section
  2. Back on the other browser tab that contains the Advances edit page, paste each highlighted section into the same respective section on the Advances page
  3. Under the Script component info section, input any value into the Name field. Eg. PayFabric
  4. Click the save button on the popup
  5. Back on the main page editor form, click the save button.
  6. Verify that the PayFabric option is available in the top right.

 

 

Roles

User needs to be assigned the following Roles to have access to PayFabric Processing inside of Sage Intacct.

::SYS::Enterprise-ROLE-FOR - Module: PayFabric

 

Permissions

User needs to be assigned the following permissions to have access to PayFabric inside of Sage Intacct.

  • For ability to process transaction inside of Sage Intacct, all objects and Menus under PayFabric permissions need to have all permission boxes selected , List, View, Ass, Edit, Delete, Menu.
  • If a User only requires Read only access, assign the View permission to all objects, and assign the menu permissions.