Skip to content

Null reference on invalid culture #83

@ziraak

Description

@ziraak

was trying out the sdk with this test case:

var b = new SdkClient(() => new ConsoleLogger());

var request = b.CreateRequest().Authenticate(key, secret, false, culture: System.Globalization.CultureInfo.CurrentCulture)
    .TransactionRequest()
    .SetBasicFields(new BuckarooSdk.DataTypes.RequestBases.TransactionBase()
    {
        AmountDebit = 10,
        Currency = "EUR",
        Invoice = "testinvoice 123",
        ReturnUrl = "http://wwww.google.com"
    });

ConfiguredServiceTransaction? transaction = paymentMethod switch
{
    ServiceNames.Sofort => request.Sofort().Pay(request: new BuckarooSdk.Services.Sofort.SofortPayRequest()),
    ServiceNames.Ideal => request.Ideal().Pay(new BuckarooSdk.Services.Ideal.TransactionRequest.IdealPayRequest()),
    ServiceNames.PayPal => request.PayPal().Pay(new BuckarooSdk.Services.PayPal.PayPalPayRequest() { ProductName = "name", BillingAgreementDescription = "", BuyerEmail = "", PageStyle = "" }),
    _ => throw new Exception(""),
};

var response = transaction?.Execute();

this returned for me a 400: Culture header could not be parsed. The provided value is not a known culture.
but the sdk does not give that response. instead it will give a null reference exception on line 47 of ConfiguredServiceTransaction.

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