Skip to main content
Chargeworx maintains four distinct environments for development, testing, and production deployments. Each environment has isolated infrastructure, databases, and configuration.

Environment overview

Development

Active development and feature testing

Staging

Pre-production testing and QA validation

Alpha

Internal testing and stakeholder review

Production

Live customer-facing environment

Environment configurations

Development

Purpose: Active development and feature testing Infrastructure:
  • Windows Server instances on AWS
  • Development SQL Server databases
  • Development Identity Server
  • Development payment processor sandbox
Configuration file: appsettings.Development.json Key settings:
{
  "ConnectionStrings": {
    "ChargeworxDb": "Development database connection",
    "ChargeworxCreditCardDb": "Development credit card database",
    "ChargeworxReportDb": "Development reporting database",
    "ChargeworxKeyDb": "Development key storage database"
  },
  "IdentityServerConfiguration": {
    "Authority": "https://dev-identity.chargeworx.com"
  }
}
Access:
  • API: https://dev-api.chargeworx.com
  • Admin: https://dev-admin.chargeworx.com

Staging

Purpose: Pre-production testing and QA validation Infrastructure:
  • Windows Server instances on AWS
  • Staging SQL Server databases
  • Staging Identity Server
  • Payment processor test environment
Configuration file: appsettings.Staging.json Key settings:
{
  "ConnectionStrings": {
    "ChargeworxDb": "Staging database connection",
    "ChargeworxCreditCardDb": "Staging credit card database",
    "ChargeworxReportDb": "Staging reporting database",
    "ChargeworxKeyDb": "Staging key storage database"
  },
  "IdentityServerConfiguration": {
    "Authority": "https://staging-identity.chargeworx.com"
  }
}
Access:
  • API: https://staging-api.chargeworx.com
  • Admin: https://staging-admin.chargeworx.com

Alpha

Purpose: Internal testing and stakeholder review Infrastructure:
  • Windows Server instances on AWS
  • Alpha SQL Server databases
  • Alpha Identity Server
  • Payment processor test environment
Configuration file: appsettings.Alpha.json Key settings:
{
  "ConnectionStrings": {
    "ChargeworxDb": "Alpha database connection",
    "ChargeworxCreditCardDb": "Alpha credit card database",
    "ChargeworxReportDb": "Alpha reporting database",
    "ChargeworxKeyDb": "Alpha key storage database"
  },
  "IdentityServerConfiguration": {
    "Authority": "https://alpha-identity.chargeworx.com"
  }
}
Access:
  • API: https://alpha-api.chargeworx.com
  • Admin: https://alpha-admin.chargeworx.com

Production

Purpose: Live customer-facing environment Infrastructure:
  • Windows Server instances on AWS (multi-AZ)
  • Production SQL Server databases (with replication)
  • Production Identity Server (high availability)
  • Live payment processor credentials
Configuration file: appsettings.Production.json Key settings:
{
  "ConnectionStrings": {
    "ChargeworxDb": "Production database connection",
    "ChargeworxCreditCardDb": "Production credit card database",
    "ChargeworxReportDb": "Production reporting database",
    "ChargeworxKeyDb": "Production key storage database"
  },
  "IdentityServerConfiguration": {
    "Authority": "https://identity.chargeworx.com"
  }
}
Access:
  • API: https://api.chargeworx.com
  • Admin: https://admin.chargeworx.com

Configuration management

Application settings

Each environment uses environment-specific configuration files that override base settings in appsettings.json. Configuration hierarchy:
  1. appsettings.json - Base configuration
  2. appsettings.{Environment}.json - Environment-specific overrides
  3. Environment variables - Runtime overrides
  4. AWS Secrets Manager - Sensitive credentials

Database connections

The platform uses four separate databases:
  • ChargeworxDb
  • ChargeworxCreditCardDb
  • ChargeworxReportDb
  • ChargeworxKeyDb
Main application databaseContains:
  • Companies and projects
  • Users and authentication
  • Transactions
  • Payment processors
  • Background processes

Identity Server configuration

Each environment has its own Identity Server instance:
{
  "IdentityServerConfiguration": {
    "Authority": "https://{env}-identity.chargeworx.com",
    "ApiName": "chargeworx-api",
    "ApiSecret": "stored-in-secrets-manager",
    "RequireHttpsMetadata": true
  }
}

Payment processor configuration

Payment processors use environment-specific credentials: CyberSource:
{
  "CybersourceConfiguration": {
    "MerchantId": "environment-specific-merchant-id",
    "ApiKey": "stored-in-secrets-manager",
    "SharedSecret": "stored-in-secrets-manager",
    "RunEnvironment": "apitest.cybersource.com" // or "api.cybersource.com" for production
  }
}
PayPal/PayFlow:
{
  "PayFlowConfiguration": {
    "Partner": "PayPal",
    "Vendor": "environment-specific-vendor",
    "User": "environment-specific-user",
    "Password": "stored-in-secrets-manager",
    "HostAddress": "pilot-payflowpro.paypal.com" // or "payflowpro.paypal.com" for production
  }
}

Secrets management

Sensitive configuration values are stored in AWS Secrets Manager:

Storing secrets

# Store database connection string
aws secretsmanager create-secret \
  --name chargeworx/staging/database \
  --secret-string "Server=...;Database=...;User Id=...;Password=..."

# Store payment processor credentials
aws secretsmanager create-secret \
  --name chargeworx/staging/cybersource \
  --secret-string '{"ApiKey":"...","SharedSecret":"..."}'

Retrieving secrets

The application retrieves secrets at startup:
// Startup.cs
var secretsManager = new AmazonSecretsManagerClient();
var secretResponse = await secretsManager.GetSecretValueAsync(
    new GetSecretValueRequest { SecretId = "chargeworx/staging/database" }
);
var connectionString = secretResponse.SecretString;

Environment promotion

Development → Staging

  1. Merge feature branch to develop
  2. Verify development deployment
  3. Create release branch: sharpdev/release/v{version}
  4. Automatic deployment to Staging
  5. Run QA test suite
  6. Verify functionality

Staging → Alpha

  1. Merge release branch to sharpdev/main
  2. Automatic deployment to Alpha
  3. Stakeholder review and testing
  4. Performance validation
  5. Security scan

Alpha → Production

  1. Create pull request from sharpdev/main to main
  2. Require approvals from reviewers
  3. Merge to main branch
  4. Automatic deployment to Production
  5. Monitor deployment health
  6. Verify production functionality

Environment variables

Key environment variables used by the application:
VariableDescriptionExample
ASPNETCORE_ENVIRONMENTCurrent environment nameProduction
AWS_REGIONAWS region for servicesus-east-1
SECRETS_PREFIXPrefix for Secrets Managerchargeworx/production
LOG_LEVELLogging verbosityInformation

Monitoring and health checks

Health check endpoints

Each environment exposes health check endpoints:
GET /Health
Response:
{
  "status": "Healthy",
  "checks": {
    "database": "Healthy",
    "identityServer": "Healthy",
    "cache": "Healthy"
  }
}

Application monitoring

  • CloudWatch Logs - Application and IIS logs
  • CloudWatch Metrics - Performance metrics
  • SumoLogic - Centralized log aggregation
  • AWS X-Ray - Distributed tracing

Troubleshooting

  • Verify environment variable ASPNETCORE_ENVIRONMENT is set correctly
  • Check configuration file exists in deployment directory
  • Review application startup logs
  • Verify file permissions
  • Verify connection string in Secrets Manager
  • Check database server accessibility
  • Verify SQL Server authentication
  • Review firewall rules and security groups
  • Verify Authority URL is correct
  • Check Identity Server is running
  • Verify API credentials in Secrets Manager
  • Review HTTPS certificate validity
  • Verify processor credentials in Secrets Manager
  • Check processor environment (test vs production)
  • Review processor API endpoint configuration
  • Verify merchant account status

Best practices

Configuration isolation

Never share credentials between environments

Secrets rotation

Regularly rotate sensitive credentials

Environment parity

Keep environments as similar as possible

Monitoring

Monitor all environments for issues