function ProcessResult() { $webhook = new \beGateway\Webhook(); if (!$webhook->isAuthorized() || !$webhook->isSuccess() || $this->_shopOrder->paid || is_null($order_id = intval(Core_Array::getRequest('order_id'))) || $order_id != $webhook->getTrackingId()) { return FALSE; } $sum = $this->getSumWithCoeff(); $oShop_Currency = Core_Entity::factory('Shop_Currency')->find($this->_begateway_currency_id); /* конвертировать RUR код в RUB */ $currency = $oShop_Currency->code; $currency = $currency == 'RUR' ? 'RUB' : $currency; $money = new \beGateway\Money(); $money->setCurrency($currency); $money->setAmount($sum); if ($money->getCents() == $webhook->getResponse()->transaction->amount && $currency == $webhook->getResponse()->transaction->currency) { $this->shopOrderBeforeAction(clone $this->_shopOrder); $result = array("Товар оплачен.", "Атрибуты:", "Номер сайта продавца: " . $this->_shop_id, "Внутренний номер покупки продавца: " . $this->_shopOrder->id, "Сумма платежа: " . $sum, "Валюта платежа: " . $oShop_Currency->code, "UID платежа: " . $webhook->getUid(), "Способ оплаты: " . $webhook->getPaymentMethod(), "Статус платежа: успешно"); if (isset($webhook->getResponse()->transaction->three_d_secure_verification)) { $result[] = "3-D Secure: " . $webhook->getResponse()->transaction->three_d_secure_verification->pa_status; } $this->_shopOrder->system_information = implode($result, "\n"); $this->_shopOrder->paid(); $this->setXSLs(); $this->send(); ob_start(); $this->changedOrder('changeStatusPaid'); ob_get_clean(); } }