コード例 #1
0
ファイル: PaymentProcessor.php プロジェクト: okwinza/Sylius
 /**
  * {@inheritdoc}
  */
 private function setPaymentMethodIfNeeded(OrderInterface $order, PaymentInterface $payment)
 {
     $lastPayment = $this->getLastPayment($order);
     if (null === $lastPayment) {
         return;
     }
     $payment->setMethod($lastPayment->getMethod());
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 private function setPaymentMethodIfNeeded(OrderInterface $order, PaymentInterface $payment)
 {
     $lastCancelledPayment = $order->getLastPayment(PaymentInterface::STATE_CANCELLED);
     $lastNewPayment = $order->getLastPayment(PaymentInterface::STATE_NEW);
     if (!$lastNewPayment && $lastCancelledPayment) {
         $payment->setMethod($lastCancelledPayment->getMethod());
     }
 }