payment methods
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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 { }
|
||||
18
Webshop.Application/DTOs/Payments/PayPalConfigurationDto.cs
Normal file
18
Webshop.Application/DTOs/Payments/PayPalConfigurationDto.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
19
Webshop.Application/DTOs/Payments/StripeConfigurationDto.cs
Normal file
19
Webshop.Application/DTOs/Payments/StripeConfigurationDto.cs
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user