payment-system

Guides Stripe Connect payment integration, webhook handling, and testing for the OrignaGTA marketplace.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/yunior123/origna_gta_firebase --skill payment-system-yunior123
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: payment-system
Source: https://github.com/yunior123/origna_gta_firebase/tree/main/.claude/skills/payment-system
Command: npx skills add https://github.com/yunior123/origna_gta_firebase --skill payment-system-yunior123

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Payment code in this repo spans Stripe Connect, Firestore transactions, webhooks, and Flutter checkout, and small mistakes (wrong source_transaction, SERVER_TIMESTAMP in arrays, hardcoded payment methods) cause real money bugs. This Skill loads the full payment architecture, known bugs, and audit checklist before any payment file is edited. ## Core Features & Use Cases - Architecture Reference: Documents the checkout flow, auto-capture vs manual capture modes, order/payment status state machines, and the complete file map across Python Cloud Functions and Flutter. - Webhook & Testing Guide: Lists all 14 handled webhook events, Stripe CLI trigger commands, test card numbers, emulator setup, and E2E Playwright suites. - Bug Prevention: Records fixed P0-P2 bugs (charge ID vs payment intent ID, Firestore sentinel crashes, decorator mismatches) plus a pre-release audit checklist. - Use Case: Before modifying capture_payment in payment_stripe.py, load this Skill to learn that confirm_order_receipt must call the undecorated _capture_payment_impl and that transfers require charge_id, not payment_intent_id. ## Quick Start Load the payment-system skill before editing any payment-related file in the OrignaGTA repo.

Frequently Asked Questions about payment-system

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test Stripe webhooks locally with the Firebase emulator?▼

Run ./start-dev.sh to start emulators plus Stripe CLI with auto-injected webhook secret, or manually run stripe listen --forward-to http://127.0.0.1:5001/orignagta/us-central1/stripe_webhook and copy the whsec_ secret into functions/.env as STRIPE_WEBHOOK_SECRET.

How do I trigger Stripe test events like checkout.session.completed?▼

Use the Stripe CLI: stripe trigger checkout.session.completed, payment_intent.succeeded, charge.refunded, charge.dispute.created, and others. You can override fixture data with --override flags, for example to set a specific metadata.orderId.

Why does Firestore fail when writing SERVER_TIMESTAMP inside an array?▼

Firestore cannot serialize the SERVER_TIMESTAMP sentinel inside array elements or ArrayUnion values, raising a conversion error. Use datetime.now(timezone.utc) for nested timestamps and reserve get_server_timestamp() for top-level fields only.

Why does Stripe reject source_transaction with a payment intent ID?▼

Stripe transfers require source_transaction to be a charge ID (ch_xxx), not a payment intent ID. Retrieve payment_intent.latest_charge after capture and pass that charge ID to stripe.Transfer.create().

What is the difference between auto-capture and manual capture in this payment flow?▼

Auto-capture collects funds at checkout, so paymentStatus is always 'captured' after checkout.session.completed. Manual capture sets capture_method: 'manual', authorizing first and capturing later via capture_payment or the auto_confirm_orders cronjob.

Why should payment_method_types not be hardcoded to card in Stripe Checkout?▼

Hardcoding payment_method_types: ['card'] blocks Apple Pay, Google Pay, and Interac, which matters for Canadian buyers. Removing it lets Stripe auto-select payment methods based on Dashboard settings.