swarmauri_billing_authorize_net
Overview
Summary
swarmauri_billing_authorize_net provides an Authorize.Net JSON API backed billing provider for Swarmauri payment workflows. It connects Swarmauri billing interfaces to Authorize.Net transaction creation, prior-auth capture, voids, refunds, customer profiles, transaction details, webhook parsing, and HMAC-SHA512 webhook validation.
Why This Package
swarmauri_billing_authorize_net gives billing integrators an Authorize.Net payment provider behind Swarmauri billing interfaces. Applications can authorize, capture, void, refund, create customer profiles, and validate webhook notifications without hard-coding Authorize.Net request payloads throughout the codebase.
When to Use
Choose swarmauri_billing_authorize_net when your integration needs authorize.Net JSON API backed Swarmauri billing provider for transactions, captures, voids, refunds, customer profiles, and webhook validation. Match the imports below to your application boundary and install its declared dependencies before using the example.
Features
- Authorize.Net provider class registered as
AuthorizeNetBillingProvider.
- JSON API transaction creation for
authCaptureTransaction and authOnlyTransaction.
- Prior authorization capture and void transaction support.
- Refund transaction creation and transaction detail lookup.
- Customer profile creation and retrieval.
- HMAC-SHA512 webhook signature validation using
X-ANET-Signature.
- Webhook JSON event parsing.
- Uses Swarmauri billing specs and refs from
swarmauri_base.billing.
- Advertises an explicit subset of
swarmauri_core.billing.Capability.
- Python 3.10, 3.11, 3.12, 3.13, and 3.14 support.
Non-Goals
swarmauri_billing_authorize_net owns authorize.Net JSON API backed Swarmauri billing provider for transactions, captures, voids, refunds, customer profiles, and webhook validation. Its imports do not by themselves configure credentials, deploy a service, or certify the behavior of its consumers. Dependencies and neighboring packages retain their own documented responsibilities.
Getting Started
Prerequisites
Python >=3.10,<3.15 is required. The manifest declares runtime dependencies including swarmauri-core, swarmauri-base, httpx. Read the example’s inputs and service requirements before execution.
Installation
Install with uv:
uv add swarmauri_billing_authorize_net
Install with pip:
pip install swarmauri_billing_authorize_net
uv
uv add swarmauri_billing_authorize_net
pip
python -m pip install swarmauri_billing_authorize_net
Poetry
poetry add swarmauri_billing_authorize_net
Quick Start
Example
Source: docs/readme/quick_start.py.
from swarmauri_billing_authorize_net import AuthorizeNetBillingProvider
from swarmauri_base.billing import PaymentIntentRequest, RefundRequest
provider = AuthorizeNetBillingProvider(
api_key="authorize-net-transaction-key",
login_id="authorize-net-login-id",
)
payment = provider.create_payment_intent(
PaymentIntentRequest(
amount_minor=4200,
currency="USD",
confirm=True,
metadata={
"opaque_data": {
"dataDescriptor": "COMMON.ACCEPT.INAPP.PAYMENT",
"dataValue": "opaque-payment-token",
}
},
)
)
refund = provider.create_refund(
payment,
RefundRequest(amount_minor=4200),
idempotency_key="refund-anet-1",
)
print(payment.status, refund["id"])
Expected Result
The example demonstrates the documented swarmauri_billing_authorize_net source boundary or workflow. Complete its required configuration first. README CI checks the maintained source’s syntax and declarations; it does not claim that external services or the application workflow were exercised.
Usage
Common Workflows
Source: docs/readme/usage.py.
from swarmauri_billing_authorize_net import AuthorizeNetBillingProvider
from swarmauri_base.billing import PaymentIntentRequest, RefundRequest
provider = AuthorizeNetBillingProvider(
api_key="authorize-net-transaction-key",
login_id="authorize-net-login-id",
)
payment = provider.create_payment_intent(
PaymentIntentRequest(
amount_minor=4200,
currency="USD",
confirm=True,
metadata={
"opaque_data": {
"dataDescriptor": "COMMON.ACCEPT.INAPP.PAYMENT",
"dataValue": "opaque-payment-token",
}
},
)
)
refund = provider.create_refund(
payment,
RefundRequest(amount_minor=4200),
idempotency_key="refund-anet-1",
)
print(payment.status, refund["id"])
Create and refund an Authorize.Net-style payment:
List payment methods for a customer reference:
from swarmauri_base.billing import CustomerSpec, PaymentMethodSpec
from swarmauri_billing_authorize_net import AuthorizeNetBillingProvider
provider = AuthorizeNetBillingProvider(
api_key="authorize-net-transaction-key",
login_id="authorize-net-login-id",
)
customer = provider.create_customer(
CustomerSpec(payload={"email": "buyer@example.com"}),
idempotency_key="customer-anet-1",
)
payment_method = provider.create_payment_method(
PaymentMethodSpec(payload={"type": "credit_card"}),
idempotency_key="pm-anet-1",
)
provider.attach_payment_method_to_customer(customer, payment_method)
methods = provider.list_payment_methods(customer, type="credit_card")
print(customer.id, len(methods))
Configuration
Configure swarmauri_billing_authorize_net through the APIs in package source; its manifest describes installation requirements, not an implicit service configuration. No additional package-global configuration contract is inferred from dependencies.
Error Handling
The inspected swarmauri_billing_authorize_net source raises RuntimeError, ValueError. Handle these at the calling boundary and consult the implementation for the triggering conditions.
Best Practices
Use the explicit swarmauri_billing_authorize_net imports documented below and keep collaborator configuration with the caller. Run the package’s relevant tests after changing AuthorizeNetBillingProvider; an import or successful installation alone does not establish its runtime guarantees.
Package Boundary
What It Owns
swarmauri_billing_authorize_net is located in community and owns authorize.Net JSON API backed Swarmauri billing provider for transactions, captures, voids, refunds, customer profiles, and webhook validation. Source-declared APIs include AuthorizeNetBillingProvider. The manifest records its direct dependency boundary.
Public API and Import Surfaces
Import namespace: swarmauri_billing_authorize_net.
Source-declared exports or types: AuthorizeNetBillingProvider.
Inspect package source for exact signatures; this inventory does not designate every internal module as stable.
Entry Points
swarmauri.billing_providers → AuthorizeNetBillingProvider → swarmauri_billing_authorize_net.provider:AuthorizeNetBillingProvider
The package exposes a Swarmauri billing provider entry point:
[project.entry-points.'swarmauri.billing_providers']
AuthorizeNetBillingProvider = "swarmauri_billing_authorize_net.provider:AuthorizeNetBillingProvider"
Injected Dependencies
The direct installation dependencies of swarmauri_billing_authorize_net are swarmauri-core, swarmauri-base, httpx. These declarations do not imply automatic provider selection. Pass collaborators through the explicit constructors or call signatures in package source.
Protocol Consumers
No direct package-manifest dependency on swarmauri_billing_authorize_net was found in the audited three-repository inventory. External consumers may still use its documented imports or commands.
Extensions
For swarmauri_billing_authorize_net, use the source-declared public interfaces (AuthorizeNetBillingProvider) when composing or extending behavior. Its entry-point section below is authoritative for registered plugins; no additional extension loader is inferred from the package name.
Operations and Readiness
Operational Requirements
Operate swarmauri_billing_authorize_net according to its actual entry points and collaborators. The dependency and Python requirements in the manifest are prerequisites; deployment topology, credentials, and readiness remain the responsibility of the consuming application unless explicitly documented above.
Health and Observability
This README does not establish a standalone health endpoint for swarmauri_billing_authorize_net. Observe the concrete caller’s results, exceptions, and existing test reports. An application that embeds this package must define its own health and telemetry contract.
Security and Resource Limits
Apply the input, credential, and resource constraints implemented in package source. The swarmauri_billing_authorize_net README gate is a documentation check, not a security review or a substitute for the implementation’s limits and caller authorization.
Compatibility
This source version of swarmauri_billing_authorize_net declares Python >=3.10,<3.15. Consult its dependency constraints before upgrading. Source-version and registry-version badges have separate meanings; this migration makes no additional platform or interoperability certification claim.
Verification
Tests
Run python -m pytest tests/unit/test_readme_sources.py from the swarmauri_billing_authorize_net package directory for the maintained example source checks (Python compilation and non-Python file presence). Behavioral tests may live in the repository’s shared suites; the new README syntax test is not presented as runtime coverage for authorize.Net JSON API backed Swarmauri billing provider for transactions, captures, voids, refunds, customer profiles, and webhook validation.
The repository README gate also checks the required heading tree, metadata, managed fragments, and referenced files.
Certification Status
No external certification is asserted for swarmauri_billing_authorize_net by this documentation migration. README conformance, example syntax, runtime tests, and protocol or security certification are distinct evidence scopes.
Evidence
The README standards CI records mechanical documentation results for its tested commit. The package source and example sources support the package-boundary description; external runtime behavior requires its own test evidence.
FAQ
Why
Q: Does this package call Authorize.Net APIs?
A: Yes for transaction and customer-profile workflows. It posts JSON requests to Authorize.Net sandbox or production endpoints with merchant authentication.
Q: Which billing areas does it cover?
A: It covers online payments, prior-auth capture, voids, refunds, customer profile create/get, transaction detail lookup for refunds, webhook parsing, and HMAC-SHA512 signature validation. Some payment-method and reporting helpers remain compatibility placeholders.
Q: What credentials are required?
A: Provide login_id for the API Login ID and api_key for the transaction key. Use environment="sandbox" for test accounts and environment="production" for live accounts.
How
How do I start? Install or synchronize the environment under Getting Started, follow the maintained example for swarmauri_billing_authorize_net, and consult package source for the exact types and signatures involved.
When
When should I validate an upgrade? Recheck swarmauri_billing_authorize_net whenever its source version, declared collaborators, configuration, or caller changes. Run relevant behavioral tests in addition to the README gate before promotion.
Documentation and Related Packages
More Documentation
The repository contribution guide, package source, and manifest provide the supporting context for swarmauri_billing_authorize_net. The README policy defines the common document structure.
Related Packages
Billing provider packages:
Foundational packages:
- swarmauri_core defines billing capabilities and provider interfaces.
- swarmauri_base provides billing specs, refs, mixins, and
BillingProviderBase.
- swarmauri provides namespace imports and plugin discovery.
Project Links
Contributing
How to Contribute