Code Monkey home page Code Monkey logo

identity-verification-sample's Introduction


Identity Verification API (beta) demo app

Demo

See a hosted version of the demo or fork a copy on codesandbox.io

demo app recording

How to run locally

This sample includes a Node server implementation.

Follow the steps below to run locally.

1. Clone the repository:

git clone https://github.com/bz-stripe/identity-verification-sample

2. Copy the env.example to a .env file:

Copy the env.example file into a file named .env in the project root folder. For example:

cp env.example .env

You will need a Stripe account in order to run the demo. Once you set up your account, go to the Stripe developer dashboard to find your API keys and update your .env file with the keys.

STRIPE_SECRET_KEY=<replace-with-your-test-secret-key>
STRIPE_PUBLISHABLE_KEY=<replace-with-your-test-publishable-key>
STRIPE_WEBHOOK_SECRET=<replace-with-your-test-webhook-secret>

CLIENT_DIR tells the server where to the client files are located and does not need to be modified unless you move the server files.

3. Install and run:

npm install
npm start

4. [Optional] Run a webhook locally:

If you want to test the integration with a local webhook on your machine, you can use the Stripe CLI to easily spin one up.

First install the CLI and link your Stripe account.

stripe listen --forward-to localhost:4242/webhook

The CLI will print a webhook secret key to the console. Set STRIPE_WEBHOOK_SECRET to this value in your .env file.

You should see events logged in the console where the CLI is running.

When you are ready to create a live webhook endpoint, follow our guide in the docs on configuring a webhook endpoint in the dashboard.

FAQ

Q: Why did you pick these frameworks?

A: We chose the most minimal framework to convey the key Stripe calls and concepts you need to understand. These demos are meant as an educational tool that helps you roadmap how to integrate Stripe within your own system independent of the framework.

Q: Can you show me how to build X?

A: We are always looking for new sample ideas, please email [email protected] with your suggestion!

Author(s)

@bz-stripe

identity-verification-sample's People

Contributors

atav32 avatar bz-stripe avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

identity-verification-sample's Issues

Unable to modify options.document rules

Attempting to limit options.document.allow_document_types to only driving_license. Unsuccessful so far.

Discovered that modifications to options.document rules in server.js (i.e., setting require_id_number: false) did not reflect in the verification_session object.

Screen Shot 2021-03-30 at 4 04 51 PM
(require_id_number: false and require_matching_selfie: false)

Screen Shot 2021-03-30 at 4 06 34 PM
Event: evt_1IapTSIr2u9N0AUon2K14lFI

The require_id_number and require_matching_selfie rules are both true, despite setting them to false in server.js

Specify API Version

The cloned repo does not specify the API version.
Appropriate code (example):
stripe.setApiVersion("2020-03-02; identity_beta=v3");

Should be inserted around line 24 in server.js

Modal verification not displaying on "Verify Me" click

Running the sample on node, the modal verification is not displaying when I click "Verify Me."

Stripe creates a new Verification Session on the click, which I can see in the dashboard.

Browser console returns:

index.js:39 Error: TypeError: Cannot read property 'trim' of undefined
    at (index):1
    at Ks ((index):1)
    at nu.<anonymous> ((index):1)
    at nu.verifyIdentity ((index):1)
    at index.js:28

Node returns no messages in Terminal.

Using the "Open verification session in a new tab" link works.

Screen Shot 2021-03-23 at 5 19 34 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.