Recently I wrote about Banklink(Pangalink) payment configuration with php. I want to add some specifics on SEB iPizza implementation.
Here is the working code for generating request to SEB
$VK_a['VK_SERVICE'] = '1002'; // ID of the service we request. In our case it is - "Invoice payment" $VK_a['VK_VERSION'] = '008'; // ID of security type. Nowadays, all banks use 008, previously they were 001, 003, 007 $VK_a['VK_SND_ID'] = 'client'; // ID of the Seller. Is obtained in bank while signing the agreement. $VK_a['VK_STAMP'] = 12345; // Session ID. It is optional and its value can be random - more useful for the Seller to track payments. $VK_a['VK_AMOUNT'] = $price; // Payment sum. $VK_a['VK_CURR'] = 'EUR'; // Payment currency. $VK_a['VK_REF'] = ''; // reference link. Some companies use it for dividing payments on one bank account. If none, leave blank. $VK_a['VK_MSG'] = 'Payment'; // Payment message. $mac_pre = ''; $reversed = array_reverse($VK_a); foreach ($reversed as $name=>$value) { $value_len = strlen($value); if (strlen($value_len) < 3) { while (strlen($value_len) < 3) { $value_len = '0'.$value_len; } } $mac_pre = $value_len.$value.$mac_pre; } $fp = fopen('../pangalink/keys/privkey.pem', 'r'); $private_key = fread($fp, 8192); fclose($fp); $private_key_id = openssl_get_privatekey($private_key, ''); openssl_sign($mac_pre, $mac, $private_key_id); $mac = base64_encode($mac); $VK_a['VK_MAC'] = $mac; // Digital signature. See further how to generate it. $VK_a['VK_ACC'] = 123456787996; // Company bank account $VK_a['VK_NAME'] = "Company OÜ"; // Company name $url='http://www.yoursite.ee'; //the domain should be the same as specified while signing the agreement $VK_a['VK_RETURN'] = $url. '/pangalink/vk_return.php; // page, there bank will return in case of successful payment. $VK_a['VK_CANCEL'] = $url. '/pangalink/vk_return.php; // page, there bank will return in case of payment cancellation. If it is the same page as VK_RETURN, you can leave it blank. $VK_a['VK_LANG'] = 'EST'; // Preferred Invoice language ?>
NOTE: I used in FORM tag attribute enctype=”multipart/form-data”. Request to SEB permanently returns error 500. Support team confirmed, that this issue is on their side and they are going to fix it in nearest future. So, just do not use this attribute in your FORM tag.
You can use http://en.e-abi.ee/ website to purchase Banklinks for most popupar open source systems such as Magento, Prestashop, WP-e-Commerce plugin.
Price is very reasonable and also there are banklinks available for Latvia and Lithuania.