16.0 add check environment validation in authorizeapi irvingreyes#630
Open
IrvingReyes wants to merge 1 commit intoVauxoo:16.0-ircfrom
Open
Conversation
Added a safe call to `_check_environment` in the `_make_request` method of the `AuthorizeAPI` class, using `getattr` to avoid errors if the method is missing. This ensures payment operations are only executed in a valid environment, enhancing protection against unintentional use of production credentials in test or staging environments. **Description of the issue/feature this PR addresses:** Allow payment providers to validate the environment before executing external API requests. Prevent unintended usage of production credentials in non-production environments. **Current behavior before PR:** The `AuthorizeAPI._make_request` method did not verify if the environment was safe for performing real transactions. As a result, production credentials could be used inadvertently in staging or test environments. **Desired behavior after PR is merged:** The `_make_request` method attempts to call the `_check_environment` method on the provider (if it exists and is callable), enforcing environment validation before continuing with the payment request. This ensures that production transactions only occur in authorized environments PATCH USE to 16.0
92fab81 to
a4f0deb
Compare
|
add the documentation of the other MR |
Author
Done |
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.
This MR is related to ISSUE#2000
MR
Added a safe call to
_check_environmentin the_make_requestmethodof the
AuthorizeAPIclass, usinggetattrto avoid errors if themethod is missing. This ensures payment operations are only executed in
a valid environment, enhancing protection against unintentional use of
production credentials in test or staging environments.
Description of the issue/feature this PR addresses:
Allow payment providers to validate the environment before executing
external API requests. Prevent unintended usage of production
credentials in non-production environments.
Current behavior before PR:
The
AuthorizeAPI._make_requestmethod did not verify if the environmentwas safe for performing real transactions. As a result, production
credentials could be used inadvertently in staging or test environments.
Desired behavior after PR is merged:
The
_make_requestmethod attempts to call the_check_environmentmethod on the provider (if it exists and is callable), enforcing
environment validation before continuing with the payment request.
This ensures that production transactions only occur in authorized
environments.
PATCH USE to 16.0