How to set a url in drupal database or settings.php?
In your settings file add

$settings['razorpayUrl'] = 'https://example.com';


Then in your module

use Drupal\Core\Site\Settings;
$url = Settings::get('razorpayUrl');