Spaces:
Running
Running
Download code-review-env/sample_codebase/payments.py from Athmabhiram1/nodeaudit-openenv: direct link, hf CLI and curl.
- Browser
- Download file 363 Bytes
-
https://huggingface.co/spaces/Athmabhiram1/nodeaudit-openenv/resolve/main/code-review-env/sample_codebase/payments.py
- Command line
-
hf download hf://spaces/Athmabhiram1/nodeaudit-openenv/code-review-env/sample_codebase/payments.py
-
curl -L -o payments.py https://huggingface.co/spaces/Athmabhiram1/nodeaudit-openenv/resolve/main/code-review-env/sample_codebase/payments.py
363 Bytes
| """Payment gateway wrapper.""" | |
| import subprocess | |
| def run_gateway_check(endpoint: str) -> int: | |
| # SECURITY ISSUE: user-provided endpoint is interpolated in a shell command. | |
| command = f"curl -s {endpoint}" | |
| return subprocess.call(command, shell=True) | |
| def charge(total: float) -> str: | |
| if total <= 0: | |
| return "rejected" | |
| return "charged" | |