Skip to content

Commit

Permalink
bug #74 fixed bug, when payment could not be completed if factory nam…
Browse files Browse the repository at this point in the history
…e was different than paypal (SirDomin)

This PR was merged into the 1.0-dev branch.

Discussion
----------



Commits
-------

988d44d order complete processor gets factory name
  • Loading branch information
Zales0123 authored Aug 31, 2020
2 parents eca96f1 + 988d44d commit 91fcc7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spec/Processor/PayPalOrderCompleteProcessorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function it_completes_pay_pal_order(

$payment->getMethod()->willReturn($paymentMethod);
$paymentMethod->getGatewayConfig()->willReturn($gatewayConfig);
$gatewayConfig->getGatewayName()->willReturn('paypal');
$gatewayConfig->getFactoryName()->willReturn('sylius.pay_pal');

$paymentStateManager->complete($payment)->shouldBeCalled();

Expand All @@ -57,7 +57,7 @@ function it_does_nothing_if_processing_payment_is_not_pay_pal(

$payment->getMethod()->willReturn($paymentMethod);
$paymentMethod->getGatewayConfig()->willReturn($gatewayConfig);
$gatewayConfig->getGatewayName()->willReturn('stripe');
$gatewayConfig->getFactoryName()->willReturn('stripe');

$paymentStateManager->complete($payment)->shouldNotBeCalled();

Expand Down
2 changes: 1 addition & 1 deletion src/Processor/PayPalOrderCompleteProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function completePayPalOrder(OrderInterface $order): void
/** @var GatewayConfigInterface $gatewayConfig */
$gatewayConfig = $paymentMethod->getGatewayConfig();

if ($gatewayConfig->getGatewayName() !== 'paypal') {
if ($gatewayConfig->getFactoryName() !== 'sylius.pay_pal') {
return;
}

Expand Down

0 comments on commit 91fcc7a

Please sign in to comment.