- Модуль: salescenter
- Путь к файлу: ~/bitrix/modules/salescenter/lib/controller/order.php
- Класс: BitrixSalesCenterControllerOrder
- Вызов: Order::resendPaymentAction
public function resendPaymentAction($orderId, $paymentId, $shipmentId, array $options = [])
{
if ($options['sendingMethod'] === 'sms')
{
$order = CrmOrderOrder::load($orderId);
$payment = null;
if ($paymentId)
{
/** @var CrmOrderPayment $payment */
$payment = $order->getPaymentCollection()->getItemById($paymentId);
}
if ($payment === null)
{
$this->addError(
new Error(Loc::getMessage('SALESCENTER_CONTROLLER_ORDER_CANT_SEND_SMS_PAYMENT_NOT_FOUND'))
);
return;
}
$shipment = null;
if ($shipmentId)
{
/** @var CrmOrderShipment $shipment */
$shipment = $order->getShipmentCollection()->getItemById($shipmentId);
}
$isSent = CrmManager::getInstance()->sendPaymentBySms($payment, $options['sendingMethodDesc'], $shipment);
if ($isSent === false)
{
$this->addError(
new Error(Loc::getMessage('SALESCENTER_CONTROLLER_ORDER_SEND_SMS_ERROR'), 20)
);
}
else
{
$this->processDocumentSelectorOptions($paymentId, $options);
}
}
}