Skip to content

Commit 4b23f81

Browse files
Merge pull request #3 from Kount/develo-k360-sfra
Kount Command -> Kount 360 Payments Fraud Migration integration Merging on behalf of @htodor after having gotten approvals internally.
2 parents a98d8fb + 26d3fb0 commit 4b23f81

30 files changed

+1385
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dw.json
22
node_modules
33
.vscode/
4+
.DS_Store
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>int_kount_360_sfra</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.demandware.studio.core.beehiveElementBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>com.demandware.studio.core.beehiveNature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"ecmaVersion": 5,
3+
"plugins": {
4+
"guess-types": {
5+
6+
},
7+
"outline": {
8+
9+
},
10+
"demandware": {
11+
12+
}
13+
}
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"caches": [
3+
{
4+
"id": "Kount360",
5+
"expireAfterSeconds": 1140
6+
}
7+
]
8+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'use strict';
2+
3+
var server = require('server');
4+
var Logger = require('dw/system/Logger').getLogger('kount-360', 'webhooks');
5+
var kountWebhookValidator = require('*/cartridge/scripts/helpers/kountWebhookValidator');
6+
7+
server.post('Webhook', function (req, res, next) {
8+
var Site = require('dw/system/Site');
9+
10+
if (!Site.getCurrent().getCustomPreferenceValue('kount360WebhooksEnabled')) {
11+
res.json({ success: true });
12+
return next();
13+
}
14+
15+
var validationResult = kountWebhookValidator.validate(req);
16+
17+
if (!validationResult.valid) {
18+
Logger.error('Kount webhook validation failed: {0}', validationResult.error);
19+
res.setStatusCode(403);
20+
res.json({ error: true, message: 'Webhook validation failed: ' + validationResult.error });
21+
return next();
22+
}
23+
24+
require('*/cartridge/scripts/helpers/kount360Helpers').storeWebhookEvent(req.body);
25+
26+
res.json({ success: true });
27+
28+
return next();
29+
});
30+
31+
module.exports = server.exports();
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## cartridge.properties for cartridge int_kount_360_sfra
2+
#Thu Oct 18 15:43:33 EEST 2018
3+
demandware.cartridges.int_kount_360_sfra.multipleLanguageStorefront=true
4+
demandware.cartridges.int_kount_360_sfra.id=int_kount_360_sfra
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
module.exports = {
4+
kount360ReqMapping: require('*/cartridge/kount360mappings/kount360ReqMapping'),
5+
kount360ReqValueMapping: require('*/cartridge/kount360mappings/kount360ReqValueMapping'),
6+
kount360ResMapping: require('*/cartridge/kount360mappings/kount360ResMapping'),
7+
kount360ResValueMapping: require('*/cartridge/kount360mappings/kount360ResValueMapping'),
8+
kount360WebhookToENSMapping: require('*/cartridge/kount360mappings/kount360WebhookToENSMapping'),
9+
kount360WebhookToENSValueMapping: require('*/cartridge/kount360mappings/kount360WebhookToENSValueMapping')
10+
};
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"merchantOrderId": "ORDR",
3+
"channel": "SITE",
4+
"deviceSessionId": "SESS",
5+
"userIp": "IPAD",
6+
"account.id": "UNIQ",
7+
"account.creationDate": "EPOC",
8+
"account.type": "SITE",
9+
"items.[*].price": "PROD_PRICE",
10+
"items.[*].description": "PROD_DESC",
11+
"items.[*].quantity": "PROD_QUANT",
12+
"items.[*].category": "PROD_TYPE",
13+
"items.[*].sku": "PROD_ITEM",
14+
"fulfillment.[*].shipping.method": "SHTP",
15+
"fulfillment.[*].recipient.person.name.first": "S2NM",
16+
"fulfillment.[*].recipient.person.email": "S2EM",
17+
"fulfillment.[*].recipient.person.phoneNumber": "S2PN",
18+
"fulfillment.[*].recipient.person.address.line1": "S2A1",
19+
"fulfillment.[*].recipient.person.address.line2": "S2A2",
20+
"fulfillment.[*].recipient.person.address.city": "S2CI",
21+
"fulfillment.[*].recipient.person.address.region": "S2ST",
22+
"fulfillment.[*].recipient.person.address.countryCode": "S2CC",
23+
"fulfillment.[*].recipient.person.address.postalCode": "S2PC",
24+
"transactions.[*].payment.type": "PTYP",
25+
"transactions.[*].payment.paymentToken": "PTOK",
26+
"transactions.[*].payment.bin": "LBIN",
27+
"transactions.[*].payment.last4": "LAST4",
28+
"transactions.[*].orderTotal": "TOTL",
29+
"transactions.[*].currency": "CURR",
30+
"transactions.[*].billedPerson.name.first": "NAME",
31+
"transactions.[*].billedPerson.emailAddress": "S2EM",
32+
"transactions.[*].billedPerson.phoneNumber": "B2PN",
33+
"transactions.[*].billedPerson.address.line1": "B2A1",
34+
"transactions.[*].billedPerson.address.line2": "B2A2",
35+
"transactions.[*].billedPerson.address.city": "B2CI",
36+
"transactions.[*].billedPerson.address.region": "B2ST",
37+
"transactions.[*].billedPerson.address.postalCode": "B2PC",
38+
"transactions.[*].billedPerson.address.countryCode": "B2CC",
39+
"transactions.[*].billedPerson.authorizationStatus.authResult": "AUTH",
40+
"transactions.[*].billedPerson.authorizationStatus.verificationResponse.addressStatus": "AVST",
41+
"transactions.[*].billedPerson.authorizationStatus.verificationResponse.postalCodeStatus": "AVSZ",
42+
"transactions.[*].billedPerson.authorizationStatus.verificationResponse.cvvStatus": "CVVR"
43+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"SHTP": { "ST": "STANDARD", "2D": "EXPRESS" , "ND": "NEXT_DAY" , "PU": "STANDARD", "DE": "STANDARD"}
3+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"VERS": "version",
3+
"TRAN": "order.orderId",
4+
"ORDR": "order.merchantOrderId",
5+
"SITE": "order.channel",
6+
"SESS": "order.deviceSessionId",
7+
"AUTO": "order.riskInquiry.decision",
8+
"OMNISCORE": "order.riskInquiry.omniscore",
9+
"DEVICES": "order.riskInquiry.persona.uniqueDevices",
10+
"EMAILS": "order.riskInquiry.persona.uniqueEmails",
11+
"FINGERPRINT": "order.riskInquiry.device.id",
12+
"KAPT": "order.riskInquiry.device.id",
13+
"BROWSER": "order.riskInquiry.device.browser",
14+
"OS": "order.riskInquiry.device.deviceAttributes.os",
15+
"MOBILE_DEVICE": "order.riskInquiry.device.deviceAttributes.os",
16+
"MOBILE_TYPE": "order.riskInquiry.device.deviceAttributes.os",
17+
"DDFS": "order.riskInquiry.device.deviceAttributes.firstSeenDateTime",
18+
"LANGUAGE": "order.riskInquiry.device.deviceAttributes.language",
19+
"TIMEZONE": "order.riskInquiry.device.deviceAttributes.timezoneOffset",
20+
"COUNTRY": "order.riskInquiry.device.location.countryCode",
21+
"REGION": "order.riskInquiry.device.location.region",
22+
"RULES_TRIGGERED": "order.riskInquiry.segmentExecuted.policiesExecuted",
23+
"RULE_ID_X": "order.riskInquiry.segmentExecuted.policiesExecuted.id",
24+
"RULE_DESCRIPTION_X": "order.riskInquiry.segmentExecuted.policiesExecuted.name"
25+
}

0 commit comments

Comments
 (0)