Skip to main content

Authorize.Net JSON API backed Swarmauri billing provider for transactions, captures, voids, refunds, customer profiles, and webhook validation.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_billing_authorize_net Discord

Swarmauri Billing Authorize.Net

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 Swarmauri Billing Authorize.Net?

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.

FAQ

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.

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.

Installation

Install with uv:

uv add swarmauri_billing_authorize_net

Install with pip:

pip install swarmauri_billing_authorize_net

Usage

Create and refund an Authorize.Net-style payment:

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"])

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))

Important Scope Notes

This package uses live Authorize.Net JSON API calls for transaction and customer-profile workflows. Payment data should be supplied through Accept.js opaque data or other compliant tokenized payloads. Do not place raw card data in application code unless your environment is explicitly PCI scoped.

Entry Point

The package exposes a Swarmauri billing provider entry point:

[project.entry-points.'swarmauri.billing_providers']
AuthorizeNetBillingProvider = "swarmauri_billing_authorize_net.provider:AuthorizeNetBillingProvider"

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.

License

Apache-2.0

Contributing

If you connect this provider to live Authorize.Net APIs, keep the stub behavior separately testable, document required credentials and webhook behavior, and add tests for every supported billing capability.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_billing_authorize_net-0.11.0.dev1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file swarmauri_billing_authorize_net-0.11.0.dev1.tar.gz.

File metadata

  • Download URL: swarmauri_billing_authorize_net-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_billing_authorize_net-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 ef3f3057c0ba8db5cf0b017767155e3ea211bb0cdd4d03ea433ae3d4a7025708
MD5 97d207191cd36c6f13f4ba281af01c27
BLAKE2b-256 563b0797cc80c09d3491626acadd15ef0041f318926b7e793f015ca22d703091

See more details on using hashes here.

File details

Details for the file swarmauri_billing_authorize_net-0.11.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_billing_authorize_net-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_billing_authorize_net-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 99bc552295604c1cb5c7f8f88b19cf33fbffbd27ee439fd41fc8e4c54340e739
MD5 d3ac5edac32775005f3987e94ba1f3d2
BLAKE2b-256 2c738c60a561f043aa55b60ddb937f244892a75de019bbddacc74a6da41c0623

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page