ultraleet/verify-once 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ultraleet/verify-once

Composer 安装命令:

composer require ultraleet/verify-once

包简介

VerifyOnce verification service integration library.

README 文档

README

VerifyOnce verification service integration library.

Usage

Add the library to your project via Composer:

composer require ultraleet/verify-once

Initialize the library by instantiating the core class:

$verifyOnce = new \Ultraleet\VerifyOnce\VerifyOnce([
    'username' => '', // Integrator username
    'password' => '', // Integrator password
]);

To initiate a verification transaction, do the following:

$response = $verifyOnce->initiate();

Response will be an object containing 'transactionId' and 'url' properties. You should store the transaction ID along with user info and redirect the user to the given URL for the verification process.

Once the verification is completed, VerifyOnce posts a JWT signed payload containing verification info to your callback URL. To verify the payload, you can use the verify method of the library:

$body = file_get_contents('php://input');
$info = $verifyOnce->verify($body);

Make sure to catch any exceptions that indicate unsuccessful payload verification.

$info will contain verification information. You can get the transaction ID to compare against the value you stored previously to find the user doing the verification from $info->transaction->id.

Depending on whether you want to verify user's identity, address, or both, you will need to check $info->identityVerification and/or $info->addressVerification. If either of them is empty, then it means it has not been successfully verified.

Next, you will want to check verification status, which is the status property of either of the above objects. It can contain the following values:

  UNINITIATED
  INITIATED
  PENDING
  VERIFIED
  FAILED
  LOCKED

These should be pretty self-explanatory.

If the status is VERIFIED, you can go ahead and check the values of whatever fields you need in order to confirm that you have the correct user/address.

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-10-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固