| @@ 569-598 (lines=30) @@ | ||
| 566 | * | |
| 567 | * @return Order | |
| 568 | */ | |
| 569 | protected function createOrder(Cart $cart, Customer $customer) | |
| 570 |     { | |
| 571 | $order = new Order(); | |
| 572 | $order->setChannel($this->integration); | |
| 573 | $order->setDataChannel($this->channel); | |
| 574 |         $order->setStatus('open'); | |
| 575 |         $order->setIncrementId('100000307'); | |
| 576 |         $order->setCreatedAt(new \DateTime('now')); | |
| 577 |         $order->setUpdatedAt(new \DateTime('now')); | |
| 578 | $order->setCart($cart); | |
| 579 | $order->setStore($this->store); | |
| 580 | $order->setCustomer($customer); | |
| 581 |         $order->setCustomerEmail('[email protected]'); | |
| 582 | $order->setDiscountAmount(4.40); | |
| 583 | $order->setTaxAmount(12.47); | |
| 584 | $order->setShippingAmount(5); | |
| 585 | $order->setTotalPaidAmount(17.85); | |
| 586 | $order->setTotalInvoicedAmount(11); | |
| 587 | $order->setTotalRefundedAmount(4); | |
| 588 | $order->setTotalCanceledAmount(0); | |
| 589 |         $order->setShippingMethod('some unique shipping method'); | |
| 590 |         $order->setRemoteIp('127.0.0.1'); | |
| 591 |         $order->setGiftMessage('some very unique gift message'); | |
| 592 | $order->setOwner($this->getUser()); | |
| 593 | $order->setOrganization($this->organization); | |
| 594 | ||
| 595 | $this->em->persist($order); | |
| 596 | ||
| 597 | return $order; | |
| 598 | } | |
| 599 | ||
| 600 | /** | |
| 601 | * @param Cart $cart | |
| @@ 605-635 (lines=31) @@ | ||
| 602 | * | |
| 603 | * @return Order | |
| 604 | */ | |
| 605 | protected function createGuestOrder(Cart $cart) | |
| 606 |     { | |
| 607 | $order = new Order(); | |
| 608 | $order->setChannel($this->integration); | |
| 609 | $order->setDataChannel($this->channel); | |
| 610 |         $order->setStatus('open'); | |
| 611 |         $order->setIncrementId('100000308'); | |
| 612 |         $order->setCreatedAt(new \DateTime('now')); | |
| 613 |         $order->setUpdatedAt(new \DateTime('now')); | |
| 614 | $order->setCart($cart); | |
| 615 | $order->setStore($this->store); | |
| 616 | $order->setCustomer(null); | |
| 617 | $order->setIsGuest(1); | |
| 618 |         $order->setCustomerEmail('[email protected]'); | |
| 619 | $order->setDiscountAmount(4.40); | |
| 620 | $order->setTaxAmount(12.47); | |
| 621 | $order->setShippingAmount(5); | |
| 622 | $order->setTotalPaidAmount(17.85); | |
| 623 | $order->setTotalInvoicedAmount(11); | |
| 624 | $order->setTotalRefundedAmount(4); | |
| 625 | $order->setTotalCanceledAmount(0); | |
| 626 |         $order->setShippingMethod('some unique shipping method'); | |
| 627 |         $order->setRemoteIp('127.0.0.1'); | |
| 628 |         $order->setGiftMessage('some very unique gift message'); | |
| 629 | $order->setOwner($this->getUser()); | |
| 630 | $order->setOrganization($this->organization); | |
| 631 | ||
| 632 | $this->em->persist($order); | |
| 633 | ||
| 634 | return $order; | |
| 635 | } | |
| 636 | ||
| 637 | /** | |
| 638 | * @param Order $order | |