From c8181621afc50a81245cff5b598594b61adddaf3 Mon Sep 17 00:00:00 2001 From: Jacek Pyziak Date: Sun, 7 Sep 2025 11:02:47 +0200 Subject: [PATCH] =?UTF-8?q?Zaktualizowano=20pliki=20konfiguracyjne=20oraz?= =?UTF-8?q?=20poprawiono=20logik=C4=99=20w=20klasie=20Tickets.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/ftp-kr.sync.cache.json | 24 ++++++++++++------------ autoload/controls/class.Tickets.php | 16 +++++++++++----- config.php | 3 --- index.php | 3 +++ 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.vscode/ftp-kr.sync.cache.json b/.vscode/ftp-kr.sync.cache.json index 6b93225..7f59a3e 100644 --- a/.vscode/ftp-kr.sync.cache.json +++ b/.vscode/ftp-kr.sync.cache.json @@ -10,15 +10,15 @@ }, "api.php": { "type": "-", - "size": 10554, + "size": 968, "lmtime": 0, - "modified": false + "modified": true }, "autoload": { "class.Cron.php": { "type": "-", - "size": 29610, - "lmtime": 0, + "size": 27, + "lmtime": 1756895449615, "modified": false }, "class.DbModel.php": { @@ -54,9 +54,9 @@ "controls": { "class.Apanel.php": { "type": "-", - "size": 4864, + "size": 5166, "lmtime": 1746048812388, - "modified": false + "modified": true }, "class.Cron.php": { "type": "-", @@ -84,8 +84,8 @@ }, "class.Users.php": { "type": "-", - "size": 3819, - "lmtime": 1746048812702, + "size": 3949, + "lmtime": 1756895574116, "modified": false }, ".htaccess": { @@ -104,8 +104,8 @@ }, "class.Cron.php": { "type": "-", - "size": 25590, - "lmtime": 1746048812954, + "size": 45, + "lmtime": 1756895770647, "modified": false }, "class.Tickets.php": { @@ -136,8 +136,8 @@ "view": { "class.Cron.php": { "type": "-", - "size": 164, - "lmtime": 0, + "size": 46, + "lmtime": 1756895555214, "modified": false }, "class.Site.php": { diff --git a/autoload/controls/class.Tickets.php b/autoload/controls/class.Tickets.php index 1513945..a7dfe66 100644 --- a/autoload/controls/class.Tickets.php +++ b/autoload/controls/class.Tickets.php @@ -453,10 +453,14 @@ class Tickets $mdb->update('orders', ['payment_status' => 1], ['id' => $order['id']]); $mdb->update('orders', ['payment_date' => date('Y-m-d H:i:s')], ['id' => $order['id']]); + // file_put_contents( 'sandbox_przelewy24_response.txt', print_r( $_POST, true ) ); + // file_put_contents( 'sandbox_przelewy24_response.txt', print_r( $order, true ), FILE_APPEND ); + //* Wystawienie faktury - if ($order['invoice_status'] == 0) + if ( $order['invoice_status'] == 0 ) { - if($order['vat'] == 0){ + if ( $order['vat'] == 0 ) + { $api = array(); $api["api_id"] = "9fa7772af97ab35b6d8a1cd05ac9e1b5"; $api["api_zadanie"] = "1"; @@ -490,7 +494,7 @@ class Tickets } $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, "https://www.fakturowo.pl/api"); + curl_setopt($curl, CURLOPT_URL, "https://konto.fakturowo.pl/api"); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 300); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); @@ -499,6 +503,7 @@ class Tickets curl_close($curl); $result = explode("\n", $result); + // file_put_contents( 'sandbox_przelewy24_response.txt', print_r( $result, true ), FILE_APPEND ); if ($result[0] == 1) { $subject = "brzezovka.pl - zamówienie biletów 'paragon'"; @@ -519,7 +524,7 @@ class Tickets echo "ERROR: " . $result[1]; } } - elseif ($order['vat'] == 1) + elseif ( $order['vat'] == 1 ) { $api = array(); $api["api_id"] = "9fa7772af97ab35b6d8a1cd05ac9e1b5"; @@ -551,7 +556,7 @@ class Tickets } $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, "https://www.fakturowo.pl/api"); + curl_setopt($curl, CURLOPT_URL, "https://konto.fakturowo.pl/api"); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 300); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); @@ -560,6 +565,7 @@ class Tickets curl_close($curl); $result = explode("\n", $result); + // file_put_contents( 'sandbox_przelewy24_response.txt', print_r( $result, true ), FILE_APPEND ); if ($result[0] == 1) { $subject = "brzezovka.pl - zamówienie biletów 'faktura'"; diff --git a/config.php b/config.php index 581d54c..fef2680 100644 --- a/config.php +++ b/config.php @@ -1,7 +1,4 @@ dispense($type);