CyberSource fixes#15
Open
StanislavSmetaninSSM wants to merge 10 commits into
Open
Conversation
- Fix cancel flow so cancelled payments restore the cart - Add configurable REST JWT authentication for certificate/shared-secret keys - Improve REST request signing, error handling, and debug logging - Clarify provider setting labels and help texts - Fix request formatting and callback validation edge cases
There was a problem hiding this comment.
Pull request overview
This PR updates the CyberSource checkout handler for DW10 compatibility, focusing on REST authentication options, safer REST diagnostics, and cancel-flow handling.
Changes:
- Adds configurable REST authentication settings for certificate JWT and shared-secret JWT.
- Adds REST request/response logging with masking and safer user-facing REST errors.
- Updates handler configuration UI, saved-card/capture validation, and cancel-return handling.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/Service/CyberSourceService.cs |
Passes REST authentication settings into REST request handling. |
src/Service/CyberSourceRestAuthenticationSettings.cs |
Adds a settings container for REST authentication and logging options. |
src/Service/CyberSourceRequestLogger.cs |
Adds CyberSource REST diagnostic logging and JSON masking. |
src/Service/CyberSourceRequest.cs |
Updates REST request construction, authentication header generation, and error logging. |
src/RestAuthenticationMethod.cs |
Adds REST authentication method enum values. |
src/Helpers/SecurityHelper.cs |
Clarifies signature helper XML documentation. |
src/Helpers/JwtAuthenticationHelper.cs |
Adds certificate and shared-secret JWT generation helpers. |
src/Helpers/Helper.cs |
Updates certificate path handling and customer-name fallback logic. |
src/Dynamicweb.Ecommerce.CheckoutHandlers.CyberSource.csproj |
Bumps package version and Dynamicweb dependency. |
src/CyberSource.cs |
Adds new settings UI, REST validation, cancel-return flow, and updated service wiring. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/Helpers/JwtAuthenticationHelper.cs:81
- Correct the grammar in this diagnostic message from "Shared Secret JWT token create failed" to "Shared Secret JWT token creation failed".
throw new Exception("Shared Secret JWT token create failed", ex);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves the DW10 CyberSource checkout handler compatibility and configuration experience.
The main changes are:
Note: I can't test payment via saved card/capture using my test account. I get the 401 error (unauthorized user), but I get this error even on the CyberSource tool for certificate testing, so I'm sure that it's the account problem. It must be tested by someone whose account is fine. I'm talking with CyberSource support about it, but they are totally dumb.
Original tasks:
https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_workitems/edit/28229
https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_workitems/edit/28210
https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_workitems/edit/28209
UPD: I will fix the copilot issues, so don't merge it before it, please.