Viincenttt / MollieApi

This project allows you to easily add the Mollie payment provider to your application.
MIT License
144 stars 83 forks source link

UpdateCustomerAsync throws error 502 #341

Closed MaoUyen closed 3 months ago

MaoUyen commented 4 months ago

Hello,

I recently tried to update a member but it threw error 502 when i tried to execute UpdateCustomerAsync(). Would you please verify and fix that function? Thank you for your time.

Viincenttt commented 4 months ago

Hi @MaoUyen

Thanks for reporting the issue. A 520 error indicates a bad gateway, which is typically a issue between the client and server connection. Just to rule out any issue with the library, could you provide a code snippet or request body that you are sending to Mollie?

Kind regards, Vincent

MaoUyen commented 4 months ago

Hello, Of course here is the code snippet, I tried deleteasync and createasync and both worked :

CustomerRequest customerRequest = new CustomerRequest(){Email = Klant.Mail,Name = Klant.Naam,Locale = myLocale}; CustomerResponse customerResponse = await customerClient.UpdateCustomerAsync(myMollie.CustomerId, customerRequest);

kind regards, Mao Uyen

Viincenttt commented 4 months ago

I haven't been able to reproduce the issue. I've used the following code on the sandbox environment, which succeeded without issues:

var createCustomerRequest = new CustomerRequest
        {
            Name = "vincent",
            Email = "vincent@fakedomain.com"
        };
        var createCustomerResult = await _customerClient.CreateCustomerAsync(createCustomerRequest);

        CustomerRequest updateCustomerRequest = new CustomerRequest
        {
            Name = "vincent-updated",
            Email = "email-updated@fakedomain.com", 
        };
        CustomerResponse customerResponse = await _customerClient.UpdateCustomerAsync(createCustomerResult.Id, updateCustomerRequest);

Are you still having this issue?