sirma-ics/ics-api-sdk

通过 Guzzle 实现的 ics-api 包

1.8 2021-06-21 12:22 UTC

This package is auto-updated.

Last update: 2024-09-21 21:04:24 UTC


README

需要 PHP 7.0+

设置

运行 composer install 以包含所需组件。

创建或更新您的 .env 文件以包含以下键变量

SIRMAICS_API_URL - which should point to the Sirma ICS API('https://ics-api.ics365.com')
SIRMAICS_API_USERNAME - the username used to authenticate for Sirma ICS API
SIRMAICS_API_PASSWORD - the password used to authenticate for Sirma ICS API
SIRMAICS_API_CERT_PATH - path to the SSL certificate file provided for authorization to the API
SIRMAICS_API_KEY_PATH - - path to the SSL key file provided for authorization to the API

使用方法: 初始化您需要使用的类,如以下列表所示

  • NomenclaturesRequests 将返回 API 命名规范,每个请求所需参数在文档中指定
    • 对于位置:[这里](https://ics-api.ics365.com/help#locations)
    • 对于对象属性:[这里](https://ics-api.ics365.com/help#objects)
    • 对于其他类型:[这里](https://ics-api.ics365.com/help#owner)
  • ShortRequests 用于使用较少参数的计算或发行(用于已注册的车辆),每个请求所需参数在文档中指定
    • 使用端点 shortCalc 进行计算所需参数:[这里](https://ics-api.ics365.com/help#liability_calc_short)
    • 使用端点 shortIssue(列在 /liability/policy-short 部分中)发行保单所需参数:[这里](https://ics-api.ics365.com/help#liability_issue_short)
    • 使用端点 shortIssueWithPayment 发行保单和首期付款所需参数:[这里](https://ics-api.ics365.com/help#liability_issue_equal_short)
  • LongRequests 用于使用完整信息进行计算或发行,每个请求所需参数在文档中指定

    • 使用端点 longCalc 进行计算所需参数:[这里](https://ics-api.ics365.com/help#liability_calc)
    • 使用端点 longIssue(列在 /liability/policy-short 部分中)发行保单所需参数:[这里](https://ics-api.ics365.com/help#liability_issue)
    • 使用端点 longIssueWithPayment 发行保单和首期付款所需参数:[这里](https://ics-api.ics365.com/help#liability_issue_equal)
  • PolicyRequests 用于请求已注册的保单,每个请求所需参数在文档中指定

    • 端点 policyNote 对指定期数的保单进行支付,所需参数如下:[这里](https://ics-api.ics365.com/help#note)
    • 端点 policyFullInfo 提供保单的完整信息,所需参数如下:[这里](https://ics-api.ics365.com/help#note-get)
    • 端点 policyPrint 通过给定的散列值返回已发行保单及其附加打印的 PDF 格式,所需参数如下:[这里](https://ics-api.ics365.com/help#print)

通过以下命令使用此包:composer require sirma-ics/ics-api-sdk

此包的示例用法如下

//load proper $_ENV package configuration - it is strongly advised to use any phpdotenv package for storing such configuration.

$api         = new NomenclaturesRequest();
$countries   = $api->getCountries();

有关更多信息和对 API 的访问,请发送邮件至 support@sirmaics.com