example values
This commit is contained in:
@@ -4,6 +4,7 @@ using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
using Microsoft.OpenApi.Any;
|
||||
using Webshop.Domain.Enums;
|
||||
using System.Net.Mime; // Für MediaTypeNames
|
||||
using System.Collections.Generic; // Für Dictionary
|
||||
|
||||
namespace Webshop.Api.SwaggerFilters
|
||||
{
|
||||
@@ -11,7 +12,6 @@ namespace Webshop.Api.SwaggerFilters
|
||||
{
|
||||
public void Apply(OpenApiOperation operation, OperationFilterContext context)
|
||||
{
|
||||
// Überprüfe, ob dies die "CreatePaymentMethod"-Methode im "AdminPaymentMethodsController" ist
|
||||
if (context.MethodInfo.DeclaringType == typeof(Controllers.Admin.AdminPaymentMethodsController) &&
|
||||
context.MethodInfo.Name == "CreatePaymentMethod")
|
||||
{
|
||||
@@ -37,7 +37,13 @@ namespace Webshop.Api.SwaggerFilters
|
||||
["description"] = new OpenApiString("Bitte überweisen Sie den Betrag auf unser Konto."),
|
||||
["isActive"] = new OpenApiBoolean(true),
|
||||
["paymentGatewayType"] = new OpenApiString(PaymentGatewayType.BankTransfer.ToString()),
|
||||
["configuration"] = new OpenApiString("{\"IBAN\":\"DE123456789\",\"BIC\":\"ABCDEFGH\",\"BankName\":\"Beispielbank AG\"}"),
|
||||
// << KORREKTUR: Configuration als OpenApiObject >>
|
||||
["configuration"] = new OpenApiObject
|
||||
{
|
||||
["IBAN"] = new OpenApiString("DE89370400440532013000"),
|
||||
["BIC"] = new OpenApiString("COBADEFFXXX"),
|
||||
["BankName"] = new OpenApiString("Beispielbank AG")
|
||||
},
|
||||
["processingFee"] = new OpenApiDouble(0)
|
||||
}
|
||||
};
|
||||
@@ -52,7 +58,12 @@ namespace Webshop.Api.SwaggerFilters
|
||||
["description"] = new OpenApiString("Sichere Zahlung mit Ihrer Kreditkarte."),
|
||||
["isActive"] = new OpenApiBoolean(true),
|
||||
["paymentGatewayType"] = new OpenApiString(PaymentGatewayType.Stripe.ToString()),
|
||||
["configuration"] = new OpenApiString("{\"PublicKey\":\"pk_test_YOUR_KEY\",\"SecretKey\":\"sk_test_YOUR_SECRET\"}"),
|
||||
// << KORREKTUR: Configuration als OpenApiObject >>
|
||||
["configuration"] = new OpenApiObject
|
||||
{
|
||||
["PublicKey"] = new OpenApiString("pk_test_YOUR_KEY"),
|
||||
["SecretKey"] = new OpenApiString("sk_test_YOUR_SECRET")
|
||||
},
|
||||
["processingFee"] = new OpenApiDouble(1.5)
|
||||
}
|
||||
};
|
||||
@@ -67,7 +78,12 @@ namespace Webshop.Api.SwaggerFilters
|
||||
["description"] = new OpenApiString("Zahlen Sie schnell und sicher mit PayPal."),
|
||||
["isActive"] = new OpenApiBoolean(true),
|
||||
["paymentGatewayType"] = new OpenApiString(PaymentGatewayType.PayPal.ToString()),
|
||||
["configuration"] = new OpenApiString("{\"ClientId\":\"YOUR_PAYPAL_CLIENT_ID\",\"ClientSecret\":\"YOUR_PAYPAL_SECRET\"}"),
|
||||
// << KORREKTUR: Configuration als OpenApiObject >>
|
||||
["configuration"] = new OpenApiObject
|
||||
{
|
||||
["ClientId"] = new OpenApiString("YOUR_PAYPAL_CLIENT_ID"),
|
||||
["ClientSecret"] = new OpenApiString("YOUR_PAYPAL_SECRET")
|
||||
},
|
||||
["processingFee"] = new OpenApiDouble(2.5)
|
||||
}
|
||||
};
|
||||
@@ -82,7 +98,11 @@ namespace Webshop.Api.SwaggerFilters
|
||||
["description"] = new OpenApiString("Nur für registrierte Geschäftskunden."),
|
||||
["isActive"] = new OpenApiBoolean(true),
|
||||
["paymentGatewayType"] = new OpenApiString(PaymentGatewayType.Invoice.ToString()),
|
||||
["configuration"] = new OpenApiString("{\"PaymentTerms\":\"14 Tage netto\"}"),
|
||||
// << KORREKTUR: Configuration als OpenApiObject >>
|
||||
["configuration"] = new OpenApiObject
|
||||
{
|
||||
["PaymentTerms"] = new OpenApiString("14 Tage netto")
|
||||
},
|
||||
["processingFee"] = new OpenApiDouble(0)
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user