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.
I propose this fix for issue #106 ...basically, try to match shipping method returned from PayPal by name with a method defined in shipping
Repository
, in order to use the actual shipping method class and save order with correctcode
.This PR also fixes a related problem I encountered when trying to match shipping method by name... my name had a ™ char in it. Since the response body is urlencoded the usual unicode handling doesn't work quite right... currently we have a double-encoded unicode type of bug so the incorrectly decoded string returned from PayPal couldn't be matched in the Repository.
We need to instead treat the response body as ascii bytes, give that to
parse_qs
to make a dict then decode the keys and values of the dict as utf8.Supporting both Py 2 & 3 made the code a bit ugly but this was the minimum change I could find to make the new test pass.