checkout / checkout-sdk-net

Checkout SDK for Microsoft .NET
https://checkout.com
MIT License
21 stars 23 forks source link

Wrong CardType EnumMember value for Deferred Debit cards #331

Closed oleksii-i-iol closed 1 year ago

oleksii-i-iol commented 1 year ago

Environment

Description

If we try to get the metadata by 4010056200000018 and then to parse to Checkout.Metadata.Card.CardMetadataResponse object, the exception is thrown "Error converting value "deferred_debit" to type 'System.Nullable`1[Checkout.Common.CardType]"

Expected behavior

Get card details without an error.

Current behavior

The exception is thrown.

Steps to reproduce

Request:

curl --location 'https://api.sandbox.checkout.com/metadata/card' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer secret_key' \
--data '
{
  "source": {
    "type": "card",
    "number": "4010056200000018"
  },
  "format": "basic"
}'

Response:

{
    "scheme": "visa",
    "scheme_local": "cartes_bancaires",
    "card_type": "deferred_debit",
    "card_category": "consumer",
    "issuer": "CREDIT DU NORD",
    "issuer_country": "FR",
    "product_id": "N",
    "product_type": "Visa Platinum",
    "issuer_country_name": "France",
    "bin": "40100562"
}

Possible solution

Modify CardType enum value [EnumMember(Value = "Deferred Debit")] DeferredDebit -> [EnumMember(Value = "deferred_debit")] DeferredDebit