Skip to content

Commit

Permalink
Merge pull request #6 from firoz2197/feature/PMONEY-476-add-merchant-…
Browse files Browse the repository at this point in the history
…id-to-headers-of

PMONEY-476 feat: added merchant id
  • Loading branch information
nogoodusername authored Jan 29, 2024
2 parents b150939 + b904fe7 commit 01290df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## [1.1.6] - 2024-01-25
- added `Merchant ID` param for all the API calls

## [1.1.5] - 2022-06-07
- added `VPA` class to verify VPA

Expand Down
1 change: 1 addition & 0 deletions src/juspay/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

api_key = ""
environment = 'production'
merchant_id = None
2 changes: 2 additions & 0 deletions src/juspay/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def request(method, url, parameters):
# Wrapper for requests
header = {'version': config.api_version,
'User-Agent': 'Python SDK'}
if juspay.merchant_id is not None:
header['x-merchantid'] = juspay.merchant_id
if method.upper() == 'GET':
response = requests.get(server + url, headers=header, params=parameters, auth=(juspay.api_key, ''))
else:
Expand Down

0 comments on commit 01290df

Please sign in to comment.