Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create customer throws error when using the testmode property in the request #342

Closed
gijsbertpieterbrouwer opened this issue Mar 5, 2024 · 2 comments

Comments

@gijsbertpieterbrouwer
Copy link

Code

  var customerRequest = new CustomerRequest()
  {
      Email = email,
      Name = name,
      Locale = Locale.en_US,
      Testmode = IsTest,
      Metadata = metaData,
  };

  ICustomerClient customerClient = new CustomerClient(ApiKey);
  var customerResponse = customerClient.CreateCustomerAsync(customerRequest).Result;

Gives error:
{Mollie.Api.Client.MollieApiException: Unprocessable Entity - Non-existent body parameter "testmode" for this API call. Did you mean: "name"?
at Mollie.Api.Client.BaseMollieClient.ProcessHttpResponseMessage[T](HttpResponseMessage response)
at Mollie.Api.Client.BaseMollieClient.SendHttpRequest[T](HttpMethod httpMethod, String relativeUri, Object data)
at Mollie.Api.Client.BaseMollieClient.PostAsync[T](String relativeUri, Object data)
at Mollie.Api.Client.CustomerClient.CreateCustomerAsync(CustomerRequest request)}

Which in fact is weird considering that the docs of mollie say there is a testmode property in the request:
https://docs.mollie.com/reference/v2/customers-api/create-customer

BUT
in the sample of mollie the request says:
"mode": "test", instead of "testmode":true

@Viincenttt
Copy link
Owner

Hi @gijsbertpieterbrouwer

The testmode parameter is only for OAuth tokens, not API keys. For API keys, you already have a separation between live and test.

@Viincenttt
Copy link
Owner

Closing this issue for now, let me know if you need any other help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants