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); }
/** * Get the order from event and create payment. * * @param GenericEvent $event * * @throws \InvalidArgumentException */ public function createOrderPayment(GenericEvent $event) { $this->paymentProcessor->createPayment($this->getOrder($event)); }
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); }
/** * 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)); } }
/** * {@inheritdoc} */ public function process(OrderInterface $order) { $this->orderShipmentProcessor->processOrderShipment($order); $this->paymentProcessor->processOrderPayments($order); }