|
|
@@ -7,6 +7,7 @@ use App\Entity\OrderShop; |
|
|
|
use Doctrine\ORM\EntityManagerInterface; |
|
|
|
use Lc\ShopBundle\Context\DocumentInterface; |
|
|
|
use Lc\ShopBundle\Context\MerchantUtilsInterface; |
|
|
|
use Lc\ShopBundle\Context\OrderPaymentInterface; |
|
|
|
use Lc\ShopBundle\Context\OrderReductionCartInterface; |
|
|
|
use Lc\ShopBundle\Context\OrderProductInterface; |
|
|
|
use Lc\ShopBundle\Context\OrderReductionCreditInterface; |
|
|
@@ -418,4 +419,20 @@ class OrderUtils |
|
|
|
return $orderProductsByProductFamily ; |
|
|
|
} |
|
|
|
|
|
|
|
public function createOrderPayment($orderShop, $type, $amount, $reference = null, $comment = null, $paidAt = null) |
|
|
|
{ |
|
|
|
$classOrderPayment = $this->em->getClassMetadata(OrderPaymentInterface::class)->getName() ; |
|
|
|
$orderPayment = new $classOrderPayment ; |
|
|
|
|
|
|
|
$orderPayment->setOrderShop($orderShop) ; |
|
|
|
$orderPayment->setType($type) ; |
|
|
|
$orderPayment->setAmount($amount) ; |
|
|
|
$orderPayment->setReference($reference) ; |
|
|
|
$orderPayment->setComment($comment) ; |
|
|
|
$orderPayment->setPaidAt($paidAt) ; |
|
|
|
|
|
|
|
$this->em->persist($orderPayment) ; |
|
|
|
$this->em->flush() ; |
|
|
|
} |
|
|
|
|
|
|
|
} |