payment methods

This commit is contained in:
Tizian.Breuch
2025-07-31 14:01:39 +02:00
parent b89f0d0dd0
commit 9eef4df3d0
7 changed files with 260 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
// src/Webshop.Application/DTOs/Payments/AdminPaymentMethodDto.cs
using System;
using Webshop.Domain.Enums;
using System.Text.Json.Serialization; // Für JsonConverter
namespace Webshop.Application.DTOs.Payments
{
@@ -11,7 +11,11 @@ namespace Webshop.Application.DTOs.Payments
public string? Description { get; set; }
public bool IsActive { get; set; }
public PaymentGatewayType PaymentGatewayType { get; set; }
public string? Configuration { get; set; } // Als JSON-String, den der Admin bearbeitet
// Configuration ist jetzt ein Objekt, das je nach PaymentGatewayType
// eine Instanz von BankTransferConfigurationDto, StripeConfigurationDto etc. sein wird.
public object? Configuration { get; set; }
public decimal? ProcessingFee { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
// src/Webshop.Application/DTOs/Payments/BankTransferConfigurationDto.cs
using System.ComponentModel.DataAnnotations;
namespace Webshop.Application.DTOs.Payments;
public class BankTransferConfigurationDto : IPaymentMethodConfiguration
{
[Required]
public string IBAN { get; set; } = string.Empty;
[Required]
public string BIC { get; set; } = string.Empty;
[Required]
public string BankName { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,5 @@
// src/Webshop.Application/DTOs/Payments/IPaymentMethodConfiguration.cs
namespace Webshop.Application.DTOs.Payments;
// Leeres Marker-Interface für polymorphe Deserialisierung
public interface IPaymentMethodConfiguration { }

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Webshop.Application.DTOs.Payments
{
public class PayPalConfigurationDto : IPaymentMethodConfiguration
{
[Required]
public string ClientId { get; set; } = string.Empty;
[Required]
public string ClientSecret { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Webshop.Application.DTOs.Payments
{
public class StripeConfigurationDto : IPaymentMethodConfiguration
{
[Required]
public string PublicKey { get; set; } = string.Empty;
[Required]
public string SecretKey { get; set; } = string.Empty;
}
}