ocittwo /
查看tiki.id的运费
v1.0.0
2017-10-02 06:40 UTC
Requires
- symfony/css-selector: ^3.3
- symfony/dom-crawler: ^3.3
This package is not auto-updated.
Last update: 2024-09-23 07:07:51 UTC
README
用于检查使用tiki快递服务的运费的库。
安装
composer require ocittwo/tiki-ongkir
用法
<?php require_once __DIR__.'/vendor/autoload.php'; use TikiOngkir\Tiki; $tiki = new Tiki; $tiki->origin = 'Jakarta'; $tiki->destination = 'Bandung'; $tiki->tariff_code_origin = 'CGK01.00'; $tiki->tariff_code_destination = 'BDO01.00'; $tiki->weight = 1; echo json_encode($tiki->getResult());
结果
{ "success": true, "origin": "Jakarta", "destination": "Bandung", "weight": "1 Kg", "result": [ { "product_code": "REG", "product_price": "Rp 10.000" }, { "product_code": "ECO", "product_price": "Rp 8.000" }, { "product_code": "ONS", "product_price": "Rp 20.000" }, { "product_code": "SDS", "product_price": "Rp 181.000" }, { "product_code": "HDS", "product_price": "Rp 42.000" }, { "product_code": "TRC", "product_price": "Rp 25.000" } ] }
获取起始点和目的地
要获取起始点和目的地的数据,请通过以下URL使用GET方法打开。
https://tiki.id/etc/CariDaerah/...
Contoh :
https://tiki.id/etc/CariDaerah/Bandung
json =>
[
{
"daerah": "Andir, Bandung",
"tariff_code": "BDO01.00",
"importance": "3",
"tariff_diff": "0"
},
{
"daerah": "Antapani (Cicadas), Bandung",
"tariff_code": "BDO01.00",
"importance": "3",
"tariff_diff": "0"
},
{
"daerah": "Arcamanik, Bandung",
"tariff_code": "BDO01.00",
"importance": "3",
"tariff_diff": "0"
},
{
"daerah": "Arjasari, Bandung",
"tariff_code": "BDO80.00",
"importance": "3",
"tariff_diff": "0"
},
{
"daerah": "Astana Anyar, Bandung",
"tariff_code": "BDO01.00",
"importance": "3",
"tariff_diff": "0"
},
{
"daerah": "Babakan Ciparay, Bandung",
"tariff_code": "BDO01.00",
"importance": "3",
"tariff_diff": "0"
}
]
许可证
阅读MIT许可证