* feat: scaffold Stripe payment method support
Adds the initial implementation for Stripe charge method (TOOLS-322):
- src/protocol/methods/stripe/ — types (StripeChargeRequest,
StripeCredentialPayload) and server-side ChargeMethod that verifies
payments by creating a Stripe PaymentIntent with an SPT
- src/client/stripe/ — StripeProvider implementing PaymentProvider
with a user-provided createToken callback
- src/server/ — StripeBuilder, StripeConfig, stripe() builder fn,
Mpp::create_stripe(), Mpp::stripe_charge()
- tests/integration_stripe.rs — e2e tests against a mock Stripe API
(full 402 flow, challenge format, requires_action rejection)
- Cargo.toml — stripe and integration-stripe feature flags
Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com>
* chore: add changelog
* feat: complete Stripe method implementation
- Add spec-required methodDetails (networkId, paymentMethodTypes) to challenges
- Add StripeChargeOptions (description, external_id, expires, metadata)
- Add ChargeChallenger impl so MppCharge extractor works with Stripe
- Parse Stripe error response bodies for better error messages
- Add Stripe unit and integration tests
Amp-Thread-ID: https://ampcode.com/threads/T-019d1969-811c-7725-aaa6-1e0116d5652c
Co-authored-by: Amp <amp@ampcode.com>
* Run stripe integration tests in CI
* docs: add Stripe examples to README
Amp-Thread-ID: https://ampcode.com/threads/T-019d1969-811c-7725-aaa6-1e0116d5652c
Co-authored-by: Amp <amp@ampcode.com>
* fix: align Stripe method with mppx TS SDK wire format
- Replace StripeChargeRequest with StripeMethodDetails (correct wire
shape: networkId/paymentMethodTypes/metadata nested under methodDetails)
- stripe_charge() now emits methodDetails with networkId and
paymentMethodTypes from config (fixes challenge schema bug)
- Add stripe_charge_with_options() + StripeChargeOptions
- Server verify() propagates metadata: analytics keys (mpp_version,
mpp_is_mpp, mpp_intent, mpp_challenge_id, mpp_server_id,
mpp_client_id) + user metadata from methodDetails
- Callback returns CreateTokenResult { spt, external_id } instead of
plain String (per-payment externalId support)
- Provider extracts metadata from methodDetails.metadata and passes
challenge JSON to callback
- Remove CreateTokenFn trait alias; use plain generic F: Fn(...)
- Provider reads networkId from methodDetails (not top-level)
Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com>
* fix: clippy lints and update README examples
Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com>
* refactor: deduplicate INTENT_CHARGE/INTENT_SESSION constants into protocol::intents
Amp-Thread-ID: https://ampcode.com/threads/T-019d1969-811c-7725-aaa6-1e0116d5652c
Co-authored-by: Amp <amp@ampcode.com>
* refactor: use typed serde structs and ResultExt across Stripe code
Amp-Thread-ID: https://ampcode.com/threads/T-019d1969-811c-7725-aaa6-1e0116d5652c
Co-authored-by: Amp <amp@ampcode.com>
* feat: add live Stripe integration tests + CI support
- tests/integration_stripe_live.rs: tests against real Stripe test-mode
API using test_helpers/shared_payment/granted_tokens endpoint.
Skipped when STRIPE_SECRET_KEY is not set.
- CI runs live tests only when STRIPE_SECRET_KEY secret exists
- Tests: happy path (real SPT + PaymentIntent), invalid SPT rejection,
expired challenge rejection
Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com>
* fix: live Stripe test fallback for seller_details + suppress dead_code warning
- create_test_spt now retries without seller_details when Stripe
returns 'Received unknown parameter' (matches mppx fallback)
- Suppress dead_code warning on ResultExt trait
Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com>
* refactor: merge live Stripe tests into integration_stripe, runtime-gated
Remove integration-stripe-live feature flag. Live tests now live in
integration_stripe.rs and skip at runtime when STRIPE_SECRET_KEY is
not set (matching mppx pattern). CI passes STRIPE_SECRET_KEY as env
var to the test step.
Revert #[allow(dead_code)] on ResultExt — pre-existing, not ours.
Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com>
* refactor: extract server tempo/stripe config into submodules
Amp-Thread-ID: https://ampcode.com/threads/T-019d1f49-ad9f-74a8-9268-37d860491bb8
Co-authored-by: Amp <amp@ampcode.com>
* docs: add Stripe example (server + client) (#147)
* docs: add Stripe example (server + client)
Pay-per-fortune example demonstrating the full SPT flow:
- Axum server with /api/create-spt proxy and /api/fortune gated endpoint
- Headless CLI client using pm_card_visa test card
- Mirrors the pympp examples/stripe/ structure
Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d20a8-7850-76dc-a346-432e5d2f4f5f
* chore: add changelog
---------
Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* fix: remove emoji from stripe example to pass no-emojis lint
Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com>
---------
Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: grandizzy <grandizzy.the.egg@gmail.com>
Co-authored-by: Amp <amp@ampcode.com>
Follow-up to PR #145 per @brendanjryan's review — adds a working example showing client/server Stripe SPT usage, mirroring pympp's stripe example.
Changes
examples/stripe/src/server.rs— Axum server with/api/create-sptSPT proxy +/api/fortunepaid endpoint ($1.00)examples/stripe/src/client.rs— headless CLI client usingpm_card_visatest card +send_with_payment()examples/stripe/README.md— setup instructions + flow diagramexamples/README.md— add Stripe entry to examples tableCo-Authored-By: grandizzy 38490174+grandizzy@users.noreply.github.com
Prompted by: georgen