Skip to content

Commit

Permalink
Merge pull request #215 from pay-now/release/1.7.9
Browse files Browse the repository at this point in the history
Release/1.7.9
  • Loading branch information
DeveloperMovecloser authored Oct 16, 2024
2 parents 72bc371 + 7aaa391 commit c28eb0a
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The `paynow` plugin adds quick bank transfers, BLIK and cards payments to Presta

## Prerequisites

- PHP since 7.1
- PHP since 7.2
- PrestaShop 1.6.0 and higher

## Installation
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Wtyczka `paynow` dodaje bezpieczne płatności BLIK, szybkie przelewy internetow

## Wymgania

- PHP od wersji 7.1
- PHP od wersji 7.2
- PrestaShop od wersji 1.6.0

## Instalacja
Expand Down Expand Up @@ -93,4 +93,4 @@ Licencja MIT. Szczegółowe informacje znajdziesz w pliku LICENSE.
[ext8]: https://paynow.wistia.com/medias/nym9wdwdwl
[ext9]: instruction/step6.png
[ext10]: https://panel.sandbox.paynow.pl/merchant/payments
[ext11]: instruction/step4b.png
[ext11]: instruction/step4b.png
8 changes: 6 additions & 2 deletions classes/PaynowPaymentDataBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,12 @@ private function build(
PaynowLogger::error('Cannot add addresses to payment data', ['msg' => $exception->getMessage()]);
}

if (!empty($id_customer) && $this->context->customer && $this->context->customer->is_guest === '0'){
$request['buyer']['externalId'] = PaynowKeysGenerator::generateBuyerExternalId($id_customer, $this->module);
if (!empty($id_customer) && $this->context->customer){
if (method_exists($this->context->customer, 'isGuest') && !$this->context->customer->isGuest()) {
$request['buyer']['externalId'] = PaynowKeysGenerator::generateBuyerExternalId($id_customer, $this->module);
} elseif ($this->context->customer->is_guest === '0') {
$request['buyer']['externalId'] = PaynowKeysGenerator::generateBuyerExternalId($id_customer, $this->module);
}
}

if (! empty($paymentMethodId)) {
Expand Down
3 changes: 2 additions & 1 deletion classes/PaynowPaymentOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public function generate(): array

$this->context->smarty->assign([
'action' => PaynowLinkHelper::getPaymentUrl(),
'data_processing_notices' => $this->data_processing_notices
'data_processing_notices' => $this->data_processing_notices,
'data_paynow_plugin_version' => $this->module->version,
]);

$isAnyPblEnabled = false;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"require": {
"php": ">=7.2",
"ext-json": "*",
"pay-now/paynow-php-sdk": "^2.4.1",
"pay-now/paynow-php-sdk": "^2.4.2",
"nyholm/psr7": "^1.2",
"php-http/curl-client": "^2.1"
},
Expand Down
5 changes: 3 additions & 2 deletions paynow.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct()
{
$this->name = 'paynow';
$this->tab = 'payments_gateways';
$this->version = '1.7.8';
$this->version = '1.7.9';
$this->ps_versions_compliancy = ['min' => '1.6.0', 'max' => _PS_VERSION_];
$this->author = 'mElements S.A.';
$this->is_eu_compatible = 1;
Expand Down Expand Up @@ -443,7 +443,8 @@ public function hookPayment($params)
'cta_text' => $this->getCallToActionText(),
'logo' => $this->getLogo(),
'paynow_url' => PaynowLinkHelper::getPaymentUrl(),
'data_processing_notices' => $gdpr_notices ?? null
'data_processing_notices' => $gdpr_notices ?? null,
'data_paynow_plugin_version' => $this->version,
]);

$digital_wallets = [
Expand Down
2 changes: 1 addition & 1 deletion upgrade/upgrade-1.7.8.php → upgrade/upgrade-1.7.9.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* @throws PrestaShopDatabaseException
*/
function upgrade_module_1_7_8($module)
function upgrade_module_1_7_9($module)
{
try {

Expand Down
14 changes: 7 additions & 7 deletions views/js/front.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,11 @@ var paynow = {
},

onPaymentOptionChange: function () {
if ($(paynow.selectors.blikCode).length != 1) {
return
if ($(paynow.selectors.blikCode).length === 1) {
$(paynow.selectors.blikCode).mask('000 000', {placeholder: "___ ___"})
}

$(paynow.selectors.blikCode).mask('000 000', {placeholder: "___ ___"})

if ($(paynow.selectors.form).data('blik-autofocus') == '1') {
if ($(paynow.selectors.form).data('blik-autofocus') === '1') {
$(paynow.selectors.blikCode).focus();
}

Expand All @@ -178,6 +176,8 @@ var paynow = {
paynow.paymentButton.hide()
} else if ($(paynow.selectors.cardMethodOptions).is(':visible') && !$(paynow.selectors.cardMethod + ':checked').length) {
paynow.paymentButton.disable()
} else if ($('div.paynow-payment-pbls .paynow-payment-option-pbl').is(':visible')) {
paynow.pblValidate()
} else {
paynow.paymentButton.enable()
paynow.paymentButton.show()
Expand All @@ -190,7 +190,7 @@ var paynow = {
},

blikValidate: function () {
blik_code_value = $(paynow.selectors.blikCode).val().replace(/\s/g, '');
const blik_code_value = $(paynow.selectors.blikCode).val().replace(/\s/g, '');

if (blik_code_value.length === 6 && !isNaN(parseInt(blik_code_value)) && parseInt(blik_code_value)) {
$(paynow.selectors.blikErrorLabel).text('');
Expand All @@ -215,7 +215,7 @@ var paynow = {
},

pblValidate: function () {
if (paynow.config.validateTerms && paynow.isTermsChecked()) {
if (!(paynow.config.validateTerms && !paynow.isTermsChecked()) && $(paynow.selectors.pblMethod + ':checked').length > 0) {
paynow.paymentButton.enable();
return true
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@
{/if}
{/foreach}
</div>
{/if}
{/if}

{if $data_paynow_plugin_version}
<span data-paynow-plugin-version="{$data_paynow_plugin_version}"></span>
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@
</div>
</div>
</div>
{/if}
{/if}

{if $data_paynow_plugin_version}
<span data-paynow-plugin-version="{$data_paynow_plugin_version}"></span>
{/if}

0 comments on commit c28eb0a

Please sign in to comment.