authnet_dart
The easiest entry point to the community-maintained Authorize.Net SDK for Dart and Flutter. One import provides typed payments, eCheck, PayPal, customer profiles (CIM), recurring billing (ARB), reporting, Accept.js, Accept Hosted, wallet token helpers, and verified webhooks.
Not affiliated with, endorsed by, or certified by Authorize.Net or Visa.
Install
dart pub add authnet_dart
import 'package:authnet_dart/authnet_dart.dart';
Quick start
final client = AuthNetClient(
config: AuthNetConfig(
apiLoginId: apiLoginId,
transactionKey: transactionKey,
environment: AuthNetEnvironment.sandbox,
),
);
final result = await client.charge(PaymentRequest(
amount: 19.99,
method: PaymentMethod.opaqueData,
billing: BillingDetails(firstName: 'Jane', lastName: 'Doe'),
opaqueData: OpaqueData(
dataDescriptor: descriptor,
dataValue: nonce,
),
));
if (result.isApproved) {
print('Approved: ${result.transactionId}');
}
client.close();
For a Flutter application, obtain the one-time nonce with the exported Accept.js or Accept Hosted helpers, then send it to your backend for the charge. Never ship a production Transaction Key in a distributed app.
Umbrella or modular packages?
Use authnet_dart when you want the simplest install and expect to use more
than one part of the SDK. The same APIs are also available separately:
| Package | Use it directly when |
|---|---|
authnet_core |
You need payments, CIM, ARB, or reporting only. |
authnet_server |
You are adding webhook verification and management to a backend. |
authnet_flutter |
You need Accept.js, Accept Hosted, wallets, or the gated direct client. |
The umbrella contains no alternate implementation: it re-exports those three packages, so moving between umbrella and modular dependencies does not require learning a second API.
Documentation
Start with the integration-mode guide, then use each modular package README for complete operations and examples. Questions belong in GitHub Discussions, bugs in the issue tracker, and vulnerabilities in private security reporting.
Libraries
- authnet_dart
- The complete community-maintained Authorize.Net SDK for Dart and Flutter.