-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use messenger to be able to make Stripe API call in the admin
- Loading branch information
Showing
21 changed files
with
451 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace spec\FluxSE\SyliusPayumStripePlugin\StateMachine; | ||
|
||
use FluxSE\SyliusPayumStripePlugin\Command\CaptureAuthorizedPayment; | ||
use PhpSpec\ObjectBehavior; | ||
use SM\Event\TransitionEvent; | ||
use Sylius\Component\Core\Model\PaymentInterface; | ||
use Symfony\Component\Messenger\Envelope; | ||
use Symfony\Component\Messenger\MessageBusInterface; | ||
|
||
final class CaptureAuthorizedOrderProcessorSpec extends ObjectBehavior | ||
{ | ||
public function let(MessageBusInterface $commandBus): void { | ||
$this->beConstructedWith($commandBus); | ||
} | ||
|
||
public function it_is_invokable( | ||
PaymentInterface $payment, | ||
TransitionEvent $event, | ||
MessageBusInterface $commandBus | ||
): void { | ||
$event->getState()->willReturn(PaymentInterface::STATE_AUTHORIZED); | ||
|
||
$payment->getId()->willReturn(1); | ||
|
||
$command = new CaptureAuthorizedPayment(1); | ||
$commandBus->dispatch($command)->willReturn(new Envelope($command)); | ||
|
||
$this->__invoke($payment, $event); | ||
} | ||
|
||
public function it_do_nothing_when_it_is_completed( | ||
PaymentInterface $payment, | ||
TransitionEvent $event | ||
): void { | ||
$event->getState()->willReturn(PaymentInterface::STATE_COMPLETED); | ||
|
||
$this->__invoke($payment, $event); | ||
} | ||
|
||
public function it_do_nothing_when_it_is_refunded( | ||
PaymentInterface $payment, | ||
TransitionEvent $event | ||
): void { | ||
$event->getState()->willReturn(PaymentInterface::STATE_REFUNDED); | ||
|
||
$this->__invoke($payment, $event); | ||
} | ||
} |
84 changes: 0 additions & 84 deletions
84
spec/StateMachine/CompleteAuthorizedOrderProcessorSpec.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.