Saltar al contenido

Primeros pasos

GitHub
Ventana de terminal
bun add @capgo/capacitor-stripe-pay
bunx cap sync
import { Stripe } from '@capgo/capacitor-stripe-pay';
import { Stripe } from '@capgo/capacitor-stripe-pay';
await Stripe.initialize({ publishableKey: 'publishable-key-123' });
import { Stripe } from '@capgo/capacitor-stripe-pay';
await Stripe.handleURLCallback({ url: 'https://example.com' });
  • Inicializa una vez: ejecuta setup durante el bootstrap de la app.
  • Sync nativo: ejecuta bunx cap sync tras actualizar los plugins.
  • Fuente de verdad: confianza src/definitions.ts en el repo de GitHub.

Para suscripciones y derechos de App Store / Play Store, usa @capgo/native-purchases en lugar de este plugin.

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

Pasa stripeAccount en initialize() o por createPaymentSheet() al crear PaymentIntents en una cuenta conectada.

Ventana de terminal
git clone https://github.com/Cap-go/capacitor-stripe-pay.git
cd capacitor-stripe-pay/example-app
bun install
bun run start

Esta página documenta la API pública actual de Cap-go/capacitor-stripe-pay.