»
S
I
D
E
B
A
R
«
Magento Banklink (Pangalink) extension 1.5.1 released
Feb 1st, 2010 by Sven

Today we released a bugfix-release of the Magento Banklink module. The current version of the extension is 1.5.1

It addresses issues with transaction statement.

Existing customers – please contact us to receive an update to your Magento Banklink extension.

Magento Banklink now supports Swedbank Latvia
Dec 22nd, 2009 by Sven

Recently we released version 1.5.0 of the Magento Banklik (Pangalink) extension. We added support for Swedbank Latvia. Swedbank in Latvia uses a bit different API version and different encodings that Swedbank in Estonia. We are happy to announce that the Magento Pangalink module is truly international from now on.

Another important update is in the keys’ configuration. The users of the extension no longer need to save keys in the server filesystem. Keys can now saved in the extension configuration panel in Magento backend.

Please feel free to contact us if are interested in Magento Banklink extension.

Wasabi provides Banklink-Pangalink integrations for other platforms also – please contact us for more information.

Magento Banklink version 1.4.1 released
Nov 11th, 2009 by Sven

We released Magento Banklink (Pangalink) version 1.4.1 today.

Main change is that it can be selected as a payment method for the orders that are created in the admin on behalf of a customer. The module has a new field in the admin also – sort order. So it can be ordered amongst other payment methods.

Can’t login to Magento admin?
Oct 11th, 2009 by Sven

This is a simple tip that could help you in case when you cannot login to Magento Admin after database migration.

Sometimes it happens that you need to move your whole Magento database from one site to another. Let’s say you want to copy your production database to your testsite. Everything goes well, you copy all data but you cannot login to admin of your test Magento… You use correct admin password, the same that you use for the production site. Still nothing…

OK, here are the clear steps to check before you start. You need to check and change a few fields in Magento configuration that is stored in database:

in table “core_config_data” check the following fields:

web/unsecure/base_url – set this to your testsite URL
web/secure/base_url – set this to your testsite URL
web/cookie/cookie_domain (this one got me once… :) ) – better set it to empty
web/cookie/cookie_path – better set it to empty

After that remove cache – delete var/cache folder.

Please leave us a comment if this post helped you or if you have anything to add here.

Important change to Magento Pangalink (Banklink) module configuration
Sep 28th, 2009 by Sven

Important! In Banklink configuration there is field “New order status”. Set this to Pending (module versions 1.3.6 and up)! Older installations of banklink module may have incorrect values there.

Another issue is that Banklink module name is now configurable in every store and view. It means that you can set different names for the module in the different views (languages).

Banklink title configurable!
Sep 12th, 2009 by Sven

Today we released an update to Magento Banklink module. Current version number is 1.3.4. This updates contains important and essential improvement of configuration. The title of the module is freely configurable now in different stores and views.

Banklink title is configurable

Banklink title is configurable

Fast and good-looking templates in PHP
Aug 14th, 2009 by Sven

This is the second article in serie of articles about using PHP in a better way than an average script-kiddie. You want to be better than an average, right?;) Then read on…

In my house no one likes spaghetti when it’s in code. That’s why we at Wasabi developed a way to separate presentation from content and code already hmm… how many years ago. I don’t know. I know that buzzword of MVC was not around yet… :) However – since we don’t need yet another mambo-jambo-fancy templating language then we need to use minimum set of code in templates also. So, let’s start.

It uses best parts of PHP like dynamic including and output buffering.

First Model-View-Controller a.k.a. MVC. It’s good, it’s easy but don’t take it like it would be the “final solution” or like it would solve all your problems. It won’t.

First let’s create a simple controller:

<?php
/**
 * Controller is invoked when web server gets a request.
 * For simplicity's sake we don't implement
 * fancy URL-to-controller-and-action mapping logic
 * This is usually done by our framework PHP-X.
 *
 * @author Sven Varkel
 */
class Controller
{
    /**
     * This is the initial action
     * that will be called by default
     *
     * @return string
     */
    public function defaultAction()
    {
        /*
         * Let's create model. This holds
         * our data. Model can be used to load data
         * from database or anywhere else.
         */
        $model = new Model();
        $model->setTitle('Mr');
        $model->setAge(33);
        $model->setFirstName('Sven');
        $model->setLastName('Varkel');
        $model->addHobby('Music');
        $model->addHobby('Fishing');
        $model->addHobby('Cooking');

        /*
         * Here we instantiate View
         * that loads a view
         * and then fills the template with data
         * that comes from the prepared
         * model. After that we render
         * the view to a wanted format.
         * In our case the format is HTML
         * but it can be PDF, XML, WML ...
         */
        $view = new View('person');
        $view->setModel($model);
        $renderedView = $view->render();

        /*
         * Finally we return rendered view
         * for output
         */
        return $renderedView;
    }
}
//EOF Controller.php

Then we create a Model …

<?php
/**
 * Model is a structure that
 * holds our data. Model or model helper
 * can be used to pull and push data from/to a data source
 * (e.g database)
 * It can also include operations for data manipulation.
 * Just to keep things clear and easy-to-understand I recommend
 * to NOT put too much logic inside a model. Use helpers for that.
 *
 * @author Sven Varkel
 */
class Model
{
    private $title = null;
    private $age = 0;
    private $firstName = null;
    private $lastName = null;
    private $hobbyList = array();

    /**
     * Gets Title
     *
     * @return Title
     */
    public function getTitle(){
        return $this->title;
    }
    /**
     * Sets Title
     *
     * @param Title
     */
    public function setTitle($value){
        $this->title = $value;
    }
    /**
     * Gets Age
     *
     * @return Age
     */
    public function getAge(){
        return $this->age;
    }
    /**
     * Sets Age
     *
     * @param Age
     */
    public function setAge($value){
        $this->age = $value;
    }
    /**
     * Gets FirstName
     *
     * @return FirstName
     */
    public function getFirstName(){
        return $this->firstName;
    }
    /**
     * Sets FirstName
     *
     * @param FirstName
     */
    public function setFirstName($value){
        $this->firstName = $value;
    }
    /**
     * Gets LastName
     *
     * @return LastName
     */
    public function getLastName(){
        return $this->lastName;
    }
    /**
     * Sets LastName
     *
     * @param LastName
     */
    public function setLastName($value){
        $this->lastName = $value;
    }
    /**
     * Gets HobbyList
     *
     * @return HobbyList
     */
    public function getHobbyList(){
        return $this->hobbyList;
    }
    /**
     * Sets HobbyList
     *
     * @param HobbyList
     */
    public function setHobbyList($value){
        $this->hobbyList = $value;
    }
    /**
     * Adds hobby with name $aHobby
     * to the list of hobbies
     *
     * @param $aHobby
     * @return
     */
    public function addHobby($aHobby){
        $this->hobbyList[] = $aHobby;
    }
    /**
     * In this override helper we
     * create getter names
     *
     * @param $theName
     * @return mixed
     */
    public function __get($theName){
        $getterName = sprintf('get%s', $theName);
        return $this->$getterName();
    }
}
//EOF Model.php

Then we create a View…

<?php
/**
 * This is the view that will
 * be rendered using a template
 *
 * @author Sven Varkel
 */
class View
{
    private $name = null;
    private $path = null;
    private $model = null;
    /**
     *
     * @param $theName
     * @return
     */
    public function __construct($theName){
        $this->setName($theName);
    }
    /**
     * Gets Name
     *
     * @return Name
     */
    public function getName(){
        return $this->name;
    }
    /**
     * Sets Name
     *
     * @param Name
     */
    public function setName($value){
        $this->name = $value;
    }
    /**
     * Gets Model
     *
     * @return Model
     */
    public function getModel(){
        return $this->model;
    }
    /**
     * Sets Model
     *
     * @param Model
     */
    public function setModel($value){
        $this->model = $value;
    }
    /**
     * Gets Path
     *
     * @return Path
     */
    public function getPath(){
        return $this->path;
    }
    /**
     * Sets Path
     *
     * @param Path
     */
    public function setPath($value){
        $this->path = $value;
    }
    /**
     * This method renders the view.
     * It loads template with slots
     * and it loads data from the model into
     * template slots.
     *
     * @return string
     */
    public function render(){
        /*
         * First we start output buffering.
         * This is critical!
         */
        ob_start();
        /*
         * Then we include the template.
         * Look at the fields inside the template!
         * Also look at how we create path of
         * the template.
         */
        $templatePath = sprintf('view/%s.tpl.php', $this->getName());
        /*
         * This is the funny trick to include template here.
         * Template becomes PART OF this class!
         * So we can use all methods from this class
         * inside our template
         */
        include $templatePath;

        /*
         * Here we collect the contents from
         * the buffer to variable $outstr
         */
        $outstr = ob_get_contents();

        /*
         * Here we end output buffering for this level
         */
        ob_end_clean();
        /*
         * Return rendered view
         */
        return $outstr;
    }
    /**
     * Returns slot value.
     * It loads value with given name from
     * the model
     *
     * @param $theName
     * @return mixed
     */
    public function getSlot($theName){
        return $this->getModel()->__get($theName);
    }
}

... and here is the template

<div>
 <h3>Personal information</h3>
 <div>
 Name and title: <?=$this->getSlot('Title')?> <?=$this->getSlot('FirstName')?> <?=$this->getSlot('LastName')?>
 </div>
 <div>
 Age: <?=$this->getSlot('Age')?>
 </div>
 <div>
 <h3>Hobbies</h3>
 <?php
 /**
 * Pay attention to this foreach. This is the elegant way
 * to use php code inside a template.
 * Code is nice and clean, easy to read.
 *
 * Use of PHP short tags is recommended, it makes code much nicer.
 * However - you can use long opening tag as well but then
 * you have to use echo instead of =
 */
 ?>

 <?foreach( $this->getModel()->getHobbyList() as $hobby ):?>

 <div><?=$hobby?></div>

 <?endforeach?>

 </div>
</div>

… and then we clue all pieces together

<?php
/**
 * This script may be called as Front Controller.
 *
 * This one takes the hits. It can ve called directly
 * but it's also very common to use rewrite that makes the URL-s
 * nicer and sends all requests to this script regardless of their
 * visible URL.
 */

/*
 * First include our required classes
 */
require_once '../lib/Model.php';
require_once '../lib/View.php';
require_once '../lib/Controller.php';

/*
 * Instantiate our default controller
 */
$controller = new Controller();

/*
 * Call default action in our controller
 */
echo $controller->defaultAction();

//EOF index.php

OK, that’s it!

This is a simple way to make MVC work for you. The trick of template is that we include it inside a class. The template which is actually made of fragments of PHP code becomes part of the class. Template can use methods of class. It can load data into itself in a clever, fast and elegant way.

All comments to this technique are welcome!

Magento Banklink (Pangalink) module version 1.3.2 released
Aug 11th, 2009 by Sven

Yesterday, on 10th of August 2009 we released version 1.3.2 of Banklink (Pangalink) Magento module.

It contains AFP – Automatic Purchase Flow for virtual (downloadable) products. It also contains a number of fixes here and there. By now the module is stable.

It has become rather popular and we thank all our customers that have chosen Magento Banklink module from Wasabi.

Magento Banklink module enables automatic purchase flow
Jul 28th, 2009 by Sven

Next version (1.3.0) of Magento Banklink (Pangalink) module enables fully automatic purchase flow (FAP). Automatic purchase flow is especially useful for downloadable products like e-books, music, pictures etc.

It works like this:

  • customer sets an order
  • order confirmation is sent to customer by e-mail
  • invoice e-mail is sent to customer automatically.
  • order and invoice status is set to “pending”
  • customer clicks button “go to bank”
  • after payment in bank customer clicks button “back to merchant”
  • after successful payment order status is set automatically to “completed”

This way more payments are quickly finished that ensures a steady cash flow for your Magento store. Customer will also be happy because she will get her purchased product immediately with no delays and waiting.

Banklink extension installation
May 27th, 2009 by Sven

This page describes banklink installation for Magento. As you can see, it’s quite straightforward but some tips may be helpful. It is assumed that you havefully working Magento installed. Banklink extension requires at least Magento version 1.2.

We call your website your.magento-site.com. Replace it with fully qualified name of your website.

  1. Extract the Magento_Banklink.zip archive to a temporary folder. This is your $source folder. Your Magento installation folder is your $destination folder.
  2. Copy files and folders from $source/app folder to $destination/app folder. It is important to copy all included subfolders and their structure!
  3. Copy files and folders from $source/skin to $destination/skin folder. It’s important to retain the structure here as well!
  4. Now remove your Magento cache from $destination/var/cache (delete that folder). Also remove $destination/app/etc/use_cache.ser
  5. Open your Magento admin and go to System->Configuration->Payment Methods. You should see Banklink there.
  6. Configure your Banklink. Most fields should be self-explanatory. Banklink return URL is http://your.magento-site.com/banklink/return/
  7. Copy and paste your private key and public keys of the banks to appropriate fields in the module configuration. Note – it is very important to keep your private key safe!

Important! in Banklink configuration there is field “New order status”. Set this to Pending (module versions 1.3.6 and up)! Older installations of banklink module may have incorrect values there.

Note for version 1.5.0 and up: keys are NOT stored in the file system folder keys any more. Keys must be copy-pasted to appropriate fields in the module admin!

Note about field “Explanation on the statement for banklink”

You can use variable placeholders here to format the message that customer
sees as explanation while making payment in the bank.

For example you would like to see text: www.yourstore.com: Order nr 12345.

Then set the explanation like this: www.yourstore.com: Order nr %1$s

Variable placeholders:
%1$s – order number

Some of the banklink API-s URL-s of Estonian banks:

https://www.seb.ee/cgi-bin/unet3.sh/un3min.r

https://www.swedbank.ee/banklink

https://www2.sampopank.ee/ibank/pizza/pizza

API URL for Swedbank in Latvia:

https://ib.swedbank.lv/banklink/

»  Substance: WordPress   »  Style: Ahren Ahimsa
© Copyright Wasabi Ltd 2009