rename customer_details to match the API #57
Merged
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.
As in #54, the name of the field is not consistent with the API. The field is named
customer
in the API. See https://github.com/braintree/braintree_python/blob/9d672082bc2ecb9b699095afd6fed7afb15c87e7/braintree/transaction.py#L702This is awkward since the official client libs (Python and Ruby) name this field
customer_details
and map the data from thecustomer
field returned by the API. This means if a developer is referring to the Braintree docs for another language then they will expect to see acustomer_details
field (https://developers.braintreepayments.com/reference/response/transaction/python#customer_details).Do you think that this library should be consistent with the official client libs and have names like
customer_details
? Or should it be consistent with the API and have names likecustomer
? Also, should this library deserialize the customer into aBraintree.Customer
struct?There are similar issues with several other fields (like
apple_pay_details
). This pull-request doesn't address those, but I'd be happy to submit a pull-request once we have an answer to the above question.Thanks ✨