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);
 }
Esempio 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));
 }
Esempio 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);
 }
Esempio 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));
     }
 }
Esempio n. 5
0
 /**
  * {@inheritdoc}
  */
 public function process(OrderInterface $order)
 {
     $this->orderShipmentProcessor->processOrderShipment($order);
     $this->paymentProcessor->processOrderPayments($order);
 }