Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SW-439 #497

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Frontend/MoptPaymentPayone/Controllers/Backend/FcPayone.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,12 +636,20 @@ public function ajaxgetRiskCheckConfigAction()

public function ajaxgetAddressCheckConfigAction()
{
$moptPayoneHelper = Shopware()->Container()->get('MoptPayoneMain')->getInstance()->getHelper();
$data = array();
$this->Front()->Plugins()->Json()->setRenderer(true);

$paymentid = $this->Request()->getParam('paymentid');
$data['data'] = $this->get('MoptPayoneMain')->getPayoneConfig($paymentid, true);
$data['status'] = 'success';
// replace addresscheck countryIds with country codes
$billingCountryIds = empty($data['data']['adresscheckBillingCountries']) ? [] : explode(',', $data['data']['adresscheckBillingCountries']);
$shippingCountryIds = empty($data['data']['adresscheckShippingCountries']) ? [] : explode(',', $data['data']['adresscheckShippingCountries']);
$billingCountries = array_map([$moptPayoneHelper, 'getCountryIsoFromId'], $billingCountryIds);
$shippingCountries = array_map([$moptPayoneHelper, 'getCountryIsoFromId'], $shippingCountryIds);
$data['data']['adresscheckBillingCountries'] = implode(',', $billingCountries);
$data['data']['adresscheckShippingCountries'] = implode(',', $shippingCountries);
$encoded = json_encode($data);
echo $encoded;
exit(0);
Expand Down Expand Up @@ -1346,6 +1354,17 @@ public function createPayoneConfig($options)
Shopware()->Models()->persist($data);
};

// replace addresscheck country codes with countryIds
$moptPayoneHelper = Shopware()->Container()->get('MoptPayoneMain')->getInstance()->getHelper();
$billingCountries = empty($options['adresscheckBillingCountries']) ? [] : explode(',', str_replace(' ', '', $options['adresscheckBillingCountries']));
$shippingCountries = empty($options['adresscheckShippingCountries']) ? [] : explode(',', str_replace(' ', '', $options['adresscheckShippingCountries']));
$billingCountryIds = array_map([$moptPayoneHelper, 'getCountryIdFromIso'], $billingCountries);
$shippingCountryIds = array_map([$moptPayoneHelper, 'getCountryIdFromIso'], $shippingCountries);
$billingCountryIds = array_filter($billingCountryIds);
$shippingCountryIds = array_filter($shippingCountryIds);
$options['adresscheckBillingCountries'] = implode(',', $billingCountryIds);
$options['adresscheckShippingCountries'] = implode(',', $shippingCountryIds);

$data->fromArray($options);
if ($options['adresscheckActive'] == "false") {
$data->setAdresscheckActive(0);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<img src="{link file='backend/_resources/images/information.png'}" data-toggle="popover" title="PAYONE Hilfe" data-content="Schlüssel des zu verwendenden Zahlungsportal">
<label for="apiKey" class="text-left col-md-3 control-label">{s name="fieldlabel/apiKey"}Schlüssel{/s}</label>
<div class="col-md-6">
<input type="text" class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="40" id="apiKey" name="apiKey" aria-describedby="apiKey-status" >
<input type="text" class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="40" id="apiKey" name="apiKey" aria-describedby="apiKey-status" >
<span class="glyphicon form-control-feedback glyphicon-remove" aria-hidden="true"></span>
<span id="apiKey-status" class="sr-only">(success)</span>
<div class="help-block with-errors"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<label for="description" class="text-left col-md-3 control-label">{s name="formpanel_description_label"}Bezeichnung{/s}</label>
<div class="col-md-6">
<input type="text" class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="0" maxlength="200" name="description" aria-describedby="description-status" >
<input type="text" class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="0" maxlength="200" name="description" aria-describedby="description-status" >
<span class="glyphicon form-control-feedback glyphicon-remove" aria-hidden="true"></span>
<span id="description-status" class="sr-only">(success)</span>
<div class="help-block with-errors"></div>
Expand All @@ -48,7 +48,7 @@

<label for="additionalDescription" class="text-left col-md-3 control-label">{s name="formpanel_additional-description_label"}Zusätzliche Beschreibung{/s}</label>
<div class="col-md-6">
<textarea rows="3" class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="0" maxlength="200" id="additionalDescription" name="additionalDescription" aria-describedby="additionalDescription-status" >
<textarea rows="3" class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="0" maxlength="200" id="additionalDescription" name="additionalDescription" aria-describedby="additionalDescription-status" >
</textarea>
<span class="glyphicon form-control-feedback glyphicon-remove" aria-hidden="true"></span>
<span id="additionalDescription-status" class="sr-only">(success)</span>
Expand Down Expand Up @@ -89,7 +89,7 @@

<label for="active" class="text-left col-md-3 control-label">{s name="formpanel_active_label"}Aktiv{/s}</label>
<div class="col-md-6">
<input type="checkbox" class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="0" maxlength="200" id="active" name="active" aria-describedby="active-status" >
<input type="checkbox" class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="0" maxlength="200" id="active" name="active" aria-describedby="active-status" >
<span class="glyphicon form-control-feedback glyphicon-remove" aria-hidden="true"></span>
<span id="active-status" class="sr-only">(success)</span>
<div class="help-block with-errors"></div>
Expand All @@ -99,7 +99,7 @@

<label for="esdActive" class="text-left col-md-3 control-label">{s name="formpanel_esdActive_label"}Aktiv für ESD-Produkte{/s}</label>
<div class="col-md-6">
<input type="checkbox" class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="0" maxlength="200" id="esdActive" name="esdActive" aria-describedby="esdActive-status" >
<input type="checkbox" class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="0" maxlength="200" id="esdActive" name="esdActive" aria-describedby="esdActive-status" >
<span class="glyphicon form-control-feedback glyphicon-remove" aria-hidden="true"></span>
<span id="esdActive-status" class="sr-only">(success)</span>
<div class="help-block with-errors"></div>
Expand All @@ -109,7 +109,7 @@

<label for="mobileInactive" class="text-left col-md-3 control-label">{s name="formpanel_mobileInactive_label"}Inaktiv für Smartphone{/s}</label>
<div class="col-md-6">
<input type="checkbox" class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="0" maxlength="200" id="mobileInactive" name="mobileInactive" aria-describedby="mobileInactive-status" >
<input type="checkbox" class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="0" maxlength="200" id="mobileInactive" name="mobileInactive" aria-describedby="mobileInactive-status" >
<span class="glyphicon form-control-feedback glyphicon-remove" aria-hidden="true"></span>
<span id="mobileInactive-status" class="sr-only">(success)</span>
<div class="help-block with-errors"></div>
Expand All @@ -119,7 +119,7 @@

<label for="checkCc" class="text-left col-md-3 control-label">{s name="fieldlabel/checkCc"}Abfrage Kreditkartenprüfziffer<br>(nur global konfigurierbar){/s}</label>
<div class="col-md-6">
<select class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="0" maxlength="200" id="checkCc" name="checkCc" aria-describedby="checkCc-status" >
<select class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="0" maxlength="200" id="checkCc" name="checkCc" aria-describedby="checkCc-status" >
<option value="true">Ja</option>
<option value="false">Nein</option>
</select>
Expand Down
18 changes: 9 additions & 9 deletions Frontend/MoptPaymentPayone/Views/backend/fc_payone/ajaxdebit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<label for="description" class="text-left col-md-3 control-label">{s name="formpanel_description_label"}Bezeichnung{/s}</label>
<div class="col-md-6">
<input type="text" class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="description" name="description" aria-describedby="description-status" >
<input type="text" class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="description" name="description" aria-describedby="description-status" >
<span class="glyphicon form-control-feedback glyphicon-remove" aria-hidden="true"></span>
<span id="description-status" class="sr-only">(success)</span>
<div class="help-block with-errors"></div>
Expand All @@ -48,7 +48,7 @@

<label for="additionalDescription" class="text-left col-md-3 control-label">{s name="formpanel_additional-description_label"}Zusätzliche Beschreibung{/s}</label>
<div class="col-md-6">
<textarea rows="3" class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="additionalDescription" name="additionalDescription" aria-describedby="additionalDescription-status" >
<textarea rows="3" class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="additionalDescription" name="additionalDescription" aria-describedby="additionalDescription-status" >
</textarea>
<span class="glyphicon form-control-feedback glyphicon-remove" aria-hidden="true"></span>
<span id="additionalDescription-status" class="sr-only">(success)</span>
Expand Down Expand Up @@ -89,7 +89,7 @@

<label for="active" class="text-left col-md-3 control-label">{s name="formpanel_active_label"}Aktiv{/s}</label>
<div class="col-md-6">
<input type="checkbox" class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="active" name="active" aria-describedby="active-status" >
<input type="checkbox" class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="active" name="active" aria-describedby="active-status" >
<span class="glyphicon form-control-feedback glyphicon-remove" aria-hidden="true"></span>
<span id="active-status" class="sr-only">(success)</span>
<div class="help-block with-errors"></div>
Expand All @@ -99,7 +99,7 @@

<label for="esdActive" class="text-left col-md-3 control-label">{s name="formpanel_esdActive_label"}Aktiv für ESD-Produkte{/s}</label>
<div class="col-md-6">
<input type="checkbox" class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="esdActive" name="esdActive" aria-describedby="esdActive-status" >
<input type="checkbox" class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="esdActive" name="esdActive" aria-describedby="esdActive-status" >
<span class="glyphicon form-control-feedback glyphicon-remove" aria-hidden="true"></span>
<span id="esdActive-status" class="sr-only">(success)</span>
<div class="help-block with-errors"></div>
Expand All @@ -109,7 +109,7 @@

<label for="mobileInactive" class="text-left col-md-3 control-label">{s name="formpanel_mobileInactive_label"}Inaktiv für Smartphone{/s}</label>
<div class="col-md-6">
<input type="checkbox" class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="mobileInactive" name="mobileInactive" aria-describedby="mobileInactive-status" >
<input type="checkbox" class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="mobileInactive" name="mobileInactive" aria-describedby="mobileInactive-status" >
<span class="glyphicon form-control-feedback glyphicon-remove" aria-hidden="true"></span>
<span id="mobileInactive-status" class="sr-only">(success)</span>
<div class="help-block with-errors"></div>
Expand All @@ -119,7 +119,7 @@

<label for="showAccountnumber" class="text-left col-md-3 control-label">{s name="fieldlabel/showAccountnumber"}Zusätzlich Kontonummer/Bankleitzahl anzeigen?{/s}</label>
<div class="col-md-6">
<select class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="showAccountnumber" name="showAccountnumber" aria-describedby="showAccountnumber-status" >
<select class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="showAccountnumber" name="showAccountnumber" aria-describedby="showAccountnumber-status" >
<option value="true">Ja</option>
<option value="false">Nein</option>
</select>
Expand All @@ -132,7 +132,7 @@

<label for="showBic" class="text-left col-md-3 control-label">{s name="fieldlabel/showBic"}Zusätzlich zur IBAN auch BIC abfragen?{/s}</label>
<div class="col-md-6">
<select class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="showBic" name="showBic" aria-describedby="showBic-status" >
<select class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="showBic" name="showBic" aria-describedby="showBic-status" >
<option value="true">Ja</option>
<option value="false">Nein</option>
</select>
Expand All @@ -145,7 +145,7 @@

<label for="mandateActive" class="text-left col-md-3 control-label">{s name="fieldlabel/mandateActive"}Mandatserteilung aktivieren?{/s}</label>
<div class="col-md-6">
<select class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="mandateActive" name="mandateActive" aria-describedby="mandateActive-status" >
<select class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="mandateActive" name="mandateActive" aria-describedby="mandateActive-status" >
<option value="true">Ja</option>
<option value="false">Nein</option>
</select>
Expand All @@ -158,7 +158,7 @@

<label for="mandateDownloadEnabled" class="text-left col-md-3 control-label">{s name="fieldlabel/mandateDownloadEnabled"}Download Mandat als PDF?{/s}</label>
<div class="col-md-6">
<select class="form-control " pattern='^[_ .()+-?,:;"!@#$%^&*ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="mandateDownloadEnabled" name="mandateDownloadEnabled" aria-describedby="mandateDownloadEnabled-status" >
<select class="form-control " pattern='^[_ .\(\)\+\-?,:;"!@#$%!^&*\/ÄÖÜäöüa-zA-Z0-9]*' minlength="1" maxlength="200" id="mandateDownloadEnabled" name="mandateDownloadEnabled" aria-describedby="mandateDownloadEnabled-status" >
<option value="true">Ja</option>
<option value="false">Nein</option>
</select>
Expand Down
Loading