Skip to content

Adds support for a second reference number #70

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

Merged
merged 4 commits into from
Nov 23, 2015

Conversation

hm122
Copy link
Contributor

@hm122 hm122 commented Nov 23, 2015

The UPS API allows to set two different reference numbers for a shipment. This functionality is added with this pull request.

@stefandoorn
Copy link
Contributor

Unfortunately this is a breaking change, as e.g. my current implementation will break. I'm using the 'setReferenceNumber' function to insert a ReferenceNumber object. Can we maybe find a workaround to introduce the same functionality, without making it breaking? E.g. what's the maximum amount of reference numbers? If not so many we can think of adding a setReferenceNumber2, etc. In any case there should be validation on the amount also, so if not too much this might be a nice workaround to get the same feature without breaking.

@hm122
Copy link
Contributor Author

hm122 commented Nov 23, 2015

True. The maximum number of reference numbers is two. I will adjust this as suggested.

@hm122
Copy link
Contributor Author

hm122 commented Nov 23, 2015

In principle this could be fixed by re-adding the original setReferenceNumber method. Is that fine? Or would you prefer a setReferenceNumber2 method?

@stefandoorn
Copy link
Contributor

Two options I think:

  • setReferenceNumber takes an array or one object, and parses that one as required into an array or just keeps the array.
  • or revert part of the change and add the second method.

My preference goes for the latter as it allows for proper type hinting, which is more strict in using the code.

@hm122
Copy link
Contributor Author

hm122 commented Nov 23, 2015

I adjusted the code, should be working now.

@stefandoorn
Copy link
Contributor

Looks good. Could you (if possible) change also the CHANGELOG file to reflect this feature for release 0.7.1? Then I will merge it and bring out the new release.

@hm122
Copy link
Contributor Author

hm122 commented Nov 23, 2015

Great, thanks! The changelog is now up to date!

stefandoorn added a commit that referenced this pull request Nov 23, 2015
Adds support for a second reference number
@stefandoorn stefandoorn merged commit 53ca1db into gabrielbull:master Nov 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants