-
-
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
[API] Initial checkout implementation #11670
Conversation
lchrusciel
commented
Jul 21, 2020
•
edited
Loading
edited
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Related tickets | Based on #11666 |
License | MIT |
/** | ||
* @When I proceed with :shippingMethod shipping method | ||
*/ | ||
public function iHaveProceededSelectingShippingMethod(ShippingMethodInterface $shippingMethod): void |
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.
public function iHaveProceededSelectingShippingMethod(ShippingMethodInterface $shippingMethod): void | |
public function iProceededWithShippingMethod(ShippingMethodInterface $shippingMethod): void |
} | ||
|
||
public function __invoke(AddressOrder $addressOrder): OrderInterface | ||
{ |
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.
$addressOrder->orderTokenValue
is used in three places, it should be assigned to new variable
$paymentMethod = $this->paymentMethodRepository->findOneBy(['code' => $choosePaymentMethod->paymentMethod]); | ||
|
||
Assert::notNull($paymentMethod, 'Payment method has not been found'); | ||
Assert::true(isset($cart->getPayments()[$choosePaymentMethod->paymentIdentifier]), 'Can not find payment with given identifier.'); |
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.
$choosePaymentMethod->paymentIdentifier
should be assigned to new variable
|
||
Assert::notNull($shippingMethod, 'Shipping method has not been found'); | ||
Assert::true( | ||
isset($cart->getShipments()[$chooseShippingMethod->shipmentIdentifier]), |
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.
$chooseShippingMethod->shipmentIdentifier
the same like above comment
public function __invoke(CompleteOrder $completeOrder): OrderInterface | ||
{ | ||
/** @var OrderInterface $cart */ | ||
$cart = $this->orderRepository->findOneBy(['tokenValue' => $completeOrder->orderTokenValue]); |
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.
$completeOrder->orderTokenValue
and here
OrderRepositoryInterface $orderRepository, | ||
OrderInterface $order, | ||
PaymentMethodRepositoryInterface $paymentMethodRepository, | ||
PaymentMethodInterface $paymentMethod, | ||
PaymentInterface $payment, | ||
FactoryInterface $stateMachineFactory, |
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.
Wrong order, first three arguments should be in order like let function
OrderRepositoryInterface $orderRepository, | ||
OrderInterface $order, | ||
PaymentMethodRepositoryInterface $paymentMethodRepository, | ||
PaymentInterface $payment, | ||
FactoryInterface $stateMachineFactory, | ||
StateMachineInterface $stateMachine |
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.
Like comment above, here and in every places in this file
OrderRepositoryInterface $orderRepository, | ||
OrderInterface $order, | ||
ShippingMethodRepositoryInterface $shippingMethodRepository, | ||
ShippingMethodInterface $shippingMethod, | ||
ShipmentInterface $shipment, | ||
ShippingMethodEligibilityCheckerInterface $eligibilityChecker, | ||
FactoryInterface $stateMachineFactory, | ||
StateMachineInterface $stateMachine |
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.
Similar like comment above
FactoryInterface $stateMachineFactory, | ||
OrderInterface $order, | ||
OrderRepositoryInterface $orderRepository, | ||
StateMachineInterface $stateMachine |
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.
And here
use Symfony\Component\BrowserKit\AbstractBrowser; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\VarDumper\VarDumper; |
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.
use Symfony\Component\VarDumper\VarDumper; | |
use Symfony\Component\VarDumper\VarDumper; |
not needed
Closing in favour of #11675 |
…iel, Tomanhez) This PR was merged into the 1.8-dev branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | License | MIT This pr is based on #11670 <!-- - Bug fixes must be submitted against the 1.7 branch (the lowest possible) - Features and deprecations must be submitted against the master branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> Commits ------- 6456377 [API] Initial checkout implementation e0857fc Add fixes for tests
…iel, Tomanhez) This PR was merged into the 1.8-dev branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | License | MIT This pr is based on Sylius/Sylius#11670 <!-- - Bug fixes must be submitted against the 1.7 branch (the lowest possible) - Features and deprecations must be submitted against the master branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> Commits ------- 64563778e6d65948afab089aa1613a4614d88130 [API] Initial checkout implementation e0857fc5a3291ffd4e4d5337c471fe717d903bfa Add fixes for tests