g4 / customer-support
客户支持 PHP 库
1.0.1
2021-02-23 12:50 UTC
Requires
- php: >=5.6
- g4/constants: 0.*
- g4/factory: 1.*
- g4/gateway: 2.*
- g4/value-object: *
Requires (Dev)
- codeception/codeception: 2.*
- g4/code-coverage: 1.*
- phpunit/php-code-coverage: 2.*
- phpunit/phpunit: 4.8.*
- squizlabs/php_codesniffer: 3.*
This package is auto-updated.
Last update: 2024-09-23 20:43:42 UTC
README
customer-support - php 库
安装
通过 composer 包管理器安装。在 packagist 上找到。
composer require g4/customer-support
用法
Zendesk 实例
<?php $adapter = 'Zendesk'; $options = (new \G4\Gateway\Options()) ->addHeader('Authorization', 'Basic *********************************') ->addHeader('Content-Type', 'application/json'); $gateway = new \G4\Gateway\Http('url', $options); $data = new Dictionary([ 'name' => 'test' 'email' => 'test@gmail.com' 'subject' => 'test' 'comment' => 'test' ]); $customerSupport = new (G4\CustomerSupport\CustomerSupportFactory) $customerSupport ->setEmail(new Email($data->get('email'))) ->setName(new StringLiteral($data->get('name'))) ->setSubject(new StringLiteral($data->get('subject'))) ->setComment(new StringLiteral($data->get('comment'))) ->setGateway($gateway) ->setAdapter($adapter); ->createInstance()
安装依赖项
composer install
运行单元测试
make unit-tests
许可证
(MIT 许可证) 详细信息请见 LICENSE 文件...