Skip to content

Currency enum serializes as "Eur" instead of "EUR" in CheckoutCreateRequest #57

@visualies

Description

@visualies

Using SumUp NuGet 0.0.8 with .NET 8, creating a checkout fails because Currency.Eur appears to serialize as "Eur" instead of "EUR".

Example:

var request = new CheckoutCreateRequest
{
    CheckoutReference = "test-123",
    Amount = 10.0f,
    Currency = Currency.Eur,
    MerchantCode = "<merchant-code>",
    Description = "Test order",
    ReturnUrl = "https://example.com/webhooks/sumup",
    RedirectUrl = "https://example.com/checkout/complete"
};

await client.Checkouts.CreateAsync(request);

API response:

{
  "error_code": "INVALID",
  "message": "Currency 'Eur' or amount is invalid",
  "param": "currency"
}

It looks like the SDK is using JsonStringEnumConverter(), which serializes the enum name (Eur) rather than the API value (EUR), even though the generated enum uses EnumMember(Value = "EUR").

Is this something I am missing on my side, since this would practically prevent checkouts from being created at all?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions