Skip to content

Commit

Permalink
chore: more validation to Seeplus payload
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Apr 16, 2024
1 parent cfb3068 commit cf1dd02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

*
* Additional validation to status changed in order for Seeplus, more pedantic

### Changed

Expand Down
9 changes: 7 additions & 2 deletions src/budy/controllers/api/seeplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ def update(self):
return dict(result=result)

def _status_change_s(self, data):
reference = data["code"]
status = data["status"]
for key in ("code", "status"):
appier.verify(
key in data,
message="Missing '%s' in Seeplus data payload (OrderManagement.StatusChanged)" % key,
code=400,
)
reference, status = data["code"], data["status"]
order = budy.Order.get(reference=reference)
seeplus_status = order.meta.get("seeplus_status", None)
seeplus_timestamp = order.meta.get("seeplus_timestamp", None)
Expand Down

0 comments on commit cf1dd02

Please sign in to comment.