Kontrola čísla
Kontrola čísla overí formát a existenciu zadaných telefónnych čísel.
$connection = new ConnectionStream('application_id', 'application_token');
$number_checker = new NumberChecker($connection);
$result = $number_checker->check(['608123456', '777777777', '420777777777', new PhoneNumber('603777777'), '42061110'], 'cz');
$result je pole, ktorého kľúče sú telefónne čísla.
[
608123456 => [
'phone_number' => '420608123456',
'valid' => true,
'country' => 'cz',
'call_prefix' => 420,
'network_code' => '23003',
'network_name' => 'Vodafone',
],
777777777 => [
'phone_number' => '420777777777',
'valid' => true,
'country' => 'cz',
'call_prefix' => 420,
'network_code' => '23003',
'network_name' => 'Vodafone',
],
420777777777 => [
'phone_number' => '420777777777',
'valid' => true,
'country' => 'cz',
'call_prefix' => 420,
'network_code' => '23003',
'network_name' => 'Vodafone',
],
603777777 => [
'phone_number' => '420603777777',
'valid' => true,
'country' => 'cz',
'call_prefix' => 420,
'network_code' => '23002',
'network_name' => 'T-Mobile',
],
42061110: {
'phone_number': '42061110',
'valid': false,
'country': 'cz',
'call_prefix': 420,
'network_code': null,
'network_name': 'unknown'
},
]
Kontrola kreditu
Trieda BulkGate\Sdk\CreditChecker vráti zostatok peňaženky, ku ktorej je
aplikácia pripojená.
$connection = new ConnectionStream('application_id', 'application_token');
$credit_checker = new CreditChecker($connection);
$result = $credit_checker->check();
[
'wallet' => 'main',
'credit' => 215.8138,
'currency' => 'CZK',
'free_messages' => 0,
'datetime' => '2026-01-15 09:00:00',
]
Obe kontroly vyhodia BulkGate\Sdk\ApiException, keď API vráti chybu.
Bola táto stránka užitočná?
Ďakujeme za spätnú väzbu.