跳过内容

开始使用

GitHub

安装

安装
终端窗口
bun add @capgo/capacitor-stripe-pay
bunx cap sync

导入

导入
import { Stripe } from '@capgo/capacitor-stripe-pay';

订阅和应用内购买

订阅和应用内购买

对于 App Store / Play Store 订阅和权利,请使用 @capgo/native-purchases instead of this plugin.

await Stripe.initialize({ publishableKey: 'pk_test_...' });
await Stripe.createPaymentSheet({
paymentIntentClientSecret: 'pi_..._secret_...',
merchantDisplayName: 'My Store',
});
const result = await Stripe.presentPaymentSheet();

Pass stripeAccount on initialize() or per createPaymentSheet() when creating PaymentIntents on a connected account.

终端窗口
git clone https://github.com/Cap-go/capacitor-stripe-pay.git
cd capacitor-stripe-pay/example-app
bun install
bun run start

本页记录了当前公共API的最新信息 Cap-go/capacitor-stripe-pay.