Skip to content
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

Merged
merged 2 commits into from
Mar 20, 2014

Conversation

kayue
Copy link
Contributor

@kayue kayue commented Mar 20, 2014

This help make sure payment amount is always match with order total.

@@ -61,18 +61,33 @@ public function __construct(PaymentProcessorInterface $paymentProcessor, EntityR
* Get the order from event and create payment.
*
* @param GenericEvent $event
* @throws \InvalidArgumentException
Copy link
Contributor

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.

@stloyd stloyd added the Bug Fix label Mar 20, 2014
@stloyd stloyd added this to the 1.0.0-BETA1 milestone Mar 20, 2014
@stloyd
Copy link
Contributor

stloyd commented Mar 20, 2014

Can you add specs? It would help to be sure we not broke it with external changes...

@kayue
Copy link
Contributor Author

kayue commented Mar 20, 2014

@stloyd May I know how to run single spec? I tried many different path but no luck.. Thanks.

@stloyd
Copy link
Contributor

stloyd commented Mar 20, 2014

$ php bin/phpspec run spec/SpecFileYouWantToTestSpec.php

@jjanvier
Copy link
Contributor

@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) {
Copy link
Member

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
Copy link
Contributor Author

kayue commented Mar 20, 2014

Thanks @stloyd @jjanvier . First time PHPSpec, quite magical. :)

@jjanvier
Copy link
Contributor

@kayue oh yes :)

stloyd added a commit that referenced this pull request Mar 20, 2014
Update order payment amount before paid.
@stloyd stloyd merged commit dd9748c into Sylius:master Mar 20, 2014
@stloyd
Copy link
Contributor

stloyd commented Mar 20, 2014

@kayue Thanks! Hope you will love phpspec same as we do =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants