Skip to content

Commit

Permalink
Merge branch 'hotfix/1.13.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nabil509 committed Apr 8, 2020
2 parents a428a5a + 1804688 commit eb6fa06
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 116 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.13.1, 2020-04-07:
- Restore compatibility with PHP v5.3.
- [embedded] Bugfix: Payment fields error relative to new JavaScript client library.

1.13.0, 2020-03-04:
- Bug fix: Fix amount issue relative to multiple partial refunds.
- Bug fix: Shipping costs not included in the refunded amount through the PrestaShop backend.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Anyone is welcome to contribute to PayZen payment plugin for PrestaShop. There a
- Raise an issue on GitHub.
- Send us a Pull Request on **develop** branch with your bug fixes.
- Fork your own copy of the repository to add new features.
- Provide feedback and suggestions on enhancement
- Provide feedback and suggestions on enhancements.
3 changes: 2 additions & 1 deletion payzen/classes/PayzenApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ public static function getSupportedCardTypes()
'SDD' => 'Prélèvement SEPA Direct Debit', 'SOFICARTE' => 'Soficarte',
'SOFORT_BANKING' => 'Sofort', 'TRUFFAUT_CDX' => 'Carte Cadeau Truffaut', 'UNION_PAY' => 'UnionPay',
'VILLAVERDE' => 'Carte enseigne Villaverde', 'VILLAVERDE_SB' => 'Carte enseigne Villaverde - Sandbox',
'WECHAT' => 'WeChat Pay', 'MYBANK' => 'MyBank', 'PRZELEWY24' => 'Przelewy24'
'WECHAT' => 'WeChat Pay', 'MYBANK' => 'MyBank', 'PRZELEWY24' => 'Przelewy24',
'ONEY_ENSEIGNE' => 'Cartes enseignes Oney'
);
}

Expand Down
2 changes: 1 addition & 1 deletion payzen/classes/PayzenTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PayzenTools

private static $CMS_IDENTIFIER = 'PrestaShop_1.5-1.7';
private static $SUPPORT_EMAIL = '[email protected]';
private static $PLUGIN_VERSION = '1.13.0';
private static $PLUGIN_VERSION = '1.13.1';
private static $GATEWAY_VERSION = 'V2';

const ORDER_ID_REGEX = '#^[a-zA-Z0-9]{1,9}$#';
Expand Down
2 changes: 1 addition & 1 deletion payzen/classes/admin/PayzenHelperForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function getAdminFormContext()
foreach (PayzenTools::$submodules as $key => $module) {
$module_class_name = 'Payzen' . $module.'Payment';
$instance_module = new $module_class_name();
if (method_exists($instance_module, 'getCountries') && ! empty($instance_module->getCountries())) {
if (method_exists($instance_module, 'getCountries') && $instance_module->getCountries()) {
$submodule_specific_countries = $instance_module->getCountries();
foreach ($submodule_specific_countries as $country) {
if (isset($countryList['ps_countries'][$country])) {
Expand Down
2 changes: 1 addition & 1 deletion payzen/payzen.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct()
{
$this->name = 'payzen';
$this->tab = 'payments_gateways';
$this->version = '1.13.0';
$this->version = '1.13.1';
$this->author = 'Lyra Network';
$this->controllers = array('redirect', 'submit', 'rest', 'iframe');
$this->module_key = 'f3e5d07f72a9d27a5a09196d54b9648e';
Expand Down
1 change: 1 addition & 0 deletions payzen/views/templates/hook/bc/payment_std.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
{/if}
<img class="logo" src="{$payzen_logo|escape:'html':'UTF-8'}" alt="PayZen" />{$payzen_title|escape:'html':'UTF-8'}
{if $payzen_saved_identifier}
<br /><br />
{include file="./payment_std_oneclick.tpl"}
{/if}

Expand Down
1 change: 1 addition & 0 deletions payzen/views/templates/hook/bc/payment_std_iframe.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
{/if}

{if $payzen_saved_identifier}
<br /><br />
{include file="./payment_std_oneclick.tpl"}
<input id="payzen_payment_by_identifier" type="hidden" name="payzen_payment_by_identifier" value="1" />
{/if}
Expand Down
72 changes: 20 additions & 52 deletions payzen/views/templates/hook/bc/payment_std_oneclick.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}

<br /><br />
<div style="padding-left: 40px;" id="payzen_oneclick_payment_description">
<ul id="payzen_oneclick_payment_description_1">
<li>
Expand All @@ -26,13 +25,13 @@
<script type="text/javascript">
function payzenOneclickPaymentSelect(paymentByIdentifier) {
if (paymentByIdentifier) {
$("#payzen_oneclick_payment_description").show();
$("#payzen_standard").hide();
$("#payzen_payment_by_identifier").val("1");
$('#payzen_oneclick_payment_description').show();
$('#payzen_standard').hide();
$('#payzen_payment_by_identifier').val('1');
} else {
$("#payzen_oneclick_payment_description").hide();
$("#payzen_standard").show();
$("#payzen_payment_by_identifier").val("0");
$('#payzen_oneclick_payment_description').hide();
$('#payzen_standard').show();
$('#payzen_payment_by_identifier').val('0');
}
}
</script>
Expand All @@ -53,57 +52,26 @@
<script type="text/javascript">
function payzenOneclickPaymentSelect(paymentByIdentifier) {
if (paymentByIdentifier) {
$("#payzen_oneclick_payment_description_1").show();
$("#payzen_oneclick_payment_description_2").hide()
$("#payzen_payment_by_identifier").val("1");
$('#payzen_oneclick_payment_description_1').show();
$('#payzen_oneclick_payment_description_2').hide()
$('#payzen_payment_by_identifier').val('1');
} else {
$("#payzen_oneclick_payment_description_1").hide();
$("#payzen_oneclick_payment_description_2").show();
$("#payzen_payment_by_identifier").val("0");
$('#payzen_oneclick_payment_description_1').hide();
$('#payzen_oneclick_payment_description_2').show();
$('#payzen_payment_by_identifier').val('0');
}
{if ($payzen_std_card_data_mode == '5')}
payzenUpdateRestToken();
setTimeout(function () {
payzenInitRestEvents();
}, 200);
{/if}
}
function payzenUpdateRestToken() {
KR.removeForms();
$('.payzen .kr-form-error').html('');
if ($("#payzen_payment_by_identifier").val() == '1') {
var token = "{$payzen_rest_identifier_token|escape:'html':'UTF-8'}";
} else {
var token = "{$payzen_rest_form_token|escape:'html':'UTF-8'}";
}
if ($('#payzen_payment_by_identifier').val() == '1') {
var token = "{$payzen_rest_identifier_token|escape:'html':'UTF-8'}";
} else {
var token = "{$payzen_rest_form_token|escape:'html':'UTF-8'}";
}
var isPopin = document.getElementsByClassName('kr-popin-button');
if (isPopin.length !== 0) {
var button = '<button type="button" id="payzen_hidden_button" class="kr-payment-button"></button>';
} else {
var button = '<div style="display: none;">'
+ ' <button type="button" id="payzen_hidden_button" class="kr-payment-button"></button>'
+ '</div>';
}
$("#payzen_standard_rest_wrapper").html(
' <div class="payzen kr-embedded" {if $payzen_rest_popin} kr-popin{/if} kr-form-token="' + token + '" >'
+ ' <div class="kr-pan"></div>'
+ ' <div class="kr-expiry"></div>'
+ ' <div class="kr-security-code"></div>'
+ button
+ ' <div class="kr-field processing" style="display: none; border: none !important;">'
+ ' <div style="background-image: url({$smarty.const._MODULE_DIR_|escape:'html':'UTF-8'}payzen/views/img/loading_big.gif);'
+ ' margin: 0 auto; display: block; height: 35px; background-position: center;'
+ ' background-repeat: no-repeat; background-size: 35px;">'
+ ' </div>'
+ ' </div>'
+ ' <div class="kr-form-error"></div>'
+ '</div>');
KR.setFormConfig({ formToken: token });
{/if}
}
</script>
{/if}
Expand Down
4 changes: 1 addition & 3 deletions payzen/views/templates/hook/bc/payment_std_rest.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@
<img class="logo" src="{$payzen_logo|escape:'html':'UTF-8'}" alt="PayZen" />{$payzen_title|escape:'html':'UTF-8'}

<div id="payzen_standard_rest_wrapper" style="padding-top: 10px; padding-left: 40px;">
<div class="kr-embedded" {if $payzen_rest_popin} kr-popin{/if} kr-form-token="{$payzen_rest_identifier_token|escape:'html':'UTF-8'}">
<div class="kr-embedded"{if $payzen_rest_popin} kr-popin{/if} kr-form-token="{$payzen_rest_identifier_token|escape:'html':'UTF-8'}">
<div class="kr-pan"></div>
<div class="kr-expiry"></div>
<div class="kr-security-code"></div>

{if !$payzen_rest_popin}
<div style="display: none;">
{/if}

<button type="button" id="payzen_hidden_button" class="kr-payment-button"></button>

{if !$payzen_rest_popin}
</div>
{/if}
Expand Down
75 changes: 20 additions & 55 deletions payzen/views/templates/hook/payment_std_oneclick.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
<script type="text/javascript">
function payzenOneclickPaymentSelect(paymentByIdentifier) {
if (paymentByIdentifier) {
$("#payzen_oneclick_payment_description_1").show();
$("#payzen_standard").hide();
$("#payzen_payment_by_identifier").val("1");
$('#payzen_oneclick_payment_description_1').show();
$('#payzen_standard').hide();
$('#payzen_payment_by_identifier').val('1');
} else {
$("#payzen_oneclick_payment_description_1").hide();
$("#payzen_standard").show();
$("#payzen_payment_by_identifier").val("0");
$('#payzen_oneclick_payment_description_1').hide();
$('#payzen_standard').show();
$('#payzen_payment_by_identifier').val('0');
}
}
</script>
Expand All @@ -58,66 +58,31 @@
<script type="text/javascript">
function payzenOneclickPaymentSelect(paymentByIdentifier) {
if (paymentByIdentifier) {
$("#payzen_oneclick_payment_description_1").show();
$("#payzen_oneclick_payment_description_2").hide()
$("#payzen_payment_by_identifier").val("1");
$('#payzen_oneclick_payment_description_1').show();
$('#payzen_oneclick_payment_description_2').hide()
$('#payzen_payment_by_identifier').val('1');
} else {
$("#payzen_oneclick_payment_description_1").hide();
$("#payzen_oneclick_payment_description_2").show();
$("#payzen_payment_by_identifier").val("0");
$('#payzen_oneclick_payment_description_1').hide();
$('#payzen_oneclick_payment_description_2').show();
$('#payzen_payment_by_identifier').val('0');
}
{if ($payzen_std_card_data_mode == '5')}
payzenUpdateRestToken();
setTimeout(function () {
payzenInitRestEvents();
}, 200);
{/if}
}
$('.payzen .kr-form-error').html('');
function payzenUpdateRestToken() {
KR.removeForms();
if ($("#payzen_payment_by_identifier").val() == '1') {
var token = "{$payzen_rest_identifier_token|escape:'html':'UTF-8'}";
} else {
var token = "{$payzen_rest_form_token|escape:'html':'UTF-8'}";
}
var isPopin = document.getElementsByClassName('kr-popin-button');
if (isPopin.length !== 0) {
var button = '<button type="button" id="payzen_hidden_button" class="kr-payment-button"></button>';
} else {
var button = '<div style="display: none;">'
+ ' <button type="button" id="payzen_hidden_button" class="kr-payment-button"></button>'
+ '</div>';
}
$("#payzen_standard_rest_wrapper").html(
' <div class="payzen kr-embedded" {if $payzen_rest_popin} kr-popin{/if} kr-form-token="' + token + '" >'
+ ' <div class="kr-pan"></div>'
+ ' <div class="kr-expiry"></div>'
+ ' <div class="kr-security-code"></div>'
+ button
if ($('#payzen_payment_by_identifier').val() == '1') {
var token = "{$payzen_rest_identifier_token|escape:'html':'UTF-8'}";
} else {
var token = "{$payzen_rest_form_token|escape:'html':'UTF-8'}";
}
+ ' <div class="kr-field processing" style="display: none; border: none !important;">'
+ ' <div style="background-image: url({$smarty.const._MODULE_DIR_|escape:'html':'UTF-8'}payzen/views/img/loading_big.gif);'
+ ' margin: 0 auto; display: block; height: 35px; background-color: #ffffff; background-position: center;'
+ ' background-repeat: no-repeat; background-size: 35px;">'
+ ' </div>'
+ ' </div>'
+ ' <div class="kr-form-error"></div>'
+ '</div>');
KR.setFormConfig({ formToken: token });
{/if}
}
</script>
{/if}
</section>

{block name='javascript_bottom'}
{include file="_partials/javascript.tpl" javascript=$javascript.bottom}
{/block}

<script type="text/javascript">
$(document).ready(function() {
$("input[data-module-name=payzen]").change(function() {
Expand Down
3 changes: 2 additions & 1 deletion payzen/views/templates/hook/payment_std_rest.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<section id="payzen_standard_rest_wrapper" style="margin-bottom: 2rem;">
<div class="payzen kr-embedded" {if $payzen_rest_popin} kr-popin{/if} kr-form-token="{$payzen_rest_identifier_token|escape:'html':'UTF-8'}">
<div class="payzen kr-embedded"{if $payzen_rest_popin} kr-popin{/if} kr-form-token="{$payzen_rest_identifier_token|escape:'html':'UTF-8'}">
<div class="kr-pan"></div>
<div class="kr-expiry"></div>
<div class="kr-security-code"></div>
Expand All @@ -30,6 +30,7 @@
background-repeat: no-repeat; background-size: 35px;">
</div>
</div>

<div class="kr-form-error"></div>
</div>
</section>
Expand Down

0 comments on commit eb6fa06

Please sign in to comment.