## Architecture Summary (Authoritative Entry Point)

Before making changes, read:
- docs/architecture.md
- docs/BOUNDARIES.md
- docs/API.md

## Change Discipline (Required)

Before making functional changes to this module:

1. Produce a short written plan:
   - What problem is being solved?
   - Which files will change?
   - Does this affect API.md, BOUNDARIES.md, DATA_OWNERSHIP.md, or OBSERVABILITY.md?
2. Confirm boundary ownership (see docs/BOUNDARIES.md).
3. Update documentation if behaviour changes.
4. If ownership or API behaviour changes, create or update an ADR.

Do not introduce cross-module writes or new integrations without documenting them first.

# Introduction
This module integrates the Computop Paygate REST API (v2.2.0) with secure authentication and robust configuration management.

# Authentication Setup

## Supported Methods
- **OAuth2**: Uses client_id and client_secret to obtain a Bearer token (POST /authorization/oauth/token)
- **Basic Auth**: Uses MerchantID:APIKey (Base64) for endpoints that support it

## Environment Selection
- Switch between test and production endpoints using the "Environment" field in settings
- Test: https://test.computop-paygate.com/api/v2
- Production: https://www.computop-paygate.com/api/v2

## Secure Credential Storage
- Credentials (client_id, client_secret, api_key) are stored in ENV/config, never in code
- Secret keys are encrypted automatically
- See SETTINGS.md for field details

## Configuration
- Access settings via `/NGauge/paygate/settings/index`
- All fields and options are documented in SETTINGS.md

# Build and Test
Run tests and validate configuration as described in SETTINGS.md.

# Contribute
Please update documentation and follow boundary ownership rules before submitting changes.