PHP code example of azmolla / fraud-checker-bd-courier
1. Go to this page and download the library: Download azmolla/fraud-checker-bd-courier library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
azmolla / fraud-checker-bd-courier example snippets
use FraudCheckerBdCourier;
// Input a standard 11-digit Bangladeshi mobile number
$report = FraudCheckerBdCourier::check('01712345678');
dd($report);
use Azmolla\FraudCheckerBdCourier\Config\FraudCheckerConfig;
use Azmolla\FraudCheckerBdCourier\Cache\FileTokenCache;
use Azmolla\FraudCheckerBdCourier\Services\SteadfastService;
use Azmolla\FraudCheckerBdCourier\Services\PathaoService;
use Azmolla\FraudCheckerBdCourier\Services\RedxService;
use Azmolla\FraudCheckerBdCourier\FraudCheckerBdCourierManager;
// 1. Setup Configuration
$config = new FraudCheckerConfig([
'steadfast' => [
'user' => '[email protected]',
'password' => 'your_steadfast_password'
],
'pathao' => [
'user' => '[email protected]',
'password' => 'your_pathao_password'
],
'redx' => [
'phone' => 'your_redx_login_phone_number',
'password' => 'your_redx_password'
]
]);
// 2. Setup Cache for RedX tokens (defaults to sys_get_temp_dir()/fraud_checker_cache)
$cache = new FileTokenCache(__DIR__ . '/cache');
// 3. Initialize Services
$steadfastService = new SteadfastService($config);
$pathaoService = new PathaoService($config);
$redxService = new RedxService($config, $cache);
// 4. Initialize Manager
$fraudChecker = new FraudCheckerBdCourierManager($steadfastService, $pathaoService, $redxService, $config);
// 5. Check Number
$report = $fraudChecker->check('01712345678');
print_r($report);
use Azmolla\FraudCheckerBdCourier\Services\PathaoService;
use Azmolla\FraudCheckerBdCourier\Services\SteadfastService;
use Azmolla\FraudCheckerBdCourier\Services\RedxService;
$steadfastData = (new SteadfastService())->getDeliveryStats('01712345678');
$redxData = (new RedxService())->getDeliveryStats('01712345678');
$pathaoData = (new PathaoService())->getDeliveryStats('01712345678');
use Azmolla\FraudCheckerBdCourier\Helpers\CourierDataValidator;
CourierDataValidator::checkBdMobile('01712345678');
// Throws InvalidArgumentException if formatting fails
bash
php artisan vendor:publish --tag="config"
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.