Question


Tata Consultancy Services
GB
Last activity: 16 Jun 2016 3:22 EDT
Semafone Integration
Hi, We have to integrate our Pega Application to Semafone for our credit card payment, which allows the customer to enter their card details securely. We have to make a call to the Semafone url with some input parameters like customer reference, amount etc along with a transaction reference, when the control will be passed on to Semafone. All the processing will be done at Semafone. And at the end Semafone will write the response, either success or failure in to a web page that we have to intercept in pega to continue with our processing.
I need help in implementing the solution. Many thanks.
Message was edited by: Lochan to add Category
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution


Tata Consultancy Services
GB
The solution is here:
We have not used any OOTB Pega connector rules. As I mentioned in the previous post, the three js files are stored as binary files in Pega. And the HTML, as in above post, is in a section rules. The HTML is modified to add the below to pass on parameters from Pega app to the semafone app. pyTempDataPage is a clipboard page where I populated all the below parameter values.
semafoneConfig.baseUrl = "<pega:reference name="pyTempDataPage.baseUrl" mode="normal" />";
semafoneConfig.clientReference = "<pega:reference name="pyTempDataPage.clientReference" mode="normal" />";
semafoneConfig.tenantId = "<pega:reference name="pyTempDataPage.tenantId" mode="normal" />";
semafoneConfig.clientId = "<pega:reference name="pyTempDataPage.clientId" mode="normal" />";
semafoneConfig.accountId = "<pega:reference name="pyTempDataPage.accountId" mode="normal" />";
semafoneConfig.principle = "<pega:reference name="pyTempDataPage.principle" mode="normal" />";
semafoneConfig.licenseCode = "<pega:reference name="pyTempDataPage.licenseCode" mode="normal" />";
semafoneConfig.responseType = "<pega:reference name="pyTempDataPage.responseType" mode="normal" />";
semafoneConfig.transactionType = "<pega:reference name="pyTempDataPage.transactionType" mode="normal" />";
semafoneConfig.responseUrl = "<pega:reference name="pyTempDataPage.responseUrl" mode="normal" />";
The solution is here:
We have not used any OOTB Pega connector rules. As I mentioned in the previous post, the three js files are stored as binary files in Pega. And the HTML, as in above post, is in a section rules. The HTML is modified to add the below to pass on parameters from Pega app to the semafone app. pyTempDataPage is a clipboard page where I populated all the below parameter values.
semafoneConfig.baseUrl = "<pega:reference name="pyTempDataPage.baseUrl" mode="normal" />";
semafoneConfig.clientReference = "<pega:reference name="pyTempDataPage.clientReference" mode="normal" />";
semafoneConfig.tenantId = "<pega:reference name="pyTempDataPage.tenantId" mode="normal" />";
semafoneConfig.clientId = "<pega:reference name="pyTempDataPage.clientId" mode="normal" />";
semafoneConfig.accountId = "<pega:reference name="pyTempDataPage.accountId" mode="normal" />";
semafoneConfig.principle = "<pega:reference name="pyTempDataPage.principle" mode="normal" />";
semafoneConfig.licenseCode = "<pega:reference name="pyTempDataPage.licenseCode" mode="normal" />";
semafoneConfig.responseType = "<pega:reference name="pyTempDataPage.responseType" mode="normal" />";
semafoneConfig.transactionType = "<pega:reference name="pyTempDataPage.transactionType" mode="normal" />";
semafoneConfig.responseUrl = "<pega:reference name="pyTempDataPage.responseUrl" mode="normal" />";
semafoneConfig.transactionReference= "<pega:reference name="pyTempDataPage.transactionRef" mode="normal" />";
semafoneConfig.amount = "<pega:reference name="pyTempDataPage.Amount" mode="normal" />";
semafoneConfig.cardHolderName = "<pega:reference name="pyTempDataPage.cardHolderName" mode="normal" />";
semafoneConfig.currency = "<pega:reference name="pyTempDataPage.currency" mode="normal" />";
semafoneConfig.continuousTransaction = "<pega:reference name="pyTempDataPage.continuousTransaction" mode="normal" />";
semafoneConfig.addressLine1 = "<pega:reference name="pyTempDataPage.addressLine1" mode="normal" />";
semafoneConfig.postCode = "<pega:reference name="pyTempDataPage.PostCode" mode="normal" />";
semafoneConfig.digest = "<pega:reference name="pyTempDataPage.digest" mode="normal" />";
semafoneConfig.semafoneMode = "<pega:reference name="pyTempDataPage.semafoneMode" mode="normal" />";
semafoneConfig.ppResponse = "<pega:reference name="pyTempDataPage.ppResponse" mode="normal" />";
semafoneConfig.gatewayId = "<pega:reference name="pyTempDataPage.gatewayId" mode="normal" />";
semafoneConfig.methodId = "<pega:reference name="pyTempDataPage.methodId" mode="normal" />";
semafoneConfig.captureMethod = "<pega:reference name="pyTempDataPage.captureMethod" mode="normal" />";
semafoneConfig.avsPolicy = "<pega:reference name="pyTempDataPage.avsPolicy" mode="normal" />";
In Semafone.js we have added the below when we get the response back from semafone to pass the response parameters back to pega and a pega activity SemafoneResponse takes over control and does the further processing.
if ((transactionCachedData.status - 0) === 1) { | ||||
/*Do this if we get a successful response from Datacash*/ | ||||
var oSafeURL = new SafeURL("Grp-Data-Fin-PaymentAccount-Card.SemafoneResponse"); | ||||
oSafeURL.put("semafoneCR", transactionCachedData.semafoneCR); | ||||
oSafeURL.put("maskedPAN", transactionCachedData.maskedPAN); | ||||
oSafeURL.put("expiryDate", transactionCachedData.expiryDate); | ||||
oSafeURL.put("status", transactionCachedData.status); | ||||
oSafeURL.put("authCode", transactionCachedData.authCode); | ||||
oSafeURL.put("cardType", transactionCachedData.cardType); | ||||
oSafeURL.put("country", transactionCachedData.country); | ||||
oSafeURL.put("contAuthRef", transactionCachedData.contAuthRef); | ||||
oSafeURL.put("datacashRef", transactionCachedData.datacashRef); | ||||
oSafeURL.put("mode", transactionCachedData.mode); | ||||
oSafeURL.put("reason", transactionCachedData.reason); | ||||
oSafeURL.put("epochTime", transactionCachedData.epochTime); | ||||
oSafeURL.put("token", transactionCachedData.token); | ||||
oSafeURL.put("policy", transactionCachedData.policy); | ||||
oSafeURL.put("sessionKey", transactionCachedData.sessionKey); | ||||
var strReturn = httpRequestAsynch(oSafeURL.toURL(),null, 50, 100); |
Thanks for looking at it.


PEG
IN
You could use PRPC as connector to connect to semafone. Based on the type of data semafone accepts you could use one of the PRPC provided connector.
https://community.pega.com/sites/default/files/help_v72/procomhelpmain.htm


PEG
IN
I would suggest you to use Connect-REST rather than Connect-HTTP.


Tata Consultancy Services
GB
I am not successful to do a POC for this yet. Please help if you can. Further details below:
I have a HTML that I have put in to a Section in a flow action.
<!DOCTYPE html>
<html>
<head>
<script>
document.domain = "hgb.hs.int";
</script>
<title>Card Payment Screen</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.ba-postmessage.min.js"></script>
<script type="text/javascript" src="semafone.js"></script>
<script>
$(function() {
// Launch Semafone!
launchSemafoneCapturePage($("#semafoneCapturePage").prop('id'));
});
</script>
</head>
<body>
<div id="content">
<div id="semafoneCapturePage"></div>
</div>
</body>
</html>
The three .js files are saved in pega as binary rules. When I run the flow action, I can see the above html executes and further executes the three .js files. that's ok. Now the last .js file semafone.js has a parameter that need to be passed on, that contain variable info related to the transaction like card no, amt etc. and it goes like a url basically, which is as below:
I am not successful to do a POC for this yet. Please help if you can. Further details below:
I have a HTML that I have put in to a Section in a flow action.
<!DOCTYPE html>
<html>
<head>
<script>
document.domain = "hgb.hs.int";
</script>
<title>Card Payment Screen</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.ba-postmessage.min.js"></script>
<script type="text/javascript" src="semafone.js"></script>
<script>
$(function() {
// Launch Semafone!
launchSemafoneCapturePage($("#semafoneCapturePage").prop('id'));
});
</script>
</head>
<body>
<div id="content">
<div id="semafoneCapturePage"></div>
</div>
</body>
</html>
The three .js files are saved in pega as binary rules. When I run the flow action, I can see the above html executes and further executes the three .js files. that's ok. Now the last .js file semafone.js has a parameter that need to be passed on, that contain variable info related to the transaction like card no, amt etc. and it goes like a url basically, which is as below:
http://devapps.hgb.hs.int:8080/tds/WebProjects/eServeSemafone/loadSemafoneIFrame.html?
ne.hgb.hs.int/semafone/service/capture/getSemafoneHomeServeResultsFragment.html&semafoneMode=MANUAL_CR&ppResponse=true&tenantId=HOMESER
VE&clientId=1&accountId=964852&principle=HSNPA&licenseCode=8rZaf0Az4aJnSs&securityKey=1qvlle1myd&avsPolicy=3&captureMethod=cnp&getDiges
tURL=http://devapps.hgb.hs.int:8888/Digest/GenerateDigest&transactionRef=ESV-DEV-HSS-
1234567&continuousTransaction=true&amount=23.42&address1=15%20Mount%20Rushmore&postcode=WS2%208BN¤cy=GBP&cardHolderName=Mr%20T
%20Spottswoode&gatewayId=DataCash--1.0&methodId=DataCash--1.0--Authorise&responseType=web&clientReference=5dfbaa3f-e04e-4e90-bf69-
7991f4f5f392&transactionType=GetTokenPanSecurityCode&sessionKey=jagshimesh
What I now can do to pass this url to the HTML code. I'm not conversant with java. So need more explanations,
What I am trying is create a page with a property called URL and set this value as above and in the next step of the activity use Flow-New method to invoke a flow with only one flow action as above but unsuccessful so far.
Accepted Solution


Tata Consultancy Services
GB
The solution is here:
We have not used any OOTB Pega connector rules. As I mentioned in the previous post, the three js files are stored as binary files in Pega. And the HTML, as in above post, is in a section rules. The HTML is modified to add the below to pass on parameters from Pega app to the semafone app. pyTempDataPage is a clipboard page where I populated all the below parameter values.
semafoneConfig.baseUrl = "<pega:reference name="pyTempDataPage.baseUrl" mode="normal" />";
semafoneConfig.clientReference = "<pega:reference name="pyTempDataPage.clientReference" mode="normal" />";
semafoneConfig.tenantId = "<pega:reference name="pyTempDataPage.tenantId" mode="normal" />";
semafoneConfig.clientId = "<pega:reference name="pyTempDataPage.clientId" mode="normal" />";
semafoneConfig.accountId = "<pega:reference name="pyTempDataPage.accountId" mode="normal" />";
semafoneConfig.principle = "<pega:reference name="pyTempDataPage.principle" mode="normal" />";
semafoneConfig.licenseCode = "<pega:reference name="pyTempDataPage.licenseCode" mode="normal" />";
semafoneConfig.responseType = "<pega:reference name="pyTempDataPage.responseType" mode="normal" />";
semafoneConfig.transactionType = "<pega:reference name="pyTempDataPage.transactionType" mode="normal" />";
semafoneConfig.responseUrl = "<pega:reference name="pyTempDataPage.responseUrl" mode="normal" />";
The solution is here:
We have not used any OOTB Pega connector rules. As I mentioned in the previous post, the three js files are stored as binary files in Pega. And the HTML, as in above post, is in a section rules. The HTML is modified to add the below to pass on parameters from Pega app to the semafone app. pyTempDataPage is a clipboard page where I populated all the below parameter values.
semafoneConfig.baseUrl = "<pega:reference name="pyTempDataPage.baseUrl" mode="normal" />";
semafoneConfig.clientReference = "<pega:reference name="pyTempDataPage.clientReference" mode="normal" />";
semafoneConfig.tenantId = "<pega:reference name="pyTempDataPage.tenantId" mode="normal" />";
semafoneConfig.clientId = "<pega:reference name="pyTempDataPage.clientId" mode="normal" />";
semafoneConfig.accountId = "<pega:reference name="pyTempDataPage.accountId" mode="normal" />";
semafoneConfig.principle = "<pega:reference name="pyTempDataPage.principle" mode="normal" />";
semafoneConfig.licenseCode = "<pega:reference name="pyTempDataPage.licenseCode" mode="normal" />";
semafoneConfig.responseType = "<pega:reference name="pyTempDataPage.responseType" mode="normal" />";
semafoneConfig.transactionType = "<pega:reference name="pyTempDataPage.transactionType" mode="normal" />";
semafoneConfig.responseUrl = "<pega:reference name="pyTempDataPage.responseUrl" mode="normal" />";
semafoneConfig.transactionReference= "<pega:reference name="pyTempDataPage.transactionRef" mode="normal" />";
semafoneConfig.amount = "<pega:reference name="pyTempDataPage.Amount" mode="normal" />";
semafoneConfig.cardHolderName = "<pega:reference name="pyTempDataPage.cardHolderName" mode="normal" />";
semafoneConfig.currency = "<pega:reference name="pyTempDataPage.currency" mode="normal" />";
semafoneConfig.continuousTransaction = "<pega:reference name="pyTempDataPage.continuousTransaction" mode="normal" />";
semafoneConfig.addressLine1 = "<pega:reference name="pyTempDataPage.addressLine1" mode="normal" />";
semafoneConfig.postCode = "<pega:reference name="pyTempDataPage.PostCode" mode="normal" />";
semafoneConfig.digest = "<pega:reference name="pyTempDataPage.digest" mode="normal" />";
semafoneConfig.semafoneMode = "<pega:reference name="pyTempDataPage.semafoneMode" mode="normal" />";
semafoneConfig.ppResponse = "<pega:reference name="pyTempDataPage.ppResponse" mode="normal" />";
semafoneConfig.gatewayId = "<pega:reference name="pyTempDataPage.gatewayId" mode="normal" />";
semafoneConfig.methodId = "<pega:reference name="pyTempDataPage.methodId" mode="normal" />";
semafoneConfig.captureMethod = "<pega:reference name="pyTempDataPage.captureMethod" mode="normal" />";
semafoneConfig.avsPolicy = "<pega:reference name="pyTempDataPage.avsPolicy" mode="normal" />";
In Semafone.js we have added the below when we get the response back from semafone to pass the response parameters back to pega and a pega activity SemafoneResponse takes over control and does the further processing.
if ((transactionCachedData.status - 0) === 1) { | ||||
/*Do this if we get a successful response from Datacash*/ | ||||
var oSafeURL = new SafeURL("Grp-Data-Fin-PaymentAccount-Card.SemafoneResponse"); | ||||
oSafeURL.put("semafoneCR", transactionCachedData.semafoneCR); | ||||
oSafeURL.put("maskedPAN", transactionCachedData.maskedPAN); | ||||
oSafeURL.put("expiryDate", transactionCachedData.expiryDate); | ||||
oSafeURL.put("status", transactionCachedData.status); | ||||
oSafeURL.put("authCode", transactionCachedData.authCode); | ||||
oSafeURL.put("cardType", transactionCachedData.cardType); | ||||
oSafeURL.put("country", transactionCachedData.country); | ||||
oSafeURL.put("contAuthRef", transactionCachedData.contAuthRef); | ||||
oSafeURL.put("datacashRef", transactionCachedData.datacashRef); | ||||
oSafeURL.put("mode", transactionCachedData.mode); | ||||
oSafeURL.put("reason", transactionCachedData.reason); | ||||
oSafeURL.put("epochTime", transactionCachedData.epochTime); | ||||
oSafeURL.put("token", transactionCachedData.token); | ||||
oSafeURL.put("policy", transactionCachedData.policy); | ||||
oSafeURL.put("sessionKey", transactionCachedData.sessionKey); | ||||
var strReturn = httpRequestAsynch(oSafeURL.toURL(),null, 50, 100); |
Thanks for looking at it.