1. Go to this page and download the library: Download fullkawa/line-at-cost 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/ */
fullkawa / line-at-cost example snippets
use LineAtCost\PlanFactory;
use LineAtCost\Estimator;
$factory = new PlanFactory(PlanFactory::TARGET_2019);
$plan_free = $factory->getInstance(1); // Free plan
$usages_free = ['message_count' => 1000];
$cost_free = Estimator::estimate($plan_free, $usages_free);
$this->assertEquals(0, $cost_free);
$plan_light = $factory->getInstance(2); // Light plan
$usages_light = ['message_count' => 16000];
$cost_light = Estimator::estimate($plan_light, $usages_light);
$this->assertEquals(10000, $cost_light);
$plan_standard = $factory->getInstance(3); // Standard plan
$usages_standard = ['message_count' => 145000];
$cost_standard = Estimator::estimate($plan_standard, $usages_standard);
$this->assertEquals(305000, $cost_standard);