Skip to content

feat: flatten stripe_multichain helpers to kwargs; delete 4 wrappers - #37

Merged
vvillait88 merged 1 commit into
mainfrom
feat/303e-stripe-multichain-flatten
May 14, 2026
Merged

feat: flatten stripe_multichain helpers to kwargs; delete 4 wrappers#37
vvillait88 merged 1 commit into
mainfrom
feat/303e-stripe-multichain-flatten

Conversation

@vvillait88

Copy link
Copy Markdown
Contributor

Summary

Flattens the 4 stripe_multichain builders.

Before After
create_multichain_payment_intent(CreateMultichainPaymentIntentInput(...)) create_multichain_payment_intent(*, stripe, amount, currency="usd", networks=None, metadata=None, idempotency_key=None)
create_pi_cache(PiCacheOptions(...)) create_pi_cache(*, redis_url=None, ttl_seconds=300, key_prefix="payto:")
simulate_crypto_deposit(SimulateCryptoDepositInput(...)) simulate_crypto_deposit(*, payment_intent_id, network, stripe_secret_key, ...)
simulate_deposit_if_test_mode(SimulateDepositIfTestModeInput(...)) simulate_deposit_if_test_mode(*, get_payment_intent_id, deposit_address, network, stripe_secret_key, ...)

Deleted from exports

CreateMultichainPaymentIntentInput, PiCacheOptions, SimulateCryptoDepositInput, SimulateDepositIfTestModeInput.

Kept

PiCache, MultichainPaymentIntentResult, StripeClientLike.

Coverage backfill

Added 2 small fill tests covering the optional transaction_hash / stripe_version / extra kwargs (line 51, 53, 59) and the Exception log-swallow branch in simulate_deposit_if_test_mode (lines 102-114) so coverage stays at 95%+ after the dataclass-init lines collapsed.

Test plan

  • uv run pytest tests/ — 1033 passed / 3 skipped, 95.15% coverage (up from 95.04%)
  • uv run ty check agentscore_commerce/ — clean
  • uv run ruff check . && uv run ruff format . — clean
  • uv run vulture agentscore_commerce/ --min-confidence 80 — only the known false positives remain

Flattens the 4 stripe_multichain builders:

- create_multichain_payment_intent(CreateMultichainPaymentIntentInput(...))
    → create_multichain_payment_intent(*, stripe, amount, currency="usd", networks=None, metadata=None, idempotency_key=None)
- create_pi_cache(PiCacheOptions(...))
    → create_pi_cache(*, redis_url=None, ttl_seconds=300, key_prefix="payto:")
- simulate_crypto_deposit(SimulateCryptoDepositInput(...))
    → simulate_crypto_deposit(*, payment_intent_id, network, stripe_secret_key, buyer_wallet=None, ...)
- simulate_deposit_if_test_mode(SimulateDepositIfTestModeInput(...))
    → simulate_deposit_if_test_mode(*, get_payment_intent_id, deposit_address, network, stripe_secret_key, ...)

Deleted from public exports: CreateMultichainPaymentIntentInput, PiCacheOptions,
SimulateCryptoDepositInput, SimulateDepositIfTestModeInput.

Kept (consumers pattern-match): PiCache, MultichainPaymentIntentResult,
StripeClientLike.

Tests: 1033 passed / 3 skipped, 95.15% coverage. Added 2 fill tests covering
optional kwargs (`transaction_hash` / `stripe_version` / `extra`) and the
error-swallow branch in `simulate_deposit_if_test_mode` so coverage stays
above the 95% floor after the dataclass-init lines went away.

ty + ruff clean. vulture: only known false positives (string-cast,
Protocol-method-param) remain.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vvillait88
vvillait88 merged commit 1b59b1d into main May 14, 2026
7 checks passed
@vvillait88
vvillait88 deleted the feat/303e-stripe-multichain-flatten branch May 14, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant