tarfin-labs/laravel-iys

该包已被弃用,不再维护。没有建议的替代包。

Laravel Iys 包

1.0.0 2020-11-02 13:04 UTC

This package is auto-updated.

Last update: 2023-05-29 01:34:05 UTC


README

Latest Version on Packagist GitHub Workflow Status Quality Score Total Downloads

Laravel İleti Yönetim Sistemi (IYS) 集成。

安装

您可以使用以下命令通过 composer 快速添加 Laravel-iys 包:

composer require tarfin-labs/laravel-iys

之后,需要发布配置文件

php artisan vendor:publish --provider="TarfinLabs\Iys\IysServiceProvider"

要完成配置,请向 .env 文件中添加以下信息

IYS_URL=
IYS_USERNAME=
IYS_PASSWORD=
IYS_CODE=
IYS_BRAND_CODE=

使用

您可以通过访问 https://dev.iys.org.tr/ 获取 IYS API 文档和返回的请求响应。

品牌管理

品牌列表

$response = Iys::brands()->all();

$iys = new \TarfinLabs\Iys\Iys();
$response = $iys->brands()->all();

权限管理

添加单个权限

$response = Iys::consents()->create([
                'consentDate'    => '2018-02-10 09:30:00',
                'source'         => 'HS_CAGRI_MERKEZI',
                'recipient'      => '+905813334455',
                'recipientType'  => 'BIREYSEL',
                'status'         => 'ONAY',
                'type'           => 'ARAMA',
                'retailerCode '  => 11223344,
                'retailerAccess' => [
                     22233344,
                     44222419,
                     13239987
                ]
            ]);

查询单个权限状态

$response = Iys::consents()->status([
                'recipient'     => '+905813334455',
                'recipientType' => 'BIREYSEL',
                'type'          => 'MESAJ',
            ]);

异步批量添加权限

$response = Iys::consents()->createMany([
             [
                 'consentDate'    => '2018-02-10 09:30:00',
                 'source'         => 'HS_MESAJ',
                 'recipient'      => '+905813334455',
                 'recipientType'  => 'BIREYSEL',
                 'status'         => 'RET',
                 'type'           => 'ARAMA',
                 'retailerCode '  => 11223344,
                 'retailerAccess' => [
                     22233344,
                     44222419,
                     13239987
                 ]
             ],
             [
                 'consentDate'    => '2018-02-10 09:40:00',
                 'source'         => 'HS_WEB',
                 'recipient'      => 'ornek@adiniz.com',
                 'recipientType'  => 'BIREYSEL',
                 'status'         => 'ONAY',
                 'type'           => 'EPOSTA',
                 'retailerCode '  => 11223344,
                 'retailerAccess' => [
                     22233344,
                     44222419,
                     13239987
                 ]
             ],
         ]);

查询批量添加权限请求

$response = Iys::consents()->statuses($requestId = '73b75030-3a92-4f1e-b247-b0509dbadbfc');

经销商管理

添加经销商

$response = Iys::retailers()->create([
            'tckn'   => 42790000000,
            'name'   => 'Adım Soyadım',
            'city'   => [
                'name' => 'İstanbul',
                'code' => '34'
            ],
            'town'   => [
                'name' => 'Şişli',
                'code' => '05'
            ],
            'title'  => 'ADIM SOYADIM TİCARET',
            'mersis' => '0015001526400496',
            'alias'  => 'ŞİŞLİ MAĞAZASI',
            'mobile' => '+905357990000'
        ]);

查询和列出经销商

  • 获取给定 IYS 号码的经销商信息
$response = Iys::retailers()->find($retailerCode = 66438915);
  • 所有经销商的详细信息
$response = Iys::retailers()->all();
  • 带有分页选项
$response = Iys::retailers()->all($offset = 100, $limit = 10);

删除经销商

$response = Iys::retailers()->delete($retailerCode = 66438915);

经销商权限管理

添加经销商权限访问

$response = Iys::consents()->giveAccess([
                 'recipient' => '+905370000000',
                 'recipientType' => 'TACIR',
                 'type' => 'MESAJ',
                 'retailerAccess' =>  [66438915, 66438916],
             ]);

授予经销商权限访问

$response = Iys::consents()->giveManyAccess([
                 'recipient'      => [
                     '+905370000000',
                     '+905370000001'
                 ],
                 'recipientType'  => 'TACIR',
                 'type'           => 'EPOSTA',
                 'retailerAccess' => [
                     66438915,
                     66438916
                 ],
             ]);

查询经销商权限访问

  • 使用默认分页值进行请求
$response = Iys::consents()->accessList([
                 'recipient'     => 'ornek@deneme.com',
                 'recipientType' => 'TACIR',
                 'type'          => 'MESAJ',
             ]);
  • 使用分页信息进行请求
$response = Iys::consents()->accessList([
                 'recipient'     => 'ornek@deneme.com',
                 'recipientType' => 'TACIR',
                 'type'          => 'MESAJ',
             ], 100, 10);

删除经销商权限访问

$response = Iys::consents()->deleteAccess([
                 'recipients'     => [
                     '+905377115251',
                     '+905377115251',
                 ],
                 'recipientType'  => 'BIREYSEL',
                 'type'           => 'MESAJ',
                 'retailerAccess' => [
                     66438915,
                     66438916,
                 ],
             ]);

删除所有经销商的权限访问

$response = Iys::consents()->deleteAllAccess([
                 'recipients'     => [
                     '+905377115251',
                     '+905377115251',
                 ],
                 'recipientType'  => 'BIREYSEL',
                 'type'           => 'MESAJ',
             ]);

测试

composer test

变更日志

请参阅 CHANGELOG 了解最近更改的详细信息。

贡献

请参阅 CONTRIBUTING 了解详情。

安全漏洞

如果您发现任何与安全相关的问题,请通过电子邮件发送到 development@tarfin.com,而不是使用问题跟踪器。

致谢

许可证

MIT许可证(MIT)。有关更多信息,请参阅许可证文件