eciboadaptech / finapi-access
<strong>RESTful API for Account Information Services (AIS) and Payment Initiation Services (PIS)</strong> <br/> <strong>应用版本:</strong> 2.29.4 <br/> 以下页面提供了有关如何使用我们的API的一些基本信息。<br/> 实际的API服务文档随后进一步说明。
Requires
- php: ^7.4 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-09-23 15:25:44 UTC
README
RESTful API for Account Information Services (AIS) and Payment Initiation Services (PIS)
应用版本 2.29.4
以下页面提供了有关如何使用我们的API的一些基本信息。
实际的API服务文档随后进一步说明。您可以使用菜单在API部分之间跳转。
此页面内置了HTTP(S)客户端,因此您可以直接在此页面上测试服务,通过在相应服务中填写请求参数和/或正文,然后点击“TRY”按钮。请注意,您需要授权才能成功调用API。要授权,请参考API的“授权”部分,或直接使用“TRY”按钮附近的OAUTH按钮。
一般信息
错误响应
当API调用返回错误时,通常具有以下示例中所示的结构{ \"errors\": [ { \"message\": \"Interface 'FINTS_SERVER' is not supported for this operation.\", \"code\": \"BAD_REQUEST\", \"type\": \"TECHNICAL\" } ], \"date\": \"2020-11-19T16:54:06.854+01:00\", \"requestId\": \"selfgen-312042e7-df55-47e4-bffd-956a68ef37b5\", \"endpoint\": \"POST /api/v2/bankConnections/import\", \"authContext\": \"1/21\", \"bank\": \"DEMO0002 - finAPI Test Redirect Bank (id: 280002, location: none)\" }
如果API调用需要用户进行额外认证,则返回HTTP代码510,错误响应包含额外的“multiStepAuthentication”对象,请参阅以下示例
{ \"errors\": [ { \"message\": \"Es ist eine zusätzliche Authentifizierung erforderlich. Bitte geben Sie folgenden Code an: 123456\", \"code\": \"ADDITIONAL_AUTHENTICATION_REQUIRED\", \"type\": \"BUSINESS\", \"multiStepAuthentication\": { \"hash\": \"678b13f4be9ed7d981a840af8131223a\", \"status\": \"CHALLENGE_RESPONSE_REQUIRED\", \"challengeMessage\": \"Es ist eine zusätzliche Authentifizierung erforderlich. Bitte geben Sie folgenden Code an: 123456\", \"answerFieldLabel\": \"TAN\", \"redirectUrl\": null, \"redirectContext\": null, \"redirectContextField\": null, \"twoStepProcedures\": null, \"photoTanMimeType\": null, \"photoTanData\": null, \"opticalData\": null, \"opticalDataAsReinerSct\": false } } ], \"date\": \"2019-11-29T09:51:55.931+01:00\", \"requestId\": \"selfgen-45059c99-1b14-4df7-9bd3-9d5f126df294\", \"endpoint\": \"POST /api/v2/bankConnections/import\", \"authContext\": \"1/18\", \"bank\": \"DEMO0001 - finAPI Test Bank\" }
此错误格式的一个例外是API认证错误,返回以下结构
{ \"error\": \"invalid_token\", \"error_description\": \"Invalid access token: cccbce46-xxxx-xxxx-xxxx-xxxxxxxxxx\" }
分页
可能返回大量数据的API服务实现分页。它们在“页面”内返回有限数量的条目。进一步条目必须通过后续调用获取。任何实现分页的API服务都提供以下输入参数
• “page”:要检索的页码(从1开始)。
• “perPage”:页面内的条目数。默认值和最大值在各自服务的文档中说明。
分页响应包含一个额外的“分页”对象,具有以下结构
{ ... , \"paging\": { \"page\": 1, \"perPage\": 20, \"pageCount\": 234, \"totalCount\": 4662 } }
国际化
finAPI服务支持国际化,这意味着您可以定义您首选的API服务响应语言。以下语言可用:德语、英语、捷克语、斯洛伐克语。
首选语言可以通过提供官方HTTP Accept-Language 标头来定义。
finAPI对官方iso语言代码“de”、“en”、“cs”和“sk”进行响应,用于命名语言。Accept-Language标头支持的其他子标签可能提供,例如“en-US”,但将被忽略。
如果没有提供Accept-Language标头,则默认使用德语。
异常
• 银行登录提示和登录字段仅在银行的语种中可用,不会进行翻译。
• 通常作为BUSINESS错误返回的来自银行系统的直接消息不会进行翻译。
• finAPI直接创建的BUSINESS错误在德语和英语中可用。
• 技术错误信息主要面向开发者,通常为英语,但也可能被翻译。
请求ID
在任何API调用中,您可以通过名为“X-Request-Id”的头部传递一个请求ID。请求ID可以是任意字符串,最多255个字符。传递更长的字符串会导致错误。如果您为调用未传递请求ID,finAPI将内部生成一个随机ID。
请求ID总是作为名为“X-Request-Id”的头部返回在服务的响应中。
我们强烈建议始终传递一个(最好是唯一的)请求ID,并在发出请求或接收响应时(尤其是错误响应的情况下)将其包含到您的客户端应用程序日志中。finAPI在其端也记录请求ID。拥有请求ID可以帮助finAPI支持团队更有效地工作并更快地解决工单。
覆盖HTTP方法
一些HTTP客户端不支持HTTP方法PATCH或DELETE。如果您在应用程序中使用此类客户端,可以使用带有特殊HTTP头部指示原始打算的HTTP方法的POST请求。该头部的名称是X-HTTP-Method-Override。将其值设置为PATCH或DELETE。设置此头部的POST请求将被finAPI服务器处理为PATCH或DELETE。
示例
X-HTTP-Method-Override: PATCH
POST /api/v2/label/51
{\"name\": \"changed label\"}
将按以下方式由finAPI解释
PATCH /api/v2/label/51
{\"name\": \"changed label\"}
用户元数据
随着对PSD2 API的迁移,API中引入了一个新术语“用户元数据”(也称为“PSU元数据”)。此用户元数据旨在告知银行API是否存在真正的最终用户在HTTP请求后面,或者请求是否由系统(例如,通过自动批量更新)触发。在后一种情况下,银行可能会应用一些限制,例如限制单个同意的HTTP请求数量。此外,某些操作可能完全被银行API禁止。例如,一些银行不允许在没有最终用户参与的情况下发出新的同意。因此,对于此类操作,客户提供PSU元数据是肯定必要的和强制性的。由于finAPI没有直接与最终用户互动,提供有关最终用户的全部必要信息是客户端应用程序的责任。这必须通过发送带有每个代表最终用户触发的请求的附加头部来完成。
目前,API支持以下头部
• \"PSU-IP-Address\" - 用户设备的IP地址。它必须是IPv4地址,因为一些银行无法处理IPv6地址。如果传递了非IPv4地址,我们将使用自己的IPv4地址作为后备值。
• \"PSU-Device-OS\" - 用户设备及/或操作系统标识。
• \"PSU-User-Agent\" - 用户浏览器或其他客户端设备标识。
常见问题解答
finAPI有SDK吗?目前我们不提供本地SDK,但可以通过OpenAPI为几乎所有目标语言生成SDK。使用此页上的“下载SDK”按钮生成SDK。
我如何启用finAPI的自动批量更新?
目前无法通过API设置批量更新。有关此问题,请联系support@finapi.io。
为什么在调用此页面的服务时需要不断授权?
此页面是一个“单页应用程序”。页面刷新会重置OAuth授权上下文。通常不需要刷新页面,所以请不要刷新,您的授权将保持有效。
有关更多信息,请访问https://www.finapi.io/impressum。
安装与使用
需求
PHP 7.4及更高版本。也应与PHP 8.0兼容。
Composer
要通过Composer安装绑定,请将以下内容添加到composer.json
中
{ "repositories": [ { "type": "vcs", "url": "https:////.git" } ], "require": { "/": "*@dev" } }
然后运行composer install
手动安装
下载文件并包含autoload.php
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
入门
请按照安装程序进行操作,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: finapi_auth $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); // Configure OAuth2 access token for authorization: finapi_auth $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); $apiInstance = new OpenAPI\Client\Api\AccountsApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $id = 56; // int | Identifier of the account to delete $psu_ip_address = 'psu_ip_address_example'; // string | The IP address of the user's device. This header will be forwarded to the bank on XS2A requests. It has to be an IPv4 address, as some banks cannot work with IPv6 addresses. If a non-IPv4 address is passed, we will replace the value with our own IPv4 address as a fallback. $psu_device_os = 'psu_device_os_example'; // string | The user's device and/or operating system identification. This header will be forwarded to the bank on XS2A requests. $psu_user_agent = 'psu_user_agent_example'; // string | The user's web browser or other client device identification. This header will be forwarded to the bank on XS2A requests. $x_http_method_override = 'x_http_method_override_example'; // string | Some HTTP clients do not support the HTTP methods PATCH or DELETE. If you are using such a client in your application, you can use a POST request instead with this header indicating the originally intended HTTP method. POST Requests having this header set will be treated either as PATCH or DELETE by the finAPI servers. $x_request_id = 'x_request_id_example'; // string | With any API call, you can pass a request ID. The request ID can be an arbitrary string with up to 255 characters. Passing a longer string will result in an error. If you don't pass a request ID for a call, finAPI will generate a random ID internally. The request ID is always returned back in the response of a service, as a header with name 'X-Request-Id'. We highly recommend to always pass a (preferably unique) request ID, and include it into your client application logs whenever you make a request or receive a response (especially in the case of an error response). finAPI is also logging request IDs on its end. Having a request ID can help the finAPI support team to work more efficiently and solve tickets faster. try { $apiInstance->deleteAccount($id, $psu_ip_address, $psu_device_os, $psu_user_agent, $x_http_method_override, $x_request_id); } catch (Exception $e) { echo 'Exception when calling AccountsApi->deleteAccount: ', $e->getMessage(), PHP_EOL; }
API端点
所有URI均相对于https://sandbox.finapi.io
模型
- AccessToken
- Account
- AccountCapability
- AccountInterface
- AccountInterfacePaymentCapabilities
- AccountList
- AccountParams
- AccountReference
- AccountStatus
- AccountType
- BadCredentialsError
- Bank
- BankBankGroup
- BankConnection
- BankConnectionBank
- BankConnectionInterface
- BankConnectionInterfaceAisConsent
- BankConnectionInterfaceLastAutoUpdate
- BankConnectionInterfaceLastManualUpdate
- BankConnectionList
- BankConnectionOwner
- BankConsent
- BankConsentStatus
- BankGroup
- BankIcon
- BankImage
- BankInterface
- BankInterfaceLoginField
- BankInterfacePaymentCapabilities
- BankInterfacePaymentConstraints
- BankInterfaceProperty
- BankInterfaceTppAuthenticationGroup
- BankLogo
- BankingInterface
- CashFlow
- CashFlowCategory
- CashFlowList
- CategorizationCheckResult
- CategorizationCheckResultCategory
- CategorizationCheckResults
- CategorizationRuleDirection
- CategorizationStatus
- Category
- CategoryParams
- CertisTransactionData
- ChangeClientCredentialsParams
- CheckCategorizationData
- CheckCategorizationTransactionData
- ClientConfiguration
- ClientConfigurationParams
- ConnectInterfaceParams
- ConnectInterfaceParamsMultiStepAuthentication
- CounterpartAddressData
- CreateDirectDebitParams
- CreateMoneyTransferParams
- CreateStandingOrderParams
- Currency
- DailyBalance
- DailyBalanceList
- DailyBalanceListPaging
- DeleteConsent
- DeleteConsentResult
- DirectDebitOrderParams
- DirectDebitSequenceType
- DirectDebitType
- EditBankConnectionParams
- EditCategoryParams
- EditTppCredentialParams
- ErrorCode
- ErrorDetails
- ErrorDetailsMultiStepAuthentication
- ErrorMessage
- ErrorType
- ExecutePasswordChangeParams
- ISO3166Alpha2Codes
- IbanRule
- IbanRuleCategory
- IbanRuleIdentifiersParams
- IbanRuleList
- IbanRuleParams
- IbanRulesParams
- IdentifierList
- ImportBankConnectionParams
- KeywordRule
- KeywordRuleIdentifiersParams
- KeywordRuleList
- KeywordRuleParams
- KeywordRulesParams
- Label
- LabelParams
- Language
- LoginCredential
- LoginCredentialResource
- MandatorLicense
- MockAccountData
- MockBankConnectionUpdate
- MockBatchUpdateParams
- MoneyTransferOrderParams
- MoneyTransferOrderParamsCounterpartAddress
- MonthlyUserStats
- MsaStatus
- MultiStepAuthenticationCallback
- MultiStepAuthenticationChallenge
- NewTransaction
- NotificationRule
- NotificationRuleList
- NotificationRuleParams
- OrderInitiationStatus
- PageableBankList
- PageableCategoryList
- PageableIbanRuleList
- PageableKeywordRuleList
- PageableLabelList
- PageablePaymentResources
- PageablePendingTransactionResources
- PageableSecurityList
- 分页可用的订单资源
- 分页可用的TPP身份验证组资源
- 分页可用的TPP证书列表
- 分页可用的TPP凭证资源
- 分页的交易列表
- 分页的用户信息列表
- 分页
- 密码更改资源
- 支付
- 支付类型
- Paypal交易数据
- 待处理交易
- 待处理交易证书数据
- 待处理交易Paypal数据
- 首选同意类型
- 产品
- 移除接口参数
- 请求密码更改参数
- 响应消息
- 安全性
- 安全位置数量名义类型
- 安全位置报价类型
- SEPA货币转账约束
- SEPA货币转账对方地址必填字段
- SEPA货币转账必填字段
- 分割交易参数
- 订单
- 订单频率
- 子交易参数
- 提交支付参数
- 提交订单参数
- 切换API版本参数
- TPP身份验证组
- TPP证书
- TPP证书参数
- TPP证书类型
- TPP凭证
- TPP凭证参数
- 火车分类数据
- 火车分类交易数据
- 交易
- 交易类别
- 交易方向
- 触发分类参数
- 两步验证过程
- 更新银行连接参数
- 更新多个交易参数
- 更新结果
- 更新结果状态
- 更新交易参数
- 用户
- 用户创建参数
- 用户标识列表
- 用户标识参数
- 用户信息
- 用户更新参数
- 验证状态资源
授权
finapi_auth
- 类型:
OAuth
- 流程:
password
- 授权URL: ``
- 作用域:
- all: 无限制
finapi_auth
- 类型:
OAuth
- 流程:
application
- 授权URL: ``
- 作用域:
- all: 无限制
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此PHP包由OpenAPI Generator项目自动生成
- API版本:
2023.50.5
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen