Zmień limit długości wiadomości zamówienia z 1024 na 900 znaków oraz popraw formatowanie błędów walidacji w odpowiedzi API
This commit is contained in:
10
cron.php
10
cron.php
@@ -466,7 +466,7 @@ if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_se
|
||||
}
|
||||
|
||||
//TODO: ostatnio był problem kiedy wiadomość miała mniej 1024 znaki ale zawierała przeniesienie tekstu '<br>' i do tego jeszcze miała emoji. Wtedy APILO tego nie przepuszczał.
|
||||
if ( strlen( $order_message ) > 1024 )
|
||||
if ( strlen( $order_message ) > 900 )
|
||||
$order_message = '<p><strong>Wiadomość do zamówienia była zbyt długa. Sprawdź szczegóły w panelu sklepu</strong></p>';
|
||||
|
||||
// add transport as product
|
||||
@@ -554,7 +554,7 @@ if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_se
|
||||
'type' => \front\factory\ShopPaymentMethod::get_apilo_payment_method_id( $order['payment_method_id'] )
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt( $ch, CURLOPT_URL, "https://projectpro.apilo.com/rest/api/orders/" );
|
||||
curl_setopt( $ch, CURLOPT_POST, 1 );
|
||||
@@ -589,8 +589,10 @@ if ( $apilo_settings['enabled'] and $apilo_settings['sync_orders'] and $apilo_se
|
||||
}
|
||||
elseif ( $response['message'] == 'Validation error' )
|
||||
{
|
||||
\S::pre( $response );
|
||||
\S::pre( $postData );
|
||||
echo '<pre>';
|
||||
echo print_r( $response, true );
|
||||
echo print_r( $postData, true );
|
||||
echo '</pre>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user