authnet_dart 1.0.2
authnet_dart: ^1.0.2 copied to clipboard
Community Authorize.Net SDK for Dart and Flutter: payments, CIM, ARB, reporting, tokenization, wallets, webhooks. Not affiliated with or endorsed by Authorize.Net or Visa.
example/authnet_dart_example.dart
import 'package:authnet_dart/authnet_dart.dart';
Future<void> main() async {
const config = AuthNetConfig(
apiLoginId: String.fromEnvironment('AUTHNET_API_LOGIN_ID'),
transactionKey: String.fromEnvironment('AUTHNET_TRANSACTION_KEY'),
);
if (!config.isConfigured) {
// Supply credentials through your runtime's secret mechanism. Never put a
// production Transaction Key in source or a distributed Flutter binary.
return;
}
final client = AuthNetClient(config: config);
try {
await client.authenticate();
} finally {
client.close();
}
}