M
M
mirexdoors2018-09-24 23:09:55
1C-Bitrix
mirexdoors, 2018-09-24 23:09:55

Creating an order via api?

Hello! I create an order in Bitrix via api on request. Everything is OK, the order is being created, only the following line will pop up in the handler's response:
CAdminMessage not found
I form the answer like this:

$response = array();
    if (isset($order_id)) {
      $response['status'] = 0;
      $response['data'] = array(
        "order_id" => $order_id,
        "link" => ""
      );

      if ($payment['id'] == 7) {
        $response['data']["link"] = "https://auth.robokassa.ru/Merchant/Index.aspx";
        $response['robokassa'] = array(
          'FinalStep' => 1,
          'MrchLogin' => 'Login',
          'OutSum' => $sum,
          "InvId" => $order_id,
          "Desc" => $order_id,
          "SignatureValue" => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
          "Email" => $orderInfo['email'],
          "SHP_HANDLER" => "ROBOXCHANGE",
          "SHP_BX_PAYSYSTEM_CODE" => 7,
          "IncCurrLabel"=> ""
        );
      }
    } else {
      $response['status'] = 1;
      $response["message"] = "Критическая ошибка";
    }

I don't use CAdminMessage anywhere.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2018-09-25
@mirexdoors

$APPLICATION->RestartBuffer();
echo json_encode($response);
die();

CAdminMessagecan get out of some event handler

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question