Langsung ke konten

Panduan Memulai

GitHub
Jendela 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' });
  • Inisialisasi sekali saja: jalankan setup saat bootstrap aplikasi.
  • Sinkronisasi native: jalankan bunx cap sync setelah upgrade plugin.
  • Sumber kebenaran: percaya src/definitions.ts pada repo GitHub.

Untuk langganan dan hak akses App Store / Play Store, gunakan @capgo/native-purchases alih-alih plugin ini.

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

Teruskan stripeAccount on initialize() atau per createPaymentSheet() saat membuat PaymentIntents pada akun yang terhubung.

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

Halaman ini mendokumentasikan API publik saat ini dari Capgo/capacitor-stripe-pay.