authnet_server 1.0.2
authnet_server: ^1.0.2 copied to clipboard
Authorize.Net webhooks for Dart servers: HMAC-SHA512 verification, management, notification history, retries. Not affiliated with or endorsed by Authorize.Net or Visa.
Changelog #
All notable changes to this project will be documented in this file. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.2 #
- Improved pub.flutter-io.cn discovery with a search-focused description, five relevant topics, an integration-architecture thumbnail, current install commands, and clearer webhook trust and capability signals in the package README.
- Added tag-based GitHub OIDC publishing support; no long-lived pub token is required after the package admin enables trusted publishing.
1.0.1 #
- Fixed
LICENSE: it had the standard MIT text plus a custom disclaimer appended after it, which broke automated license recognition (pub.flutter-io.cn scored it 0/10 for "Use an OSI-approved license").LICENSEis now pure MIT text; the disclaimer's content was already covered by this README's License section and the root repo'sSECURITY.md.
1.0.0 #
First stable release. The public API is now under a stability commitment (breaking changes will bump the major version).
- Test suite expanded to 65 tests covering 99.67% of
lib/(304/305 lines); the 1 remaining line is the default arm of an internalswitch (method)that every public method reaches only with a hardcoded HTTP verb, unreachable through the public API. - Webhook management now validates HTTPS callback URLs, identifiers, event lists, statuses, timeout configuration, and update payloads locally.
- Required fields in event-type, webhook, and delivery payloads now produce typed parse exceptions instead of silently creating empty identifiers.
- Network failures from webhook mutations explicitly describe the remote outcome as unknown and direct callers to verify state before retrying.
verifyWebhookSignature(): HMAC-SHA512 verification of theX-ANET-Signatureheader, which should always be checked before trusting a webhook body. Matches an independently-computed (Pythonhmac) reference vector: seewebhook_signature_test.dart. Hex-decoding the portal's 128-character Signature Key follows Authorize.Net's published key-format guidance; a live delivery is still needed to validate an integrator's raw-body handling.parseWebhookEvent()/WebhookEvent: parses a verified webhook body, withnotificationId(for idempotent handling of Authorize.Net's at-least-once delivery) andentityId(the transaction/subscription id to look up viaauthnet_core). ThrowsWebhookParseException(consistently, never a bareTypeError) for any body that isn't a JSON object.WebhookClient: full webhook CRUD (listWebhooks,createWebhook,getWebhook,updateWebhook,deleteWebhook,listEventTypes) over the Webhooks REST API (HTTP Basic auth, a separate service fromauthnet_core's Transaction/JSON API).listWebhooks()/listEventTypes()were tested against a live sandbox account; see the README for whatcreateWebhook()and its dependents weren't, and why. Every failure mode (a non-200 response, a non-JSON body, or a JSON body in an unexpected shape) surfaces as a typedWebhookApiException, never a bareTypeError/FormatException; error-message extraction now also recognizes the{"reason":...,"message":...}shape that a real validation failure actually returns.- Webhook management now supports the optional webhook
name, testing an inactive webhook withpingWebhook(), listing notification history with documented date/status/pagination filters, and retrieving a notification's retry log and event payload. Resource identifiers are path-safe and malformed list entries are rejected rather than silently discarded. WebhookConfig: credentials for the Webhooks REST API, with aWebhookConfig.fromAuthNetConfig()convenience constructor.WebhookStatus: an unrecognized status string from Authorize.Net parses toWebhookStatus.unknownrather than being silently reported asinactive.WebhookEventTypes: expanded from 6 to all 23 constants: every payment, customer profile, and subscription event type Authorize.Net actually returns, matching a livelistEventTypes()call exactly. Also resolves the open question of eCheck-specific event names: there are none; eCheck transactions fire the same payment events as card transactions.- New
WebhookConfig.eventTypesUrlgetter, replacing a regex that reconstructed the event-types URL by stripping/webhooksoffbaseUrl; that worked, but was fragile againstbaseUrlever changing shape.
