marketscan/mscan
Composer 安装命令:
composer require marketscan/mscan
包简介
MarketScan mScan API wrapper and sample code
README 文档
README
This is a PHP client for the MarketScan mScan API.
This library is written, maintained, and used by MarketScan customers. For help with this client library, please open an issue or pull request. If you're having credential or other MarketScan problems, please contact their excellent API support team at mscanapi@marketscan.com
Getting Started
You can install this library through Composer:
composer require marketscan/mscan
In your code, instantiate the API client by passing your Partner ID and Account number to the constructor. Optionally you can pass in the root URL as the third argument.
$mscan = new \MarketScan\MScan( 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '000000', 'http://integration.marketscan.com/mscanservice/rest/mscanservice.rst/?' );
Commands
Looking up vehicles
The most powerful way to look up vehicles is using GetVehiclesByVINParams.
You can look up a specific vehicle by VIN by passing that as the only parameter:
$mscan->GetVehiclesByVINParams('1G1YB2D73G5121725');
You can also pass a more detailed query object that uses the MarketScan VIN exploder to search your inventory. See documentation for details.
$mscan->GetVehiclesByVINParams([ 'Vin' => '1G1YB2D73G5', 'IsNew' => true ]);
You can get a complete list of Makes and Models. Each call takes one parameter, if true it returns Makes or Models that are currently New, if false it returns Makes and Models that may be available used (e.g., DMC, Plymouth).
$mscan->GetMakes(true); $mscan->GetModels(true);
Get Manufacturer Information
You can get a complete list of supported manufacturers. This information rarely changes and can be cached.
$mscan->GetManufacturers();
You can also get the manufacturer of a specific vehicle (by MarketScan Vehicle ID):
$mscan->GetManufacturer($vehicle_id);
Information About Your Dealership
You can look up the code MarketScan uses to describe your region by looking up the ZIP code of your dealership:
$mscan->GetMarketByZIP(68123);
Etc.
The entire API has not yet been mapped to PHP methods yet. (Pull requests are welcome!) If you need an API method that is not yet implemented directly, the general form for API calls is:
$mscan->api_request( 'api method name', 'GET or POST', 'string to append to the URL', 'data to JSON encode and POST in the request body' );
Some of these API actions, especially RunScan, offer incredibly fine-grained control. If you need help figuring out what options can be passed, check out MarketScan's API documentation.
Demo Pages
The library includes demo code to take a VIN and return a matrix of Lease and Retail Loan payments. To run the demo:
- Clone this repository
- In the repo folder, run
composer installto load dependencies and set up the autoloader. cp demo/credentials-sample.php demo/credentials.phpthen update credentials.php with actual MarketScan credentials from your account team. (This new file will be ignored by git if you commit changes for a pull request.)- Start the PHP local server:
php -S localhost:4242 -t demo - Open your browser to http://localhost:4242
Getting to RunScan
There is a lot of good stuff in the MarketScan API, but the very best stuff is in RunScan results.
To build your request object to pass to RunScan for a vehicle (assuming you're starting with its VIN):
- Set
Vehicle.IDto the value you received from$mscan->GetVehiclesByVINParams($vin) - Set
AutoRebateParams.ZIPto the customer's ZIP - Set
AutoRebateParams.DealerZIPto the dealer's ZIP - Set
Marketto the dealership's market ID you received from$mscan->GetMarketByZIP($zip)(the market ID can be cached indefinitely)
marketscan/mscan 适用场景与选型建议
marketscan/mscan 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.55k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2016 年 09 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 marketscan/mscan 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 marketscan/mscan 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7.55k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-01