-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Update order payment amount before paid. #1246
Conversation
@@ -61,18 +61,33 @@ public function __construct(PaymentProcessorInterface $paymentProcessor, EntityR | |||
* Get the order from event and create payment. | |||
* | |||
* @param GenericEvent $event | |||
* @throws \InvalidArgumentException |
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 new line before this one.
Can you add specs? It would help to be sure we not broke it with external changes... |
@stloyd May I know how to run single spec? I tried many different path but no luck.. Thanks. |
$ php bin/phpspec run spec/SpecFileYouWantToTestSpec.php |
@kayue go in the directory of the bundle you are working and launch the specs from here : cd src/Sylius/Bundle/CartBundle
../../../../bin/phpspec run |
$order = $this->getOrder($event); | ||
$payment = $order->getPayment(); | ||
|
||
if (!$payment instanceof PaymentInterface) { |
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.
This check is not needed. Checking if the payment is not null should be enough, because it can be only PaymentInterface or null. (see the Order / OrderInterface)
@kayue oh yes :) |
Update order payment amount before paid.
@kayue Thanks! Hope you will love phpspec same as we do =) |
This help make sure payment amount is always match with order total.