Skip to content

Commit

Permalink
Merge pull request #276 from mollie/v11
Browse files Browse the repository at this point in the history
v11.0.0
  • Loading branch information
QualityWorks committed Nov 16, 2021
2 parents b9c1098 + 4af51fe commit 4ce05bf
Show file tree
Hide file tree
Showing 247 changed files with 4,798 additions and 5,271 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,16 @@

# Changelog #

#### Changes in release 11.0.0
+ Added Klarna Pay Now payment method
+ Added Voucher payment method
+ Added Option to use Payment API (or Order API)
+ Extended refund option to refund orderlines as well
+ Bug Fixes

#### Changes in release 10.3.2
+ Fixed bug in currency due to other payment methods

#### Changes in release 10.3.1
+ Fixed shipment creation exception
+ Fixed bug in currency
Expand Down
4 changes: 4 additions & 0 deletions admin/controller/extension/payment/mollie_klarnapaynow.php
@@ -0,0 +1,4 @@
<?php
include_once(DIR_APPLICATION . "controller/payment/mollie_klarnapaynow.php");
class ControllerExtensionPaymentMollieKlarnapaynow extends ControllerPaymentMollieKlarnapaynow{}
?>
4 changes: 4 additions & 0 deletions admin/controller/extension/payment/mollie_voucher.php
@@ -0,0 +1,4 @@
<?php
include_once(DIR_APPLICATION . "controller/payment/mollie_voucher.php");
class ControllerExtensionPaymentMollieVoucher extends ControllerPaymentMollieVoucher{}
?>
45 changes: 39 additions & 6 deletions admin/controller/payment/mollie/base.php
Expand Up @@ -355,10 +355,24 @@ public function install () {
$this->db->query("ALTER TABLE `" . DB_PREFIX . "mollie_payments` ADD `payment_attempt` INT(11) NOT NULL");

// Update primary key
// $query = $this->db->query("SHOW INDEX FROM `" .DB_PREFIX. "mollie_payments` where Key_name = 'PRIMARY'");
// if($query->num_rows > 0 && $query->row['Column_name'] != 'mollie_order_id') {
// $this->db->query("DELETE FROM `" .DB_PREFIX. "mollie_payments` where mollie_order_id IS NULL OR mollie_order_id = ''");
// $this->db->query("ALTER TABLE `" .DB_PREFIX. "mollie_payments` DROP PRIMARY KEY, ADD PRIMARY KEY (mollie_order_id)");
// }

// Drop Primary Key
$query = $this->db->query("SHOW INDEX FROM `" .DB_PREFIX. "mollie_payments` where Key_name = 'PRIMARY'");
if($query->num_rows > 0 && $query->row['Column_name'] != 'mollie_order_id') {
$this->db->query("DELETE FROM `" .DB_PREFIX. "mollie_payments` where mollie_order_id IS NULL OR mollie_order_id = ''");
$this->db->query("ALTER TABLE `" .DB_PREFIX. "mollie_payments` DROP PRIMARY KEY, ADD PRIMARY KEY (mollie_order_id)");
if($query->num_rows > 0) {
$this->db->query("ALTER TABLE `" .DB_PREFIX. "mollie_payments` DROP PRIMARY KEY");
}

// Drop Unique Key
$query = $this->db->query("SHOW INDEX FROM `" .DB_PREFIX. "mollie_payments`");
if($query->num_rows > 0) {
foreach ($query->rows as $row) {
$this->db->query("ALTER TABLE `" .DB_PREFIX. "mollie_payments` DROP INDEX " . $row['Key_name'] . "");
}
}

// Create mollie customers table
Expand Down Expand Up @@ -997,6 +1011,7 @@ public function index () {
$paymentFee = array();
$paymentTotalMin = array();
$paymentTotalMax = array();
$paymentAPIToUse = array();

foreach ($this->mollieHelper->MODULE_NAMES as $module_name) {
$paymentDesc[] = $code . '_' . $module_name . '_description';
Expand All @@ -1007,9 +1022,10 @@ public function index () {
$paymentFee[] = $code . '_' . $module_name . '_payment_fee';
$paymentTotalMin[] = $code . '_' . $module_name . '_total_minimum';
$paymentTotalMax[] = $code . '_' . $module_name . '_total_maximum';
$paymentAPIToUse[] = $code . '_' . $module_name . '_api_to_use';
}

$fields = array("show_icons", "show_order_canceled_page", "ideal_description", "api_key", "client_id", "client_secret", "refresh_token", "ideal_processing_status_id", "ideal_expired_status_id", "ideal_canceled_status_id", "ideal_failed_status_id", "ideal_pending_status_id", "ideal_shipping_status_id", "create_shipment_status_id", "ideal_refund_status_id", "create_shipment", "payment_screen_language", "debug_mode", "mollie_component", "mollie_component_css_base", "mollie_component_css_valid", "mollie_component_css_invalid", "default_currency", "recurring_email", "align_icons", "single_click_payment", "order_expiry_days", "partial_refund", "ideal_partial_refund_status_id", "payment_fee_tax_class_id");
$fields = array("show_icons", "show_order_canceled_page", "description", "api_key", "client_id", "client_secret", "refresh_token", "ideal_processing_status_id", "ideal_expired_status_id", "ideal_canceled_status_id", "ideal_failed_status_id", "ideal_pending_status_id", "ideal_shipping_status_id", "create_shipment_status_id", "ideal_refund_status_id", "create_shipment", "payment_screen_language", "debug_mode", "mollie_component", "mollie_component_css_base", "mollie_component_css_valid", "mollie_component_css_invalid", "default_currency", "recurring_email", "align_icons", "single_click_payment", "order_expiry_days", "partial_refund", "ideal_partial_refund_status_id", "payment_fee_tax_class_id");

$settingFields = $this->addPrefix($code . '_', $fields);

Expand Down Expand Up @@ -1091,6 +1107,9 @@ public function index () {
$data['text_no_maximum_limit'] = $this->language->get('text_no_maximum_limit');
$data['text_standard_total'] = $this->language->get('text_standard_total');
$data['text_advance_option'] = $this->language->get('text_advance_option');
$data['text_payment_api'] = $this->language->get('text_payment_api');
$data['text_order_api'] = $this->language->get('text_order_api');
$data['text_info_orders_api'] = $this->language->get('text_info_orders_api');

$data['title_global_options'] = $this->language->get('title_global_options');
$data['title_payment_status'] = $this->language->get('title_payment_status');
Expand All @@ -1111,6 +1130,7 @@ public function index () {
$data['name_mollie_eps'] = $this->language->get('name_mollie_eps');
$data['name_mollie_giropay'] = $this->language->get('name_mollie_giropay');
$data['name_mollie_klarnapaylater'] = $this->language->get('name_mollie_klarnapaylater');
$data['name_mollie_klarnapaynow'] = $this->language->get('name_mollie_klarnapaynow');
$data['name_mollie_klarnasliceit'] = $this->language->get('name_mollie_klarnasliceit');
$data['name_mollie_przelewy24'] = $this->language->get('name_mollie_przelewy24');
$data['name_mollie_applepay'] = $this->language->get('name_mollie_applepay');
Expand Down Expand Up @@ -1171,6 +1191,7 @@ public function index () {
$data['entry_total'] = $this->language->get('entry_total');
$data['entry_minimum'] = $this->language->get('entry_minimum');
$data['entry_maximum'] = $this->language->get('entry_maximum');
$data['entry_api_to_use'] = $this->language->get('entry_api_to_use');

$data['error_order_expiry_days'] = $this->language->get('error_order_expiry_days');

Expand All @@ -1196,6 +1217,7 @@ public function index () {
$data['button_clear'] = $this->language->get('button_clear');
$data['button_submit'] = $this->language->get('button_submit');
$data['button_advance_option'] = $this->language->get('button_advance_option');
$data['button_close'] = $this->language->get('button_close');

$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_payment'),
Expand Down Expand Up @@ -1276,12 +1298,17 @@ public function index () {
$data['error_warning'] = '';
}

$description = array();
foreach ($data['languages'] as $_language) {
$description[$_language['language_id']]['title'] = "Order %";
}

// Load global settings. Some are prefixed with mollie_ideal_ for legacy reasons.
$settings = array(
$code . "_api_key" => NULL,
$code . "_client_id" => NULL,
$code . "_client_secret" => NULL,
$code . "_description" => "Order %",
$code . "_description" => $description,
$code . "_show_icons" => FALSE,
$code . "_align_icons" => 'left',
$code . "_show_order_canceled_page" => FALSE,
Expand Down Expand Up @@ -1488,7 +1515,13 @@ public function index () {
} else {
$payment_method['total_maximum'] = ($allowed_methods[$module_name]['maximumAmount']) ? $this->numberFormat($this->currency->convert($maximumAmount, $currency, $this->config->get('config_currency')), $this->config->get('config_currency')) : '';
}
}
}

if (isset($this->data[$store['store_id'] . '_' . $code . '_' . $module_name . '_api_to_use'])) {
$payment_method['api_to_use'] = $this->data[$store['store_id'] . '_' . $code . '_' . $module_name . '_api_to_use'];
} else {
$payment_method['api_to_use'] = isset($this->data[$code . "_" . $module_name . "_api_to_use"]) ? $this->data[$code . "_" . $module_name . "_api_to_use"] : null;
}

$data['store_data'][$store['store_id'] . '_' . $code . '_payment_methods'][$module_name] = $payment_method;
}
Expand Down
7 changes: 7 additions & 0 deletions admin/controller/payment/mollie_klarnapaynow.php
@@ -0,0 +1,7 @@
<?php
require_once(DIR_APPLICATION . "controller/payment/mollie/base.php");

class ControllerPaymentMollieKlarnapaynow extends ControllerPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_KLARNAPAYNOW;
}
7 changes: 7 additions & 0 deletions admin/controller/payment/mollie_voucher.php
@@ -0,0 +1,7 @@
<?php
require_once(DIR_APPLICATION . "controller/payment/mollie/base.php");

class ControllerPaymentMollieVoucher extends ControllerPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_VOUCHER;
}
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_klarnapaynow.php");
2 changes: 2 additions & 0 deletions admin/language/de-de/extension/payment/mollie_voucher.php
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_voucher.php");
4 changes: 4 additions & 0 deletions admin/language/de-de/payment/mollie_klarnapaynow.php
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_klarnapaynow'];
4 changes: 4 additions & 0 deletions admin/language/de-de/payment/mollie_voucher.php
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_voucher'];
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_klarnapaynow.php");
2 changes: 2 additions & 0 deletions admin/language/dutch/extension/payment/mollie_voucher.php
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_voucher.php");
11 changes: 11 additions & 0 deletions admin/language/dutch/payment/mollie.php
Expand Up @@ -46,9 +46,12 @@
$_['text_mollie_eps'] = $method_list_logo;
$_['text_mollie_giropay'] = $method_list_logo;
$_['text_mollie_klarnapaylater'] = $method_list_logo;
$_['text_mollie_klarnapaynow'] = $method_list_logo;
$_['text_mollie_klarnasliceit'] = $method_list_logo;
$_['text_mollie_przelewy24'] = $method_list_logo;
$_['text_mollie_applepay'] = $method_list_logo;
$_['text_mollie_voucher'] = $method_list_logo;

//These methods have been removed, it's here only to supress error of undefined variables. We'll remove it later
$_['text_mollie_inghomepay'] = $method_list_logo;
$_['text_mollie_directdebit'] = $method_list_logo;
Expand All @@ -75,9 +78,12 @@
$_['name_mollie_eps'] = 'EPS';
$_['name_mollie_giropay'] = 'Giropay';
$_['name_mollie_klarnapaylater'] = 'Klarna Pay Later';
$_['name_mollie_klarnapaynow'] = 'Klarna Pay Now';
$_['name_mollie_klarnasliceit'] = 'Klarna Slice It';
$_['name_mollie_przelewy24'] = 'P24';
$_['name_mollie_applepay'] = 'Apple Pay';
$_['name_mollie_voucher'] = "Voucher";

//These methods have been removed, it's here only to supress error of undefined variables. We'll remove it later
$_['name_mollie_inghomepay'] = 'INGHOMEPAY';
$_['name_mollie_directdebit'] = 'Direct Debit';
Expand Down Expand Up @@ -124,6 +130,9 @@
$_['text_no_maximum_limit'] = 'Geen maximum bedrag limiet';
$_['text_standard_total'] = 'Standaard totaal: %s';
$_['text_advance_option'] = 'Geavanceerde opties voor %s';
$_['text_payment_api'] = 'Betalingen API';
$_['text_order_api'] = 'Bestellingen API';
$_['text_info_orders_api'] = 'Waarom Orders API gebruiken?';

// Entry
$_['entry_payment_method'] = "Betaalmethode";
Expand Down Expand Up @@ -164,6 +173,7 @@
$_['entry_total'] = "Totaal";
$_['entry_minimum'] = "Minimum";
$_['entry_maximum'] = "Maximaal";
$_['entry_api_to_use'] = "API om te gebruiken";

// Help
$_['help_view_profile'] = 'U kunt uw API-sleutel vinden bij <a href="https://www.mollie.com/dashboard/settings/profiles/" target="_blank" class="alert-link">uw Mollie-websiteprofielen</a>.';
Expand Down Expand Up @@ -227,6 +237,7 @@
$_['button_update'] = "Bijwerken";
$_['button_mollie_connect'] = "Connect via Mollie";
$_['button_advance_option'] = "Advance Option";
$_['button_close'] = "Sluiten";

//Error log
$_['text_log_success'] = 'Succes: u hebt met succes uw foutenlogboek gewist!';
Expand Down
4 changes: 4 additions & 0 deletions admin/language/dutch/payment/mollie_klarnapaynow.php
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_klarnapaynow'];
4 changes: 4 additions & 0 deletions admin/language/dutch/payment/mollie_voucher.php
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_voucher'];
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_klarnapaynow.php");
2 changes: 2 additions & 0 deletions admin/language/en-gb/extension/payment/mollie_voucher.php
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_voucher.php");
4 changes: 4 additions & 0 deletions admin/language/en-gb/payment/mollie_klarnapaynow.php
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_klarnapaynow'];
4 changes: 4 additions & 0 deletions admin/language/en-gb/payment/mollie_voucher.php
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_voucher'];
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_klarnapaynow.php");
2 changes: 2 additions & 0 deletions admin/language/english/extension/payment/mollie_voucher.php
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_voucher.php");
11 changes: 11 additions & 0 deletions admin/language/english/payment/mollie.php
Expand Up @@ -46,9 +46,12 @@
$_['text_mollie_eps'] = $method_list_logo;
$_['text_mollie_giropay'] = $method_list_logo;
$_['text_mollie_klarnapaylater'] = $method_list_logo;
$_['text_mollie_klarnapaynow'] = $method_list_logo;
$_['text_mollie_klarnasliceit'] = $method_list_logo;
$_['text_mollie_przelewy24'] = $method_list_logo;
$_['text_mollie_applepay'] = $method_list_logo;
$_['text_mollie_voucher'] = $method_list_logo;

//These methods have been removed, it's here only to supress error of undefined variables. We'll remove it later
$_['text_mollie_inghomepay'] = $method_list_logo;
$_['text_mollie_directdebit'] = $method_list_logo;
Expand All @@ -75,9 +78,12 @@
$_['name_mollie_eps'] = 'EPS';
$_['name_mollie_giropay'] = 'Giropay';
$_['name_mollie_klarnapaylater'] = 'Klarna Pay Later';
$_['name_mollie_klarnapaynow'] = 'Klarna Pay Now';
$_['name_mollie_klarnasliceit'] = 'Klarna Slice It';
$_['name_mollie_przelewy24'] = 'P24';
$_['name_mollie_applepay'] = 'Apple Pay';
$_['name_mollie_voucher'] = "Voucher";

//These methods have been removed, it's here only to supress error of undefined variables. We'll remove it later
$_['name_mollie_inghomepay'] = 'INGHOMEPAY';
$_['name_mollie_directdebit'] = 'Direct Debit';
Expand Down Expand Up @@ -124,6 +130,9 @@
$_['text_no_maximum_limit'] = 'No maximum amount limit';
$_['text_standard_total'] = 'Standard Total: %s';
$_['text_advance_option'] = 'Advanced Options For %s';
$_['text_payment_api'] = 'Payments API';
$_['text_order_api'] = 'Orders API';
$_['text_info_orders_api'] = 'Why Use Orders API?';

// Entry
$_['entry_payment_method'] = "Payment method";
Expand Down Expand Up @@ -165,6 +174,7 @@
$_['entry_total'] = "Total";
$_['entry_minimum'] = "Minimum";
$_['entry_maximum'] = "Maximum";
$_['entry_api_to_use'] = "API to Use";

// Help
$_['help_view_profile'] = 'You can find your API key in <a href="https://www.mollie.com/dashboard/settings/profiles/" target="_blank" class="alert-link">your Mollie website profiles</a>.';
Expand Down Expand Up @@ -228,6 +238,7 @@
$_['button_update'] = "Update";
$_['button_mollie_connect'] = "Connect via Mollie";
$_['button_advance_option'] = "Advance Option";
$_['button_close'] = "Close";

//Error log
$_['text_log_success'] = 'Success: You have successfully cleared your mollie log!';
Expand Down
4 changes: 4 additions & 0 deletions admin/language/english/payment/mollie_klarnapaynow.php
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_klarnapaynow'];
4 changes: 4 additions & 0 deletions admin/language/english/payment/mollie_voucher.php
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_voucher'];
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_klarnapaynow.php");
2 changes: 2 additions & 0 deletions admin/language/es-es/extension/payment/mollie_voucher.php
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_voucher.php");
4 changes: 4 additions & 0 deletions admin/language/es-es/payment/mollie_klarnapaynow.php
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_klarnapaynow'];
4 changes: 4 additions & 0 deletions admin/language/es-es/payment/mollie_voucher.php
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_voucher'];
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_klarnapaynow.php");
2 changes: 2 additions & 0 deletions admin/language/fr-fr/extension/payment/mollie_voucher.php
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_voucher.php");
4 changes: 4 additions & 0 deletions admin/language/fr-fr/payment/mollie_klarnapaynow.php
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_klarnapaynow'];
4 changes: 4 additions & 0 deletions admin/language/fr-fr/payment/mollie_voucher.php
@@ -0,0 +1,4 @@
<?php
require(dirname(__FILE__) . "/mollie.php");

$_['heading_title'] .= " &ndash; " . $_['name_mollie_voucher'];
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_klarnapaynow.php");
2 changes: 2 additions & 0 deletions admin/language/french/extension/payment/mollie_voucher.php
@@ -0,0 +1,2 @@
<?php
include(__DIR__."/../../payment/mollie_voucher.php");

0 comments on commit 4ce05bf

Please sign in to comment.