优雅 / laravel-yousign
Laravel的Yousign SDK
v0.0.1
2024-06-08 20:36 UTC
Requires
- php: ^8.2
- illuminate/contracts: ^10.0||^11.0
- saloonphp/saloon: ^3.8
- spatie/laravel-package-tools: ^1.16
- spatie/laravel-webhook-client: ^3.4
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
README
为您的Laravel应用程序提供Yousign API和Webhooks。
安装
您可以通过composer安装此包
composer require elegantly/laravel-yousign
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="laravel-yousign-config"
这是已发布配置文件的内容
return [ /** * The Yousign API key */ 'api_key' => env('YOUSIGN_KEY'), /** * Whether request should be sent to the sandbox environnement */ 'sandbox' => env('YOUSIGN_SANDBOX', true), 'webhooks' => [ /* * Yousign will sign each webhook using a secret. You can find the used secret at the * webhook configuration settings: https://yousign.app/auth/workspace/integrations/webhooks */ 'signing_secret' => env('YOUSIGN_WEBHOOK_SECRET'), /* * You can define a default job that should be run for all other Stripe event type * without a job defined in next configuration. * You may leave it empty to store the job in database but without processing it. */ 'default_job' => '', /* * You can define the job that should be run when a certain webhook hits your application * here. The key is the name of the Stripe event type with the `.` replaced by a `_`. * * You can find a list of Stripe webhook types here: * https://stripe.com/docs/api#event_types. */ 'jobs' => [ // 'signature_request_done' => \App\Jobs\YousignWebhooks\HandleSignatureRequestDone::class, ], /* * The classname of the model to be used. The class should equal or extend * Spatie\WebhookClient\Models\WebhookCall. */ 'model' => \Spatie\WebhookClient\Models\WebhookCall::class, /** * This class determines if the webhook call should be stored and processed. */ 'profile' => \Elegantly\Yousign\Webhooks\YousignWebhookProfile::class, /* * Specify a connection and or a queue to process the webhooks */ 'connection' => env('YOUSIGN_WEBHOOK_CONNECTION'), 'queue' => env('YOUSIGN_WEBHOOK_QUEUE'), /* * When disabled, the package will not verify if the signature is valid. * This can be handy in local environments. */ 'verify_signature' => env('YOUSIGN_SIGNATURE_VERIFY', true), ], ];
API使用
\Elegantly\Yousign\Facades\Yousign::connector()->signatureRequest()->find('YOUSIGN_SIGNATURE_ID');
Webhooks使用
Route::yousignWebhooks('/yousign/webhooks');
变更日志
请参阅变更日志以获取更多最近更改的信息。
贡献
请参阅贡献指南以获取详细信息。
安全漏洞
请查看我们的安全策略了解如何报告安全漏洞。
鸣谢
许可
MIT许可(MIT)。请参阅许可文件以获取更多信息。