31 lines
1.2 KiB
PHP
31 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Payment;
|
|
|
|
use App\Entities\Customer\ServiceEntity;
|
|
use App\Entities\Equipment\ServerPartEntity;
|
|
use App\Entities\PaymentEntity;
|
|
|
|
class ModifyPayment extends PaymentService
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
//서버연결정보용 수정
|
|
protected function setServerPart_process(ServerPartEntity $serverPartEntity, ServiceEntity $serviceEntity, array $formDatas): serverPartEntity
|
|
{
|
|
$serverPartEntity = parent::setServerPart_process($serverPartEntity, $serviceEntity, $formDatas);
|
|
if (!array_key_exists('serverpartinfo_uid', $formDatas)) {
|
|
throw new \Exception(__METHOD__ . "에서 오류발생: 기존 결제정보가 지정되지 않았습니다.");
|
|
}
|
|
$entity = $this->getEntity(['serverpartinfo_uid' => $serverPartEntity->getPK(), 'status' => STATUS['UNPAID']]);
|
|
if (!$entity instanceof PaymentEntity) {
|
|
throw new \Exception(__METHOD__ . "에서 오류발생: {$serverPartEntity->getPK()}에 해당하는 결제정보를 찾을수 없습니다.");
|
|
}
|
|
$entity = $this->modify($entity, $formDatas);
|
|
return $serverPartEntity;
|
|
}
|
|
}
|