mollie-api-go icon indicating copy to clipboard operation
mollie-api-go copied to clipboard

Optional Shipping address

Open nstapelbroek opened this issue 1 year ago • 1 comments

Hi there, loving the library so far. Thank you!

Describe the bug I'm selling digital products, so there is no need for a shipping address. As far as I can tell the API reference for creating an order also tells me that the shipping address is optional.

The library however, requires a shipping address because the default zero value of a mollie.Order.ShippingAddress is invalid when creating an order.

To Reproduce

  1. Install library in your project
  2. Create an order without setting the shipping address
  3. Acknowledge mollie returns an error telling you that the shipping address is invalid.

Expected behavior I should be able to create an order without shipping address.

Additional context I could work on a PR that makes the shipping address optional. Not requesting you to do the work, just merely wondering if I'm missing something 😄

nstapelbroek avatar Jul 28 '23 07:07 nstapelbroek

This is an interesting one, I was under the impression that if the field is empty then when encoding json you would not get it.

I will try to reproduce it but if you have an idea on how to solve it, please go ahead.

VictorAvelar avatar Jul 28 '23 13:07 VictorAvelar

Updated and included in changes to be tagger with v4

VictorAvelar avatar Mar 15 '24 20:03 VictorAvelar