diff --git a/doneren-met-mollie.php b/doneren-met-mollie.php
index 84a5ca1..19b455c 100644
--- a/doneren-met-mollie.php
+++ b/doneren-met-mollie.php
@@ -2,7 +2,7 @@
/*
Plugin Name: Doneren met Mollie
Description: Donaties ontvangen via Mollie
-Version: 2.1.7
+Version: 2.2.0
Author: Nick Dijkstra
Author URI: http://nickdijkstra.nl
Text Domain: doneren-met-mollie
@@ -15,7 +15,7 @@
// Plugin Version
if (!defined('DMM_VERSION')) {
- define('DMM_VERSION', '2.1.7');
+ define('DMM_VERSION', '2.2.0');
}
// Plugin Folder Path
diff --git a/includes/class-admin.php b/includes/class-admin.php
index 2179837..73d3f59 100644
--- a/includes/class-admin.php
+++ b/includes/class-admin.php
@@ -14,6 +14,7 @@ public function __construct()
add_action('admin_menu', array($this, 'dmm_admin_menu'));
add_action('admin_init', array($this, 'dmm_register_settings'));
+ add_action('admin_post_dmm_export', array($this, 'dmm_export_donations'));
}
/**
@@ -189,11 +190,68 @@ public function dmm_page_donations() {
+
display();?>
wpdb->get_results("SELECT * FROM " . DMM_TABLE_DONATIONS . $where . " ORDER BY time DESC");
+ foreach ($donations as $donation)
+ {
+ fputcsv($output, array(
+ $donation->time,
+ $donation->dm_name,
+ $donation->dm_company,
+ $donation->dm_email,
+ $donation->dm_phone,
+ $donation->dm_address,
+ $donation->dm_zipcode,
+ $donation->dm_city,
+ $donation->dm_country,
+ $donation->dm_project,
+ $donation->dm_message,
+ $donation->dm_amount,
+ $donation->dm_status,
+ $donation->payment_method,
+ $donation->donation_id,
+ $donation->payment_id,
+ ));
+ }
+ }
+
public function dmm_page_donation()
{
$donation = $this->wpdb->get_row("SELECT * FROM " . DMM_TABLE_DONATIONS . " WHERE id = '" . esc_sql($_REQUEST['id']) . "'");
@@ -616,9 +674,8 @@ private function dmm_tab_settings_recurring()
return;
}
- foreach ($mollie->methods->all() as $method)
- if ($method->id == 'directdebit' || $method->id == 'creditcard')
- $recurring = true;
+ if (count($mollie->methods->all(0,50, array('recurringType' => 'recurring'))))
+ $recurring = true;
} catch (Mollie_API_Exception $e) {
echo "
API call failed: " . htmlspecialchars($e->getMessage()) . "
";
diff --git a/includes/class-start.php b/includes/class-start.php
index 47f7179..cc7a0b2 100644
--- a/includes/class-start.php
+++ b/includes/class-start.php
@@ -493,7 +493,7 @@ private function dmm_payment_methods($mollie) {
if (get_option('dmm_recurring'))
{
$recurring = array('dd' => false, 'cc' => false);
- foreach ($mollie->methods->all() as $method)
+ foreach ($mollie->methods->all(0,50,array('recurringType' => 'recurring')) as $method)
{
if ($method->id == 'directdebit')$recurring['dd'] = true;
if ($method->id == 'creditcard')$recurring['cc'] = true;
@@ -584,7 +584,7 @@ function dmm_recurring_methods(value) {
*/
private function dmm_recurring_method($id)
{
- $recurring = array('ideal', 'mistercash', 'belfius', 'sofort', 'creditcard');
+ $recurring = array('ideal', 'mistercash', 'kbc', 'belfius', 'sofort', 'creditcard');
return !in_array($id, $recurring) ? 'class="dmm_recurring"' : 'class="' . ($id == 'creditcard' ? 'dmm_cc' : 'dmm_dd') . '"';
}
diff --git a/includes/class-webhook.php b/includes/class-webhook.php
old mode 100644
new mode 100755
diff --git a/includes/config.php b/includes/config.php
old mode 100755
new mode 100644
index a2d63d8..9d5b8ca
--- a/includes/config.php
+++ b/includes/config.php
@@ -13,6 +13,7 @@
define('DMM_TXT_DOMAIN', 'doneren-met-mollie');
// Pages
+define('DMM_PAGE_EXPORT', 'doneren-met-mollie-export');
define('DMM_PAGE_DONATION', 'doneren-met-mollie-donatie');
define('DMM_PAGE_DONATIONS', 'doneren-met-mollie');
define('DMM_PAGE_DONORS', 'doneren-met-mollie-donateurs');
diff --git a/readme.txt b/readme.txt
index 02bad64..478779a 100644
--- a/readme.txt
+++ b/readme.txt
@@ -3,7 +3,7 @@ Contributors: ndijkstra
Tags: mollie,doneren,donate,ideal,mistercash,bancontact,bitcoin,creditcard,paypal,sofort,belfius,overboeking,recurring,incasso,debit,herhaalbetalingen,sepa,subscriptions,kbc,cbc
Requires at least: 3.0.1
Tested up to: 4.6.1
-Stable tag: 2.1.7
+Stable tag: 2.2.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -39,6 +39,10 @@ Naast eenmalige donaties is deze plugin ook goed bruikbaar om periodiek bedragen
== Changelog ==
+= 2.2.0 =
+* Fix dat recurring niet meer mogelijk was vanwege aanpassing Mollie API SEPA-incasso
+* Donaties exporteren naar CSV mogelijk
+
= 2.1.7 =
* Eerste bedrag bij herhaalbetaling (recurring) meteen bedrag voor eerste termijn ipv €0,01