The objective of this solution is to run automated bank payment or refund transactions by credit card, transferring to CVP and using the PCI's security standards (Payment Card Industry).
Note: The CVP application for banking transactions is not included
This gadget is only a sample and is NOT guaranteed to be bug free and production quality.
The sample gadgets are meant to:
Support for the JavaScript library is provided on a "best effort" basis via DevNet. Like any custom deployment, it is the responsibility of the partner and/or customer to ensure that the customization works correctly and this includes ensuring that the Cisco Finesse JavaScript is properly integrated into 3rd party applications. Cisco reserves the right to make changes to the JavaScript code and corresponding API as part of the normal Cisco Finesse release cycle.
It is Cisco's intention to ensure JavaScript compatibility across versions as much as possible and Cisco will make every effort to clearly document any differences in the JavaScript across versions in the event that a backwards compatibility impacting change is made.
Cisco Systems, Inc.
http://www.cisco.com
http://developer.cisco.com/site/finesse
The Finesse JavaScript library requires a deployment that includes Cisco Finesse. If you do not have a system that includes Cisco Finesse, you can reserve a DevNet sandbox for developing your gadget.
Documentation for the Finesse REST API can be found in the Finesse Developer Guide.
Documentation for the Finesse JavaScript library can be found on DevNet and is also located on the Finesse server at the following URL: http(s)://<FQDN>:<port>/desktop/assets/js/doc/index.html
If you have third-party gadgets loaded on Finesse, the third-party gadgets can access the JavaScript library at: /desktop/assets/js/finesse.js.
If you have third-party gadgets loaded on Finesse, the third-party gadgets can access JQuery at: /desktop/assets/js/jquery.min.js.
For proper functioning of the JavaScript library, you must import both the JavaScript library and JQuery.
In the screenshot below, the architecture of the project is shown.
The architecture diagram shows all the components that participate in the solution. The functionality of each element is described below.
The repository has two projects:
The Bridge is developed in C # language and uses the HttpListener class. The class belonging to the System.Net library, which allows you to emulate an IIS Web site. The specifications with development dependencies are listed below.
The content of the solution is shown below, and notable files are marked in red.
The project can be configured according to the requirements of the client, and this configuration is found in the files:
App.config: This file contains all the settings the service requires to build it. There are 4 configuration parameters for the Bridge application that need to look after:
Log4net.config: Contains the configuration of the logging library.
Note: To use the service in debug mode, you need to run VS 2015 as administrator.
The Gadget, designed for Finesse v11.5, is a component that is embedded in the Cisco Finesse interface, which main task is to take the bridge data, store it in the call variables and transfer the call to the IVR to complete the transaction.
The gadget project contains the following files:
Below is a screenshot of the GUI within Finesse
The GUI shown is conditional on the number of parameters.
HTML Test interface:
<body> <fieldset id="fsSales"> <table> <tr> <td>No. Orden:</td> <td><input id="nOrden" /></td> </tr> <tr> <td>Banco:</td> <td><input id="cBanco" /></td> </tr> <tr> <td>Monto:</td> <td><input id="nMonto" /></td> </tr> <tr> <td>Armado:</td> <td><input id="bArmado" type="checkbox" checked="checked" /></td> </tr> <tr> <td>Locación:</td> <td><input id="nLocation" /></td> </tr> <tr> <td>Parametro Cybersource:</td> <td><input id="cCyberS" /></td> </tr> <tr> <td><input value="Send Sale" type="button" onclick="sendSale();" /></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> </tr> </table> </fieldset> <fieldset id="fsDevs"> <table> <tr> <td>No. Orden:</td> <td><input id="nOrdenD" /></td> </tr> <tr> <td>Tarjeta truncada:</td> <td><input id="cCard" /></td> </tr> <tr> <td>Monto:</td> <td><input id="nMontoD" /></td> </tr> <tr> <td><input value="Send Refund" type="button" onclick="sendRefund();" /></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> </tr> </table> </fieldset> <body>
And the Javascript code behind sendSale and sendRefund look's like:
function sendSale() { var bArm = document.getElementById("bArmado"); var dataClient = { "arm":bArm.checked, "nor":$("#nOrden").val(), "bnc":$("#cBanco").val(), "mnt": $("#nMonto").val(), "loc": $("#nLocation").val(), "pcs": $("#cCyberS").val() } console.log(JSON.stringify(dataClient)); $.ajax({ url: "http://127.0.0.1:8880/pci_bridge/sls/", type: "POST", data: JSON.stringify(dataClient), success: handleResponseSuccess,//Your function error: handleResponseError//Your function }); } function sendRefund() { var bArm = document.getElementById("bArmado"); var dataClient = { "nor": $("#nOrdenD").val(), "tct": $("#cCard").val(), "mnt": $("#nMontoD").val() } console.log(JSON.stringify(dataClient)); $.ajax({ url: "http://127.0.0.1:8880/pci_bridge/dvl/", type: "POST", data: JSON.stringify(dataClient), success: handleResponseSuccess, error: handleResponseError }); }
Finally, the notification for local test that should come from the IVR should have the following format:
function Notify() { var dataClient = { "nor": "738389", "tct": "4765********9031", "mnt": 83773.23, "mne": "SUCCESS", "fec": "20191030", "nau": "5578765443", "pro": "3msi", "hor": "12:20:35" } console.log(JSON.stringify(dataClient)); $.ajax({ url: "http://127.0.0.1:8880/pci_bridge/ivr/", type: "POST", data: JSON.stringify(dataClient), success: handleResponseSuccess, error: handleResponseError }); }
Enjoy.
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community