Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLUGIN1CC-3709] Calling 1cc pref api only for admin user and in razorpay payment seet… #557

Merged
merged 3 commits into from
Jun 10, 2024

Conversation

ChetanGN
Copy link
Contributor

…ings page

Note :- Please follow the below points while attaching test cases document link below:

- If label Tested is added then test cases document URL is mandatory.

- Link added should be a valid URL and accessible throughout the org.

- If the branch name contains hotfix / revert by default the BVT workflow check will pass.

Test Case Document URL
Please paste test case document link here....

@ChetanGN ChetanGN added the TestingNotRequired TestingNotRequired label for BVT label May 28, 2024
if (!empty($merchantPreferences['features']['one_cc_store_account'])) {
$isAccCreationAvailable = true;
}
set_transient( self::ONE_CC_MERCHANT_PREF, $merchantPreferences, 7200 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChetanGN , don't see any check around this before API call ?

$merchantPreferences = get_transient(self::ONE_CC_MERCHANT_PREF);

// Load preference API call only for administrative interface + razorpay payment settings page.
if (current_user_can('administrator') &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChetanGN , any analysis why too many API hits , though we have admin check here ?

@@ -277,6 +277,7 @@ public function __construct($hooks = true)

// Load preference API call only for administrative interface + razorpay payment settings page.
if (current_user_can('administrator') &&
empty($merchantPreferences) === true &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChetanGN , please use () for each condition.

Copy link
Contributor

@ramth05 ramth05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ramth05 ramth05 merged commit 0b81e99 into master Jun 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TestingNotRequired TestingNotRequired label for BVT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants