开始使用
复制一个包含安装步骤和本插件的完整 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 而不是这个插件。
支付表单流程
支付表单流程await Stripe.initialize({ publishableKey: 'pk_test_...' });
await Stripe.createPaymentSheet({ paymentIntentClientSecret: 'pi_..._secret_...', merchantDisplayName: 'My Store',});
const result = await Stripe.presentPaymentSheet();直接收费(Stripe Connect)
直接收费(Stripe Connect)通过 stripeAccount 在 initialize() 或每 createPaymentSheet() 在创建支付意向时,连接到一个账户。
示例应用
示例应用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.