Skip to content
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

TDL-19325: Add missing fields #32

Merged
merged 9 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions tap_recharge/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,13 @@ def request(self, method, path=None, url=None, **kwargs): # pylint: disable=too-
kwargs['headers'] = {}
kwargs['headers']['X-Recharge-Access-Token'] = self.__access_token
kwargs['headers']['Accept'] = 'application/json'
# If we did not specify any API Version during API Call, the Recharge will use the default API Version of our store
# the 'collections' was added as part of API Version: '2021-11', for older API Version,
# we will get empty records so adding 'X-Recharge-Version' for 'collections' API call
if path == 'collections':
kwargs['headers']['X-Recharge-Version'] = '2021-11'
kwargs['headers']['X-Recharge-Version'] = '2021-11'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also removed the above comment, is it intensional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, now all streams except products and shop will run on 2021-11.

# Products and Shop are not supported in new version: 2021-11
# For 'Onetimes', for the new version: 2021-11, we can only get active onetimes.
# To get all the onetimes, we need to pass the 'include_cancelled' param, but as per the discussion with support,
# the param is not working, thus using the old version: 2021-01
if path in ['products', 'shop', 'onetimes']:
kwargs['headers']['X-Recharge-Version'] = '2021-01'

if self.__user_agent:
kwargs['headers']['User-Agent'] = self.__user_agent
Expand Down
53 changes: 53 additions & 0 deletions tap_recharge/schemas/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,59 @@
},
"zip": {
"type": ["null", "string"]
},
"payment_method_id": {
"type": ["null", "integer"]
},
"country_code": {
"type": ["null", "string"]
},
"discounts": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": ["null", "integer"]
}
}
}
},
{
"type": "null"
}
]
},
"order_attributes": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": ["null", "string"]
},
"value": {
"type": ["null", "string"]
}
}
}
},
{
"type": "null"
}
]
},
"order_note": {
"type": ["null", "string"]
},
"presentment_currency": {
"type": ["null", "string"]
}
}
}
Loading