agentscore-commerce 2.0.0__tar.gz → 2.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/PKG-INFO +1 -1
  2. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/checkout.py +50 -0
  3. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/checkout_hooks.py +4 -0
  4. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/pyproject.toml +1 -1
  5. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_checkout.py +136 -0
  6. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_seamless_helpers.py +75 -0
  7. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/uv.lock +1 -1
  8. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  9. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  10. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  11. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/.github/dependabot.yml +0 -0
  12. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/.github/workflows/ci.yml +0 -0
  13. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/.github/workflows/publish.yml +0 -0
  14. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/.github/workflows/security.yml +0 -0
  15. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/.gitignore +0 -0
  16. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/CLAUDE.md +0 -0
  17. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/CODE_OF_CONDUCT.md +0 -0
  18. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/CONTRIBUTING.md +0 -0
  19. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/LICENSE +0 -0
  20. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/README.md +0 -0
  21. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/SECURITY.md +0 -0
  22. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/__init__.py +0 -0
  23. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/api/__init__.py +0 -0
  24. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/challenge/__init__.py +0 -0
  25. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/challenge/accepted_methods.py +0 -0
  26. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/challenge/agent_instructions.py +0 -0
  27. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/challenge/agent_memory.py +0 -0
  28. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/challenge/body.py +0 -0
  29. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/challenge/how_to_pay.py +0 -0
  30. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/challenge/identity.py +0 -0
  31. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/challenge/pricing.py +0 -0
  32. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/challenge/receipt.py +0 -0
  33. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/challenge/respond_402.py +0 -0
  34. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/challenge/validation_error.py +0 -0
  35. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/discovery/__init__.py +0 -0
  36. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/discovery/agentscore_content.py +0 -0
  37. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/discovery/bazaar.py +0 -0
  38. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/discovery/llms_txt.py +0 -0
  39. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/discovery/openapi.py +0 -0
  40. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/discovery/probe.py +0 -0
  41. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/discovery/redemption_md.py +0 -0
  42. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/discovery/robots_tag.py +0 -0
  43. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/discovery/skill_md.py +0 -0
  44. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/discovery/well_known.py +0 -0
  45. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/discovery/well_known_mpp.py +0 -0
  46. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/discovery/well_known_x402.py +0 -0
  47. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/__init__.py +0 -0
  48. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/_denial.py +0 -0
  49. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/_response.py +0 -0
  50. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/a2a.py +0 -0
  51. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/address.py +0 -0
  52. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/aiohttp.py +0 -0
  53. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/cache.py +0 -0
  54. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/core.py +0 -0
  55. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/django.py +0 -0
  56. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/fastapi.py +0 -0
  57. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/flask.py +0 -0
  58. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/middleware.py +0 -0
  59. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/policy.py +0 -0
  60. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/py.typed +0 -0
  61. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/sanic.py +0 -0
  62. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/sessions.py +0 -0
  63. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/signer.py +0 -0
  64. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/tokens.py +0 -0
  65. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/types.py +0 -0
  66. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/ucp.py +0 -0
  67. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/identity/ucp_jwks.py +0 -0
  68. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/__init__.py +0 -0
  69. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/amounts.py +0 -0
  70. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/directive.py +0 -0
  71. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/dispatch.py +0 -0
  72. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/headers.py +0 -0
  73. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/idempotency.py +0 -0
  74. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/lazy.py +0 -0
  75. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/mppx_server.py +0 -0
  76. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/networks.py +0 -0
  77. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/rail_spec.py +0 -0
  78. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/rails.py +0 -0
  79. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/settlement_override.py +0 -0
  80. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/signer.py +0 -0
  81. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/solana.py +0 -0
  82. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/usdc.py +0 -0
  83. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/wwwauthenticate.py +0 -0
  84. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/x402.py +0 -0
  85. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/x402_server.py +0 -0
  86. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/x402_settle.py +0 -0
  87. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/x402_validation.py +0 -0
  88. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/payment/zero_settle.py +0 -0
  89. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/stripe_multichain/__init__.py +0 -0
  90. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/stripe_multichain/mppx_stripe.py +0 -0
  91. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/stripe_multichain/payment_intent.py +0 -0
  92. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/stripe_multichain/pi_cache.py +0 -0
  93. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/agentscore_commerce/stripe_multichain/simulate_deposit.py +0 -0
  94. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/examples/README.md +0 -0
  95. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/examples/api_provider.py +0 -0
  96. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/examples/compliance_merchant.py +0 -0
  97. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/examples/identity_only.py +0 -0
  98. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/examples/multi_rail_merchant.py +0 -0
  99. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/examples/per_product_policy_merchant.py +0 -0
  100. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/examples/signed_ucp_merchant.py +0 -0
  101. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/examples/stripe_multichain_merchant.py +0 -0
  102. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/examples/variable_cost_merchant.py +0 -0
  103. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/lefthook.yml +0 -0
  104. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/ruff.toml +0 -0
  105. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/scripts/regenerate_cross_lang_fixtures.py +0 -0
  106. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/__init__.py +0 -0
  107. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/conftest.py +0 -0
  108. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/node-agentscore-gate-blocked.json +0 -0
  109. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/node-agentscore-gate-full.json +0 -0
  110. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/node-capability.json +0 -0
  111. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/node-emoji-keys.json +0 -0
  112. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/node-es256-rails.json +0 -0
  113. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/node-extras-int.json +0 -0
  114. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/node-int-boundary.json +0 -0
  115. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/node-minimal.json +0 -0
  116. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/node-multikey.json +0 -0
  117. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/node-unicode.json +0 -0
  118. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/py-agentscore-gate-blocked.json +0 -0
  119. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/py-agentscore-gate-full.json +0 -0
  120. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/py-capability.json +0 -0
  121. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/py-emoji-keys.json +0 -0
  122. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/py-es256-rails.json +0 -0
  123. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/py-extras-int.json +0 -0
  124. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/py-int-boundary.json +0 -0
  125. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/py-minimal.json +0 -0
  126. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/py-multikey.json +0 -0
  127. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/fixtures/cross-lang/py-unicode.json +0 -0
  128. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_a2a.py +0 -0
  129. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_address.py +0 -0
  130. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_agent_memory_emitter.py +0 -0
  131. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_aiohttp.py +0 -0
  132. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_amounts.py +0 -0
  133. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_api_reexport.py +0 -0
  134. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_cache.py +0 -0
  135. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_challenge.py +0 -0
  136. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_classify_orchestration_error.py +0 -0
  137. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_core.py +0 -0
  138. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_coverage_fillers.py +0 -0
  139. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_denial.py +0 -0
  140. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_discovery.py +0 -0
  141. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_dispatch.py +0 -0
  142. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_django.py +0 -0
  143. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_fastapi.py +0 -0
  144. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_flask.py +0 -0
  145. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_gate_quota_info.py +0 -0
  146. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_get_signer_verdict.py +0 -0
  147. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_idempotency_helper.py +0 -0
  148. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_integration.py +0 -0
  149. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_lifted_helpers.py +0 -0
  150. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_load_ucp_signing_key_from_env.py +0 -0
  151. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_middleware.py +0 -0
  152. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_payment_directive.py +0 -0
  153. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_payment_dispatch.py +0 -0
  154. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_payment_handlers.py +0 -0
  155. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_payment_headers.py +0 -0
  156. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_payment_misc.py +0 -0
  157. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_payment_servers.py +0 -0
  158. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_payment_signer.py +0 -0
  159. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_policy.py +0 -0
  160. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_pricing.py +0 -0
  161. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_public_surface.py +0 -0
  162. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_rail_spec.py +0 -0
  163. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_response.py +0 -0
  164. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_robots_tag.py +0 -0
  165. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_sanic.py +0 -0
  166. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_sessions.py +0 -0
  167. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_signer_match.py +0 -0
  168. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_skill_md.py +0 -0
  169. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_stripe_multichain.py +0 -0
  170. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_tokens.py +0 -0
  171. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_ucp.py +0 -0
  172. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_ucp_cross_lang.py +0 -0
  173. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_ucp_jwks.py +0 -0
  174. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_validation_error.py +0 -0
  175. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/tests/test_zero_settle.py +0 -0
  176. {agentscore_commerce-2.0.0 → agentscore_commerce-2.0.1}/vulture_whitelist.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentscore-commerce
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: Agent 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 agent commerce.
5
5
  Project-URL: Homepage, https://agentscore.sh
6
6
  Project-URL: Repository, https://github.com/agentscore/python-commerce
@@ -450,6 +450,9 @@ class SettleOutcome:
450
450
  """``"evm"`` / ``"solana"`` for chain signers; ``None`` otherwise."""
451
451
  payment_response_header: str | None = None
452
452
  """The ``PAYMENT-RESPONSE`` header to echo (x402 success path). ``None`` for MPP."""
453
+ payment_receipt_header: str | None = None
454
+ """The ``Payment-Receipt`` header to echo (MPP success path, paymentauth.org §5).
455
+ ``None`` for x402 and for the MPP zero-settle carve-out (no receipt minted)."""
453
456
  raw: Any = None
454
457
  """The underlying settle result. Inspect for power-user fields (facilitator
455
458
  diagnostics, raw receipt blobs); prefer the normalized fields above for the
@@ -490,6 +493,11 @@ class MppxComposeOutcome:
490
493
  """For ``status=200``: ``"evm"`` / ``"solana"`` depending on the rail."""
491
494
  payment_response_header: str | None = None
492
495
  """For ``status=200``: optional PAYMENT-RESPONSE header echoed to the agent."""
496
+ payment_receipt_header: str | None = None
497
+ """For ``status=200``: serialized ``Payment-Receipt`` header (base64url-encoded
498
+ receipt struct per pympp's ``Receipt.to_payment_receipt``). Echoed to the agent
499
+ so spec-strict MPP clients (tempo CLI, etc.) can lift tx_hash + source from
500
+ headers without parsing the JSON body."""
493
501
  raw: Any = None
494
502
  """The underlying pympp compose result for ``on_settled`` introspection."""
495
503
 
@@ -540,6 +548,41 @@ async def _maybe_await(value: Any) -> Any:
540
548
  return value
541
549
 
542
550
 
551
+ def _extract_mppx_receipt_header_from_raw(raw: Any) -> str | None:
552
+ """Best-effort ``Payment-Receipt`` extraction from a custom hook's ``raw``.
553
+
554
+ Handles the three shapes hand-rolled hooks commonly return on a 200:
555
+
556
+ * The raw object itself exposes ``to_payment_receipt()`` (pympp Receipt
557
+ handed back directly).
558
+ * ``raw`` is a tuple ``(credential, receipt)`` (the pympp ``Mpp.charge``
559
+ return shape, unpacked but not re-wrapped).
560
+ * ``raw`` is a dict with ``receipt`` key, or an object with ``.receipt``
561
+ attribute (the auto-built hook's ``{"credential", "receipt"}`` dict).
562
+
563
+ Returns ``None`` when none of the shapes match, or the receipt's
564
+ ``to_payment_receipt`` raises: the response then omits the header rather
565
+ than emitting a malformed value.
566
+ """
567
+ candidates: list[Any] = [raw]
568
+ if isinstance(raw, tuple | list) and len(raw) >= 2:
569
+ candidates.append(raw[1])
570
+ if isinstance(raw, dict) and "receipt" in raw:
571
+ candidates.append(raw["receipt"])
572
+ if hasattr(raw, "receipt"):
573
+ candidates.append(raw.receipt)
574
+ for candidate in candidates:
575
+ to_header = getattr(candidate, "to_payment_receipt", None)
576
+ if callable(to_header):
577
+ try:
578
+ value = to_header()
579
+ except Exception: # noqa: S112
580
+ continue
581
+ if isinstance(value, str) and value:
582
+ return value
583
+ return None
584
+
585
+
543
586
  def _resolve_identity_metadata(ctx: CheckoutContext) -> dict[str, Any] | None:
544
587
  """Compose the identity_metadata block from request + assess state.
545
588
 
@@ -1574,6 +1617,7 @@ class Checkout:
1574
1617
  signer_address=carve.signer_address,
1575
1618
  signer_network="evm" if carve.signer_address else None,
1576
1619
  payment_response_header=None,
1620
+ payment_receipt_header=None,
1577
1621
  raw=verified,
1578
1622
  )
1579
1623
  return await self._build_success(ctx, outcome)
@@ -1589,6 +1633,7 @@ class Checkout:
1589
1633
  signer_address=carve.signer_address,
1590
1634
  signer_network="evm" if carve.signer_address else None,
1591
1635
  payment_response_header=None,
1636
+ payment_receipt_header=None,
1592
1637
  raw=None,
1593
1638
  )
1594
1639
  return await self._build_success(ctx, outcome)
@@ -1705,6 +1750,7 @@ class Checkout:
1705
1750
  signer_address=x402_signer.address if x402_signer else None,
1706
1751
  signer_network=x402_signer.network if x402_signer else None,
1707
1752
  payment_response_header=settle.payment_response_header,
1753
+ payment_receipt_header=None,
1708
1754
  raw=settle,
1709
1755
  )
1710
1756
  return await self._build_success(ctx, outcome)
@@ -1722,6 +1768,8 @@ class Checkout:
1722
1768
  signer_address=composed.signer_address,
1723
1769
  signer_network=composed.signer_network,
1724
1770
  payment_response_header=composed.payment_response_header,
1771
+ payment_receipt_header=composed.payment_receipt_header
1772
+ or _extract_mppx_receipt_header_from_raw(composed.raw),
1725
1773
  raw=composed.raw,
1726
1774
  )
1727
1775
  return await self._build_success(ctx, outcome)
@@ -1862,6 +1910,8 @@ class Checkout:
1862
1910
  headers: dict[str, str] = {}
1863
1911
  if outcome.payment_response_header:
1864
1912
  headers["payment-response"] = outcome.payment_response_header
1913
+ if outcome.payment_receipt_header:
1914
+ headers["payment-receipt"] = outcome.payment_receipt_header
1865
1915
  return CheckoutResult(
1866
1916
  status=200,
1867
1917
  body=body,
@@ -93,11 +93,15 @@ def make_mppx_compose_hook(
93
93
  signer_address = signer.address
94
94
  signer_network = signer.network
95
95
 
96
+ to_header = getattr(receipt, "to_payment_receipt", None)
97
+ payment_receipt_header = to_header() if callable(to_header) else None
98
+
96
99
  return MppxComposeOutcome(
97
100
  status=200,
98
101
  tx_hash=tx_hash,
99
102
  signer_address=signer_address,
100
103
  signer_network=signer_network,
104
+ payment_receipt_header=payment_receipt_header,
101
105
  raw={"credential": credential, "receipt": receipt},
102
106
  )
103
107
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "agentscore-commerce"
7
- version = "2.0.0"
7
+ version = "2.0.1"
8
8
  description = "Agent 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 agent commerce."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -300,6 +300,142 @@ async def test_compose_mppx_returns_200_runs_on_settled() -> None:
300
300
  on_settled.assert_awaited_once()
301
301
 
302
302
 
303
+ @pytest.mark.asyncio
304
+ async def test_compose_mppx_payment_receipt_header_surfaces_on_response() -> None:
305
+ """When ``compose_mppx`` populates ``payment_receipt_header``, Checkout echoes
306
+ it as a ``payment-receipt`` HTTP header on the success response — symmetric
307
+ to the existing ``payment_response_header`` (x402) behavior."""
308
+ receipt_header = "eyJzdGF0dXMiOiJzdWNjZXNzIn0"
309
+ compose_mppx = AsyncMock(
310
+ return_value=MppxComposeOutcome(status=200, payment_receipt_header=receipt_header),
311
+ )
312
+ checkout = Checkout(
313
+ rails={"tempo": TempoRailSpec(recipient="0xtempo")},
314
+ url="https://api.example/purchase",
315
+ compute_pricing=lambda _ctx: PricingResult(amount_usd=10.0),
316
+ compose_mppx=compose_mppx,
317
+ )
318
+ result = await checkout.handle(_req(headers={"authorization": "Payment id=abc"}))
319
+ assert result.status == 200
320
+ assert result.headers["payment-receipt"] == receipt_header
321
+
322
+
323
+ @pytest.mark.asyncio
324
+ async def test_compose_mppx_omitted_payment_receipt_header_emits_no_header() -> None:
325
+ """Default ``payment_receipt_header=None`` on the compose outcome must NOT
326
+ emit an empty ``payment-receipt`` header on the response."""
327
+ compose_mppx = AsyncMock(return_value=MppxComposeOutcome(status=200))
328
+ checkout = Checkout(
329
+ rails={"tempo": TempoRailSpec(recipient="0xtempo")},
330
+ url="https://api.example/purchase",
331
+ compute_pricing=lambda _ctx: PricingResult(amount_usd=10.0),
332
+ compose_mppx=compose_mppx,
333
+ )
334
+ result = await checkout.handle(_req(headers={"authorization": "Payment id=abc"}))
335
+ assert result.status == 200
336
+ assert "payment-receipt" not in result.headers
337
+
338
+
339
+ @pytest.mark.asyncio
340
+ async def test_compose_mppx_auto_extracts_receipt_header_from_raw_dict() -> None:
341
+ """When a custom compose_mppx returns ``raw={'credential': c, 'receipt': r}``
342
+ (the auto-built hook's shape) without explicitly setting
343
+ ``payment_receipt_header``, Checkout lifts the header from ``r.to_payment_receipt()``."""
344
+
345
+ class _Receipt:
346
+ @staticmethod
347
+ def to_payment_receipt() -> str:
348
+ return "auto-from-raw-dict"
349
+
350
+ compose_mppx = AsyncMock(
351
+ return_value=MppxComposeOutcome(status=200, raw={"credential": object(), "receipt": _Receipt()}),
352
+ )
353
+ checkout = Checkout(
354
+ rails={"tempo": TempoRailSpec(recipient="0xtempo")},
355
+ url="https://api.example/purchase",
356
+ compute_pricing=lambda _ctx: PricingResult(amount_usd=10.0),
357
+ compose_mppx=compose_mppx,
358
+ )
359
+ result = await checkout.handle(_req(headers={"authorization": "Payment id=abc"}))
360
+ assert result.status == 200
361
+ assert result.headers["payment-receipt"] == "auto-from-raw-dict"
362
+
363
+
364
+ @pytest.mark.asyncio
365
+ async def test_compose_mppx_auto_extracts_receipt_header_from_raw_tuple() -> None:
366
+ """``raw=(credential, receipt)`` (the pympp Mpp.charge return) is also a
367
+ recognized shape — the second element's ``to_payment_receipt()`` is lifted."""
368
+
369
+ class _Receipt:
370
+ @staticmethod
371
+ def to_payment_receipt() -> str:
372
+ return "auto-from-raw-tuple"
373
+
374
+ compose_mppx = AsyncMock(
375
+ return_value=MppxComposeOutcome(status=200, raw=(object(), _Receipt())),
376
+ )
377
+ checkout = Checkout(
378
+ rails={"tempo": TempoRailSpec(recipient="0xtempo")},
379
+ url="https://api.example/purchase",
380
+ compute_pricing=lambda _ctx: PricingResult(amount_usd=10.0),
381
+ compose_mppx=compose_mppx,
382
+ )
383
+ result = await checkout.handle(_req(headers={"authorization": "Payment id=abc"}))
384
+ assert result.status == 200
385
+ assert result.headers["payment-receipt"] == "auto-from-raw-tuple"
386
+
387
+
388
+ @pytest.mark.asyncio
389
+ async def test_compose_mppx_explicit_payment_receipt_header_wins_over_raw() -> None:
390
+ """When the hook sets ``payment_receipt_header`` explicitly, the auto-extract
391
+ from ``raw`` is NOT consulted."""
392
+
393
+ class _Receipt:
394
+ @staticmethod
395
+ def to_payment_receipt() -> str:
396
+ return "auto-IGNORED"
397
+
398
+ compose_mppx = AsyncMock(
399
+ return_value=MppxComposeOutcome(
400
+ status=200,
401
+ payment_receipt_header="explicit-value",
402
+ raw={"receipt": _Receipt()},
403
+ ),
404
+ )
405
+ checkout = Checkout(
406
+ rails={"tempo": TempoRailSpec(recipient="0xtempo")},
407
+ url="https://api.example/purchase",
408
+ compute_pricing=lambda _ctx: PricingResult(amount_usd=10.0),
409
+ compose_mppx=compose_mppx,
410
+ )
411
+ result = await checkout.handle(_req(headers={"authorization": "Payment id=abc"}))
412
+ assert result.status == 200
413
+ assert result.headers["payment-receipt"] == "explicit-value"
414
+
415
+
416
+ @pytest.mark.asyncio
417
+ async def test_compose_mppx_receipt_to_header_that_throws_falls_through() -> None:
418
+ """If ``to_payment_receipt()`` raises (unsupported pympp version, malformed
419
+ receipt), the SDK omits the header rather than emitting a malformed value."""
420
+
421
+ class _BadReceipt:
422
+ def to_payment_receipt(self) -> str:
423
+ raise RuntimeError("malformed receipt")
424
+
425
+ compose_mppx = AsyncMock(
426
+ return_value=MppxComposeOutcome(status=200, raw={"receipt": _BadReceipt()}),
427
+ )
428
+ checkout = Checkout(
429
+ rails={"tempo": TempoRailSpec(recipient="0xtempo")},
430
+ url="https://api.example/purchase",
431
+ compute_pricing=lambda _ctx: PricingResult(amount_usd=10.0),
432
+ compose_mppx=compose_mppx,
433
+ )
434
+ result = await checkout.handle(_req(headers={"authorization": "Payment id=abc"}))
435
+ assert result.status == 200
436
+ assert "payment-receipt" not in result.headers
437
+
438
+
303
439
  @pytest.mark.asyncio
304
440
  async def test_compose_mppx_returns_402_on_settle_leg_rejects_credential() -> None:
305
441
  """When the agent sends Authorization: Payment and mppx returns 402 (credential
@@ -274,6 +274,81 @@ async def test_make_mppx_compose_hook_lifts_signer_from_did_pkh_eip155() -> None
274
274
  assert out.signer_network == "evm"
275
275
 
276
276
 
277
+ @pytest.mark.asyncio
278
+ async def test_make_mppx_compose_hook_serializes_receipt_to_payment_receipt_header() -> None:
279
+ """When the pympp ``Receipt`` exposes ``to_payment_receipt()``, the compose
280
+ hook lifts the serialized header onto ``MppxComposeOutcome.payment_receipt_header``
281
+ so Checkout can echo it as the response's ``Payment-Receipt`` header."""
282
+
283
+ class _Credential:
284
+ source = "did:pkh:eip155:8453:0xABCD000000000000000000000000000000000003"
285
+
286
+ class _Receipt:
287
+ reference = "0xtx_hash"
288
+ transaction = None
289
+
290
+ @staticmethod
291
+ def to_payment_receipt() -> str:
292
+ return "eyJzdGF0dXMiOiJzdWNjZXNzIn0"
293
+
294
+ class _Mpp:
295
+ realm = "r"
296
+
297
+ async def charge(self, *, authorization: str | None, amount: str) -> tuple:
298
+ return (_Credential(), _Receipt())
299
+
300
+ async def _getter() -> _Mpp:
301
+ return _Mpp()
302
+
303
+ hook = make_mppx_compose_hook(server_getter=_getter)
304
+
305
+ class _Pricing:
306
+ amount_usd = 0.1
307
+
308
+ class _Ctx:
309
+ request = _req({"authorization": "Payment somevalidcred"})
310
+ pricing = _Pricing()
311
+
312
+ out = await hook(_Ctx())
313
+ assert out.status == 200
314
+ assert out.payment_receipt_header == "eyJzdGF0dXMiOiJzdWNjZXNzIn0"
315
+
316
+
317
+ @pytest.mark.asyncio
318
+ async def test_make_mppx_compose_hook_omits_receipt_header_when_unavailable() -> None:
319
+ """Older pympp Receipts without ``to_payment_receipt()`` leave the header
320
+ field None rather than raising or fabricating."""
321
+
322
+ class _Credential:
323
+ source = "did:pkh:eip155:8453:0xABCD000000000000000000000000000000000003"
324
+
325
+ class _Receipt:
326
+ reference = "0xtx_hash"
327
+ transaction = None
328
+
329
+ class _Mpp:
330
+ realm = "r"
331
+
332
+ async def charge(self, *, authorization: str | None, amount: str) -> tuple:
333
+ return (_Credential(), _Receipt())
334
+
335
+ async def _getter() -> _Mpp:
336
+ return _Mpp()
337
+
338
+ hook = make_mppx_compose_hook(server_getter=_getter)
339
+
340
+ class _Pricing:
341
+ amount_usd = 0.1
342
+
343
+ class _Ctx:
344
+ request = _req({"authorization": "Payment somevalidcred"})
345
+ pricing = _Pricing()
346
+
347
+ out = await hook(_Ctx())
348
+ assert out.status == 200
349
+ assert out.payment_receipt_header is None
350
+
351
+
277
352
  @pytest.mark.asyncio
278
353
  async def test_make_mppx_compose_hook_returns_402_when_charge_raises() -> None:
279
354
  class _Mpp:
@@ -10,7 +10,7 @@ resolution-markers = [
10
10
 
11
11
  [[package]]
12
12
  name = "agentscore-commerce"
13
- version = "2.0.0"
13
+ version = "2.0.1"
14
14
  source = { editable = "." }
15
15
  dependencies = [
16
16
  { name = "agentscore-py" },