Files
summercms/.planning/phases/18-payment-gateway/COVERAGE.md

5.5 KiB

API Coverage — Stripe (stripe-go v87), NBP exchange rates, Fixer exchange rates

Full coverage by default. Opt-outs are explicit, reasoned decisions. Written at plan time for Phase 18 (plans 18-02, 18-05, 18-06); the seal-time gate validates this file.

Stripe (github.com/stripe/stripe-go/v87, operator golem15.pgstripe::lang.operators.stripe)

capability decision reason
checkout_sessions.create INTEGRATE mode payment, one line item, success/cancel URL, client_reference_id, metadata on session and payment intent
checkout_sessions.retrieve INTEGRATE browser-return re-check and refund lookup (18-05 Task 2)
payment_intents.create (amount, currency, metadata, payment_method + confirm) INTEGRATE
payment_intents.retrieve INTEGRATE browser-return re-check (18-05 Task 2)
refunds.create (payment_intent) INTEGRATE
webhook signature verification (webhook.ValidatePayload) INTEGRATE signature-only, API-version independent (RESEARCH F-4); GenerateTestSignedPayload in tests
webhook event checkout.session.completed INTEGRATE
webhook event checkout.session.async_payment_succeeded INTEGRATE
webhook event checkout.session.async_payment_failed INTEGRATE
webhook event payment_intent.succeeded INTEGRATE
webhook event payment_intent.payment_failed INTEGRATE logged only (18-08): sent on every declined attempt the customer may retry, so the payment stays Sent; PHP never rejected from a notification
webhook event checkout.session.expired OPT-OUT not needed: the payment stays Sent and pg:cancel-sent-payments cancels it after the timeout, as PHP did (re-decided in 18-08)
webhook event payment_intent.canceled OPT-OUT not needed: same as checkout.session.expired; the payment stays Sent until pg:cancel-sent-payments (decided in 18-08)
webhook event charge.refunded / charge.dispute.* OPT-OUT not needed yet: refunds are initiated by the plugin (refunds.create); disputes have no PHP counterpart; tracked for a follow-up phase
webhook event construction (webhook.ConstructEvent, full typed event) OPT-OUT explicitly out of scope: rejects events from other API release trains (RESEARCH F-4); replaced by minimal local decode
checkout_sessions.expire / list / line_items OPT-OUT not needed: sessions are single-use and never enumerated
payment_intents.confirm / capture / cancel OPT-OUT not needed: confirmation happens on the client (Stripe.js in the host app) or server-side at create with confirm; manual capture is not a PHP feature
payment_methods.* OPT-OUT not needed: card data never touches the server; the host app's Stripe.js handles the payment method
customers.* OPT-OUT explicitly out of scope: Phase 18.1 (subscriptions) introduces customers (D-01)
subscriptions., prices., products., invoices. OPT-OUT explicitly out of scope: Phase 18.1 (D-01)
billing_portal.sessions.* OPT-OUT explicitly out of scope: Phase 18.1 (D-01)
webhook_endpoints.* (management API) OPT-OUT not needed: endpoints are created in the dashboard per application; documented in the pgstripe README
charges.* OPT-OUT not needed: PaymentIntents replace direct charges; charge_id is only stored from events
balance / payouts / transfers / connect accounts OPT-OUT not needed: StripeConnect is another application's own operator (RESEARCH Pattern 4 note), not this plugin
setup_intents.* OPT-OUT explicitly out of scope: Phase 18.1
tax rates / automatic tax OPT-OUT not needed: VAT is computed from the cart's integer tax rates; one aggregated line item is sent (RESEARCH Pattern 6)
test clocks / events.list (polling) OPT-OUT not needed: events arrive by webhook; tests use GenerateTestSignedPayload

NBP (Narodowy Bank Polski exchange rates, pg:update-currencies with exchange_rate_provider = nbp)

capability decision reason
exchangerates/tables/A (current table, JSON) INTEGRATE mid, table number and effective date stored on golem15_paymentgateway_currencies
exchangerates/tables/A/{date} and date ranges OPT-OUT not needed: PHP fetched only the current table; historical rates have no consumer
exchangerates/tables/B and C OPT-OUT not needed: table B lists currencies no consumer trades; table C (bid/ask) was never used by PHP
exchangerates/rates/{table}/{code} (single currency) OPT-OUT not needed: the whole table is fetched once per run and filtered locally
cenyzlota (gold prices) OPT-OUT not needed

Fixer (exchange_rate_provider = fixer, access key golem15.paymentgateway.fixer_access_key)

capability decision reason
latest (base currency, symbols) INTEGRATE
historical/{date}, timeseries, fluctuation OPT-OUT not needed: PHP used latest only; no historical consumer
convert OPT-OUT not needed: conversion is done locally with exact integer math on the stored ratio (D-09)
symbols OPT-OUT not needed: the ISO table is embedded in the plugin (currency/iso.go)

Not external APIs (recorded so the detector's signals are accounted for)

  • The /_paymentgateway/api/v1 customer API and the _paymentgateway/{operator}/{mode?}/{result?} notification route are APIs this phase publishes, not consumes; their coverage is the must_haves of plans 18-02 and 18-06.
  • Yahoo currency exchange (PHP support/YahooCurrencyExchange.php) is not ported: it is not selectable in settings (RESEARCH Deprecated).