mark order shipping address optional #307
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Hi there,
It's been a long time coming (#271 ) but this PR changes the shipping address from value to pointer, allowing empty values to be skipped during serialisation.
I'm running my fork of the lib in the wild and it seems to work. Since it's been a while since I've contributed to a go lib repo I'm a bit skeptic that this is good enough to merge.
Let me know what you think ;)
Motivation and context
When selling digital goods there is no need to send a shipping address when creating an order. The API docs even dictate that this address is optional. I merely made the field optional in the api client library.
See #271 for our initial discussion.
How has this been tested?
Did a test order on my local app running a mollie integration in test-mode.
You can see that the order no longer has the address attached to it. Here's a before and after:
make test
)test data
has been added / updatedIf you are running the tests locally, please specify:
Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Checklist
Go over all the following points, and put an
x
in all the boxes that apply.Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your tests and code style pass.