Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛠️ Getting Started with Stripe Identity Plugin

You can visit the official Stripe Identity Documentation for a complete overview of how Stripe Identity works.

This package helps you integrate Stripe Identity seamlessly into your Flutter app.


🚀 Features

  • ✅ Easy integration with Stripe Identity Verification
  • 📱 Support for both Android and iOS platforms
  • 🧩 Customizable brand logo display
  • 🛡️ Secure verification handled by Stripe SDK
  • 🔍 Simple error handling and type-safe results

📦 Flutter Installation

Add to your pubspec.yaml:

dependencies:
  stripe_identity_plugin: ^1.0.4

⚙️ Android Setup

1. AndroidManifest Configuration

Inside android/app/src/main/AndroidManifest.xml, add the following:

<uses-permission android:name="android.permission.CAMERA" />

<application>
    <activity
      android:name="com.stripe.android.identity.IdentityActivity"
      android:exported="false"
      android:theme="@style/StripeIdentityTheme" />
</application>

2. Add Theme for Stripe

In android/app/src/main/res/values/styles.xml:

<style name="StripeIdentityTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
    <item name="colorPrimary">#000000</item>
    <item name="colorPrimaryVariant">#000000</item>
    <item name="colorOnPrimary">#FFFFFF</item>
    <item name="android:statusBarColor">#000000</item>
    <item name="android:windowLightStatusBar">false</item>
    <item name="android:windowBackground">@android:color/white</item>
</style>

3. Update MainActivity.kt

package com.example.your_app_name

import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity : FlutterFragmentActivity()

FlutterFragmentActivity is required for fragment-based Stripe Identity flows.


🍏 iOS Setup

1. Add Camera & Photo Permissions in Info.plist

Edit your ios/Runner/Info.plist and add:

<key>NSCameraUsageDescription</key>
<string>This app requires camera access for identity verification.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to your photo library to upload documents.</string>

2. Customize Stripe Button & Tint Color

To customize button colors, links, and default blue UI elements, add this in AppDelegate.swift:

import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {

    // Set global tint color to black
    UIView.appearance().tintColor = .black

    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

This will change button and icon tint colors from default system blue to black throughout Stripe's native UI.


📲 Flutter Usage

After getting the session ID and ephemeral key from your server:

final stripeIdentity = StripeIdentityPlugin();

final (status, message) = await stripeIdentity.startVerification(
  id: 'verification_session_id_from_server',
  key: 'ephemeral_key_secret_from_server',
  brandLogoUrl: 'https://your-domain.com/logo.png', // Optional
);

switch (status) {
  case VerificationResult.completed:
    print('✅ Verification completed successfully');
    break;
  case VerificationResult.canceled:
    print('⚠️ User canceled verification');
    break;
  case VerificationResult.failed:
    print('❌ Verification failed: $message');
    break;
  case VerificationResult.unknown:
    print('❓ Unknown error: $message');
    break;
}

🎥 Demo Videos

✅ Valid Key & Session ID

📽️ View Demo – Success Flow If your API key and session ID are correct, the verification will start as expected.


❌ Invalid Key or Session ID

📽️ View Demo – Error Flow If you use invalid credentials, you’ll see how the plugin handles the error gracefully.


🔐 Security Notes

  • Never expose STRIPE_SECRET in your Flutter app.
  • Always call Stripe from a backend service.
  • Protect your endpoints using authentication and HTTPS.

About

Flutter plugin for integrating Stripe Identity verification on Android and iOS.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages