-
Notifications
You must be signed in to change notification settings - Fork 38
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
Conversation
Controller/Payment/Order.php
Outdated
$currency === "OMR" or | ||
$currency === "BHD") | ||
{ | ||
throw new \Exception($currency . " currency is not supported at the moment."); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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' => []
];
Controller/Payment/Order.php
Outdated
@@ -249,10 +249,19 @@ public function execute() | |||
. " and amount:" . $amount); | |||
// @codeCoverageIgnoreEnd | |||
|
|||
$currency = $mazeOrder->getOrderCurrencyCode(); | |||
|
|||
if ($currency === "KWD" or |
There was a problem hiding this comment.
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
Controller/Payment/Order.php
Outdated
@@ -249,10 +249,30 @@ public function execute() | |||
. " and amount:" . $amount); | |||
// @codeCoverageIgnoreEnd | |||
|
|||
$currency = $mazeOrder->getOrderCurrencyCode(); | |||
|
|||
if (in_array($currency, ["KWD", "BHD", "OMR"])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yashgit891 , use === true
There was a problem hiding this comment.
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.
Controller/Payment/Order.php
Outdated
@@ -249,10 +249,30 @@ public function execute() | |||
. " and amount:" . $amount); | |||
// @codeCoverageIgnoreEnd | |||
|
|||
$currency = $mazeOrder->getOrderCurrencyCode(); |
There was a problem hiding this comment.
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."); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.