Gateway changes in 2.2

May 14, 2009
Cody

As Paul recently announced on our forums, multi-currency support is coming in version 2.2. This is a major change and affects just about every aspect of Blesta. For this reason a few minor changes have been made to the way gateways are written to accommodate multi-currency support. If you plan to upgrade to version 2.2 and are using any gateways not listed in our

official gateways listing, you should closely examine the following changes and contact us if you have any questions so you can make a smooth transition into version 2.2. All gateways must now extend the following abstract Gateway class:

<?php
abstract class Gateway {
   /**
    * Returns all currencies supported by this gateway.
    *
    * @return array An array of currencies supported by this gateway
    */
   abstract function getCurrencies();
   /**
    * Returns all gateway settings fields
    *
    * @return array An array of all configurable fields
    */
   abstract function getSettingFields();
}
?>

Changes for Non-Merchant Gateways 1. Must now extend the Gateway class. 2. Must define the getCurrencies() method. 3. Must return the currency used in the process() method as part of the return array (i.e. $trans[‘currency’] = “USD”). Changes for Merchant Gateways 1. Must define the getCurrencies() method. 2. Must define the getSettingFields() method. This method is implemented exactly as it is currently implemented in Non-Merchant gateways. Below is an example implementation of the getCurrencies() method:

<?php
    // All currencies this gateway accepts
   private static $supportedCurrencies = array("AUD", "EUR", "JPY", "USD");
 
   public function getCurrencies() {
      return self::$supportedCurrencies;
   }
?>

You must also be sure that your gateway is POSTing the currency to your gateway in the appropriate manner. The currency will be fed to your gateway in the constructor’s 1st parameter as ‘currency’ (i.e. $gatewayinfo[‘currency’]). Failure to do so may result in your gateway processing your transaction in the incorrect currency, or a failed transaction. Again, this article only applies if you are using an unofficial or custom gateway and plan on upgrading to version 2.2. All gateways packaged with 2.2 will already contain these changes.


Related Tags:

Blesta for Windows

February 6, 2009
Cody

We’ve been hard at work on the next installment of Blesta (version 2.1) lately, which is looking to be our most feature rich update to date. One thing we’ve worked hard on is adding support for Windows machines. Finally, Windows users will get to experience what everyone else has come to love about Blesta: Simplicity, Productivity, and Power. Check back soon for more updates!


Related Tags:

New Standards for Developers

November 4, 2008
Cody

In an effort to increase future compatability with both browsers and PHP environments we’ve introduced two new standards in the Blesta 2.0 release.

Out with the old, in with the new. PHP short tags are out – That means all PHP code must be enclosed in <?php … ?> rather than <? … ?> XHTML Strict is in – All templates (.pdt files) must conform to the XHTML Strict standard (see w3c.org for more informationon on XHTML). What does this mean for me? When submitting templates, modules, gateways, or add-ons be sure to follow the above convention to ensure your contributions will be accepted into a future release of Blesta. If you don’t plan to contribute or distribute your work then of course you need not abide by these standards. Another addition to template creation is the introduction of template versioning. Each template directory will now contain a text file containing the version number (of Blesta) that the associated template files are compatible with. This will allow developers to ensure compatibility with specific versions of Blesta. The backend will still allow older templates to be selected in the Admin area, but will mark each outdated template with “(incompatible)”.


Related Tags:

GoDaddy.com and .mobi domains

September 12, 2008
Cody

I recently received an email from GoDaddy.com that I thought was hilarious. Apparently users with mobile devices can only visit .mobi domain names? Here’s the excerpt:

Imagine if customers could access your Web site even when they’re away from their computers… Having your own .MOBI domain can make that dream a reality. With .MOBI, anyone can access your site from their Web-ready cell phone or mobile device. Oh really? That’s funny because I’ve been visiting .com domains on my mobile since 2001.


Related Tags:

Upcoming version 1.4

June 4, 2008
Cody

While we crank away on version 1.4 (scheduled for release next month), I wanted to give a quick update on a couple of the big features we’ve gotten excited about. Probably the most interesting feature of 1.4 will be the dynamic integrated order system. The system we developed will allow admins to create really cool order forms in just a couple of clicks, and you’ll be able to link to these various order forms from any website using a unique URL. You’ll also be able to pass certain additional parameters on to the order form (in much the same way you can with our sample order form in version 1.3 and earlier), such as package ids, terms, coupon codes and things like that. Additionally, the order system supports drop-in form templates (a PHP class that controls certain actions during the order process) — a great feature for developers. Another big change we’ve made in 1.4 is the way in which language is handled. In 1.4 users will be able to select their own language (separate from the default language) as well as receive e-mails from Blesta in that language, a big improvement over 1.3. A couple other resources we’ve developed recently geared more towards custom developers are below. Expect to see updates to these as well in July.

Resources: Language Validator – helps translate files or update custom language among different versions. Template Listing – a complete listing of what template files are associated with which files.


Related Tags:
Top