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

@@ -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'";