Skip to content

Commit

Permalink
PLGPRSS-510: Remove issuers from iDEAL (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel-MultiSafepay authored and danielcivit committed Sep 11, 2024
1 parent 74c664f commit 4c11f47
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 28 deletions.
4 changes: 2 additions & 2 deletions multisafepay/views/templates/hook/payment.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*}
<div class="row">
<div class="col-xs-12">
{if !$direct && !$useTokenization}
{if ($gateway == 'IDEAL') || (!$direct && !$useTokenization)}
<form
id="{$gateway|escape:'htmlall':'UTF-8'}"
action="{$link->getModuleLink({$moduleLink|escape:'htmlall':'UTF-8'}, 'validation', [], true)|escape:'htmlall':'UTF-8'}"
Expand Down Expand Up @@ -77,6 +77,6 @@
</div>
</div>

{if $direct || $useTokenization}
{if ($gateway != 'IDEAL') && ($direct || $useTokenization)}
{include file="$main_path_ssl/modules/multisafepay/views/templates/hook/modal.tpl"}
{/if}
4 changes: 1 addition & 3 deletions multisafepayideal/controllers/front/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ class MultisafepayIdealValidationModuleFrontController extends MultisafepayValid
{
public function postProcess()
{
$this->type = Tools::getValue('direct') ? 'direct' : 'redirect';
$this->gatewayInfo = ['issuer_id' => Tools::getValue('issuers')];

$this->type = 'direct';
parent::postProcess();
}
}
24 changes: 1 addition & 23 deletions multisafepayideal/multisafepayideal.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,6 @@ public function hookPayment()
$msp->setApiKey(Configuration::get('MULTISAFEPAY_API_KEY'));
$msp->setApiUrl(Configuration::get('MULTISAFEPAY_SANDBOX'));

try {
$issuers = $msp->issuers->get();
} catch (Exception $e) {
$issuers = [];
$msg = $this->l('Error:') . htmlspecialchars($e->getMessage());
PrestaShopLogger::addLog($msg, 4, '', 'MultiSafepay', 'MSP', 'MSP');
}

$direct = true;
if ($this->context->api_access === '0') {
$direct = false;
}

$this->context->smarty->clearAssign(MultiSafepay::SMARTY_VARIABLES_TO_UNASSIGN);

$this->context->smarty->assign([
Expand All @@ -119,17 +106,8 @@ public function hookPayment()
'gateway' => $this->gateway,
'name' => $this->displayName,
'fee' => $this->fee,
'direct' => $direct,
'direct' => true,
'useTokenization' => false,
'fields' => [
[
'type' => 'issuers',
'name' => 'issuers',
'label' => 'Please select your issuer',
'required' => true,
'options' => $issuers,
],
],
]);

return $this->display(__FILE__, 'payment.tpl');
Expand Down

0 comments on commit 4c11f47

Please sign in to comment.