Drupal: Paypal popravki

This commit is contained in:
Robert 2020-10-29 06:58:42 +01:00
parent ae494c9ab2
commit df3d8970a6
2 changed files with 10 additions and 4 deletions

View File

@ -108,7 +108,7 @@ function nakupovanje_1ka_menu()
]; ];
// ENG povezave // ENG povezave
$items['purchase/paypal'] = [ $items['purchase-paypal/success'] = [
'title' => 'Uspešno plačilo preko PayPala', //page title '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. '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 '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 'title' => 'Payment canceled via PayPal', //page title
'page callback' => 'nakupovanje_1ka_paypal_cancel', //callback function which is invoked when menu item is called. '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 'access callback' => true, //any user can access this page

View File

@ -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); var parametri = window.location.search.substr(1);
jQuery.post('/frontend/payments/api.php?action=cancel_narocilo_paypal', parametri).done(function (val) { 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); var parametri = window.location.search.substr(1);
jQuery.post('/frontend/payments/api.php?action=capture_narocilo_paypal', parametri).done(function (val) { jQuery.post('/frontend/payments/api.php?action=capture_narocilo_paypal', parametri).done(function (val) {