Authorize.Net PHP SDK
Official PHP SDK for the Authorize.Net payment gateway API.
Repository Health
Technical Analysis
The Authorize.Net PHP SDK is the official client library for integrating the Authorize.Net payment gateway into PHP applications. It exposes the gateway’s full XML API through generated request, response, and contract classes, letting developers charge cards, tokenize payment data, manage customer profiles, and run recurring subscriptions without hand-building API payloads.
Built around a controller pattern that serializes typed request objects and executes them against Authorize.Net’s sandbox or production endpoints, the SDK covers transactions, Automated Recurring Billing (ARB), Customer Information Manager (CIM) profiles, and transaction reporting. It requires cURL and JSON extensions and enforces TLS 1.2 for all connections.
What You Get
- Typed request, response, and contract classes for the full Authorize.Net XML API
- Controllers that serialize requests and execute them against sandbox or production
- Support for charges, refunds, voids, and payment tokenization
- Automated Recurring Billing (ARB) subscription management
- Customer Information Manager (CIM) profile storage and transaction reporting
Common Use Cases
- Accepting credit card payments in a PHP e-commerce checkout
- Managing recurring subscription billing via ARB
- Storing reusable customer payment profiles with CIM
Under The Hood
Architecture - The SDK is organized under the net\authorize\api namespace into three layers: contract/v1 holds generated value objects for every request and response type (transactions, ARB subscriptions, CIM profiles, reporting), controller holds a controller per operation that extends a shared base to serialize the request and dispatch it, and constants defines the sandbox and production endpoint URLs. A companion util package handles logging with sensitive-field masking so card data is scrubbed from logs.
Tech Stack - Pure PHP supporting a very wide range (php >=5.6 through 8.x), depending only on the cURL and JSON extensions at runtime. Autoloading is classmap-based over the lib directory rather than PSR-4, and the request/response contracts are generated from the AnetApiSchema.xsd schema. PHPUnit drives the test suite.
Code Quality - The generated contract classes are verbose but consistent, mirroring the gateway XSD one-to-one. The repository ships a tests/ suite plus extensive runnable sample-code-php examples for nearly every operation, and includes explicit handling for TLS 1.2 and sensitive-data masking. Its broad legacy PHP support constrains the code to older idioms, and maintenance activity has slowed in recent releases.
API Design - The public API follows a predictable request-controller-response triad: build a typed request object, wrap it in the matching controller, call executeWithApiResponse() against an environment constant, and read a typed response. The pattern is repetitive but highly discoverable, and the bundled per-feature sample code sharply reduces the boilerplate needed to get a first integration working.