- Updated Docker configuration for production deployment - Added SilverPay integration settings - Configured for admin.thebankofdebbie.giize.com deployment - Includes all recent security fixes and improvements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
4.5 KiB
4.5 KiB
SilverPay Settings Configuration
Overview
The LittleShop admin panel now includes a comprehensive SilverPay integration settings page that allows you to configure the payment gateway connection dynamically without modifying code or configuration files.
Accessing the Settings
-
Start the Application
dotnet run --project LittleShop/LittleShop.csproj -
Navigate to Admin Panel
- Open your browser and go to: http://localhost:5000/Admin
- Login with default credentials:
admin/admin
-
Access System Settings
- Click on "Settings" in the navigation menu (gear icon)
- Or directly navigate to: http://localhost:5000/Admin/SystemSettings
SilverPay Configuration Options
Base URL
- Purpose: The API endpoint URL for SilverPay services
- Example:
http://31.97.57.205:8001orhttps://api.silverpay.com - Required: Yes
API Key
- Purpose: Authentication key for SilverPay API requests
- Security: Displayed as password field with toggle visibility
- Required: Optional (leave empty if SilverPay doesn't require authentication)
Webhook Secret
- Purpose: Secret key used to validate incoming webhook requests from SilverPay
- Security: Displayed as password field with toggle visibility
- Required: Optional but recommended for production
Default Webhook URL
- Purpose: Your endpoint URL where SilverPay will send payment notifications
- Example:
https://yourdomain.com/api/silverpay/webhook - Required: Optional (can be set per order)
Features
Connection Testing
- Click the "Test Connection" button to verify your SilverPay settings
- The test will attempt to retrieve supported currencies from SilverPay
- Results are displayed immediately with success/failure status
- Connection status and last test timestamp are shown in the interface
Status Indicators
- Not Configured: No base URL has been set
- Configured: Settings are saved but not tested
- Connected: Settings are saved and successfully tested
- Not Tested: Settings changed since last test
Dynamic Configuration
- Settings are stored in the database and loaded dynamically
- Changes take effect immediately without application restart
- Falls back to appsettings.json if database settings are not configured
Implementation Details
Database Storage
Settings are stored in the SystemSettings table with the following keys:
SilverPay.BaseUrlSilverPay.ApiKeySilverPay.WebhookSecretSilverPay.DefaultWebhookUrlSilverPay.LastTestDateSilverPay.LastTestSuccessSilverPay.LastTestMessage
Service Architecture
The SilverPayService has been updated to:
- Check database settings first
- Fall back to configuration file settings
- Update HTTP client configuration dynamically per request
- Use dependency injection with scoped service provider for settings access
Security Considerations
- API keys and webhook secrets are stored encrypted in the database
- Password fields are used in the UI to prevent shoulder surfing
- HTTPS should be used in production environments
- Consider using Azure Key Vault or similar for production secrets
Migration from Configuration Files
If you have existing settings in appsettings.json:
- The system will automatically use them as fallback
- Navigate to the Settings page
- Save the settings to migrate them to the database
- Once saved in database, those settings take precedence
Troubleshooting
Settings Not Saving
- Check browser console for JavaScript errors
- Ensure you have Admin role permissions
- Verify database write permissions
Connection Test Fails
- Verify the Base URL is correct and accessible
- Check if API key is required and correctly entered
- Ensure SilverPay service is running and reachable
- Check firewall/network settings
Settings Not Taking Effect
- Settings are loaded per request, no restart needed
- Clear browser cache if UI shows old values
- Check application logs for configuration errors
Production Deployment
For production environments:
- Use HTTPS for both your application and SilverPay endpoints
- Set strong webhook secrets
- Configure proper CORS settings if needed
- Monitor connection test results regularly
- Set up alerts for payment webhook failures
API Integration
The settings are used by:
ISilverPayServicefor payment processingCryptoPaymentServicefor order payment creationSilverPayWebhookControllerfor webhook validation
All services automatically use the latest settings from the database.