public function handle($data) { PayqrConfig::setConfig(); if (isset($data["invoice_action"])) { $order_id = $data["order_id"]; $action = $data["invoice_action"]; $invoice_id = $data["invoice_id"]; if ($this->validate($data)) { $invAction = new PayqrInvoiceAction(); switch ($action) { case "invoice_cancel": $invAction->invoice_cancel($invoice_id); $order = new PayqrOrder(); $order->cancelOrder(); break; case "invoice_revert": $revert_amount = $data["invoice_revert_amount"]; $invAction->invoice_revert($invoice_id, $revert_amount); break; case "invoice_confirm": $invAction->invoice_confirm($invoice_id); break; case "invoice_execution_confirm": $invAction->invoice_execution_confirm($invoice_id); break; case "invoice_message": $text = $data["invoice_message_text"]; $image_url = $data["invoice_message_image_url"]; $click_url = $data["invoice_message_click_url"]; $invAction->invoice_message($invoice_id, $text, $image_url, $click_url); break; case "invoice_sync_data": $order = new PayqrOrder(); $order->syncOrder(); break; } } } }
/** * Задаём настройки */ private function setModuleConfig() { $user_id = isset($_GET["user_id"]) ? $_GET["user_id"] : 1; $auth = new PayqrModuleAuth($user_id); PayqrConfig::setConfig(); }