madmatt/id3global-service
Composer 安装命令:
composer require madmatt/id3global-service
包简介
Allows a PHP-powered website to communicate with the GBG ID3global API to verify identities. This library is not affiliated with GBG PLC in any way.
README 文档
README
Allows a PHP-powered website to communicate with the GBG ID3global API to verify identities.
Installation
composer require madmatt/id3global-service
If you're not already using Composer for dependency management, please consider doing so. If you'd prefer not to, you can download the latest release from the Releases section.
Usage
The WSDL file gives an overview of the values that can be provided, these will vary by country.
Please see the Full Code Example that provides a complete overview of usage of this module.
Accessing the underlying ID3global request and response
Depending on your use case, you may need to access the underlying request sent to ID3global, or the response returned by the ID3global API. Typical use cases of this are for auditing purposes - to confirm that identity information hasn't changed since the last time an identity verification was performed for example.
In order to facilitate this, the GlobalAuthenticationService class has a number of helper methods to give you access to the underlying data. All of the below code assumes that you have already called the ->verifyIdentity() method and that either you have a valid BandText, or you have caught the IdentityVerificationFailureException that may be thrown.
// Assumes $service is an instance of ID3Global\Service\GlobalAuthenticationService // Return the last SOAP request made to the ID3global API as a string $lastRawRequest = $service->getLastRawRequest(); // Returns the SoapClient interpreted response from the API (this will be an object of type \stdClass, or null if the SOAP request failed entirely // For example you can access the BandText of a valid response with $lastResponse->AuthenticateSPResult->BandText $lastResponse = $service->getLastVerifyIdentityResponse(); // Access the underlying SoapClient object to perform more detailed debugging $gateway = $service->getGateway(); // Returns a ID3Global\Gateway\GlobalAuthenticationGateway object $soapClient = $gateway->getSoapClient(); // Returns a ID3Global\Gateway\SoapClient\ID3GlobalSoapClient object // You can then do anything you'd normally do on SoapClient, such as: $lastRawRequestHeaders = $soapClient->__getLastRequestHeaders(); // Returns an array of the headers sent to the API $lastRawResponse = $soapClient->__getLastResponse(); // Returns the last response returned by the API
Debugging identity verification failures
In certain circumstances, generally when the ID3Global API produces unexpected results, you may get an IdentityVerificationFailureException returned to you. This can happen in a number of scenarios, such as required fields being missing from the request, or data being in an invalid format.
You should also wrap your ->verifyIdentity() calls within a try/catch to prevent users from seeing these exceptions.
By default, this library does not expose information in the exception message that would leak personally identifiable information, however this can be enabled if you are confident that the exception is properly handled (e.g. is being forwarded to a GDPR-compliant logging service). Sometimes this level of detail is necessary to determine why the API request failed.
You can enable logging of this information via the exception message with the following configuration:
$service = new ID3Global\Service\GlobalAuthenticationService; // Must be set before calling ->verifyIdentity() $service->setVerboseExceptionHandling(true); // Either way, regardless of whether or not you enable verbose exception handling, IdentityVerificationFailureException will still contain the response try { $service->verifyIdentity($identity, 'customer reference'); } catch (IdentityVerificationFailureException $e) { /** @var stdClass $response */ $response = $e->getResponse(); }
madmatt/id3global-service 适用场景与选型建议
madmatt/id3global-service 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.21k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2016 年 05 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「identity」 「ID3Global」 「GBG」 「GBG PLC」 「identity verification」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 madmatt/id3global-service 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 madmatt/id3global-service 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 madmatt/id3global-service 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Allows a PHP-powered website to communicate with the GBG ID3global API to verify identities. This library is not affiliated with GBG PLC in any way.
Acts as an adapter between Laravel Eloquent and GBG ID3global service
Identity authorizator class for Nette Framework
Identity ACL extension for Nette Framework
AXIUM Identity Symfony Bundle - Client d'authentification centralisée OAuth2/Keycloak
Laravel 中国身份证验证
统计信息
- 总下载量: 9.21k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 26
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2016-05-31