npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-alipay-verify

v0.1.4

Published

react-native-alipay-verify

Downloads

2

Readme

react-native-alipay-verify

NPM Version Dependency Status Build Status License

🍺🍺🍺 支付宝实名认证(人脸识别,生物识别),移动端调起实名认证流程进行了封装 📦 , 真实姓名+身份证号+人脸识别

身份验证官方文档:https://opendocs.alipay.com/open/20181012100420932508/intro

在使用前确保你已完成了服务端的接入工作,组件完成了移动端接入

(x) 服务端SDK接入流程:https://opendocs.alipay.com/open/20181012100420932508/01brh4 (需手动接入)

(√) ~~Adnroid 客户端接入流程:https://opendocs.alipay.com/open/20181012100420932508/00zc1e~~

(√) ~~iOS 客户端接入流程:https://opendocs.alipay.com/open/20181012100420932508/00ze52~~


o6LKnH.png

Requirement

  • React Native >= 0.60.0

  • iOS >= 9.0

  • Android >= 4.4

SDK library :

  • iOS: v2.1.1
  • Android: v2.0.0

Installation

npm install react-native-alipay-verify

or

yarn add react-native-alipay-verify

IOS 需要手动处理额外的步骤 ➡️ IOS Setup

Usage

import AlipayVerify, {ResultStatusCode, AlipayVerifyEvent} from "react-native-alipay-verify";

// 获取场景码
AlipayVerify.getBizCode().then((bizCode) => {
	console.log(bizCode);
}).catch((error) => console.log(error));

// 发起人脸识别认证
AlipayVerify.verify(certifyId, certifyUrl).then((verifyResult) => {
      let message = ""
      switch (Number(verifyResult)) {
        case ResultStatusCode.NETWORK_ANOMALY: message = '网络异常';
          break;
        case ResultStatusCode.SYSTEM_EXCEPTION: message = '系统异常';
          break;
        case ResultStatusCode.USER_CANCEL: message = '用户取消认证';
          break;
        case ResultStatusCode.VERIFY_SUCCESS: message = '认证成功';
          // 此状态需向商户服务器证实认证结果
          
          break;
        case ResultStatusCode.AWAIT_VERIFY:
          // 等待认证结束,通过监听方式得到认证结束通知
          
          break;
        default:
          message = "调起支付宝SDK失败,错误码:"+ verifyResult
          break;
      }
      console.log(message+ " " + verifyResult);
}).catch((error) => console.log(error));

// 监听回调 此处为认证结束的事件。认证成功与否需要前往服务器验证
DeviceEventEmitter.addListener(AlipayVerifyEvent.EVENT_QUERY_CERTIFY_RESULT,(event) => {
      console.log("监听:"+ JSON.stringify(event));
      // 向商户服务器 证实 认证结果
  
})

// 防止错过认证结束通知 回到前台时处理 认证状态
AppState.addEventListener('change', (appState) => {
  if(appState === 'active'){
    // 向商户服务器 证实 认证结果
    
  }
});

Run Example Project

git clone

git clone https://github.com/DengXiangHong/react-native-alipay-verify.git
cd react-native-alipay-verify/example && yarn install

ios

pod install
yarn ios

android

yarn android

TODO

  • ~~iOS设备下,场景码获取始终为 FACE_ALIPAY_SDK~~
  • iOS设备下,下没有安装支付宝APP时无法调起内置SDK进行识别

License

MIT

Change Log

  • 0.1.4
    • 2022-11-17, 双料特工・钏钐钾, 本地依赖迁移至 maven.xingqiji.com
      • ./android/build.gradle#64:5