Kontrola čísla
Kontrola čísla ověří formát a existenci zadaných telefonních čí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, jehož klíče jsou telefonní čí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
Třída BulkGate\Sdk\CreditChecker vrátí zůstatek peněženky, ke které je
aplikace připojená.
$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',
]
Obě kontroly vyhodí BulkGate\Sdk\ApiException, když API vrátí chybu.
Byla tato stránka užitečná?
Děkujeme za zpětnou vazbu.