Zaktualizowano pliki konfiguracyjne oraz poprawiono logikę w klasie Tickets.

This commit is contained in:
2025-09-07 11:02:47 +02:00
parent d01f237aeb
commit c8181621af
4 changed files with 26 additions and 20 deletions

View File

@@ -10,15 +10,15 @@
}, },
"api.php": { "api.php": {
"type": "-", "type": "-",
"size": 10554, "size": 968,
"lmtime": 0, "lmtime": 0,
"modified": false "modified": true
}, },
"autoload": { "autoload": {
"class.Cron.php": { "class.Cron.php": {
"type": "-", "type": "-",
"size": 29610, "size": 27,
"lmtime": 0, "lmtime": 1756895449615,
"modified": false "modified": false
}, },
"class.DbModel.php": { "class.DbModel.php": {
@@ -54,9 +54,9 @@
"controls": { "controls": {
"class.Apanel.php": { "class.Apanel.php": {
"type": "-", "type": "-",
"size": 4864, "size": 5166,
"lmtime": 1746048812388, "lmtime": 1746048812388,
"modified": false "modified": true
}, },
"class.Cron.php": { "class.Cron.php": {
"type": "-", "type": "-",
@@ -84,8 +84,8 @@
}, },
"class.Users.php": { "class.Users.php": {
"type": "-", "type": "-",
"size": 3819, "size": 3949,
"lmtime": 1746048812702, "lmtime": 1756895574116,
"modified": false "modified": false
}, },
".htaccess": { ".htaccess": {
@@ -104,8 +104,8 @@
}, },
"class.Cron.php": { "class.Cron.php": {
"type": "-", "type": "-",
"size": 25590, "size": 45,
"lmtime": 1746048812954, "lmtime": 1756895770647,
"modified": false "modified": false
}, },
"class.Tickets.php": { "class.Tickets.php": {
@@ -136,8 +136,8 @@
"view": { "view": {
"class.Cron.php": { "class.Cron.php": {
"type": "-", "type": "-",
"size": 164, "size": 46,
"lmtime": 0, "lmtime": 1756895555214,
"modified": false "modified": false
}, },
"class.Site.php": { "class.Site.php": {

View File

@@ -453,10 +453,14 @@ class Tickets
$mdb->update('orders', ['payment_status' => 1], ['id' => $order['id']]); $mdb->update('orders', ['payment_status' => 1], ['id' => $order['id']]);
$mdb->update('orders', ['payment_date' => date('Y-m-d H:i:s')], ['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 //* Wystawienie faktury
if ( $order['invoice_status'] == 0 ) if ( $order['invoice_status'] == 0 )
{ {
if($order['vat'] == 0){ if ( $order['vat'] == 0 )
{
$api = array(); $api = array();
$api["api_id"] = "9fa7772af97ab35b6d8a1cd05ac9e1b5"; $api["api_id"] = "9fa7772af97ab35b6d8a1cd05ac9e1b5";
$api["api_zadanie"] = "1"; $api["api_zadanie"] = "1";
@@ -490,7 +494,7 @@ class Tickets
} }
$curl = curl_init(); $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_POST, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 300); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 300);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
@@ -499,6 +503,7 @@ class Tickets
curl_close($curl); curl_close($curl);
$result = explode("\n", $result); $result = explode("\n", $result);
// file_put_contents( 'sandbox_przelewy24_response.txt', print_r( $result, true ), FILE_APPEND );
if ($result[0] == 1) if ($result[0] == 1)
{ {
$subject = "brzezovka.pl - zamówienie biletów 'paragon'"; $subject = "brzezovka.pl - zamówienie biletów 'paragon'";
@@ -551,7 +556,7 @@ class Tickets
} }
$curl = curl_init(); $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_POST, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 300); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 300);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
@@ -560,6 +565,7 @@ class Tickets
curl_close($curl); curl_close($curl);
$result = explode("\n", $result); $result = explode("\n", $result);
// file_put_contents( 'sandbox_przelewy24_response.txt', print_r( $result, true ), FILE_APPEND );
if ($result[0] == 1) if ($result[0] == 1)
{ {
$subject = "brzezovka.pl - zamówienie biletów 'faktura'"; $subject = "brzezovka.pl - zamówienie biletów 'faktura'";

View File

@@ -1,7 +1,4 @@
<?php <?php
if ( $_GET['debug'] == 'lower_price_ticket' )
$_SESSION['lower_price_ticket'] = true;
$database['name'] = 'srv81099_brzez_ticket'; $database['name'] = 'srv81099_brzez_ticket';
$database['host'] = 'localhost'; $database['host'] = 'localhost';
$database['user'] = 'srv81099_brzez_ticket'; $database['user'] = 'srv81099_brzez_ticket';

View File

@@ -35,6 +35,9 @@ if ($_SESSION['ip'] !== $_SERVER['REMOTE_ADDR']) {
exit; exit;
} }
if ( $_GET['debug'] == 'lower_price_ticket' )
$_SESSION['lower_price_ticket'] = true;
\R::setup('mysql:host=' . $database['host'] . ';dbname=' . $database['name'], $database['user'], $database['password']); \R::setup('mysql:host=' . $database['host'] . ';dbname=' . $database['name'], $database['user'], $database['password']);
\R::ext('xdispense', function ($type) { \R::ext('xdispense', function ($type) {
return R::getRedBean() -> dispense($type); return R::getRedBean() -> dispense($type);