import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { switchMap } from 'rxjs/operators';
import { StripeService } from 'ngx-stripe';
selector: 'app-identity',
templateUrl: './identity.component.html'
export class IdentityComponent {
private http: HttpClient,
private stripeService: StripeService
// Check the server.js tab to see an example implementation
this.https.post('/create-verification-session', {})
// Show the verification modal.
return this.stripeService.verifyIdentity(session.clientSecret)
// If `verifyIdentity` fails, you should display the localized
// error message to your user using `error.message`.
alert(result.error.message);