Skip to content

Commit fa6fb44

Browse files
cybersource-tpiShakshiPoddarShakshi Poddarrajasuma1SA20184625
authored
23.2.0 (#11)
* Document for AWS Lambda Deplpoyment (#80) Co-authored-by: Shakshi Poddar <sh20202930@wipro.com> * eCheck (#85) * Document and code changes for AWS Lambda (#99) Co-authored-by: Shakshi Poddar <sh20202930@wipro.com> * 100 echeck document updation (#103) * eCheck document Updation * Update Process-a-Payment-eCheck.md * eCheck document Updation * eCheck diagram reference updated * eCheck diagram issue fixed * Version Changed to V22.2.0 (#106) * 107 document updation (#109) * Documentation changes added * review changes for document * 22.2.0 (#44) * Latest code with 3ds payment method integration * Latest code with subscription * Latest code with refactoring * latest code with unit testing * Latest code with Tokenization with update and delete tokens feature * Changed env file * Latest code with Google Pay payment method * Latest code for unit testing including google pay * Latest code with Apple Pay payment method * Latest code with google pay unit test cases * Latest code with 3ds defects fixed * Removed old Unit test folder * Latest code with apple pay unit test * Latest code with Sonar fix * Removed unwanted files * Latest code with tokenization bug fix * Latest code of unit test * Payer Authentication bundle call * Variable rename * Variable rename * Variable rename * Enroll fields mapping * Partner solution id & capture bug fix * Removed public folder * Unit test with latest fixes * Device information for payments * Messages updated * Messages updated * Messages updated * Updated messages * Spell check * Spell check * Added offset for run sync * Defect undefined firtstName fixed * Defect undefined firtstName fixed * Updated card details * Added more validation for service response * Added docs * Added docs * Added docs * Unit test case with latest fixes * Latest code with visa Click to Pay defect and TypeError fix * new feature rate limiter and discounts * Updated rate limiter variables * Updated rate limiter changes * 3ds Dm scenario updated * Updated payments query * Updated unit test cases * Feature sca (#37) * Latest code with SCA challenge for 3DS * Latest code with SCA challenge for 3DS * Add token and script to load custom data (#38) * Add token and script to load custom data * Add token and script to load custom types * Add token and script to load custom data * Add token and script to load custom data * Add token and script to load custom data * Added code for Sale and MOTO transactions (#41) * Updated docs for tokenization (#40) * Updates docs for tokenization * Updated docs for tokenization * loggers changes (#42) * updated documents for sale and MOTO transactions * Document for AWS Lambda Deplpoyment (#80) Co-authored-by: Shakshi Poddar <sh20202930@wipro.com> * eCheck (#85) * Document and code changes for AWS Lambda (#99) Co-authored-by: Shakshi Poddar <sh20202930@wipro.com> * 100 echeck document updation (#103) * eCheck document Updation * Update Process-a-Payment-eCheck.md * eCheck document Updation * eCheck diagram reference updated * eCheck diagram issue fixed * Version Changed to V22.2.0 (#106) * 22.2.0 release * 107 document updation (#109) * Documentation changes added * review changes for document Co-authored-by: sh20094173 <shwetha.v08@wipro.com> Co-authored-by: jbransvisa <55891199+jbransvisa@users.noreply.github.com> Co-authored-by: Shakshi Poddar (Americas 2 - iDEAS-Cloud Transformation) <sh20202930@wipro.com> Co-authored-by: Sandra <sandra.m07@wipro.com> Co-authored-by: shwethav08 <68940571+shwethav08@users.noreply.github.com> Co-authored-by: SA20184625 <85941120+SA20184625@users.noreply.github.com> Co-authored-by: rajasuma1 <85928576+rajasuma1@users.noreply.github.com> Co-authored-by: ShakshiPoddar <85929351+ShakshiPoddar@users.noreply.github.com> Co-authored-by: Krishna Prasad <ksalemna@visa.com> * Updated unit test cases (#110) * Updated unit test cases * Update PaymentRefundServiceECCredit.spec.ts Co-authored-by: Shakshi Poddar <sh20202930@wipro.com> * Defects fix and Docker deployment (#113) * Defects fix and Docker deployment * Defects-fix-and-Docker * Defects fix and Docker deployment * Defects fix and Docker deployment * 109 latest unit test (#119) * Updated document & unit test cases * Updated navigations & links * Updated AWS documents * Updated document * Update Commercetools-Setup.md --------- Co-authored-by: Shakshi Poddar <sh20202930@wipro.com> * updated PSID (#126) * updatedDocuments (#130) * Checkmarx fixes (#131) * checkmarkfix --------- * checkmark fixes (#133) * 137 defect fix v23.1.0 (#141) * Auth Reversal issue fixed * Auth Reversal issue fixed with re-tries * 23.2.0 (#46) * 123 multi mid functionality configuration (#148) * Multi Mid functionality * multi-mid functionality and partial capture * multi-mid functionality & partial capture * multi-mid functionality & partial capture * multi-mid configuration & partial capture * Updated for AuthReversal with master branch * Decision Sync msg added * Resolved duplicate constants --------- Co-authored-by: Shwetha V <shwetha.v08@wipro.com> Co-authored-by: rajasuma1 <raja.suma@wipro.com> * Bug fixes for cart locale and multiple shipping (#149) * Bug fixes for cart locale and multiple shipping * review changes added * Updated unit test cases and solution for unit test timeout issue (#150) Co-authored-by: Shakshi Poddar <sh20202930@wipro.com> * Added security code for saved card and defect fix (#159) * DM Reject after Auth for sale defect fixed * Reverted Auth Reverse changes from master * Added changes for DM Reject After Auth for Sale (#162) * Update README.md - Network Compatibility Network Compatibility note --------- Co-authored-by: SA20184625 <85941120+SA20184625@users.noreply.github.com> Co-authored-by: Shwetha V <shwetha.v08@wipro.com> Co-authored-by: rajasuma1 <raja.suma@wipro.com> Co-authored-by: ShakshiPoddar <85929351+ShakshiPoddar@users.noreply.github.com> Co-authored-by: Shakshi Poddar <sh20202930@wipro.com> Co-authored-by: Sandra <sandra.m07@wipro.com> Co-authored-by: Wompa <wompalabs@gmail.com> --------- Co-authored-by: ShakshiPoddar <85929351+ShakshiPoddar@users.noreply.github.com> Co-authored-by: Shakshi Poddar <sh20202930@wipro.com> Co-authored-by: rajasuma1 <85928576+rajasuma1@users.noreply.github.com> Co-authored-by: SA20184625 <85941120+SA20184625@users.noreply.github.com> Co-authored-by: sh20094173 <shwetha.v08@wipro.com> Co-authored-by: jbransvisa <55891199+jbransvisa@users.noreply.github.com> Co-authored-by: Sandra <sandra.m07@wipro.com> Co-authored-by: shwethav08 <68940571+shwethav08@users.noreply.github.com> Co-authored-by: Krishna Prasad <ksalemna@visa.com> Co-authored-by: rajasuma1 <raja.suma@wipro.com> Co-authored-by: Wompa <wompalabs@gmail.com> Co-authored-by: cybersource-tpi <jbrans@visa.com>
1 parent f6583d6 commit fa6fb44

106 files changed

Lines changed: 12040 additions & 30233 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ PAYMENT_GATEWAY_MERCHANT_KEY_ID =
88
PAYMENT_GATEWAY_MERCHANT_SECRET_KEY =
99

1010
PAYMENT_GATEWAY_RUN_ENVIRONMENT =
11-
PAYMENT_GATEWAY_DECISION_MANAGER =
1211
PAYMENT_GATEWAY_SCA_CHALLENGE =
1312
PAYMENT_GATEWAY_ORDER_RECONCILIATION =
1413
PAYMENT_GATEWAY_TARGET_ORIGIN =
@@ -25,7 +24,9 @@ PAYMENT_GATEWAY_LIMIT_SAVED_CARD_RATE =
2524
PAYMENT_GATEWAY_SAVED_CARD_LIMIT_FRAME =
2625

2726
PAYMENT_GATEWAY_DECISION_SYNC =
27+
PAYMENT_GATEWAY_DECISION_MANAGER =
2828
PAYMENT_GATEWAY_RUN_SYNC =
29+
PAYMENT_GATEWAY_DECISION_SYNC_MULTI_MID =
2930

3031
AWS_ACCESS_KEY_ID =
3132
AWS_SECRET_ACCESS_KEY =

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
"editor.formatOnSave": true,
55
"typescript.tsdk": "node_modules/typescript/lib",
66
"typescript.enablePromptUseWorkspaceTsdk": true,
7-
"editor.defaultFormatter": "esbenp.prettier-vscode"
7+
"editor.defaultFormatter": "esbenp.prettier-vscode",
8+
"[typescript]": {
9+
"editor.defaultFormatter": "vscode.typescript-language-features"
10+
}
811
}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ The plugin is a publicly exposed service that acts as a middleware between the C
3434

3535
- Follow [Setup Guide](./docs/Setup.md) for getting started with the integration of Commercetools with the plugin.
3636
- Follow [Usage Guide](./docs/Usage.md) to see more information about the payment services.
37+
38+
## Network Capability
39+
40+
By accepting this document, you acknowledge and accept that you are responsible for and assume liability for the functionality, maintenance and availability of your software and network. At all times, it is your responsibility to ensure the accuracy, technical sufficiency and functionality of your software, network, plug-ins, configurations, applications, code, application program interfaces (APIs), software development kits and all other technology (“Your Network”). You are responsible for Your Network’s ability to use and/or access the Cybersource network, any Cybersource API and receive the benefit of Cybersource’s services. You are responsible for all costs, fees, expenses and liabilities associated with Your Network’s ability to access and interface with the Cybersource network and receive the benefit of Cybersource’s services. Cybersource will not be responsible or liable for loss or costs associated with or that results from Your Network’s inability to connect to or process transactions on the Cybersource network.

docs/API-Extension-Setup.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ Variables that begin with 'CT' prefix are Commercetools project specific propert
2121
| PAYMENT_GATEWAY_EXTENSION_DESTINATION_URL | URL where your plugin is hosted | Recommended https. Required to create custom types to process payments |
2222
| PAYMENT_GATEWAY_EXTENSION_HEADER_VALUE | Your Commercetools username:password base64 encoded value | Required to extend payment and customer API to process payments |
2323
| PAYMENT_GATEWAY_MERCHANT_ID | Your Cybersource merchant Id | Provided by Cybersource |
24-
| PAYMENT_GATEWAY_MERCHANT_KEY_ID | Id of a Cybersource shared secret key to be used for HTTP Signature authentication | Created in <a href="Key-Creation.md">Key Creation</a> |
25-
| PAYMENT_GATEWAY_MERCHANT_SECRET_KEY | Value of a Cybersource shared secret key to be used for HTTP Signature authentication | Created in <a href="Key-Creation.md">Key Creation</a> |
24+
| PAYMENT_GATEWAY_MERCHANT_KEY_ID | Id of a Cybersource shared secret key to be used for HTTP Signature authentication | Created in <a href="Key-Creation.md">Key Creation</a>. This would be considered as the default mid credentials of the plugin. |
25+
| PAYMENT_GATEWAY_MERCHANT_KEY_ID | Id of a Cybersource shared secret key to be used for HTTP Signature authentication | Created in <a href="Key-Creation.md">Key Creation</a>. This would be considered as the default mid credentials of the plugin. |
26+
| PAYMENT_GATEWAY_MERCHANT_SECRET_KEY | Value of a Cybersource shared secret key to be used for HTTP Signature authentication | Created in <a href="Key-Creation.md">Key Creation</a>. |
27+
| XXXX_KEY_ID | Id of a Cybersource shared secret key to be used for HTTP Signature authentication | Created in <a href="Key-Creation.md">Key Creation</a> . Required only when you need to support Multi-Mid. XXXX should be your Cybersource merchant Id in block letters |
28+
| XXXX_SECRET_KEY | Value of a Cybersource shared secret key to be used for HTTP Signature authentication | Created in <a href="Key-Creation.md">Key Creation</a> . Required only when you need to support Multi-Mid. XXXX should be your Cybersource merchant Id in block letters |
2629
| PAYMENT_GATEWAY_RUN_ENVIRONMENT | TEST or PRODUCTION | Property for running the project in TEST or PRODUCTION environment |
2730
| PAYMENT_GATEWAY_DECISION_MANAGER | Boolean value - true or false | Flag for enabling or disabling Decision Manager for Authorization. Case sensitive |
2831
| PAYMENT_GATEWAY_SCA_CHALLENGE | Boolean value - true or false | Flag to force Strong consumer authentication challenge while saving a card using Payer Authentication. Case sensitive |
29-
| PAYMENT_GATEWAY_ORDER_RECONCILIATION | Boolean value - true or false | Flag for enabling or disabling Order reconciliation to indicate whether reconciliation Id to be passed in authorization, capture and refund transactions. Case sensitive
32+
| PAYMENT_GATEWAY_ORDER_RECONCILIATION | Boolean value - true or false | Flag for enabling or disabling Order reconciliation to indicate whether reconciliation Id to be passed in authorization, capture and refund transactions. Case sensitive. **_NOTE:_** The Cybersource-Commercetools Plugin will consider order number as the reconciliation id if available. The order number from Commercetools should be numeric/alpha-numeric string to reflect in Cybersource
3033
| PAYMENT_GATEWAY_TARGET_ORIGIN | Base URL where your frontend will be accessible | |
3134
| PAYMENT_GATEWAY_VERIFICATION_KEY | Used to check Flex tokens for tampering | Use <b>Openssl -rand64 32</b> to generate verification key |
3235
| PAYMENT_GATEWAY_3DS_RETURN_URL | URL that the issuing bank will redirect to the customer for payer Authentication | Used only if payment.paymentMethodInfo.method == creditCardWithPayerAuthentication |
@@ -39,6 +42,7 @@ Variables that begin with 'CT' prefix are Commercetools project specific propert
3942
| PAYMENT_GATEWAY_SAVED_CARD_LIMIT_FRAME | Numeric value between 1-24 | Provide the number of hours that saved card attempts are counted (Max of 24 hours). By default this value is set to 1, applicable only if rate limiter is enabled |
4043
| PAYMENT_GATEWAY_DECISION_SYNC | Boolean value - true or false | Flag for enabling or disabling Decision sync. Case sensitive |
4144
| PAYMENT_GATEWAY_RUN_SYNC | Boolean value - true or false | Flag for enabling or disabling Run sync. Case sensitive |
45+
| PAYMENT_GATEWAY_DECISION_SYNC_MULTI_MID | Comma separated value of merchant Ids | Merchant Ids in which decision sync should be enabled. Provide the exact merchant id as it is.(Make sure there is no extra spaces in between) |
4246
| AWS_ACCESS_KEY_ID | AWS Access Key ID | Provided by AWS in [AWS-Serverless-Deployment\#AWSSecurityCredentials](AWS-Serverless-Deployment.md#AWSSecurityCredentials). Required when running Docker container in AWS |
4347
| AWS_SECRET_ACCESS_KEY | AWS Secret Key | Provided by AWS in [AWS-Serverless-Deployment\#AWSSecurityCredentials](AWS-Serverless-Deployment.md#AWSSecurityCredentials). Required when running Docker container in AWS |
4448
| AWS_REGION | AWS Region Name | Provided by AWS. Required when running Docker container in AWS |
@@ -50,6 +54,40 @@ Variables that begin with 'CT' prefix are Commercetools project specific propert
5054
| CT_AUTH_HOST | Commercetools auth server URL | Created in <a href="Key-Creation.md">Key Creation</a> |
5155
| CT_API_HOST | Commercetools API server URL | Created in <a href="Key-Creation.md">Key Creation</a> |
5256

57+
## Support for Multi-Mid
58+
59+
In this section mid refers to Cybersource Merchant Id.
60+
61+
The new mid configurations should be added in the .env file of the plugin in the following format
62+
63+
XXXX_KEY_ID = <Id of a Cybersource shared secret key>
64+
XXXX_SECRET_KEY = <Value of a Cybersource shared secret key>
65+
66+
Likewise you can configure, as many mids you want to support.
67+
68+
The mid added for `PAYMENT_GATEWAY_MERCHANT_ID` should be the default mid in which transactions will be processed when Multi-Mid is not enabled.
69+
70+
Following are the constraints to be followed when you want to support multiple mids in your plugin instance.
71+
72+
1. It is mandatory to provide the env variables for multi-mid in recommended format only.
73+
2. All env variables should be in block letters
74+
3. First part of the variable (XXXX) should be your Cybersource merchant Id in block letters
75+
4. Second part of the variable to store key Id should be _KEY_ID
76+
5. Second part of the variable to store secret key should be _SECRET_KEY
77+
78+
Example :
79+
80+
Below is the env variables for the mid which has merchant Id as `merchantid123`
81+
82+
83+
MERCHANTID123_KEY_ID = <Id of a Cybersource shared secret key>
84+
MERCHANTID123_SECRET_KEY = <Value of a Cybersource shared secret key>
85+
86+
Below is an example to set the value for PAYMENT_GATEWAY_DECISION_SYNC_MULTI_MID variable.
87+
88+
PAYMENT_GATEWAY_DECISION_SYNC_MULTI_MID = merchantId1,merchantId2,merchantId3,...
89+
90+
For tokenization service i.e adding a card, updating a card and deleting a card in my account section, plugin will always consider default mid.
5391
# Deployment
5492

5593
The Commercetools - Cybersource plugin is a typescript project which is built using cybersource-rest-client npm package and other several node packages.
@@ -71,13 +109,19 @@ The steps involved in deploying the Commercetools - Cybersource plugin in develo
71109

72110
> **_NOTE:_** This is not necessary if the dependencies are already availabe in <b>node_modules</b> repository
73111
112+
- Run the following script to create the Commercetools extensions and custom fields
113+
114+
npm run setup-resources
115+
116+
> **_NOTE:_** This can also be done by using `{baseUrl}/configurePlugin` endpoint once the server is started
117+
74118
- Run the following script to build the changes & running the plugin
75119

76120
npm run start
77121

78122
> **_NOTE:_** It is necessary to build the entire plugin. Whenever there is a change and that need to be reflected, run the following script for building the application
79123
80-
npm run build
124+
npm run build
81125

82126
### Run Unit Tests
83127

docs/Capture-a-Payment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Process
88

9-
To capture a payment, an Authorization must have been completed. When the Payment Update API plugin receives a payment that contains an INITIAL CHARGE transaction, it will attempt to capture the requested amount on the transaction using the `interactionId` of the existing SUCCESS AUTHORIZATION transaction on the payment.
9+
To capture a payment, an Authorization must have been completed. When the Payment Update API plugin receives a payment that contains an INITIAL CHARGE transaction, it will attempt to capture the requested amount on the transaction using the `interactionId` of the existing SUCCESS AUTHORIZATION transaction on the payment.You can perform multiple captures but the total of all previous successful captures and the current capture must be not more than the amount authorized.
1010

1111
## Steps
1212

docs/Commercetools-Setup.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ Fields
143143
| isv_accountNumber | String | false |
144144
| isv_accountType | String | false |
145145
| isv_routingNumber | String | false |
146+
| isv_merchantId | String | false |
147+
| isv_securityCode | Number | false |
146148

147149
### Payer authentication enrolment check
148150

@@ -228,8 +230,28 @@ Below is the Endpoint to create the extensions and the custom fields for the pay
228230
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
229231
| {baseUrl}/configurePlugin | The baseUrl will be defined by where you deploy the plugin. HTTPS should be used for production. See [API Extension Setup](API-Extension-Setup.md) to know the values to be passed for the fields required before running the script |
230232

231-
Alternatively, navigate to the `{baseUrl}/orders` endpoint and click on **Run Script** button in the UI page. This will invoke the `{baseUrl}/configurePlugin` endpoint to handle the same. Ensure to create the extensions using the plugin endpoint provided in order to avoid authentication overheads later.
233+
You can navigate to the `{baseUrl}/orders` endpoint and click on **Run Script** button in the UI page. This will invoke the `{baseUrl}/configurePlugin` endpoint to handle the same. Ensure to create the extensions using the plugin endpoint provided in order to avoid authentication overheads later.
234+
235+
Alternatively, you can create extensions and custom fields also by executing the following script command.
236+
237+
npm run setup-resources
238+
239+
Following env variables are mandatory for the script to execute successfully:
240+
241+
- PAYMENT_GATEWAY_EXTENSION_DESTINATION_URL
242+
- PAYMENT_GATEWAY_EXTENSION_HEADER_VALUE
243+
- CT_PROJECT_KEY
244+
- CT_CLIENT_ID
245+
- CT_CLIENT_SECRET
246+
- CT_AUTH_HOST
247+
- CT_API_HOST
248+
249+
Refer [API Estension Setup](./API-Extension-Setup.md) to know more about the value to be populated to each of the variable.
250+
251+
<b>Ensure to create the extensions using any one of the above approaches only in order to avoid authentication overheads later.</b>
252+
253+
> **_NOTE:_** For all kind of deployments including local, AWS and for Docker image, the extension creation and customization using the npm command `npm run setup-resources` will be possible only if the system supports `npm`
232254
233255
> **_NOTE:_** Authentication is required for accessing any endpoint in the plugin, hence ensure to provide the valid values for the same. Refer [Authentication](./Authentication.md) for more information.
234256
235-
> **_NOTE:_** An example of custom field creation and setting data to the created custom field can be found in [Example-Custom-Field](./Example-Custom-Field.md)
257+
An example of custom field creation and setting data to the created custom field can be found in [Example-Custom-Field](./Example-Custom-Field.md)

docs/Decision-Manager.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Replace the below data:
3636

3737
### Enabling/disabling decision manager for specific payments
3838

39-
The Cybersource Plugin has environment variable for decision manager as PAYMENT_GATEWAY_DECISION_MANAGER, you can set the values to true or false to enable or disable decision manager
39+
The Cybersource Plugin has environment variable for decision manager as PAYMENT_GATEWAY_DECISION_MANAGER, you can set the values to true or false to enable or disable decision manager. If set to true, PAYMENT_GATEWAY_DECISION_SYNC_MULTI_MID variable must be configured with comma separated values of different merchant Ids in which decision manager has to be executed.
4040

4141
> **_NOTE:_** This field is case sensitive
4242

0 commit comments

Comments
 (0)