function it_creates_payment(GenericEvent $event, OrderInterface $order, PaymentProcessorInterface $processor)
 {
     $event->getSubject()->willReturn($order);
     $order->getLastPayment()->willReturn(false);
     $processor->processOrderPayments($order)->shouldBeCalled();
     $this->createOrderPayment($event);
 }
Exemplo n.º 2
0
 /**
  * Get the order from event and create payment.
  *
  * @param GenericEvent $event
  *
  * @throws \InvalidArgumentException
  */
 public function createOrderPayment(GenericEvent $event)
 {
     $this->paymentProcessor->createPayment($this->getOrder($event));
 }
Exemplo n.º 3
0
 function it_runs_order_shipment_processor_and_payment_processor_to_control_order_shipments_and_payments(OrderInterface $order, OrderShipmentProcessorInterface $orderShipmentProcessor, PaymentProcessorInterface $paymentProcessor)
 {
     $orderShipmentProcessor->processOrderShipment($order)->shouldBeCalled();
     $paymentProcessor->processOrderPayments($order)->shouldBeCalled();
     $this->process($order);
 }
Exemplo n.º 4
0
 /**
  * Get the order from event and create payment.
  *
  * @param GenericEvent $event
  *
  * @throws \InvalidArgumentException
  */
 public function createOrderPayment(GenericEvent $event)
 {
     if (false === $this->getOrder($event)->getLastPayment()) {
         $this->paymentProcessor->createPayment($this->getOrder($event));
     }
 }
Exemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function process(OrderInterface $order)
 {
     $this->orderShipmentProcessor->processOrderShipment($order);
     $this->paymentProcessor->processOrderPayments($order);
 }