Add IFRAME feature to the Moneybookers payment add-on in CS-Cart 2.1.4

How to add support of IFRAME feature to the Moneybookers payment add-on in CS-Cart 2.1.4 (only in this version).



These instructions are applicable to Community, Professional and Multi-Vendor editions:


  1. Upload the ‘mb-iframe.zip’ archive file (attached to this post) to the root CS-Cart directory and unpack it there.


  2. Open the “controllers/customer/checkout.php” CS-Cart file in a text editor and replace the following part of the code:



$view->assign('payment_info', $payment_info);




with this one:



$view->assign('payment_info', $payment_info);
// [mb]
if (!empty($payment_info['params']['iframe_mode']) && $payment_info['params']['iframe_mode'] == 'Y') {
$view->assign('iframe_mode', true);
}
// [/mb]




Then the following part of the code:



fn_add_breadcrumb(fn_get_lang_var('landing_header'));
}




with this one:



fn_add_breadcrumb(fn_get_lang_var('landing_header'));
// [mb]
} elseif ($mode == 'process_payment') {
if (fn_allow_place_order($cart) == true) {
$order_info = $cart;
$order_info['items'] = $cart['products'];
$order_info = fn_array_merge($order_info, fn_check_table_fields($cart['user_data'], 'orders'));
$order_info['order_id'] = $order_id = TIME . "_" . (!empty($auth['user_id']) ? $auth['user_id'] : 0);

list($is_processor_script, $processor_data) = fn_check_processor_script($order_info['payment_id'], '');
if ($is_processor_script) {
set_time_limit(300);
$index_script = INDEX_SCRIPT;
$mode = MODE;
fn_define('IFRAME_MODE', true);

include(DIR_PAYMENT_FILES . $processor_data['processor_script']);

fn_finish_payment($order_id, $pp_response, array());
fn_order_placement_routines($order_id);
}
}
}
// [/mb]




3. Edit the “skins/basic/admin/views/payments/components/cc_processors/moneybookers_ew.tpl” and “skins/basic/admin/views/payments/components/cc_processors/moneybookers_qc.tpl” files and replace the following part of the code:


```php


{$lang.return_url_target}:

_top
_parent
_self
_blank




{$lang.cancel_url_target}:

_top
_parent
_self
_blank

```

with this one:

```php
{* [mb] *}

{$lang.iframe_mode}:

{$lang.disabled}
{$lang.enabled}


{* [/mb] *}
```

4. Edit the "skins/CUSTOMER_SKIN_DIR/styles.css" file by additin the following code to the end of the file:

```php
/* [mb] */
.payment_method_iframe {
z-index: 1000;
background-color: #C0C0C0;
position: relative;
top:-820px;
left:0px;
height:820px;
width:100%;
filter:alpha(opacity=90);
-moz-opacity: 0.90;
opacity: 0.90;
}
.payment_method_iframe_label {
position: relative;
top:410px;
padding: 10px 10px 10px 10px;
height: 50px;
}
.payment_method_iframe_text {
vertical-align: middle;
text-align:center;
font-weight:bolder;
position:relative;
top: 20px;
}
.payment_method_iframe_box {
height:820px;
overflow:hidden;
}
/* [/mb] */
```

5. Make a backup copy of the "skins/CUSTOMER_SKIN_DIR/views/checkout/components/steps/step_four.tpl" file and replace this file with the "step_four.tpl" file located in the CS-Cart root directory (it will be there after unpacking the archive at step 1).

6. Log in to the CS-Cart administration panel.

7. Clean up the CS-Cart cache by opening the following link in the browser:

```php
http://www.your_domain.com/admin.php?cc
```

where "www.your_domain.com" is the actual domain of your store and "admin.php" is the actual file name of your administrator script (if it was renamed for security reasons).

8. Open the "Administration" > "Database" page, then click the "Restore" tab. You will see the "t_moneybookers_ewqc.sql" file in the list. Select it and click the "Restore" button.

9. Open the "Administration" > "Payment methods", click on the "edit" link next to a payment method, then select "Moneybookers Quick Checkout" or "Moneybookers eWallet" in the "Processor" select box. Then click the "Configure" tab. Enable the "iFrame mode" setting there.

After that the Moneybookers payment gateway will be displayed in the IFRAME on the last checkout page (when the defined payment method is selected).

This functionality will be added to the next CS-Cart release as well.

If you have any problems with enabling this feature, please contact our support team via our [URL=http://helpdesk.cs-cart.com]Customer Help Desk[/URL].

Thank you.

mb-iframe.zip

Can this load in a CS-Cart SSL environment if the store has a certificate?



I understand that the iframe is SSL protected but the buyer will not see that in their browser and that may scare them off.

[quote name=‘S-Combs’]

I understand that the iframe is SSL protected but the buyer will not see that in their browser and that may scare them off.[/QUOTE]



Hello S-Combs. Yes, you are right, the content of the IFRAME is loaded via HTTPS, but the customer cannot notice it if your checkout is not secure as well.


[quote name=‘S-Combs’]Can this load in a CS-Cart SSL environment if the store has a certificate?[/QUOTE]

Unfortunately, the version we released yesterday could not do it. Thank you for asking for it. We have added this ability to the add-on. I have updated the ZIP file in the first post.



Thank you.

So in other words if checkout is SSL enabled then this mod will not work ?

[quote name=‘Darius’]So in other words if checkout is SSL enabled then this mod will not work ?[/QUOTE]



No, it works through both HTTP and HTTPS. I said in my previous message, that we added SSL support (on 18th of March).



Thank you.

I have installed CS Cart v 3.0 and trying to enable Moneybookers Quick Checkout, however, I am getting the following error:



Error Oops, something went wrong (error). Please try again.



I get this error when I click on Validate E-mail. I can successfully add Moneybookers (Depreciated) through the same process but not Quick Checkout. Can somebody help me to fix this?





[sharedmedia=core:attachments:5537]