Authorize.Net Refactoring#3
Conversation
…e opeation). Small code refactor and errors handling.
There was a problem hiding this comment.
Pull request overview
This PR is a comprehensive refactoring of the Authorize.Net checkout handler to align with the DW10 architecture. It replaces legacy model classes (in src/Model/, src/Enum/, src/API/) with properly structured models using DataContract/DataMember serialization, introduces a service layer architecture, and adds webhook support for transaction notifications.
Changes:
- Replaced legacy plain model/enum/API classes with PascalCase-named models using
DataContractattributes, organized undersrc/Models/,src/Helpers/,src/Constants/,src/Services/, andsrc/Exceptions/directories. - Added comprehensive webhook management support including registration, update, deletion, and event type validation through
AuthorizeNetServiceand related webhook models. - Introduced security helpers (HMAC validation, sensitive data masking), a structured logging system (
AuthorizeNetLogger,AuthorizeNetRequestLogger), and organized constants for endpoints, response codes, and security settings.
Reviewed changes
Copilot reviewed 210 out of 212 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Dynamicweb.Ecommerce.CheckoutHandlers.AuthorizeNetApi.csproj | Updated package versions, tags, copyright year, and added package icon |
| src/Services/AuthorizeNetService.cs | New core service handling Authorize.Net API interactions (payments, profiles, webhooks) |
| src/Services/AuthorizeNetHttpService.cs | New HTTP service wrapping HttpClient for API communication |
| src/Services/AuthorizeNetLogger.cs | New structured logger for Authorize.Net operations |
| src/Helpers/AuthorizeNetModelFactory.cs | New factory for creating billing/shipping address and line item models from orders |
| src/Helpers/*.cs | Various new helpers: security, HMAC, string manipulation, amount rounding, enum conversion |
| src/Models/*.cs | ~60+ new model classes replacing legacy models with proper DataContract serialization |
| src/Constants/*.cs | New constants for endpoints, response codes, security settings, template folders, tags |
| src/Exceptions/AuthorizeNetApiException.cs | New custom exception for API errors |
| src/Model/*.cs (deleted) | Removed all legacy model classes |
| src/Enum/*.cs (deleted) | Removed all legacy enum classes |
| src/API/*.cs (deleted) | Removed all legacy API classes |
| src/Helper.cs (deleted) | Removed legacy monolithic helper class |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… to copilot code review)
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 210 out of 212 changed files in this pull request and generated 3 comments.
💡 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 209 out of 211 changed files in this pull request and generated 2 comments.
💡 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 209 out of 211 changed files in this pull request and generated 2 comments.
💡 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 209 out of 211 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I've had some chats with AI. Main areas to watch in QA: |
The task is to make the Authorize.Net version workable in the DW10.
What was did:
Refactoring: The codebase was fully refactored to align with the DW10 architecture.
Webhooks Integration: Added comprehensive webhook support. The provider interface now includes two new options:
Enable auto webhook registration: Webhooks are automatically registered during the first checkout transaction.
Force webhook re-registration: Resets existing webhook notifications associated with the current site URL and triggers a fresh registration. This setting automatically unchecks itself once the process is complete.
Security & Cleanup: Removed legacy settings for various checkout form templates. The integration now exclusively uses the Authorize.Net Hosted Payment Form, ensuring a more secure and standardized checkout process.
NOTE: The webhooks support is mandatory for this provider! It doesn't set the transaction number after redirect user back to DW site, so the only way to set it is a webhook notification!
The original task: https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_workitems/edit/27013