g4/customer-support

1.0.1 2021-02-23 12:50 UTC

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 文件...