Download the PHP package yohns/authorize.net-payments without Composer
On this page you can find all versions of the php package yohns/authorize.net-payments. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yohns/authorize.net-payments
More information about yohns/authorize.net-payments
Files in yohns/authorize.net-payments
Package authorize.net-payments
Short Description Authorize.Net PHP 8.2 payment gateway wrapper with line item support.
License MIT
Informations about the package authorize.net-payments
Yohns\Payments
A PHP 8.2+ wrapper around the Authorize.Net PHP SDK with first-class line item support. Designed to make it easy to submit orders with product/menu catalog data attached to each transaction.
Requirements
- PHP 8.2 or newer
ext-curl,ext-json,ext-xml- authorizenet/authorizenet
^2.0
Installation
Or clone and install dependencies manually:
Directory Structure
Credentials
Sandbox credentials are obtained from developer.authorize.net. Production credentials are obtained from account.authorize.net.
Both are found under Account → Security Settings → API Credentials & Keys.
The Transaction Key is always exactly 16 characters. Generating a new one immediately invalidates the previous one.
Quick Start
Classes
PaymentGateway
The main entry point. Instantiate once and reuse across requests.
charge()
Authorize and capture in a single step. The total amount is automatically calculated from line item totals plus tax and shipping, minus any discount.
authorizeOnly()
Places a hold on the card without capturing funds. Use captureAuthorized() later to complete the charge.
captureAuthorized()
Captures a previously authorized transaction.
void()
Voids an unsettled transaction.
refund()
Refunds a settled transaction. Supports partial refunds.
LineItem
Represents a single product or menu item on an order. Authorize.Net supports up to 30 line items per transaction.
CreditCard
Authorize.Net sandbox test card numbers:
4111111111111111(Visa),5424000000000015(Mastercard),370000000000002(Amex). Any future expiration date and any CVV work in sandbox.
BillingAddress
Providing address and zip enables AVS (Address Verification System) checks, which reduce fraud risk and can lower interchange fees.
PaymentResult
Immutable result object returned by every gateway method.
AVS result codes: Y = full match, A = address only, Z = zip only, N = no match, U = unavailable.
CVV result codes: M = match, N = no match, P = not processed, S = should be present, U = issuer unable to process.
Error Reference
| Code | Meaning |
|---|---|
E00007 |
Authentication failed — wrong API Login ID or Transaction Key, or sandbox/production mismatch |
E00003 |
Invalid element — often a malformed request field |
E00027 |
Transaction was unsuccessful |
NO_RESPONSE |
No response from gateway — network or TLS issue |
Sandbox vs Production
Sandbox and production credentials are not interchangeable. Using sandbox credentials against production (or vice versa) will return E00007.
License
MIT