40katty04/plaid-api-php-client
Composer 安装命令:
composer require 40katty04/plaid-api-php-client
包简介
PHP API Client for Plaid.com
README 文档
README
PHP Client for the plaid.com API
This is a PHP port of the official python client library for the Plaid API
Table of Contents
Install
$ composer require 40katty04/plaid-api-php-client
Documentation
The module supports only a select few Plaid API endpoints at the moment. For complete information about the Plaid.com API, head to the Plaid Documentation.
Examples
Exchange a public token for an access token
Exchange a public_token from Plaid Link for a Plaid access token:
$clientId = '*****'; $secret = '*****'; $publicKey = '*****'; $publicToken = '<public_token from Plaid Link>'; // Available environments are 'sandbox', 'development', and 'production' $client = new Client($clientId, $secret, $publicKey, 'sandbox'); $response = $client->item()->publicToken()->exchange($publicToken); $accessToken = $response['access_token'];
Retrieve Transactions
$response = $client->transactions()->get($accessToken, '2018-01-01', '2018-01-31'); $transactions = $response['transactions'];
Asset Reports
There are multiple steps to retrieving an Asset Report.
- Create the report
- Filter unwanted accounts out of report
- Retrieve the report as JSON or PDF
- Refresh a previously created or filtered report
- Remove a report
Create an Asset Report
// an array of previously generated access_tokens $accessTokens = ['<access_token(s) returned from exchange token call(s)>']; $daysRequested = 180; // all of these are optional $options = [ 'client_report_id' => '<user supplied id for reference', 'webhook' => 'https://your-application.io/webhook', 'user' => [ 'client_user_id' => '<user supplied id>', 'first_name' => 'Testynthia', 'middle_name' => 'T.', 'last_name' => 'Tertestdez', 'ssn' => '123-45-6789', 'phone_number' => '555-555-1234', 'email' => 'test@test.com' ] ]; $response = $this->client->assetReport()->create($accessTokens, $daysRequested, $options);
Create Asset Report Response
{
"asset_report_id": "<asset_report guid>",
"asset_report_token": "<assets-sandbox-guid>",
"request_id": "<request_id>"
}
Filter an Asset Report
$assetReportToken = '<returned in asset report creation call>'; $accountIdsToExclude = ['<credit_card_id>', '<401k_account_id>']; $response = $this->client->assetReport()->filter($assetReportToken, $accountIdsToExclude);
Filter Asset Report Repsonse
{
"asset_report_id": "<asset_report guid>",
"asset_report_token": "<assets-sandbox-guid>",
"request_id": "<request_id>"
}
Retrieve an Asset Report
// retrieve the report in JSON format $response = $this->client->assetReport()->get($accessReportToken); // retrieve the report in PDF format $response = $this->client->assetReport()->getPdf($accessReportToken); file_put_contents('asset-report.pdf', $response);
Retrieve Asset Report Response
The JSON results of an asset report can be reviewed in plaid's documentation.
The /asset_report/pdf/get endpoint returns binary PDF data, which can be saved into a local file.
Refresh an Asset Report
// $daysRequested is optional and only needed if you want to override the value sent when report was created // $options is optional, only required for overrides to previous values $response = $this->client->assetReport()->refresh($assetReportToken, $daysRequested, $options);
Refresh Asset Report Response
{
"asset_report_id": "<asset_report guid>",
"asset_report_token": "<assets-sandbox-guid>",
"request_id": "<request_id>"
}
Remove an Asset Report
$response = $this->client->assetReport()->remove($assetReportToken);
Remove Asset Report Response
{
"removed": true,
"request_id": "<request_id>"
}
License
40katty04/plaid-api-php-client 适用场景与选型建议
40katty04/plaid-api-php-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 38 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 01 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 40katty04/plaid-api-php-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 40katty04/plaid-api-php-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 38
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-19