-
Notifications
You must be signed in to change notification settings - Fork 2
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
SL-196: payment method invoice append #134
Conversation
mant02
commented
Dec 8, 2023
saferpayofficial.php
Outdated
@@ -21,6 +21,8 @@ | |||
*@license SIX Payment Services | |||
*/ | |||
|
|||
use Invertus\SaferPay\Repository\SaferPayOrderRepository; |
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.
If module is supported in 1.6, then do not use dependency import here in main class. If you need to define service namespace, use full namespace where you need that (probably other services are use there like that as well).
public function hookActionObjectOrderPaymentAddAfter($params) | ||
{ | ||
/** @var OrderPayment $orderPayment */ | ||
$orderPayment = $params['object']; |
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.
check if this is valid object as well, also check if array key is actually set
$orders = Order::getByReference($orderPayment->order_reference); | ||
|
||
/** @var Order $order */ | ||
$order = $orders->getFirst(); |
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.
can also be bool (not sure what in 1.6 is return value). Order|bool
saferpayofficial.php
Outdated
return; | ||
} | ||
|
||
// NOTE: ask on what to name the payment method. Ex. SaferPay - PayPal ... |
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.
So, did you ask...?
saferpayofficial.php
Outdated
return; | ||
} | ||
|
||
$brand = $saferPayOrderRepository->getPaymentBrandByAssertId($saferPayAssertId); |
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.
useless method, just retrieve brand by safer pay order id and replace method above