42 $result->addError(
new Error(
'ORDER_ID is not defined',
''));
51 public function save()
62 public function add(array $params)
68 $result->addError(
new Error(GetMessage(
'SALE_EXCHANGE_ENTITY_PAYMENT_ORDER_IS_NOT_LOADED_ERROR'),
'ENTITY_PAYMENT_ORDER_IS_NOT_LOADED_ERROR'));
74 if(($paySystem =
Sale\PaySystem\Manager::getObjectById(
$fields[
'PAY_SYSTEM_ID'])) ==
null)
76 $result->addError(
new Error(GetMessage(
'SALE_EXCHANGE_ENTITY_PAYMENT_PAYMENT_SYSTEM_IS_NOT_AVAILABLE_ERROR'),
'PAYMENT_SYSTEM_IS_NOT_AVAILABLE_ERROR'));
82 $payment = $paymentCollection->createItem($paySystem);
83 $result = $payment->setFields(
$fields);
85 if($result->isSuccess())
98 public function update(array $params)
103 $criterion = $this->getCurrentCriterion($this->
getEntity());
106 if(!$criterion->equals(
$fields))
115 $result = $payment->setFields(
$fields);
124 public function delete(array $params =
null)
129 if($result->isSuccess())
146 return 'EXTERNAL_PAYMENT';
165 $this->loadParentEntity([
'ID'=>
$fields[
'ORDER_ID']])
189 return new Sale\Result();
202 $entity->setField(
'PAID',
'N');
213 if(!($payment instanceof
Payment))
216 $paySystem = $payment->getPaySystem();
217 $type = $paySystem->getField(
'IS_CASH');
219 return static::resolveEntityTypeIdByCodeType($type);
264 $collection =
$entity->getCollection();
266 return $collection->getOrder();
274 parent::__construct($parentEntityContext);
287 parent::__construct($parentEntityContext);
300 parent::__construct($parentEntityContext);
setParentEntity(Sale\Order $parentEntity)
setCollisions($tipeId, Sale\Internals\Entity $entity, $message=null)
setExternal($external=true)
__construct($parentEntityContext=null)
__construct($parentEntityContext=null)
__construct($parentEntityContext=null)
static resolveEntityTypeId(Internals\Entity $payment)
static resolveEntityTypeIdByCodeType($type)
setEntity(Internals\Entity $entity)
checkFields(array $fields)
const OrderPaymentDeletedError
const PAYMENT_CARD_TRANSACTION
refreshData(array $fields)
static getBusinessValueOrderProvider(\Bitrix\Sale\IBusinessValueProvider $entity)