config('harim_web_services.Harim_Payment.username'), 'password' => config('harim_web_services.Harim_Payment.PASSWORD'), 'amount' => $payment_amount, 'serial' => "12345", 'type' => 1, 'instanceid' => 123, 'ownerid' => $national_id, 'calculationBox' => "{\"rows\":[{\"amount\":" . $payment_amount . ",\"code\":\"7070011026200593\"}]}" ); $response = Http::retry(3, 100)->withBody(http_build_query($payload)) ->post(config('harim_web_services.Harim_Payment.url')); return $response->body(); } catch (\Throwable $th) { throw new ProhibitedAction('خطا در ارتباط با سرویس پرداخت'); } } return 0; } public function callPaymentStatusBillApi($bill_code) { if (App::isProduction()) { try { $username = config('harim_web_services.Harim_Payment.username'); $password = config('harim_web_services.Harim_Payment.PASSWORD'); $url = config('harim_web_services.Harim_Payment.url'); $result = "{$url}/{$username}/{$password}/{$bill_code}"; $response = Http::timeout(10)->get($result); return $response; } catch (\Throwable $th) { abort(500); } } return json_encode(['isPayed' => 1]); } }