Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions agentscore_commerce/stripe_multichain/mppx_stripe.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
"""Stripe SPT method wrapper for ``pympp`` server merchants.

Wraps the ``mpp.methods.stripe.charge(...)`` boilerplate so vendors only declare config,
not method instantiation. Returns the value vendors pass into ``Mppx.create(methods=[...])``.
not method instantiation. Returns the value vendors pass into ``Mpp.create(method=...)``.

``Mpp.create`` takes ONE method per server, so a merchant accepting Stripe SPT alongside
another rail builds a separate ``Mpp`` per method rather than passing a list. This mirrors
what ``create_mppx_server`` does.

Example::

from mpp.server import Mppx
from mpp.methods.tempo import charge as tempo_charge
from mpp.server import Mpp
from agentscore_commerce.stripe_multichain import create_mppx_stripe

stripe_method = await create_mppx_stripe(
profile_id=os.environ["STRIPE_PROFILE_ID"],
secret_key=os.environ["STRIPE_SECRET_KEY"],
)

mpp = Mppx.create(
methods=[tempo_charge(currency=USDC_TEMPO, recipient=...), stripe_method],
stripe_server = Mpp.create(
method=stripe_method,
secret_key=os.environ["MPP_SECRET_KEY"],
)

Expand All @@ -36,7 +39,7 @@ async def create_mppx_stripe(
secret_key: str,
payment_method_types: list[str] | None = None,
) -> Any:
"""Build the Stripe SPT method instance for ``Mppx.create(methods=[...])``.
"""Build the Stripe SPT method instance for ``Mpp.create(method=...)``.

Args:
profile_id: Stripe profile_id / network_id advertised in your ``stripe/charge``
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "agentscore-commerce"
version = "2.5.16"
version = "2.5.17"
description = "Agentic commerce SDK for Python: identity middleware (FastAPI, Flask, Django, AIOHTTP, Sanic, ASGI) + payment helpers + 402 builders + discovery + Stripe multichain. The full merchant-side toolkit for AgentScore-powered agentic commerce."
readme = "README.md"
license = "MIT"
Expand Down
Loading