Skip to content

Commit

Permalink
Merged in COMDEVNL-1156 (pull request #2)
Browse files Browse the repository at this point in the history
COMDEVNL-1156 -- api v2

Approved-by: Maxim Janssens <[email protected]>
Approved-by: Kim Hoogenberg <[email protected]>
  • Loading branch information
mark smit authored and Kim Hoogenberg committed Jul 18, 2018
2 parents 9544d7c + 4bf4a60 commit 78063e5
Show file tree
Hide file tree
Showing 39 changed files with 737 additions and 787 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@

#### Wijzigigen in versie 5.0
+ De module gebruikt nu de nieuwe betalings-API van Mollie. Dit betekent dat de module naast [iDEAL](https://www.mollie.com/ideal/), nu
ook [creditcard](https://www.mollie.com/creditcard/), [Mister Cash](https://www.mollie.com/mistercash/) en [paysafecard](https://www.mollie.com/paysafecard/)
ook [creditcard](https://www.mollie.com/creditcard/), [Mister Cash](https://www.mollie.com/bancontact/) en [paysafecard](https://www.mollie.com/paysafecard/)
ondersteunt. Mocht een betaling om wat voor reden dan ook niet lukken, dat kan uw klant het gelijk nog een keer proberen. U hoeft hiervoor niets extra's
te implementeren. In de toekomst zullen ook nog nieuwe betaalmethodes toegevoegd worden. Deze zijn dan direct beschikbaar in uw webshop.
+ Het instellingenscherm in de admin toont nu gelijk of de module correct kan communiceren met de Mollie API. Hierdoor kunnen we u beter helpen wanneer
Expand Down
25 changes: 17 additions & 8 deletions admin/controller/extension/payment/mollie/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
* @property URL $url
* @property User $user
*/
use Mollie\Api\Exceptions\ApiException;
use Mollie\Api\Exceptions\IncompatiblePlatform;
use Mollie\Api\MollieApiClient;

require_once(dirname(DIR_SYSTEM) . "/catalog/controller/extension/payment/mollie/helper.php");

class ControllerExtensionPaymentMollieBase extends Controller
Expand All @@ -57,7 +61,7 @@ class ControllerExtensionPaymentMollieBase extends Controller

/**
* @param int $store The Store ID
* @return Mollie_API_Client
* @return MollieApiClient
*/
protected function getAPIClient ($store = 0)
{
Expand Down Expand Up @@ -102,7 +106,9 @@ public function cleanUp()
$catalogThemeDir = DIR_CATALOG . 'view/theme/default/template/extension/payment/';

// Remove old template from previous version.
unlink($adminThemeDir . 'mollie_2.tpl');
if (file_exists($adminThemeDir . 'mollie_2.tpl')) {
unlink($adminThemeDir . 'mollie_2.tpl');
}

if (MollieHelper::isOpenCart3x()) {
unlink($adminThemeDir . 'mollie_1.tpl');
Expand Down Expand Up @@ -408,7 +414,7 @@ public function index ()
$allowed_methods[] = $api_method->id;
}
}
catch (Mollie_API_Exception $e)
catch (Mollie\Api\Exceptions\ApiException $e)
{
// If we have an unauthorized request, our API key is likely invalid.
if ($data['stores'][$store['id']][$code . '_api_key'] !== NULL && strpos($e->getMessage(), "Unauthorized request") >= 0)
Expand Down Expand Up @@ -472,7 +478,10 @@ public function index ()
));
}

public function validate_api_key()
/**
*
*/
public function validate_api_key()
{
$json = array(
'error' => false,
Expand All @@ -497,10 +506,10 @@ public function validate_api_key()
$json['valid'] = true;
$json['message'] = 'Ok.';
}
} catch (Mollie_API_Exception_IncompatiblePlatform $e) {
} catch (IncompatiblePlatform $e) {
$json['error'] = true;
$json['message'] = $e->getMessage() . ' You can ask your hosting provider to help with this.';
} catch (Mollie_API_Exception $e) {
} catch (ApiException $e) {
$json['error'] = true;
$json['message'] = '<strong>Communicating with Mollie failed:</strong><br/>'
. htmlspecialchars($e->getMessage())
Expand Down Expand Up @@ -565,9 +574,9 @@ protected function checkCommunicationStatus ($api_key = null)
$client->methods->all();

return '<span style="color: green">OK</span>';
} catch (Mollie_API_Exception_IncompatiblePlatform $e) {
} catch (Mollie\Api\Exceptions\ApiException_IncompatiblePlatform $e) {
return '<span style="color:red">' . $e->getMessage() . ' You can ask your hosting provider to help with this.</span>';
} catch (Mollie_API_Exception $e) {
} catch (Mollie\Api\Exceptions\ApiException $e) {
return '<span style="color:red">'
. '<strong>Communicating with Mollie failed:</strong><br/>'
. htmlspecialchars($e->getMessage())
Expand Down
7 changes: 7 additions & 0 deletions admin/controller/extension/payment/mollie_bancontact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerExtensionPaymentMolliebancontact extends ControllerExtensionPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_BANCONTACT;
}
7 changes: 0 additions & 7 deletions admin/controller/extension/payment/mollie_mistercash.php

This file was deleted.

4 changes: 2 additions & 2 deletions admin/language/dutch/extension/payment/mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$_['text_mollie_directdebit'] = $method_list_logo;
$_['text_mollie_ideal'] = $method_list_logo;
$_['text_mollie_kbc'] = $method_list_logo;
$_['text_mollie_mistercash'] = $method_list_logo;
$_['text_mollie_bancontact'] = $method_list_logo;
$_['text_mollie_paypal'] = $method_list_logo;
$_['text_mollie_paysafecard'] = $method_list_logo;
$_['text_mollie_sofort'] = $method_list_logo;
Expand All @@ -64,7 +64,7 @@
$_['name_mollie_directdebit'] = "Eenmalige incasso";
$_['name_mollie_ideal'] = "iDEAL";
$_['name_mollie_kbc'] = "KBC/CBC-Betaalknop";
$_['name_mollie_mistercash'] = "Bancontact/MisterCash";
$_['name_mollie_bancontact'] = "bancontact";
$_['name_mollie_paypal'] = "PayPal";
$_['name_mollie_paysafecard'] = "paysafecard";
$_['name_mollie_sofort'] = "SOFORT Banking";
Expand Down
4 changes: 4 additions & 0 deletions admin/language/dutch/extension/payment/mollie_bancontact.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_bancontact'];
4 changes: 0 additions & 4 deletions admin/language/dutch/extension/payment/mollie_mistercash.php

This file was deleted.

4 changes: 2 additions & 2 deletions admin/language/en-gb/extension/payment/mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$_['text_mollie_directdebit'] = $method_list_logo;
$_['text_mollie_ideal'] = $method_list_logo;
$_['text_mollie_kbc'] = $method_list_logo;
$_['text_mollie_mistercash'] = $method_list_logo;
$_['text_mollie_bancontact'] = $method_list_logo;
$_['text_mollie_paypal'] = $method_list_logo;
$_['text_mollie_paysafecard'] = $method_list_logo;
$_['text_mollie_sofort'] = $method_list_logo;
Expand All @@ -64,7 +64,7 @@
$_['name_mollie_directdebit'] = "Direct debit";
$_['name_mollie_ideal'] = "iDEAL";
$_['name_mollie_kbc'] = "KBC/CBC Payment Button";
$_['name_mollie_mistercash'] = "Bancontact/MisterCash";
$_['name_mollie_bancontact'] = "Bancontact";
$_['name_mollie_paypal'] = "PayPal";
$_['name_mollie_paysafecard'] = "paysafecard";
$_['name_mollie_sofort'] = "SOFORT Banking";
Expand Down
4 changes: 4 additions & 0 deletions admin/language/en-gb/extension/payment/mollie_bancontact.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_bancontact'];
4 changes: 0 additions & 4 deletions admin/language/en-gb/extension/payment/mollie_mistercash.php

This file was deleted.

4 changes: 2 additions & 2 deletions admin/language/english/extension/payment/mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$_['text_mollie_directdebit'] = $method_list_logo;
$_['text_mollie_ideal'] = $method_list_logo;
$_['text_mollie_kbc'] = $method_list_logo;
$_['text_mollie_mistercash'] = $method_list_logo;
$_['text_mollie_bancontact'] = $method_list_logo;
$_['text_mollie_paypal'] = $method_list_logo;
$_['text_mollie_paysafecard'] = $method_list_logo;
$_['text_mollie_sofort'] = $method_list_logo;
Expand All @@ -62,7 +62,7 @@
$_['name_mollie_directdebit'] = "Direct debit";
$_['name_mollie_ideal'] = "iDEAL";
$_['name_mollie_kbc'] = "KBC/CBC Payment Button";
$_['name_mollie_mistercash'] = "Bancontact/MisterCash";
$_['name_mollie_bancontact'] = "Bancontact";
$_['name_mollie_paypal'] = "PayPal";
$_['name_mollie_paysafecard'] = "paysafecard";
$_['name_mollie_sofort'] = "SOFORT Banking";
Expand Down
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_bancontact'];

This file was deleted.

4 changes: 2 additions & 2 deletions admin/language/fr-fr/extension/payment/mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$_['text_mollie_directdebit'] = $method_list_logo;
$_['text_mollie_ideal'] = $method_list_logo;
$_['text_mollie_kbc'] = $method_list_logo;
$_['text_mollie_mistercash'] = $method_list_logo;
$_['text_mollie_bancontact'] = $method_list_logo;
$_['text_mollie_paypal'] = $method_list_logo;
$_['text_mollie_paysafecard'] = $method_list_logo;
$_['text_mollie_sofort'] = $method_list_logo;
Expand All @@ -64,7 +64,7 @@
$_['name_mollie_directdebit'] = "Débit direct";
$_['name_mollie_ideal'] = "iDEAL";
$_['name_mollie_kbc'] = "Bouton de paiement KBC/CBC";
$_['name_mollie_mistercash'] = "Bancontact/MisterCash";
$_['name_mollie_bancontact'] = "Bancontact";
$_['name_mollie_paypal'] = "PayPal";
$_['name_mollie_paysafecard'] = "paysafecard";
$_['name_mollie_sofort'] = "SOFORT Banking";
Expand Down
4 changes: 4 additions & 0 deletions admin/language/fr-fr/extension/payment/mollie_bancontact.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_bancontact'];
4 changes: 0 additions & 4 deletions admin/language/fr-fr/extension/payment/mollie_mistercash.php

This file was deleted.

4 changes: 2 additions & 2 deletions admin/language/french/extension/payment/mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$_['text_mollie_directdebit'] = $method_list_logo;
$_['text_mollie_ideal'] = $method_list_logo;
$_['text_mollie_kbc'] = $method_list_logo;
$_['text_mollie_mistercash'] = $method_list_logo;
$_['text_mollie_bancontact'] = $method_list_logo;
$_['text_mollie_paypal'] = $method_list_logo;
$_['text_mollie_paysafecard'] = $method_list_logo;
$_['text_mollie_sofort'] = $method_list_logo;
Expand All @@ -64,7 +64,7 @@
$_['name_mollie_directdebit'] = "Débit direct";
$_['name_mollie_ideal'] = "iDEAL";
$_['name_mollie_kbc'] = "Bouton de paiement KBC/CBC";
$_['name_mollie_mistercash'] = "Bancontact/MisterCash";
$_['name_mollie_bancontact'] = "Bancontact";
$_['name_mollie_paypal'] = "PayPal";
$_['name_mollie_paysafecard'] = "paysafecard";
$_['name_mollie_sofort'] = "SOFORT Banking";
Expand Down
4 changes: 4 additions & 0 deletions admin/language/french/extension/payment/mollie_bancontact.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_bancontact'];
4 changes: 0 additions & 4 deletions admin/language/french/extension/payment/mollie_mistercash.php

This file was deleted.

4 changes: 2 additions & 2 deletions admin/language/nl-nl/extension/payment/mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$_['text_mollie_directdebit'] = $method_list_logo;
$_['text_mollie_ideal'] = $method_list_logo;
$_['text_mollie_kbc'] = $method_list_logo;
$_['text_mollie_mistercash'] = $method_list_logo;
$_['text_mollie_bancontact'] = $method_list_logo;
$_['text_mollie_paypal'] = $method_list_logo;
$_['text_mollie_paysafecard'] = $method_list_logo;
$_['text_mollie_sofort'] = $method_list_logo;
Expand All @@ -64,7 +64,7 @@
$_['name_mollie_directdebit'] = "Eenmalige incasso";
$_['name_mollie_ideal'] = "iDEAL";
$_['name_mollie_kbc'] = "KBC/CBC-Betaalknop";
$_['name_mollie_mistercash'] = "Bancontact/MisterCash";
$_['name_mollie_bancontact'] = "Bancontact";
$_['name_mollie_paypal'] = "PayPal";
$_['name_mollie_paysafecard'] = "paysafecard";
$_['name_mollie_sofort'] = "SOFORT Banking";
Expand Down
4 changes: 4 additions & 0 deletions admin/language/nl-nl/extension/payment/mollie_bancontact.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_bancontact'];
4 changes: 0 additions & 4 deletions admin/language/nl-nl/extension/payment/mollie_mistercash.php

This file was deleted.

2 changes: 1 addition & 1 deletion catalog/controller/extension/payment/mollie-api-client
Submodule mollie-api-client updated 148 files
Loading

0 comments on commit 78063e5

Please sign in to comment.