Skip to content

Commit

Permalink
Merge pull request #36 from mollie/maikeldoren-master
Browse files Browse the repository at this point in the history
Language support for OC 2.2.
  • Loading branch information
ricardodevries committed Mar 17, 2016
2 parents 21fd0c3 + 801a516 commit ea83a23
Show file tree
Hide file tree
Showing 44 changed files with 768 additions and 22 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: php
php:
- "7.0"
- "5.6"
- "5.5"
- "5.4"
- "5.3"
script: "phpunit -c tests/phpunit.xml"
script: "phpunit -c tests/phpunit.xml"
62 changes: 49 additions & 13 deletions admin/controller/payment/mollie/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -478,26 +478,57 @@ private function validate ($store = 0)
protected function checkModuleStatus ()
{
$need_files = array();
$mod_files = array(
DIR_APPLICATION . "controller/payment/mollie/base.php",
DIR_APPLICATION . "language/english/payment/mollie.php",
DIR_TEMPLATE . "payment/mollie.tpl",
DIR_TEMPLATE . "payment/mollie_2.tpl",
DIR_CATALOG . "controller/payment/mollie-api-client/",
DIR_CATALOG . "controller/payment/mollie/base.php",
DIR_CATALOG . "language/english/payment/mollie.php",
DIR_CATALOG . "model/payment/mollie/base.php",
DIR_CATALOG . "view/theme/default/template/payment/mollie_checkout_form.tpl",
DIR_CATALOG . "view/theme/default/template/payment/mollie_return.tpl",
DIR_CATALOG . "view/theme/default/template/payment/mollie_return_2.tpl",
);

if ($this->isOpencart22())
{
$mod_files = array(
DIR_APPLICATION . "controller/payment/mollie/base.php",
DIR_APPLICATION . "language/en-gb/payment/mollie.php",
DIR_TEMPLATE . "payment/mollie.tpl",
DIR_TEMPLATE . "payment/mollie_2.tpl",
DIR_CATALOG . "controller/payment/mollie-api-client/",
DIR_CATALOG . "controller/payment/mollie/base.php",
DIR_CATALOG . "language/en-gb/payment/mollie.php",
DIR_CATALOG . "model/payment/mollie/base.php",
DIR_CATALOG . "view/theme/default/template/payment/mollie_checkout_form.tpl",
DIR_CATALOG . "view/theme/default/template/payment/mollie_return.tpl",
DIR_CATALOG . "view/theme/default/template/payment/mollie_return_2.tpl",
);
}
else
{
$mod_files = array(
DIR_APPLICATION . "controller/payment/mollie/base.php",
DIR_APPLICATION . "language/english/payment/mollie.php",
DIR_TEMPLATE . "payment/mollie.tpl",
DIR_TEMPLATE . "payment/mollie_2.tpl",
DIR_CATALOG . "controller/payment/mollie-api-client/",
DIR_CATALOG . "controller/payment/mollie/base.php",
DIR_CATALOG . "language/english/payment/mollie.php",
DIR_CATALOG . "model/payment/mollie/base.php",
DIR_CATALOG . "view/theme/default/template/payment/mollie_checkout_form.tpl",
DIR_CATALOG . "view/theme/default/template/payment/mollie_return.tpl",
DIR_CATALOG . "view/theme/default/template/payment/mollie_return_2.tpl",
);
}


foreach (MollieHelper::$MODULE_NAMES as $module_name)
{
if ($this->isOpencart22())
{
$mod_files[] = DIR_APPLICATION . "controller/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_APPLICATION . "language/en-gb/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_CATALOG . "controller/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_CATALOG . "model/payment/mollie_" . $module_name . ".php";
}
else
{
$mod_files[] = DIR_APPLICATION . "controller/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_APPLICATION . "language/english/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_CATALOG . "controller/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_CATALOG . "model/payment/mollie_" . $module_name . ".php";
}
}

foreach ($mod_files as $file)
Expand Down Expand Up @@ -651,6 +682,11 @@ protected function isOpencart2 ()
{
return version_compare(VERSION, 2, ">=");
}

protected function isOpencart22 ()
{
return version_compare(VERSION, 2.2, ">=");
}

/**
* Retrieve additional store id's from store table.
Expand Down
112 changes: 112 additions & 0 deletions admin/language/en-gb/payment/mollie.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?php
/**
* Copyright (c) 2012-2015, Mollie B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* @package Mollie
* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php
* @author Mollie B.V. <[email protected]>
* @copyright Mollie B.V.
* @link https://www.mollie.com
*/

// These are called automatically by the Payment modules list - do not change the names
$method_list_logo = '<a href="https://www.mollie.com" target="_blank"><img src="https://www.mollie.com/images/logo.png" alt="Mollie" title="Mollie" style="border:0px" /></a>';
$_['text_mollie_banktransfer'] = $method_list_logo;
$_['text_mollie_belfius'] = $method_list_logo;
$_['text_mollie_bitcoin'] = $method_list_logo;
$_['text_mollie_creditcard'] = $method_list_logo;
$_['text_mollie_directdebit'] = $method_list_logo;
$_['text_mollie_ideal'] = $method_list_logo;
$_['text_mollie_mistercash'] = $method_list_logo;
$_['text_mollie_paypal'] = $method_list_logo;
$_['text_mollie_paysafecard'] = $method_list_logo;
$_['text_mollie_sofort'] = $method_list_logo;

// Heading
$_['heading_title'] = "Mollie";
$_['title_global_options'] = "Options for all Mollie modules";
$_['title_payment_status'] = "Payment statuses";
$_['title_mod_about'] = "About this module";
$_['footer_text'] = "Payment services";

// Module names
$_['name_mollie_banktransfer'] = "Bank transfer";
$_['name_mollie_belfius'] = "Belfius Direct Net";
$_['name_mollie_bitcoin'] = "Bitcoin";
$_['name_mollie_creditcard'] = "Creditcard";
$_['name_mollie_directdebit'] = "Direct debit";
$_['name_mollie_ideal'] = "iDEAL";
$_['name_mollie_mistercash'] = "Bancontact/MisterCash";
$_['name_mollie_paypal'] = "PayPal";
$_['name_mollie_paysafecard'] = "paysafecard";
$_['name_mollie_sofort'] = "SOFORT Banking";

// Text
$_['text_edit'] = "Edit";
$_['text_payment'] = "Payment";
$_['text_success'] = "Success: You have successfully modified your Mollie settings!";
$_['text_missing_api_key'] = "Please fill out your API key below.";
$_['text_activate_payment_method'] = 'Enable this payment method in your <a href="https://www.mollie.com/beheer/account/profielen/" target="_blank">Mollie dashboard</a>.';
$_['text_no_status_id'] = "- Do not update the order status (not recommended) -";

// Entry
$_['entry_payment_method'] = "Payment method";
$_['entry_activate'] = "Activate";
$_['entry_sort_order'] = "Sort order";
$_['entry_status'] = "Status";
$_['entry_api_key'] = "API key";
$_['entry_description'] = "Description";
$_['entry_show_icons'] = "Show icons";
$_['entry_show_order_canceled_page'] = "Show message if payment is cancelled";

// Help
$_['help_view_profile'] = 'You can find your API key in <a href="https://www.mollie.com/beheer/account/profielen/" target="_blank" class="alert-link">your Mollie website profiles</a>.';
$_['help_status'] = "Activate the module";
$_['help_api_key'] = 'Enter the <code>api_key</code> of the website profile you want to use. The API key starts with <code>test_</code> or <code>live_</code>.';
$_['help_description'] = 'This description will appear on the bank / card statement of your customer. You may use a maximum of 29 characters. TIP: Use <code>%</code>, this will be replaced by the order id of the payment. Don\'t forget <code>%</code> can be multiple characters long!';
$_['help_show_icons'] = 'Show icons next to the Mollie payment methods on the checkout page.';
$_['help_show_order_canceled_page'] = 'Show a message to the customer if a payment is cancelled, before redirecting the customer back to their shopping cart.';

// Info
$_['entry_module'] = "Module";
$_['entry_mod_status'] = "Module status";
$_['entry_comm_status'] = "Communication status";
$_['entry_support'] = "Support";

$_['entry_version'] = '<a href="https://github.com/mollie/OpenCart/releases" target="_blank">Mollie Opencart</a>';

// Error
$_['error_permission'] = "Warning: You don't have permission to modify the Mollie payment methods.";
$_['error_api_key'] = "Mollie API key is required!";
$_['error_api_key_invalid'] = "Invalid API key!";
$_['error_description'] = "Description is required!";
$_['error_file_missing'] = "File does not exist";

// Status
$_['entry_pending_status'] = "Payment created status";
$_['entry_failed_status'] = "Payment failed status";
$_['entry_canceled_status'] = "Payment canceled status";
$_['entry_expired_status'] = "Payment expired status";
$_['entry_processing_status'] = "Payment successful status";
4 changes: 4 additions & 0 deletions admin/language/en-gb/payment/mollie_banktransfer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_banktransfer'];
4 changes: 4 additions & 0 deletions admin/language/en-gb/payment/mollie_belfius.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_belfius'];
4 changes: 4 additions & 0 deletions admin/language/en-gb/payment/mollie_bitcoin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_bitcoin'];
4 changes: 4 additions & 0 deletions admin/language/en-gb/payment/mollie_creditcard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_creditcard'];
4 changes: 4 additions & 0 deletions admin/language/en-gb/payment/mollie_directdebit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_directdebit'];
4 changes: 4 additions & 0 deletions admin/language/en-gb/payment/mollie_ideal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_ideal'];
4 changes: 4 additions & 0 deletions admin/language/en-gb/payment/mollie_mistercash.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_mistercash'];
4 changes: 4 additions & 0 deletions admin/language/en-gb/payment/mollie_paypal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_paypal'];
4 changes: 4 additions & 0 deletions admin/language/en-gb/payment/mollie_paysafecard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_paysafecard'];
4 changes: 4 additions & 0 deletions admin/language/en-gb/payment/mollie_sofort.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_sofort'];
112 changes: 112 additions & 0 deletions admin/language/fr-fr/payment/mollie.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?php
/**
* Copyright (c) 2012-2015, Mollie B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* @package Mollie
* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php
* @author Mollie B.V. <[email protected]>
* @copyright Mollie B.V.
* @link https://www.mollie.com
*/

// These are called automatically by the Payment modules list - do not change the names
$method_list_logo = '<a href="https://www.mollie.com" target="_blank"><img src="https://www.mollie.com/images/logo.png" alt="Mollie" title="Mollie" style="border:0px" /></a>';
$_['text_mollie_banktransfer'] = $method_list_logo;
$_['text_mollie_belfius'] = $method_list_logo;
$_['text_mollie_bitcoin'] = $method_list_logo;
$_['text_mollie_creditcard'] = $method_list_logo;
$_['text_mollie_directdebit'] = $method_list_logo;
$_['text_mollie_ideal'] = $method_list_logo;
$_['text_mollie_mistercash'] = $method_list_logo;
$_['text_mollie_paypal'] = $method_list_logo;
$_['text_mollie_paysafecard'] = $method_list_logo;
$_['text_mollie_sofort'] = $method_list_logo;

// Heading
$_['heading_title'] = "Mollie";
$_['title_global_options'] = "Pour tous les modules Mollie";
$_['title_payment_status'] = "États de paiement";
$_['title_mod_about'] = "Sur ce module";
$_['footer_text'] = "Services paiement";

// Module names
$_['name_mollie_banktransfer'] = "Virement bancaire";
$_['name_mollie_belfius'] = "Belfius Direct Net";
$_['name_mollie_bitcoin'] = "Bitcoin";
$_['name_mollie_creditcard'] = "Creditcard";
$_['name_mollie_directdebit'] = "Débit direct";
$_['name_mollie_ideal'] = "iDEAL";
$_['name_mollie_mistercash'] = "Bancontact/MisterCash";
$_['name_mollie_paypal'] = "PayPal";
$_['name_mollie_paysafecard'] = "paysafecard";
$_['name_mollie_sofort'] = "SOFORT Banking";

// Text
$_['text_edit'] = "Éditer Mollie";
$_['text_payment'] = "Paiement";
$_['text_success'] = "Succès: Vous avez réussi à modifier les paramètres Mollie!";
$_['text_missing_api_key'] = "Remplir votre clé API ci-dessous.";
$_['text_activate_payment_method'] = 'Activer ce mode de paiement via le <a href="https://www.mollie.com/beheer/account/profielen/" target="_blank">Mollie dashboard</a>.';
$_['text_no_status_id'] = '- Ne pas mettre à jour le statut (non recommandé) -';

// Entry
$_['entry_payment_method'] = "Procédé de paiement";
$_['entry_activate'] = "Activate";
$_['entry_sort_order'] = "Ordre de triage";
$_['entry_status'] = "État";
$_['entry_api_key'] = "Clé API";
$_['entry_description'] = "Description";
$_['entry_show_icons'] = "Afficher des icônes";
$_['entry_show_order_canceled_page'] = "Afficher un message si le paiement est annulé";

// Help
$_['help_view_profile'] = 'Vous pouvez trouver votre clé API dans <a href="https://www.mollie.com/beheer/account/profielen/" target="_blank" class="alert-link">vos profils de site à Mollie</a>.';
$_['help_status'] = "Activer le module";
$_['help_api_key'] = 'Entrer ici le <code>api_key</code> du profil que vous souhaitez utiliser. Le cl&eacute; API commence par <code>test_</code> ou <code>live_</code>.';
$_['help_description'] = 'Cette description apparaîtra sur le relevé bancaire de votre client. Vous pouvez utiliser un maximum de 29 caractères. ASTUCE: Utilisez le <code>%</code>, il sera remplacé par l\'id de la commande du paiement. N\'oubliez pas que <code>%/code> peut devenir plusieurs caractères!';
$_['help_show_icons'] = 'Afficher les icônes à côté des méthodes de paiement Mollie sur la page de paiement.';
$_['help_show_order_canceled_page'] = 'Afficher un message au client si un paiement est annulé, avant de rediriger le client vers leur panier.';

// Info
$_['entry_module'] = "Module";
$_['entry_mod_status'] = "État du module";
$_['entry_comm_status'] = "État de la communication";
$_['entry_support'] = "Assistance";

$_['entry_version'] = '<a href="https://github.com/mollie/OpenCart/releases" target="_blank">MollieOpenCart</a>';

// Error
$_['error_permission'] = "Attention: Vous n'avez pas l'autorisation de modifier les méthodes de paiement Mollie.";
$_['error_api_key'] = "La clé API est nécessaire!";
$_['error_api_key_invalid'] = "La clé API est invalide!";
$_['error_description'] = "Description est nécessaire!";
$_['error_file_missing'] = "Fichier ne existe pas";

// Status
$_['entry_pending_status'] = "État de paiement attente";
$_['entry_failed_status'] = "État de paiement échoué";
$_['entry_canceled_status'] = "État de paiement annulé";
$_['entry_expired_status'] = "État de paiement expiré";
$_['entry_processing_status'] = "État de paiement traitement";
4 changes: 4 additions & 0 deletions admin/language/fr-fr/payment/mollie_banktransfer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_banktransfer'];
4 changes: 4 additions & 0 deletions admin/language/fr-fr/payment/mollie_belfius.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_belfius'];
4 changes: 4 additions & 0 deletions admin/language/fr-fr/payment/mollie_bitcoin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_bitcoin'];
4 changes: 4 additions & 0 deletions admin/language/fr-fr/payment/mollie_creditcard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_creditcard'];
4 changes: 4 additions & 0 deletions admin/language/fr-fr/payment/mollie_directdebit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_directdebit'];
4 changes: 4 additions & 0 deletions admin/language/fr-fr/payment/mollie_ideal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_ideal'];
Loading

0 comments on commit ea83a23

Please sign in to comment.