Dumplie\CustomerService\Domain\Payments::add PHP Method

add() public method

public add ( Payment $payment )
$payment Payment
    public function add(Payment $payment);

Usage Example

 /**
  * @param CreatePayment $command
  * @throws OrderNotFoundException
  */
 public function handle(CreatePayment $command)
 {
     $order = $this->orders->getById(new OrderId($command->orderId()));
     $this->payments->add(new Payment(new PaymentId($command->paymentId()), $order));
 }