开始使用
复制一个包含安装步骤和本插件完整 Markdown 指南的配置提示。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-stripe-pay`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/stripe-pay/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
安装
安装bun add @capgo/capacitor-stripe-paybunx cap sync导入
导入import { Stripe } from '@capgo/capacitor-stripe-pay';订阅和应用内购买
订阅和应用内购买对于 App Store / Play Store 订阅和权利,请使用 @capgo/native-purchases instead of this plugin.
Payment Sheet flow
Section titled “Payment Sheet flow”await Stripe.initialize({ publishableKey: 'pk_test_...' });
await Stripe.createPaymentSheet({ paymentIntentClientSecret: 'pi_..._secret_...', merchantDisplayName: 'My Store',});
const result = await Stripe.presentPaymentSheet();Direct Charges (Stripe Connect)
Section titled “Direct Charges (Stripe Connect)”Pass stripeAccount on initialize() or per createPaymentSheet() when creating PaymentIntents on a connected account.
Example app
Section titled “Example app”git clone https://github.com/Cap-go/capacitor-stripe-pay.gitcd capacitor-stripe-pay/example-appbun installbun run start真实数据来源
名为“真实数据来源”的部分本页记录了当前公共API的最新信息 Cap-go/capacitor-stripe-pay.