Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/09/2018 in all areas

  1. Whmxx has done more features than blesta in the last two years after the release of v7, they have flyed with so many cool featurs . For me blesta is out from competing other hosting billing system !
    1 point
  2. I already request to close this post . It has no sense without any feedbacks .
    1 point
  3. Module for what ? it can be 0$ or 50$ or 500$, and maybe 1500$ .
    1 point
  4. When the API doesn't work the way you expect, you should look at the errors you enconter, e.g.: print_r($response->errors()); See the docs for an example. From looking at your request, you are making a couple mistakes: You're using the "GET" HTTP verb to add something. "GET" [i.e. $api->get(..)] should only be used for retrieving information, not setting information. Use "POST" [i.e. $api->post(...)] You're not passing valid key => value pairs for all values expected by Invoices::add You have "array($service_id,'Desc', 1,1,0)". Is that supposed to be the line items? Why aren't they in key => value format? You have "...'recur_date_billed' => $today, 1)));". What is that extraneous 1 at the end of the list that is not in key => value format? It'll be easier to figure out and avoid issues if you format your source code better: $response = $api->get( "invoices", "add", array( 'vars' => array( 'client_id' => $client_id, 'date_billed' => $today, 'date_due' => $today, 'date_closed' => $today, 'date_autodebit' => $today, 'status' => 'active', 'currency' => '208', 'note_public' => 'Public note', 'note_private' => 'Privat note', array($service_id,'Desc', 1,1,0), 'period' => 'month', 'duration' => 'indefinitely', 'duration_time' => '1', 'recur_date_billed' => $today, 1 ) ) );
    1 point
  5. Ooh thats how it works haha Gotcha, now i fully understand the system
    1 point
  6. array('ticket_id' => $ticket_id, 'vars' => array('client_id' => $client_id, 'details' => 'dab'))
    1 point
  7. lolgc1

    Get username

    This is solved
    1 point
  8. The intent is to perform proration separately from a service edit, such as apart of a pricing presenter (which is what we had done in some places, like queued service changes, in v4.0), and overall decrease the number of separate actions that a service edit performs.
    1 point
  9. 1 point
  10. Tyson

    Get username

    If you are unable to access the blesta_id from the session: $user_id = (isset($_SESSION['blesta_id']) ? $_SESSION['blesta_id'] : null); ...then I would suggest following @Blesta Addons's recommendation of creating a plugin. If you upgrade Blesta to v4.3.0+ then your plugin can make use of the new Requestor object that retrieves some relevant information on the currently-logged-in user. If the user is currently logged into Blesta, you should be able to retrieve their user information by creating a plugin with a model that fetches the user from the database, e.g.: class MyPluginUserModel extends MyPluginModel { public function getCurrentUser() { // Load information on the current user $requestor = $this->getFromContainer('requestor'); // Fetch additional information on the current user if ($requestor->user_id !== null) { Loader::loadModels($this, ['Users']); // Fetch and return the user if one exists if (($user = $this->Users->get($requestor->user_id))) { return $user; } } // Return null that no user was found return null; } } You just need to make an API call to your "MyPluginUserModel::getCurrentUser" to retrieve the user. If a non-null value is returned, the username would be available in the "username" property: <?php // Load the API require_once "/home/username/public_html/blesta_api.php"; $user = "API USERNAME"; $key = "API KEY"; $url = "https://blestainstallationurl.com/api/"; $api = new BlestaApi($url, $user, $key); // Fetch the current user's username if they are logged into Blesta $username = null; if (($user = $api->get("MyPlugin.MyPluginUserModel", "getCurrentUser"))) { $username = $user->username; }
    1 point
  11. Blesta Addons

    Get username

    normally the signed in user are stored in blesta sessions, so blesta can retrieve the blesta_id . from out side blesta is dificult to get get it or almost impossible to get it with simple code, you need to make plugin to help you do the job or you need to hack some blesta files . my simple approach for this would to create a simple plugin that act the login and the logout, preaction events, and each event i will pass the client info to a remote file (let say data.php). the data php should be in your root folder and use the same sessions as your index.php , the rule of this file would be only to insert in the session the info send from the plugin and destroy the info if sent a command from blesta plugin .
    1 point
  12. Merchant processors are fickle. Braintree wouldn't take us because we bill quarterly. This in spite of the fact we have been in business nearly 30 years. Stripe doesn't have a problem with our business model, so we'll stick with them.
    1 point
  13. i think you should first search for a software that do this like virtual datacenter, something like DCI Manager, NOC .... ect, then make a module to interact with their API .
    1 point
×
×
  • Create New...