Skip to content

Latest commit

 

History

History
108 lines (81 loc) · 3.67 KB

File metadata and controls

108 lines (81 loc) · 3.67 KB

forter-salesforce-b2c-cartridge

This file provides context for AI coding assistants working with this repository.

Repository Overview

Code base for hosting and releasing official Forter Salesforce B2C cartridge

Tech Stack: Node.js, TypeScript, JavaScript, CSS, SCSS

Build System

This project uses Node.js and npm for dependency management and build processes. Key scripts are defined in the package.json file.

Essential Workflows

Initial Setup

  1. Clone the repository
  2. Install dependencies:
    npm install
    
  3. Review the documentation in documentation/Forter LINK Integration Documentation.pdf

Making Code Changes

  1. Make changes in the appropriate cartridge under the cartridges/ directory
  2. Follow the coding standards for Salesforce Commerce Cloud development
  3. Test your changes locally

Running Tests

Execute the following npm scripts for testing:

npm test                     # Run unit tests
npm run cover                # Run tests with coverage
npm run test:integration     # Run integration tests
npm run test:functional      # Run functional tests

For specific test suites:

npm run test:integration:checkout  # Run checkout integration tests
npm run test:functional:docker     # Run functional tests in Docker
npm run test:functional:sauce      # Run functional tests on Sauce Labs

Project Structure

📁 cartridges/
  📁 bm_forter/              # Business Manager extension for Forter
  📁 forter_sg_changes/      # SiteGenesis specific changes
  📁 int_forter/             # Core Forter integration
  📁 int_forter_sfra/        # SFRA specific integration
📁 cartridges_extra/         # Additional cartridges (e.g. PayPal, Authorize.Net)
📁 documentation/            # Integration documentation
📁 metadata/                 # Site template metadata
📁 sitegenesis-105.1.0/      # SiteGenesis reference implementation
📁 storefront-reference-architecture-6.1.0/  # SFRA reference implementation

Critical Patterns

  1. Use the appropriate cartridge based on the Salesforce Commerce Cloud architecture (SFRA or SiteGenesis)
  2. Follow Salesforce Commerce Cloud best practices for cartridge development
  3. Utilize the provided integration documentation for implementation details
  4. Leverage the reference implementations in sitegenesis-105.1.0/ and storefront-reference-architecture-6.1.0/ for guidance

Common Pitfalls to Avoid

  1. Mixing SFRA and SiteGenesis implementations
  2. Neglecting to update both SFRA and SiteGenesis cartridges when making changes
  3. Failing to test changes in both Business Manager and storefront contexts
  4. Overlooking the impact of changes on third-party integrations like PayPal and Authorize.Net

Security Guidelines (CRITICAL - Forter Standards)

Must Follow:

  • ❌ NEVER hardcode secrets, API keys, or credentials
  • ❌ NEVER log sensitive data (PII, tokens, passwords)
  • ❌ NEVER commit .env files or secrets
  • ✅ Use environment variables for all secrets
  • ✅ Validate and sanitize all user inputs
  • ✅ Follow the principle of least privilege

Additional Salesforce Commerce Cloud specific guidelines:

  • Use Site Preferences for configuration values
  • Implement proper access controls in Business Manager
  • Follow Salesforce Commerce Cloud security best practices

Before Committing

  1. Run all test suites:
    npm test
    npm run test:integration
    npm run test:functional
    
  2. Ensure code adheres to Salesforce Commerce Cloud coding standards
  3. Update documentation if necessary
  4. Verify changes work in both SFRA and SiteGenesis contexts (if applicable)
  5. Test in Business Manager and storefront environments

Generated by Forter AI Platform