Skip to content

16.0 add check environment validation in authorizeapi irvingreyes#630

Open
IrvingReyes wants to merge 1 commit intoVauxoo:16.0-ircfrom
vauxoo-dev:16.0-add-check-environment-validation-in-authorizeapi-irvingreyes
Open

16.0 add check environment validation in authorizeapi irvingreyes#630
IrvingReyes wants to merge 1 commit intoVauxoo:16.0-ircfrom
vauxoo-dev:16.0-add-check-environment-validation-in-authorizeapi-irvingreyes

Conversation

@IrvingReyes
Copy link

@IrvingReyes IrvingReyes commented Jul 2, 2025

This MR is related to ISSUE#2000

MR

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

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
@IrvingReyes IrvingReyes force-pushed the 16.0-add-check-environment-validation-in-authorizeapi-irvingreyes branch from 92fab81 to a4f0deb Compare July 2, 2025 18:28
@imanie383
Copy link

add the documentation of the other MR

@IrvingReyes IrvingReyes changed the base branch from 16.0 to 16.0-irc July 4, 2025 22:10
@IrvingReyes
Copy link
Author

add the documentation of the other MR

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants