Skip to content

Commit 632c4e5

Browse files
Merge pull request #32 from cybersource-tpi/checkmarx
Checkmarx
2 parents 1777b15 + 0a0699a commit 632c4e5

40 files changed

+171
-97
lines changed

Jenkinsfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ podTemplate(
109109
reportName : 'Code Coverage Reports'
110110
])
111111

112-
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: '[email protected]'])
112+
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: ''])
113113
notifySlack(this, "cybersource-jenkins", false)
114114
}
115115
}

Jenkinsfile.publish

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ podTemplate(
145145
currentBuild.result = 'FAILURE'
146146
throw any
147147
} finally {
148-
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: '[email protected]'])
148+
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: ''])
149149
notifySlack(this, "cybersource-jenkins", false)
150150
}
151151
}}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ISV OCC Payment
1+
# Cybersource Official
22

33
## Documentation
44

Binary file not shown.
-63.3 KB
Loading

documentation/images/merchantId.png

864 KB
Loading

documentation/installation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Once the module is installed, head back to the Oracle Commerce Cloud Admin to co
8686
After successful deployment you will need to enable payment gateway:
8787

8888
- Go to OCC Admin -> Settings -> Payment Processing
89-
- Open 'Payment gateways' tab and choose 'ISV OCC Gateway' from the list
89+
- Open 'Payment gateways' tab and choose 'Cybersource Official' from the list
9090
- Select 'Payment Gateway Enabled' option
9191
- Configure gateway settings by providing values (e.g. merchant credentials) for particular channel (Preview, Storefront, Agent)
9292
- Save Changes

documentation/occ.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# ISV OCC Payment Plugin
2+
# Cybersource Official Payment Plugin
33

44
## Oracle Commerce Cloud
55

@@ -23,7 +23,7 @@
2323

2424
## Audience and Purpose
2525

26-
This document is written for merchants who want to use Payment and Value added Business services. This document provides an overview for integrating ISV OCC payment services into Oracle Commerce Cloud platform.
26+
This document is written for merchants who want to use Payment and Value added Business services. This document provides an overview for integrating Cybersource Official payment services into Oracle Commerce Cloud platform.
2727

2828
## Conventions
2929

documentation/package-contents.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The `payment-gateway` package hold gateway settings definition according to [Sup
5656
.
5757
├── ext.json
5858
├── gateway
59-
│   └── isv-occ-gateway // name of the gateway
59+
│   └── isv-occ-gateway
6060
│   ├── config
6161
│   │   ├── config.json // configuration properties
6262
│   │   └── locales
@@ -69,7 +69,7 @@ The `gateway/isv-occ-gateway/gateway.json` file has the following definition:
6969

7070
```json
7171
{
72-
"provider": "ISV OCC Gateway",
72+
"provider": "Cybersource Official",
7373
"paymentMethodTypes": ["generic", "card"],
7474
"transactionTypes": {
7575
"generic": ["initiate", "retrieve", "authorization", "void", "refund"],

documentation/payment-services/credit-card.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
3. [Payer Authentication](#payer-authentication)
1010
1. [UI integration details](#ui-integration-details-1)
1111
2. [Backend (SSE) integration details](#backend-sse-integration-details-1)
12-
3. [Strong Customer Authentication (SCA)](#strong-customer-authentication-sca)
12+
3. [Decision Manager with Payer Authentication](#decision-manager-with-payer-authentication)
13+
4. [Strong Customer Authentication (SCA)](#strong-customer-authentication-sca)
1314
4. [Network Tokens](#network-tokenization)
1415
5. [Capturing funds during authorization (SALE)](#capturing-funds-during-authorization-sale)
1516

@@ -273,6 +274,10 @@ The following UI component contains Payer Authentication integration logic `plug
273274
- `server-extension/src/services/payments/converters/request/mappers/payerAuthEnrollMapper.ts` Including payer auth reference id into PSP card authorization request
274275
- `server-extension/src/services/payments/converters/request/mappers/payerAuthValidationMapper.ts` Including payer auth validation token into PSP card authorization request
275276

277+
#### Decision Manager with Payer Authentication
278+
You can use Decision Manager with payer authentication services to allow the risk of an order to determine when you need to invoke payer authentication.
279+
[Decision Manager with Payer Authentication](https://ebc.cybersource.com/content/ebc/docs/cybs/en-us/html/dm-develop/developer/all/so/oxy_ex-1/topics/c_Using_DM_With_Payer_Auth.html)
280+
276281
#### Strong Customer Authentication (SCA)
277282

278283
When `Payer Authentication` is enabled, if a transaction gets declined with the reason as Strong Customer Authentication required, then another request will be sent from Oracle Commerce Cloud automatically for the same order and the customer will be 3DS challenged.

documentation/support.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ If you require support with this software, please contact GlobalPartnerSolutions
55
- Steps to reproduce the issue
66
- Oracle Commerce Cloud Platform version: You can find Oracle Commerce Cloud Platform Version in Oracle Commerce Cloud Backoffice dashboard.
77
![Version](images/version.png)
8-
- Plugin/ Extension version: Under Settings->Extension, find the version of the installed ISV Payment Gateway extension.
8+
- Plugin/ Extension version: Under Settings->Extension, find the version of the installed Cybersource Official Payment Gateway extension.
99
![Extension Version](images/extension-version.png)
10-
- Cybersource Merchant ID: Under Settings->Payment Processing, Select the ISV OCC Payment from the Service Type dropdown, find the Merchant Id
10+
- Cybersource Merchant ID: Under Settings->Payment Processing, Select Cybersource Official from the Service Type dropdown, find the Merchant Id.
1111
![Merchant Id](images/merchantId.png)
1212
- Order ID/ Merchant Reference Number: Order ID can be found in Order Confirmation Page or under Order History.
13-
- Configuration screenshots: Please provide screenshots of ISV OCC Gateway Configurations.
13+
- Configuration screenshots: Please provide screenshots of Cybersource Official Configurations.
1414
- Log file and other relevant data: Download the **debug** and **error** logs from Oracle Commerce Cloud using getExtensionServerLogs admin endpoint.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "24.1.1",
44
"description": "ISV Oracle Commerce Cloud Payment Plugin",
55
"main": "index.js",
6-
"repository": "[email protected]:cybersource-tpi/cybersource-plugins-oraclecxcommerce.git",
6+
"repository": "[email protected]:CyberSource/cybersource-plugins-oraclecxcommerce.git",
77
"author": "ISV Payments",
88
"license": "MIT",
99
"private": true,

packages/applepay-payment-service/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "ApplePay SSE Payment Service",
55
"repository": {
66
"type": "git",
7-
"url": "[email protected]:cybersource-tpi/cybersource-plugins-oraclecxcommerce.git"
7+
"url": "[email protected]:CyberSource/cybersource-plugins-oraclecxcommerce.git"
88
},
99
"author": "ISV Payments",
1010
"main": "cjs/index.js",

packages/card-payment-service/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Card SSE Payment Service",
55
"repository": {
66
"type": "git",
7-
"url": "[email protected]:cybersource-tpi/cybersource-plugins-oraclecxcommerce.git"
7+
"url": "[email protected]:CyberSource/cybersource-plugins-oraclecxcommerce.git"
88
},
99
"author": "ISV Payments",
1010
"main": "cjs/index.js",

packages/generic-payment-service/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Generic SSE Payment Service",
55
"repository": {
66
"type": "git",
7-
"url": "[email protected]:cybersource-tpi/cybersource-plugins-oraclecxcommerce.git"
7+
"url": "[email protected]:CyberSource/cybersource-plugins-oraclecxcommerce.git"
88
},
99
"author": "ISV Payments",
1010
"main": "cjs/index.js",

packages/googlepay-payment-service/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "GooglePay SSE Payment Service",
55
"repository": {
66
"type": "git",
7-
"url": "[email protected]:cybersource-tpi/cybersource-plugins-oraclecxcommerce.git"
7+
"url": "[email protected]:CyberSource/cybersource-plugins-oraclecxcommerce.git"
88
},
99
"author": "ISV Payments",
1010
"main": "cjs/index.js",

packages/occ-mock-server/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "Mock OCC APIs",
66
"repository": {
77
"type": "git",
8-
"url": "[email protected]:cybersource-tpi/cybersource-plugins-oraclecxcommerce.git"
8+
"url": "[email protected]:CyberSource/cybersource-plugins-oraclecxcommerce.git"
99
},
1010
"author": "ISV Payments",
1111
"main": "cjs/server.js",

packages/occ-payment-factory/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "Oracle Commerce payment service factory",
66
"repository": {
77
"type": "git",
8-
"url": "[email protected]:cybersource-tpi/cybersource-plugins-oraclecxcommerce.git"
8+
"url": "[email protected]:CyberSource/cybersource-plugins-oraclecxcommerce.git"
99
},
1010
"author": "ISV Payments",
1111
"main": "cjs/indexPaymentFactory.js",

packages/occ-payment-service/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Oracle Commerce payment service",
55
"repository": {
66
"type": "git",
7-
"url": "[email protected]:cybersource-tpi/cybersource-plugins-oraclecxcommerce.git"
7+
"url": "[email protected]:CyberSource/cybersource-plugins-oraclecxcommerce.git"
88
},
99
"author": "ISV Payments",
1010
"main": "cjs/indexPaymentService.js",

packages/occ-sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "OCC SDK",
66
"repository": {
77
"type": "git",
8-
"url": "[email protected]:cybersource-tpi/cybersource-plugins-oraclecxcommerce.git"
8+
"url": "[email protected]:CyberSource/cybersource-plugins-oraclecxcommerce.git"
99
},
1010
"author": "ISV Payments",
1111
"main": "cjs/occSdk.js",

packages/occ-sse-gateway/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "Oracle Commerce SSE payment gateway",
66
"repository": {
77
"type": "git",
8-
"url": "[email protected]:cybersource-tpi/cybersource-plugins-oraclecxcommerce.git"
8+
"url": "[email protected]:CyberSource/cybersource-plugins-oraclecxcommerce.git"
99
},
1010
"author": "ISV Payments",
1111
"main": "cjs/indexGateway.js",

packages/payment-gateway/ext.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"extensionID": "",
33
"developerID": "999",
4-
"createdBy": "ISV Plugins",
4+
"createdBy": "Cybersource Official",
55
"name": "payment-gateway-24.1.1",
66
"version": 2411,
77
"timeCreated": "2024-04-04",
8-
"description": "ISV Payment Gateway"
9-
}
8+
"description": "Cybersource Official Payment Gateway"
9+
}

packages/payment-gateway/gateway/isv-occ-gateway/config/locales/en.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"resources": {
3-
"title": "ISV Payment Gateway",
4-
"description": "ISV Payment Gateway configuration",
3+
"title": "Cybersource Official",
4+
"description": "Cybersource Official configuration",
55
"agentInstanceLabel": "Agent Configuration",
66
"previewInstanceLabel": "Preview Configuration",
77
"storefrontInstanceLabel": "Storefront Configuration",

packages/payment-gateway/gateway/isv-occ-gateway/gateway.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"provider": "ISV OCC Gateway",
2+
"provider": "Cybersource Official",
33
"paymentMethodTypes": ["generic", "card"],
44
"transactionTypes": {
55
"generic": ["initiate", "retrieve", "authorization", "void", "refund"],

packages/payment-gateway/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@isv-occ-payment/payment-gateway",
33
"version": "24.1.1",
44
"private": true,
5-
"description": "ISV OCC Payment Gateway",
5+
"description": "Cybersource Official Payment Gateway",
66
"repository": "",
7-
"author": "ISV Plugins"
8-
}
7+
"author": "Cybersource Official"
8+
}

packages/payment-sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "Payment SDK",
66
"repository": {
77
"type": "git",
8-
"url": "[email protected]:cybersource-tpi/cybersource-plugins-oraclecxcommerce.git"
8+
"url": "[email protected]:CyberSource/cybersource-plugins-oraclecxcommerce.git"
99
},
1010
"author": "ISV Payments",
1111
"types": "index.d.ts",

packages/server-extension/docs/ISV OCC Payment SSE postman_collection.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"info": {
33
"_postman_id": "439b9e2b-4d72-4655-9ff5-b8fc7c28d9ec",
4-
"name": "ISV OCC Payment SSE Copy",
4+
"name": "ISV OCC Payment SSE",
55
"description": "This collection is included into SSE package which can be used for testing and exploring the endpoints.\n\nThe following collection variables should be updated prior its running:\n\nOCC_ENVIRONMENT\nAPP_KEY\napplePayInitiativeContext",
66
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
77
},

packages/server-extension/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "Payment Server Extension",
66
"repository": {
77
"type": "git",
8-
"url": "[email protected]:cybersource-tpi/cybersource-plugins-oraclecxcommerce.git"
8+
"url": "[email protected]:CyberSource/cybersource-plugins-oraclecxcommerce.git"
99
},
1010
"author": "ISV Payments",
1111
"main": "cjs/indexServerExtension.js",

packages/server-extension/src/controllers/payerAuth.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ router.post('/setup', asyncMiddleware(
1818
);
1919

2020
router.post('/returnUrl', (req: Request, res: Response) => {
21-
const transactionId = JSON.stringify(req.body?.TransactionId);
21+
const transactionValidationId = JSON.stringify(req.body?.TransactionId);
2222
res.send(`<script>
23-
window.parent.postMessage({
24-
'messageType':'transactionValidation',
25-
'message':'${transactionId}'
26-
},'*');
27-
</script>`);
23+
let transactionId = '${transactionValidationId}';
24+
let messageObj = { 'messageType':'transactionValidation', 'message': transactionId };
25+
window.parent.postMessage(messageObj, \'*\'); </script> `);
2826
});
2927

3028
export default router;

packages/server-extension/src/controllers/webhookRouter.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import { RequestContext, asyncMiddleware, maskRequestData } from '@server-extens
22
import { validateISVWebhook } from '@server-extension/middlewares/validateWebhook';
33
import occClientStorefront from '@server-extension/services/occ/occClientStorefront';
44
import makeRequest from '@server-extension/services/payments/api/paymentCommand';
5+
import { WEBHOOK_SUBSCRIPTION } from '@server-extension/services/payments/converters/request/common';
6+
import { getSavedNetworkTokenConfigurations } from '@server-extension/services/payments/converters/response/mappers';
57
import { InstrumentIdentifierApi, PostInstrumentIdentifierRequest } from 'cybersource-rest-client';
68
import { NextFunction, Request, Response, Router } from 'express';
7-
import nconf from 'nconf';
89
const { LogFactory } = require('@isv-occ-payment/occ-payment-factory');
910
const logger = LogFactory.logger();
1011
const router = Router();
@@ -14,12 +15,12 @@ router.get('/tokenUpdate', asyncMiddleware(async (req: Request, res: Response, n
1415
return res.status(200).send();
1516
}))
1617

17-
router.post('/tokenUpdate', validateISVWebhook, asyncMiddleware(async (req: Request, res: Response, next: NextFunction) => {
18+
router.post('/tokenUpdate', asyncMiddleware(validateISVWebhook), asyncMiddleware(async (req: Request, res: Response, next: NextFunction) => {
1819
try {
1920
const webhookRequestData: OCC.Notification = req.body;
2021
const requestContext: RequestContext = req.app.locals;
21-
const savedWebhookConfiguration = nconf.get("networkSubscriptionConfigurations") || [];
22-
if (requestContext.gatewaySettings?.networkTokenUpdates && "tms.networktoken.updated" === webhookRequestData?.eventType && webhookRequestData?.payload[0]?.data) {
22+
const savedWebhookConfiguration = await getSavedNetworkTokenConfigurations();
23+
if (requestContext.gatewaySettings?.networkTokenUpdates && WEBHOOK_SUBSCRIPTION.EVENT_TYPE === webhookRequestData?.eventType && webhookRequestData?.payload[0]?.data) {
2324
for (const payload of webhookRequestData.payload) {
2425
const isConfigurationMatch = savedWebhookConfiguration.find((configuration: any) => configuration.merchantId === payload.organizationId) || false;
2526
if (isConfigurationMatch) {
@@ -44,7 +45,7 @@ router.post('/tokenUpdate', validateISVWebhook, asyncMiddleware(async (req: Requ
4445
}
4546
}
4647
catch (error) {
47-
logger.debug("WebhookRouter tokenUpdate: " + error.message);
48+
logger.error("WebhookRouter tokenUpdate: " + error.message + `STACK TRACE: ${error.stack}`);
4849
res.status(404).send();
4950
};
5051
}
@@ -86,7 +87,7 @@ async function updateCardDetails(instrumentIdentifier: string, paymentInstrument
8687
}
8788
}
8889
catch (error) {
89-
logger.debug(("WebhookRouter tokenUpdate: " + error.message));
90+
logger.error(("WebhookRouter tokenUpdate: " + error.message + `STACK TRACE: ${error.stack}`));
9091
}
9192
}
9293

packages/server-extension/src/middlewares/errorHandler.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ export default function errorHandler(err: any, req: Request, res: Response, next
66
if (!err) {
77
if (next) {
88
return next();
9-
}
10-
9+
}
1110
return res.end();
1211
}
1312

packages/server-extension/src/middlewares/validateWebhook.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { NextFunction, Request, Response } from 'express';
22
import nconf from 'nconf';
33
import validateWebHookPayloadSignature from '../services/occ/webhookSignatureValidation';
44
import { LogFactory } from '@isv-occ-payment/occ-payment-factory';
5+
import { getSavedNetworkTokenConfigurations } from '@server-extension/services/payments/converters/response/mappers';
56

67
const SKIP_HOSTS = ['localhost', '127.0.0.1'];
78
const WEBHOOK_OCC_SIGNATURE_HEADER = 'x-oracle-cc-webhook-signature-sha512';
@@ -29,7 +30,7 @@ export default function validateOCCWebhook(req: Request, res: Response, next: Ne
2930
next();
3031
}
3132

32-
export function validateISVWebhook(req: Request, res: Response, next: NextFunction) {
33+
export async function validateISVWebhook(req: Request, res: Response, next: NextFunction) {
3334
const vCSignatureHeader = <string>req.headers[WEBHOOK_ISV_SIGNATURE_HEADER];
3435
logger.debug("ISV Webhook Signature: vcSignatureHeader: " + vCSignatureHeader)
3536
if (vCSignatureHeader) {
@@ -40,7 +41,7 @@ export function validateISVWebhook(req: Request, res: Response, next: NextFuncti
4041
if (!timestamp || !keyId || !signature) {
4142
throw new Error(`ISV Webhook Signature: missing timeStamp, keyId or signature : timeStamp: ${timestamp} keyId: ${keyId} signature: ${signature}`);
4243
}
43-
const webhookConfigurations: [] = nconf.get("networkSubscriptionConfigurations") || [];
44+
const webhookConfigurations = await getSavedNetworkTokenConfigurations();
4445
logger.debug('ISV Webhook Signature: Saved Configurations ' + JSON.stringify(webhookConfigurations));
4546
const { key } = webhookConfigurations.find((configuration: any) => configuration.keyId === keyId) || {} as { key?: string };
4647
if (!key) { throw new Error("No key available in saved configuration") };

0 commit comments

Comments
 (0)