feat: Expire payment link#1
Open
pantomaxdotco wants to merge 7 commits into
Open
Conversation
The commit adds a new file, `.panto.json`, which includes configuration settings for the Panto tool. This file specifies the files to be scanned and the project languages.
Owner
Author
|
/review |
| ) | ||
| return | ||
|
|
||
| def _getBaseUrl(): |
There was a problem hiding this comment.
Add 'self' parameter to _getBaseUrl() method for proper instance method usage
def _getBaseUrl(self):
return PRODUCTION_BASE| return PRODUCTION_BASE | ||
|
|
||
| @Decorators.auth_handler | ||
| def expire_payment_link(self, platform_bill_id: str): |
There was a problem hiding this comment.
Add a 'reason' parameter (and include it in the request payload) in expire_payment_link method to meet the business requirement
@Decorators.auth_handler
def expire_payment_link(self, platform_bill_id: str, reason: str):
"""Expire payment link using a provided reason."""
base_url = self._getBaseUrl()
headers = {
"X-Setu-Product-Instance-ID": self.product_instance_id,
"Content-Type": "application/json",
}
payload = {"reason": reason}
res = self.session.post(
f"{base_url}/utilities/bills/{platform_bill_id}/expire",
headers=headers,
json=payload,
)
return res| """Fixture to get V1 creds.2""" | ||
| return APICredentials( | ||
| scheme_id="5bf4376b-6008-43c8-8ce0-a5ea196e3091", | ||
| secret="9975fd99-d5ed-416a-9963-5d113dc80582", |
There was a problem hiding this comment.
[Security] "secret" detected here, make sure this is not a hard-coded secret.
# Instead of hardcoding the secret, consider loading it from an environment variable.
import os
@ pytest.fixture
def v1_creds() -> APICredentials:
"""Fixture to get V1 creds.2"""
return APICredentials(
scheme_id="5bf4376b-6008-43c8-8ce0-a5ea196e3091",
secret=os.environ.get("API_SECRET") # load the secret securely
)|
Reviewed up to commit:d03c60a2a9caff87d53cccdbff6bfa6ab727dff2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Requirement: