eliosfund/plaid-php-sdk
Composer 安装命令:
composer require eliosfund/plaid-php-sdk
包简介
Plaid SDK for Laravel and PHP.
README 文档
README
A PHP package to help kickstart your next Plaid integration.
Introduction
The Plaid PHP SDK is a PHP package that provides a simple and easy-to-use interface for interacting with the Plaid API.
Table of Contents
Installation
You can install the package using Composer:
composer require eliosfund/plaid-php-sdk
Getting Started
To get started, a new instance of the Plaid client should be created. You can then use the instance to interact with the Plaid API. In the following example, we request a public link token that can then be used to initialize a Link session.
<?php use Plaid\Environment; use Plaid\Plaid; // Create the Plaid client $plaid = new Plaid( clientId: env('PLAID_CLIENT_ID'), clientSecret: env('PLAID_SECRET'), environment: Environment::SANDBOX ); // Request a public link token $token = $plaid ->link() ->publicTokenCreate([ "client_name" => env('APP_NAME'), "products" => ["auth"], "country_codes" => ["US"], "language" => "en", "user" => [ "client_user_id" => "1" ] ]) ->json('link_token');
Versioning
A specific Plaid API version can be used by adding a Plaid-Version header to the request. The following example demonstrates how to request a specific version of the Auth endpoint.
<?php use Plaid\Environment; use Plaid\Exceptions\PlaidException; use Plaid\Http\Requests\Auth\GetRequest; use Plaid\Plaid; // Create the Plaid client $plaid = new Plaid( clientId: env('PLAID_CLIENT_ID'), clientSecret: env('PLAID_SECRET'), accessToken: $accessToken, environment: Environment::SANDBOX ); // Create a request $request = new GetRequest(); $request->headers()->add('Plaid-Version', '2020-09-14'); // Send the request $data = $plaid->send($request)->json();
Error Handling
The Plaid PHP SDK throws exceptions when an API error occurs. You can catch these exceptions and handle them accordingly with a standard try/catch block. All errors thrown by the SDK extend the PlaidException class. For a more elegant approach to error handling, consider using the promise-based approach.
<?php use Plaid\Environment; use Plaid\Exceptions\PlaidException; use Plaid\Plaid; // Create the Plaid client $plaid = new Plaid( clientId: env('PLAID_CLIENT_ID'), clientSecret: env('PLAID_SECRET'), environment: Environment::SANDBOX ); // Perform a request try { $transactions = $plaid->transactions([ 'start_date' => '2021-01-01', 'end_date' => '2021-01-31' ])->get()->json(); } catch (PlaidException $exception) { // Handle API exceptions } catch (Exception $e) { // Handle PHP exceptions }
Promise Support
The Plaid PHP SDK can send asynchronous requests using a promise-based approach. This allows you to handle both successful and failed requests in a more elegant way.
<?php use Plaid\Environment; use Plaid\Http\Requests\Auth\GetRequest; use Plaid\Plaid; use Saloon\Exceptions\Request\RequestException; use Saloon\Http\Response; // Create the Plaid client $plaid = new Plaid( clientId: env('PLAID_CLIENT_ID'), clientSecret: env('PLAID_SECRET'), accessToken: $accessToken, environment: Environment::SANDBOX ); // Create a promise $promise = $plaid->sendAsync(new GetRequest()); // Send the request $promise ->then(function (Response $response) { // Handle successful response }) ->otherwise(function (RequestException $exception) { // Handle failed request }); // Force the promise to be resolved $promise->wait();
Products Supported
Currently, the following Plaid products are supported:
- Auth
- Identity
- Link
- Sandbox
- Transactions
- Transfer
Contributing
Please see here for more details about contributing.
eliosfund/plaid-php-sdk 适用场景与选型建议
eliosfund/plaid-php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.53k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 06 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「sdk」 「laravel」 「plaid」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 eliosfund/plaid-php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 eliosfund/plaid-php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 eliosfund/plaid-php-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Alfabank REST API integration
Zero-dependency raw PHP DNS resolver, domain-ownership verification, and intoDNS/MxToolbox-style diagnostics. Queries authoritative nameservers directly over sockets — never trusts the recursive cache for ownership checks.
Laravel package for Accurate Online API integration.
A lightweight plain-PHP framework for database-backed CRUD APIs.
bughq error tracking - PHP SDK
Shared RCX Laravel DataTables UI and configuration helpers.
统计信息
- 总下载量: 5.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-18