Jump to content

Tyson

Blesta Developers
  • Posts

    3,638
  • Joined

  • Last visited

  • Days Won

    241

Reputation Activity

  1. Like
    Tyson got a reaction from Michael in Adding A Coupon empties cart   
    What order template are you using? Your site looks like it has custom changes to the order plugin. That could be responsible for the problem.
    I wasn't able to duplicate this behavior on an AJAX or Wizard order template. The Order plugin shouldn't redirect to another page when you redeem a coupon, it should just refresh the Order Summary section via AJAX.
  2. Haha
    Tyson got a reaction from Michael in Payza gateway using payza.com   
    Are the URLs to the sandbox, live, and refund end-points identical to what they were before, but just at the EU TLD?
    It looks like the US DOJ charged the company with a felony and took down their website for processing transactions without a license, so that's probably why they moved operations to their EU domain.
  3. Like
    Tyson reacted to qba82 in Payza gateway using payza.com   
    Yeah changing domain did module works fine.
  4. Like
    Tyson got a reaction from Joseph H in Renewal Price Field   
    The renewal price will be grayed out on the package if it is the same price as the base price right next to it. In this case, the difference is moot.
    Is that the case for you? e.g. the price is 5.00 and the renewal price is also 5.00?
  5. Like
    Tyson reacted to Blesta Addons in Client Side not showing errors returned from gateway buildProcess()   
    re-uploaded the files again and is working now .
  6. Like
    Tyson got a reaction from EuroDomenii in How To Get Order Number In Blesta   
    I think it's first important to understand the payment flow here. When a payment is made using a non-merchant gateway, the gateway is unaware of how the invoice it is intending to pay is created, or even if there is an invoice at all. You can make a payment using the non-merchant gateway to pay for nothing.
     
    In your case, however, you want to pay for an invoice created from an order in the order system using the Order plugin. This is a special case, and should be treated as such. Which means, you should not rely on this to always be true, and must setup logic to handle the cases where it is not.
     
    In your non-merchant gateway's class, you should have defined a buildProcess method. This method accepts, optionally, an array of invoice amounts as its third parameter. In that array is a list of IDs representing the invoices being paid. If you are paying an invoice on the order form, you should only have one invoice ID in the list. You need to take this invoice ID and find the associated order ID from the order system.
     
    Considering the order system is a plugin, it may not be installed for the company. You should check that it is first.
    Loader::loadModels($this, array("PluginManager")); $order_number = "N/A"; // Is the Order plugin installed? if ($this->PluginManager->isInstalled("order", Configure::get("Blesta.company_id"))) { ... } The Order plugin associates an invoice with the order, so you must find the correct order that matches the invoice ID you were given. However, the Order plugin does not provide a method to find an order by invoice, so you must write your own. First, make sure you have an invoice number.
    $invoice_id = null; if (isset($invoice_amounts[0])) { $invoice_id = $invoice_amounts[0]['id']; } Now you need to find the order number associated with the invoice. Since the Order plugin does not have a method for doing this, you can either 1) add a method for it to do it from the OrderOrders model by updating the source code yourself, or use the Record component to query the database for it manually. The later is more difficult as you will need to manually connect to the database by passing valid credentials yourself. See here for an example of someone that has. I will skip that part and simply assume the Record component is setup to perform a query.
    Loader::loadComponents($this, array("Record")); # # TODO: create a connection to the database # try { $order = $this->Record->select()->from("order_orders") ->where("invoice_id", "=", $invoice_id)->fetch(); if ($order) { $order_number = $order->order_number; } } catch (Exception $e) { // Unable to fetch the order number } Putting it all together now:
    Loader::loadModels($this, array("PluginManager")); Loader::loadComponents($this, array("Record")); $order_number = "N/A"; // Is the Order plugin installed? if ($this->PluginManager->isInstalled("order", Configure::get("Blesta.company_id"))) { // Do we have one invioce? $invoice_id = null; if (isset($invoice_amounts[0]) && count($invoice_amounts) === 1) { $invoice_id = $invoice_amounts[0]['id']; # # TODO: create a connection to the database so we can run a query # // Can we fetch an order for this invoice? try { $order = $this->Record->select()->from("order_orders") ->where("invoice_id", "=", $invoice_id)->fetch(); if ($order) { $order_number = $order->order_number; } } catch (Exception $e) { // Unable to fetch the order number } } } // Use the $order_number
  7. Like
    Tyson got a reaction from activa in application.min.css incorrect font location   
    Thanks for finding that. This is CORE-3155. The fonts will be moved to /fonts/bootstrap/
  8. Like
    Tyson got a reaction from activa in API - Services getAllByClient   
    Are you using the SDK from the API documentation? It will do this for you, but @activa is correct that you should pass your data through http_build_query() if you do it yourself.
  9. Like
    Tyson reacted to activa in API - Services getAllByClient   
    Make all params inside a $vars array then use  http_build_query() it will do the job for you. Anyway i think the result will be like
    order_by%5date_added%5=desc
     
  10. Like
    Tyson got a reaction from Michael in White space?   
    CORE-3181
  11. Thanks
    Tyson reacted to elzek1 in TeamSpeak 3 Module (Alpha)   
    https://docs.planetteamspeak.com/ts3/php/framework/
    On suspend Mode all option are disable from client side
  12. Like
    Tyson reacted to Blesta Addons in Dates in blesta should have a fix,   
    i have found the issue is not the null, it was a char before null that caused the error
            Loader::loadHelpers($this, ['Date' => [ null, 'UTC', Configure::get('Blesta.company_timezone')]]);
            Loader::loadHelpers($this, ['Date' => [null, 'UTC', Configure::get('Blesta.company_timezone')]]);
  13. Like
    Tyson got a reaction from mobbdeep in Blesta Soft Auto Installer   
    Only package options with a matching term to the package can be set. So if you have a 3 month term package, only package options that are 3 month terms can be ordered with it. I'm not aware of ordering multiple domains for a single WP package, I think that has more to do with parking domains on a web hosting account.
    The package's welcome email contains the "service" object, and the package options are available in a list of "service.options". You would have to loop over the "service.options" and then evaluate the specific option to display the option name and value (e.g. "Admin Password: abc123").
    For example:
    {% for option in service.options %} {% if option.option_name == 'admin_name'}{option.option_label}: {option.value}{% endif %} {% if option.option_name == 'admin_pass'}{option.option_label}: {option.value}{% endif %} {% endfor %} The above would look over all service options, and display admin name and password if those are options on the service:
    Admin Name: myname Admin Password: mypassword  
  14. Like
    Tyson got a reaction from Blesta Addons in Blesta Soft Auto Installer   
    In your screenshot for the package option "Script", I notice that the "Name" is capitalized as "Script" rather than "script" as mentioned in the documentation. I believe that is case-sensitive, so it may be why WP does not get installed. I would update that and retest first.
    The package has 1 and 3 month terms, but the package options are only setup for 1 month, so it would only be installed if the 1 month package was ordered, not the 3 month package.
  15. Thanks
    Tyson got a reaction from Serverhosh in Noc-PS Module Issue   
    That can occur if there are errors trying to fetch those options from the module (i.e. NOC-PS). There could be something misconfigured, or Blesta may not be able to connect to the NOC-PS API.
    Check your module logs under Tools > Logs > Module tab and see if there are any logs stored for NOC-PS. Click the table row to expand the section to see the raw input/output communication Blesta does with the NOC-PS API. There may be an error mentioned that could lead you to the problem.
    After looking at your screenshot, I see that the Text/HTML description is not loading properly, so there must be JavaScript errors on the page. That could also be causing your module options to not be retrieved. You should check your web browser's developer panel to see what JavaScript error was encountered.
  16. Thanks
    Tyson got a reaction from activa in Mass Mailer, SMTP setting   
    Created as CORE-3111.
  17. Thanks
    Tyson got a reaction from Blesta Addons in Mass Mailer, SMTP setting   
    Created as CORE-3111.
  18. Like
    Tyson got a reaction from Michael in Mass Mailer, SMTP setting   
    How do you think that should work?
    Should you add SMTP details that the Mass Mailer plugin will save? Then you can select which details you would like to use when you create the email piece?
  19. Like
    Tyson got a reaction from Michael in Mass Mailer, SMTP setting   
    Created as CORE-3111.
  20. Like
    Tyson got a reaction from Michael in Use Multi-Currency On Your Site Using GeoIP   
    Looks good!
    One thing you could do in the future to improve on this is to create a plugin for Blesta that accepts an IP address and uses the GeoIP2 database already supported by Blesta to determine the country (i.e. replaces the geoplugin.com file), then your plugin can do the mapping and return the appropriate currency for the country.
  21. Like
    Tyson reacted to adamjedgar in How to configure API and Packages for Centos Web Panel   
    Wohooo....I have it working at last.
    The procedure is as follows:
    1. setup the Blesta Module on your web server where blesta is installed.
    2. Create an API key in CWP which can then be added to the Blesta Module
    3. Now for the stupid part and the easy fix to my complete waste of almost a week...
    -Log into Centos Web Panel as Root 
    -Open file manager and navigate to /usr/local/cwp/.conf/
    -in the above directory create 2 new files (they most likely do not exist)
    1. api_key.conf (open this file and copy and paste just the API key created in CWP into this file then save it)
    2. api_allowed.conf (open this file and paste just the IP adress of the webserver where Blesta is installed...if blesta has its own IP address then i would imagine one should use that ip address)
     
    Now your CWP module for Blesta should work provisioning new accounts in Centos Web Panel. 
    Please note, i havent done any further testing at this point (ie i am not sure if all other functions of the module such as suspending, deleting, etc work).
     
    Paul and Tyson, If you dont mind i will do a full write up of exactly how to do this (with screenshots) and forward that to you guys to add to the Blesta Wiki for this module.
     
    Hope this helps others...it has been a very infuriating process for me and i have directed my anger at some people who really didnot fully deserve it. So to Paul and Tyson, i apologise for that. 
     
    I think the moral of the story is, "ensure that modules have decent working tutorials on how to configure them before releasing for public use!" In this case, things fell in a heap because the CWP API does not actually work properly...anyone who would create such functionality should have realised that they also needed to add scripts that automatically inserted IP addresses and API key into new files and directory as i outlined above!
     
    kind regards
    Adam
     
     
  22. Like
    Tyson got a reaction from activa in Enable account credit   
    A credit is a payment transaction that is not applied to any invoices. On that "Record Payment" page, simply enter the payment amount, but do not check any invoices to pay from the list. In that case, a transaction will be created and it will not be assigned to any invoices, therefore it will appear as available credit.
  23. Like
    Tyson got a reaction from activa in Use Multi-Currency On Your Site Using GeoIP   
    Looks good!
    One thing you could do in the future to improve on this is to create a plugin for Blesta that accepts an IP address and uses the GeoIP2 database already supported by Blesta to determine the country (i.e. replaces the geoplugin.com file), then your plugin can do the mapping and return the appropriate currency for the country.
  24. Like
    Tyson reacted to Michael Kinder in Use Multi-Currency On Your Site Using GeoIP   
    Hi everyone! I just wanted to share this with you because I think it would be useful to those who aren't necessarily familiar with PHP and want to display different currencies based upon the user's IP address. Big thanks to @Blesta.Store for sharing a big portion of this code already on the forum. This will pull prices from Blesta's API and allow you to use multiple currencies.
     
    After you've uploaded the API SDK, you're going to want to download this file: https://www.geoplugin.com/_media/webservices/geoplugin.class.phps
    Upload that file into your site's directory, then take the contents below and place it at the top of your site files (or the pages where you will be displaying the prices).
     
    <?php require_once('geoplugin.class.php'); $geoplugin = new geoPlugin(); $geoplugin->locate(); // create a variable for the country code $var_country_code = $geoplugin->countryCode; // redirect based on country code: if ($var_country_code == "AU") { $selected_currency = "AUD"; } else if ($var_country_code == "CA") { $selected_currency = "CAD"; } else if ($var_country_code == "AT") { $selected_currency = "EUR"; } else if ($var_country_code == "BE") { $selected_currency = "EUR"; } else if ($var_country_code == "BG") { $selected_currency = "EUR"; } else if ($var_country_code == "CY") { $selected_currency = "EUR"; } else if ($var_country_code == "CZ") { $selected_currency = "EUR"; } else if ($var_country_code == "DK") { $selected_currency = "EUR"; } else if ($var_country_code == "EE") { $selected_currency = "EUR"; } else if ($var_country_code == "FI") { $selected_currency = "EUR"; } else if ($var_country_code == "DE") { $selected_currency = "EUR"; } else if ($var_country_code == "GR") { $selected_currency = "EUR"; } else if ($var_country_code == "HU") { $selected_currency = "EUR"; } else if ($var_country_code == "IE") { $selected_currency = "EUR"; } else if ($var_country_code == "IT") { $selected_currency = "EUR"; } else if ($var_country_code == "LV") { $selected_currency = "EUR"; } else if ($var_country_code == "LU") { $selected_currency = "EUR"; } else if ($var_country_code == "MT") { $selected_currency = "EUR"; } else if ($var_country_code == "NL") { $selected_currency = "EUR"; } else if ($var_country_code == "PL") { $selected_currency = "EUR"; } else if ($var_country_code == "PT") { $selected_currency = "EUR"; } else if ($var_country_code == "RO") { $selected_currency = "EUR"; } else if ($var_country_code == "SK") { $selected_currency = "EUR"; } else if ($var_country_code == "SI") { $selected_currency = "EUR"; } else if ($var_country_code == "ES") { $selected_currency = "EUR"; } else if ($var_country_code == "SE") { $selected_currency = "EUR"; } else if ($var_country_code == "GB") { $selected_currency = "GBP"; } else if ($var_country_code == "IN") { $selected_currency = "INR"; } else if ($var_country_code == "MX") { $selected_currency = "MXN"; } else { $selected_currency = "USD"; } require_once "/home/username/public_html/blesta/api/blesta_api.php"; $user = "username"; $key = "key"; $url = "url"; $api = new BlestaApi($url, $user, $key); $company_id = 1; // Set acceptable currencies $valid_currencies = array("USD", "GBP", "EUR", "INR", "MXN", "AUD"); // Set default currency // Set another currency if given if (isset($_GET['currency']) && in_array(strtoupper($_GET['currency']), $valid_currencies)) $selected_currency = strtoupper($_GET['currency']); $price1 = getPackagePrice($api, 4, "month", 1); $price2 = getPackagePrice($api, 57, "year", 1); $price3 = getPackagePrice($api, 29, "month", 1); $price4 = getPackagePrice($api, 50, "month", 1); $price5 = getPackagePrice($api, 298, "year", 1); $price1_amount = formatCurrency($api, $price1->price, $price1->currency, $selected_currency, $company_id); $price2_amount = formatCurrency($api, $price2->price, $price2->currency, $selected_currency, $company_id); $price3_amount = formatCurrency($api, $price3->price, $price3->currency, $selected_currency, $company_id); $price4_amount = formatCurrency($api, $price4->price, $price4->currency, $selected_currency, $company_id); $price5_amount = formatCurrency($api, $price5->price, $price5->currency, $selected_currency, $company_id); function getPackagePrice($api, $package_id, $period, $term) { $package = $api->get("packages", "get", array('package_id' => $package_id))->response(); $package_price = null; foreach ($package->pricing as $price) { // Get monthly term if ($price->period == $period && $price->term == $term) { return $price; } } return false; } function formatCurrency($api, $amount, $from_currency, $to_currency, $company_id) { // Do the currency conversion $amount = $api->get("currencies", "convert", array('amount' => $amount, 'from_currency' => $from_currency, 'to_currency' => $to_currency, 'company_id' => $company_id))->response(); // Format the currency return $api->get("currencies", "toCurrency", array('value' => $amount, 'currency' => $to_currency, 'company_id' => $company_id))->response(); } ?>  
    Next, you're going to want to create your API credentials in Blesta and fill them in appropriately.
    After you've done this, simply place the following code (changing the numbers appropriately) where you would like to display the prices.
     
    <?php echo $price1_amount; ?>  
    Of course you can make modifications as you desire, but I wanted to share this with you in case anyone wanted to do the same.
  25. Like
    Tyson got a reaction from huangsenli in blesta Integrate css problem   
    If no one else has that problem, then it might be your computer. Have you tried clearing your web browser cache? Have you tried using a different web browser? Are you sure all of the files exist on the file system, in particular, the CSS files? Do you have any custom code that might conflict with the CSS?
×
×
  • Create New...