-
Couldn't load subscription status.
- Fork 40
Magic integration latest #524
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
base: master-2.x
Are you sure you want to change the base?
Conversation
… customer email in notes
Added COD fee support in magento order
…o add_magic_integration_param
…ay-magento into magic_integration_latest
…ay-magento into add_magic_integration_param
Added magic-integration param
…o magic_integration_latest
…ay-magento into magic_integration_latest
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.
🔴 Brief Code Review shows huge gaps in the understanding of Magento maintainability and following best practices.
| @@ -0,0 +1,26 @@ | |||
| <?php | |||
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.
Add strict types declaration
| use Magento\Sales\Block\Adminhtml\Order\Totals as MagentoOrderTotals; | ||
| use Magento\Framework\DataObject; | ||
|
|
||
| class Totals extends MagentoOrderTotals |
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.
You should avoid inheritance.
In this specific case, you should use Magento built-in composition for adding custom Totals.
| @@ -0,0 +1,370 @@ | |||
| <?php | |||
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.
Add strict types declaration
|
|
||
| namespace Razorpay\Magento\Controller\OneClick; | ||
|
|
||
| use Magento\Framework\App\Action\Action; |
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.
Optimize imports
| /** | ||
| * @var Http | ||
| */ | ||
| protected $request; |
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.
All non-public properties should be private
| const COD = 'cashondelivery'; | ||
| const RAZORPAY = 'razorpay'; | ||
| const STATE_PENDING_PAYMENT = 'pending_payment'; |
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.
constshould be at the top of the class- And have their visibility
public/private
|
|
||
| $orderPlacement = false; | ||
|
|
||
| try { |
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.
Nested try ... catch significantly increases the cyclomatic complexity, making it difficult to troubleshoot / debug
| @@ -0,0 +1,98 @@ | |||
| <!-- | |||
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.
- Override in Payment Method module is really bad idea,
- Additionally -- You should not include outdated Magento copyright message.
| @@ -0,0 +1,45 @@ | |||
| <?php | |||
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.
You should never use ObjectManager directly.
Instead, inject ViewModel to the view.
| @@ -0,0 +1,33 @@ | |||
| <?php | |||
|
|
|||
| $objectManager = getObjectManager(); | |||
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.
You should never use ObjectManager directly.
Instead, use view model
Note :- Please follow the below points while attaching test cases document link below:
- If label
Testedis 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.