networkrailbusinesssystems/oracle-api
最新稳定版本:1.0.0
Composer 安装命令:
composer require networkrailbusinesssystems/oracle-api
包简介
Provide end points for sending and receiving data from Oracle (iStore Catalogue)
README 文档
README
This api is for searching and ordering iStore catalogue items.
Built for Laravel 10.
Installation
Add the library via Composer: composer require networkrailbusinesssystems/oracle-api
Once installed, export the config: php artisan vendor:publish --provider="NetworkRailBusinessSystems\OracleApi\OracleApiServiceProvider.php"
- Set for accessing the Oracle
ORACLE_CATALOGUE_USERNAME= ORACLE_CATALOGUE_PASSWORD= ORACLE_CATALOGUE_EMULATOR=false
- Set for Searching by item or description from Oracle.
ORACLE_CATALOGUE_GET_HOST=
Then you can use the OracleCatalogueHelper class functions in your project for item search:
use NetworkRailBusinessSystems\OracleApi\OracleCatalogueHelper; $response = OracleCatalogueHelper::search('016798 or FENCE', limit = 100); // search by item code or description $response = OracleCatalogueHelper::searchByCode('0004/016798', limit = 100); // search by item code $response = OracleCatalogueHelper::searchByDescription('FENCE', limit = 100); // search by item description
- Set for Order submission.
ORACLE_CATALOGUE_POST_HOST=
Then you can use the OracleCatalogueHelper class function for order submission:
use NetworkRailBusinessSystems\OracleApi\OracleCatalogueHelper; $oracle_order_number = OracleCatalogueHelper::submitOrderToOracle($orderDetails);
The Oracle API package makes use of the Laravel Http Client. This enables you to fake the Http response in your test, so it doesn't need a live connection to the Oracle API.
- Set for fake search response and order submission.
ORACLE_CATALOGUE_EMULATOR=true
Http::fake([ '*' => Http::response([ "ItemCode" => "0004/016798", "ItemDescription" => "POST FENCE INTERMDT 6 HOLE", "ItemYourPrice" => 50.95, "Status" => "NR SUPER", "PackSize" => "1", "IBECustomAttribute15" => null, "ConfigurableItem" => null, "ItemPrimaryUOMCode" => null, "MiniSiteName" => "Non-Heavy Products" ]), ]);
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-26