bukashk0zzz/hellosign-bundle

一个简单的用于HelloSign官方SDK的Symfony2/Symfony3包。

安装次数: 4,558

依赖项: 0

建议者: 0

安全: 0

星标: 1

关注者: 3

分支: 0

类型:symfony-bundle

v1.0.1 2016-05-30 12:50 UTC

This package is auto-updated.

Last update: 2024-09-04 20:39:46 UTC


README

#Symfony2/Symfony3 HelloSign Bundle

Build Status Code Coverage Scrutinizer Code Quality License Latest Stable Version Total Downloads

SensioLabsInsight knpbundles.com

关于

这是一个由HelloSign提供的官方SDK的包装器。

安装

将以下内容添加到您的composer.json文件中

"require": {
	"bukashk0zzz/hellosign-bundle": "dev-master",
}

将包添加到app/AppKernel.php

$bundles = array(
	// ... other bundles
	new Bukashk0zzz\HelloSignBundle\Bukashk0zzzHelloSignBundle(),
);

配置

将以下内容添加到您的config.yml文件中

bukashk0zzz_hello_sign:
    #(Required) email address or apikey or OAuthToken
    login: 'XXXXXXXX'
    #(Optional, default: null) Null if using apikey or OAuthToken
    password: 'ZZZ'
    #(Optional, default: https://api.hellosign.com/v3/) alternative api base url
    url: 'https://api.hellosign.com/v3/'
    #(Optional, default: https://www.hellosign.com/oauth/token) alternative oauth url
    oauth_url: 'https://www.hellosign.com/oauth/token'

使用方法

提供的服务

在控制器内部

class DocsController extends Controller
{
    public function createSignatureRequestAction()
    {
        $request = new HelloSign\TemplateSignatureRequest;
        $request->enableTestMode();
        $request->setTemplateId($template->getId());
        $request->setSubject('Purchase Order');
        $request->setMessage('Glad we could come to an agreement.');
        $request->setSigner('Client', 'george@example.com', 'George');
        $request->setCC('Accounting', 'accounting@example.com');
        $request->setCustomFieldValue('Cost', '$20,000');
        
        $response = $this->getContainer()->get('hellosign.client')->sendTemplateSignatureRequest($request);
    }
}

版权 / 许可证

请参阅LICENSE