Google 致力于为黑人社区推动种族平等。查看具体举措

Run Payments with Stripe

Stripe
Stripe 制造

Controls access to paid content by syncing your one-time and recurring payments with Firebase Authentication.

此扩展程序的运作方式

Use this extension as a backend for your Stripe payments.

The extension supports multiple use cases:

  • Process one-time payments with Stripe Checkout on the web.
  • Create subscriptions for your users and manage access control via Firebase Authentication.
  • Process payments & set up payment methods with the mobile payment sheet on Android, iOS, or with React Native.

Subscription payments with Stripe Checkout

Users can sign-up for your digital goods and paid content with Stripe Checkout and manage their subscriptions with the Stripe customer portal.

This extension syncs customers' subscription status with your Cloud Firestore and adds custom claims using Firebase Authentication for convenient access control in your application.

The design for Stripe Checkout and the customer portal can be customized in your Stripe Dashboard branding settings. See this example which is customized to match the Firebase color scheme:

Stripe Checkout Page Stripe Customer Portal

If you're building on the web platform, you can use this extension for any of your payment use cases.

If you're developing native mobile applications and you're selling digital products or services within your app, (e.g. subscriptions, in-game currencies, game levels, access to premium content, or unlocking a full version), you must use the app store's in-app purchase APIs. See Apple's and Google's guidelines for more information.

For all other scenarios you can use the stripe-android, stripe-ios, stripe-react-native, or flutter_stripe SDKs.

Client SDK

You can use the @stripe/firestore-stripe-payments JavaScript package to easily access this extension from web clients. This client SDK provides TypeScript type definitions and high-level convenience APIs for most common operations client applications would want to implement using the extension.

Use a package manager like NPM to install the above package, and use it in conjunction with the Firebase Web SDK.

Additional setup

Before installing this extension, set up the following Firebase services in your Firebase project:

Then, in the Stripe Dashboard:

  • Create a new restricted key with write access for the "Customers", "Checkout Sessions" and "Customer portal" resources, and read-only access for the "Subscriptions" and "Plans" resources.

Billing

This extension uses the following Firebase services which may have associated charges:

  • Cloud Firestore
  • Cloud Functions
  • Cloud Secret Manager
  • Firebase Authentication

This extension also uses the following third-party services:

You are responsible for any costs associated with your use of these services.

Note from Firebase

To install this extension, your Firebase project must be on the Blaze (pay-as-you-go) plan. You will only be charged for the resources you use. Most Firebase services offer a free tier for low-volume use. Learn more about Firebase billing.

Starting August 17 2020, you will be billed a small amount (typically less than $0.10) when you install or reconfigure this extension. See the Cloud Functions for Firebase billing FAQ for a detailed explanation.

如何安装此扩展程序

使用 Firebase 控制台

要安装和管理扩展程序,您可以使用 Firebase 控制台。

使用控制台安装

使用 Firebase CLI

要安装和管理扩展程序,您还可以使用 Firebase CLI:

步骤 1:运行以下 npm 命令来安装 CLI 或将 CLI 更新到最新版本。

npm install -g firebase-tools
不能运行?请参阅 Firebase CLI 参考文档或者更改您的 npm 权限

步骤 2:运行以下命令来安装此扩展程序

firebase ext:install stripe/firestore-stripe-payments --project=projectId_or_alias
支持
Authentication Cloud Firestore
作者
合作方
许可
Apache-2.0
版本
0.2.2