From df3d8970a654099fa65e30b5bad39227c00b14f9 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 29 Oct 2020 06:58:42 +0100 Subject: [PATCH] Drupal: Paypal popravki --- .../all/modules/nakupovanje_1ka/nakupovanje_1ka.module | 4 ++-- frontend/drupal/sites/all/themes/pro1ka/js/script.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/drupal/sites/all/modules/nakupovanje_1ka/nakupovanje_1ka.module b/frontend/drupal/sites/all/modules/nakupovanje_1ka/nakupovanje_1ka.module index d1e49fda5..5c2e67472 100755 --- a/frontend/drupal/sites/all/modules/nakupovanje_1ka/nakupovanje_1ka.module +++ b/frontend/drupal/sites/all/modules/nakupovanje_1ka/nakupovanje_1ka.module @@ -108,7 +108,7 @@ function nakupovanje_1ka_menu() ]; // ENG povezave - $items['purchase/paypal'] = [ + $items['purchase-paypal/success'] = [ 'title' => 'Uspešno plačilo preko PayPala', //page title 'page callback' => 'nakupovanje_1ka_paypal_return', //callback function which is invoked when menu item is called. 'access callback' => true, //any user can access this page @@ -117,7 +117,7 @@ function nakupovanje_1ka_menu() ], ]; - $items['purchase/paypal-cancel'] = [ + $items['purchase-paypal/cancel'] = [ 'title' => 'Payment canceled via PayPal', //page title 'page callback' => 'nakupovanje_1ka_paypal_cancel', //callback function which is invoked when menu item is called. 'access callback' => true, //any user can access this page diff --git a/frontend/drupal/sites/all/themes/pro1ka/js/script.js b/frontend/drupal/sites/all/themes/pro1ka/js/script.js index 3b4063ece..d43ad964f 100755 --- a/frontend/drupal/sites/all/themes/pro1ka/js/script.js +++ b/frontend/drupal/sites/all/themes/pro1ka/js/script.js @@ -789,7 +789,10 @@ } } - if (window.location.pathname.indexOf('/narocilo/paypal-cancel') > -1 && location.search.split('narocilo_id=').length > 1) { + if ( + (window.location.pathname.indexOf('/narocilo/paypal-cancel') > -1 && location.search.split('narocilo_id=').length > 1) || + (window.location.pathname.indexOf('/purchase-paypal/cancel') > -1 && location.search.split('narocilo_id=').length > 1) + ) { var parametri = window.location.search.substr(1); jQuery.post('/frontend/payments/api.php?action=cancel_narocilo_paypal', parametri).done(function (val) { @@ -802,7 +805,10 @@ }); } - if (window.location.href.indexOf('/narocilo/paypal?narocilo_id') > -1 && location.search.split('narocilo_id=').length > 1) { + if ( + (window.location.href.indexOf('/narocilo/paypal?narocilo_id') > -1 && location.search.split('narocilo_id=').length > 1) || + (window.location.href.indexOf('/purchase-paypal/success?narocilo_id') > -1 && location.search.split('narocilo_id=').length > 1) + ){ var parametri = window.location.search.substr(1); jQuery.post('/frontend/payments/api.php?action=capture_narocilo_paypal', parametri).done(function (val) {