/** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magentocommerce.com so we can send you a copy immediately. * * @category Phoenix * @package Phoenix_Moneybookers * @copyright Copyright (c) 2015 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ Event.observe(window, 'load', function() { initMoneybookers(); }); Moneybookers = Class.create(); Moneybookers.prototype = { initialize: function(bannerUrl, activateemailUrl, checksecretUrl, checkemailUrl){ this.bannerUrl = bannerUrl; this.activateemailUrl = activateemailUrl; this.checksecretUrl = checksecretUrl; this.checkemailUrl = checkemailUrl; this.txtBtnStatus0 = this.translate('Validate Email'); this.txtBtnStatus1 = this.translate('Activate Moneybookers Quick Checkout'); this.txtBtnStatus2 = this.translate('Validate Secret Word'); this.txtErrStatus0 = this.translate('This email address is not registered.'); this.txtErrStatus2 = this.translate('This Secret Word is incorrect. After activation Moneybookers will give you access to a new section in your Moneybookers account called "Merchant tools". Please choose a secret word (do not use your password for this) and provide it in your Moneybookers admin area and above.'); this.txtInfStatus0 = this.translate('Moneybookers is an all in one payments solution that enables a merchant to accept debit and credit card payments, bank transfers and the largest range of local payments directly on your website.') + ''; this.txtInfStatus1 = this.translate('Moneybookers Quick Checkout enables you to take direct payments from credit cards, debit cards and over 50 other local payment options in over 200 countries for customers without an existing Moneybookers eWallet.'); this.txtNotSavechanges = this.translate('Please save the configuration before continuing.'); this.txtNotStatus0 = this.translate('Email was validated by Moneybookers.'); this.txtNotStatus1 = this.translate('Activation email was sent to Moneybookers. Please be aware that the verification process to use Moneybookers Quick Checkout takes some time. You will be contacted by Moneybookers when the verification process has been completed.'); this.txtNotStatus2 = this.translate('Secret Word was validated by Moneybookers. Your installation is completed and you are ready to receive international and local payments.'); $("moneybookers_settings_moneybookers_email").setAttribute("onchange", "moneybookers.setStatus(0); moneybookers.changeUi(); document.getElementById('moneybookers_settings_customer_id').value = ''; document.getElementById('moneybookers_settings_customer_id_hidden').value = '';"); $("moneybookers_settings_customer_id").disabled = true; $("moneybookers_settings_customer_id_hidden").name = document.getElementById("moneybookers_settings_customer_id").name; $("moneybookers_settings_customer_id_hidden").value = document.getElementById("moneybookers_settings_customer_id").value; $("moneybookers_settings_secret_key").setAttribute("onchange", "moneybookers.setStatus(2); moneybookers.changeUi();"); if (this.isStoreView()) { this.infoOrig = { email: $("moneybookers_settings_moneybookers_email").value, customerId: $("moneybookers_settings_customer_id").value, key: $("moneybookers_settings_secret_key").value, status: this.getStatus(), useDefult: $("moneybookers_settings_moneybookers_email_inherit").checked }; var defaults = $$("#row_moneybookers_settings_customer_id .use-default, #row_moneybookers_settings_secret_key .use-default, #row_moneybookers_settings_activationstatus .use-default"); if (Object.isArray(defaults)) { for (var i=0; i 3) number = 3; $("moneybookers_settings_activationstatus").value = number; }, changeUi: function () { var status = this.getStatus(); if (status < 1) { $("moneybookers_inf_div").update(this.txtInfStatus0); $("moneybookers_multifuncbutton_label").update(this.txtBtnStatus0); } if (status == 1) { $("moneybookers_inf_div").update(this.txtInfStatus1); $("moneybookers_multifuncbutton_label").update(this.txtBtnStatus1); } if (status < 2) { $("moneybookers_inf_div").style.display = "block"; $("moneybookers_settings_secret_key").disabled = true; } if (status == 2) { $("moneybookers_multifuncbutton_label").update(this.txtBtnStatus2); if (this.isStoreView()) { $("moneybookers_settings_secret_key").enable(); $("moneybookers_settings_secret_key_inherit").removeAttribute('checked'); } } if (status > 2) { $("moneybookers_multifuncbutton").style.display = "none"; } else { $("moneybookers_multifuncbutton").style.display = "block"; } }, changeStore: function () { if (!$("moneybookers_settings_moneybookers_email_inherit").checked) { if (this.infoOrig.useDefult) { $("moneybookers_settings_customer_id_inherit").click(); $("moneybookers_settings_customer_id").clear(); $("moneybookers_settings_secret_key_inherit").click(); $("moneybookers_settings_secret_key").clear(); $("moneybookers_settings_activationstatus_inherit").click(); this.setStatus(0); } } else { if (this.infoOrig.useDefult) { $("moneybookers_settings_customer_id").setValue(this.infoOrig.customerId); $("moneybookers_settings_customer_id_inherit").click(); $("moneybookers_settings_secret_key").setValue(this.infoOrig.key); $("moneybookers_settings_secret_key_inherit").click(); $("moneybookers_settings_activationstatus_inherit").click(); this.setStatus(this.infoOrig.status); } } this.changeUi(); }, isStoreView: function() { return $("moneybookers_settings_moneybookers_email_inherit") != undefined; } }