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

Blocked currencies KWD, OMR, BHD. #461

Merged
merged 4 commits into from
Nov 9, 2023

Conversation

yashgit891
Copy link
Contributor

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....

@yashgit891 yashgit891 added the TestingNotRequired TestingNotRequired label for BVT label Nov 7, 2023
$currency === "OMR" or
$currency === "BHD")
{
throw new \Exception($currency . " currency is not supported at the moment.");
Copy link
Contributor

Choose a reason for hiding this comment

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

@yashgit891 , please return response same like error so that it can be used. No need to throw the exception. Also log it.

Copy link
Contributor

Choose a reason for hiding this comment

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

same like this one

                'message'   => 'Unable to create your order. Please contact support.',
                'parameters' => []
            ];

@@ -249,10 +249,19 @@ public function execute()
. " and amount:" . $amount);
// @codeCoverageIgnoreEnd

$currency = $mazeOrder->getOrderCurrencyCode();

if ($currency === "KWD" or
Copy link
Contributor

Choose a reason for hiding this comment

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

@yashgit891 , also please an array for the same. use in array

@@ -249,10 +249,30 @@ public function execute()
. " and amount:" . $amount);
// @codeCoverageIgnoreEnd

$currency = $mazeOrder->getOrderCurrencyCode();

if (in_array($currency, ["KWD", "BHD", "OMR"]))
Copy link
Contributor

Choose a reason for hiding this comment

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

@yashgit891 , use === true

Copy link
Contributor

Choose a reason for hiding this comment

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

Also define these currency as const array as well.

@@ -249,10 +249,30 @@ public function execute()
. " and amount:" . $amount);
// @codeCoverageIgnoreEnd

$currency = $mazeOrder->getOrderCurrencyCode();
Copy link
Contributor

Choose a reason for hiding this comment

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

@yashgit891 , lets use it directly here, we don't to assign it new var

@@ -132,6 +134,11 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
];
}

if (in_array($order_currency_code, static::THREE_DECIMAL_CURRENCIES) === true)
{
throw new \Exception($order_currency_code . " currency is not supported at the moment.");
Copy link
Contributor

Choose a reason for hiding this comment

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

@yashgit891 , please add info log here as well

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

@yashgit891 yashgit891 marked this pull request as ready for review November 9, 2023 12:44
@yashgit891 yashgit891 merged commit 23d4734 into master-2.x Nov 9, 2023
1 of 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