Fix SilverPay payment integration JSON serialization

- Changed JSON naming policy from CamelCase to SnakeCaseLower for SilverPay API compatibility
- Fixed field name from 'fiat_amount' to 'amount' in request body
- Used unique payment ID instead of order ID to avoid duplicate external_id conflicts
- Modified SilverPayApiResponse to handle string amounts from API
- Added [JsonIgnore] attributes to computed properties to prevent JSON serialization conflicts
- Fixed test compilation errors (mock service and enum casting issues)
- Updated SilverPay endpoint to http://10.0.0.52:8001/

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-22 04:38:28 +01:00
parent 034b8facee
commit 5138242a99
5 changed files with 23 additions and 11 deletions

View File

@@ -19,14 +19,16 @@ namespace LittleShop.Tests.Unit;
public class PushNotificationControllerTests
{
private readonly Mock<IPushNotificationService> _pushServiceMock;
private readonly Mock<ITeleBotMessagingService> _teleBotServiceMock;
private readonly PushNotificationController _controller;
private readonly Guid _testUserId = Guid.NewGuid();
public PushNotificationControllerTests()
{
_pushServiceMock = new Mock<IPushNotificationService>();
_controller = new PushNotificationController(_pushServiceMock.Object);
_teleBotServiceMock = new Mock<ITeleBotMessagingService>();
_controller = new PushNotificationController(_pushServiceMock.Object, _teleBotServiceMock.Object);
// Setup controller context for authenticated user
SetupControllerContext();
}