authnet_core 1.0.2 copy "authnet_core: ^1.0.2" to clipboard
authnet_core: ^1.0.2 copied to clipboard

Authorize.Net SDK for Dart/Flutter: card, eCheck, PayPal payments, CIM profiles, ARB subscriptions, reporting. 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 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"). LICENSE is now pure MIT text; the disclaimer's content was already covered by this README's License section and the root repo's SECURITY.md.

1.0.0 #

First stable release: the public API is now under a stability commitment (breaking changes will bump the major version). client.dart, request_builder.dart, and response_parser.dart were also split into domain-grouped files under lib/src/client/, lib/src/request_builder/, and lib/src/response_parser/ via Dart part/part of, a pure internal reorganization; the public API is unchanged.

  • Test suite expanded to 400 tests covering 99.48% of lib/ (1734/1743 lines); the 9 remaining lines are defensive branches confirmed unreachable through the public API (e.g. a JsonUnsupportedObjectError catch with no caller-reachable non-encodable value, a RetryPolicy guard shadowed by that model's own constructor assert).

  • Successful response parsing now requires Authorize.Net's top-level messages.resultCode: "Ok" envelope and required identifiers/statuses; malformed or empty JSON can no longer become a false success or an empty domain object.

  • Public operations validate payment-source fields, IDs, dates, ARB intervals/trials, invoice numbers, and line items before sending a request.

  • shortRef() is monotonic within an isolate, preventing collisions when multiple requests are built within the same millisecond.

  • eCheck routing numbers are now redacted by maskForLog().

  • AuthNetClient.close(): releases the underlying http.Client's resources (connection pool). Only actually closes it if AuthNetClient created it itself (you didn't pass your own httpClient); a client you provided is yours to close.

  • Automatic retry for semantically read-only operations (RetryPolicy, new retryPolicy constructor parameter, defaults to 3 attempts with exponential backoff). Mutation calls are never retried: a ClientException does not prove no request bytes were sent, and Authorize.Net has no idempotency key.

  • Ambiguous mutation network failures now explicitly tell callers to verify transaction/account state before retrying; TransactionStatus.failed no longer incorrectly implies that Authorize.Net definitely did no work.

  • updateSubscription() now omits ARB's immutable billing interval from the wire request; live sandbox verification previously returned E00034 for every update because the unchanged interval was still being sent. The immutable start date is now omitted as required by the current schema too.

  • Added the complete documented PayPal redirect flow: initial auth/auth-capture, continuation, and detail retrieval, including the typed pendingCustomerAction result.

  • Added split-tender group updates and a held-transaction list convenience.

  • Added ARB creation from existing CIM customer/payment/address profiles.

  • Reporting, ARB lists, expiring-profile searches, and Account Updater details now expose their documented filters, sorting, and paging controls.

  • Corrected Account Updater's non-empty response mapping to the official auResponse/auUpdate/auDelete shapes; the previous guessed card-type fields could not parse a real populated response.

  • Expanded transaction, subscription-list, subscription-detail, and line-item models so documented reconciliation and billing-attempt fields are no longer discarded.

  • Request validation now enforces current schema limits for card/bank data, customer fields, addresses, ARB counts/names, and all line-item fields.

  • Fixed held-transaction updates to send refTransId (the schema field), not the nonexistent transactionId field.

  • New model: RetryPolicy.

  • AuthNetClient.authenticate(): authenticateTestRequest, validates credentials without running a transaction.

  • AuthNetClient.getHostedPaymentPageToken() / getHostedProfilePageToken(): getHostedPaymentPageRequest/getHostedProfilePageRequest, the tokens authnet_flutter's Accept Hosted contract loads into an iframe.

  • New AuthNetConfig.hostedFormUrl getter: the Accept Hosted iframe/form target for the configured environment.

  • maskForLog() hardening: card number masking no longer depends on the value being pure digits: a value containing spaces/dashes (never stripped by this SDK; see CardDetails.number's dartdoc) is now masked reliably instead of silently passing through unmasked. API Login IDs inside merchantAuthentication and partner access tokens are now redacted too, and masking parses JSON so escaped quote characters cannot bypass a regular expression.

  • RetryPolicy.delayFor() no longer risks a 32-bit bitwise-shift overflow on web for an unusually large caller-configured maxAttempts.

  • Fixed six bugs found by testing this SDK against a live sandbox account rather than mocks alone:

    • getMerchantDetails(), getUnsettledTransactionList(), getTransactionList(), and getTransactionListForCustomer() threw a TypeError on every real response. They assumed Authorize.Net wraps list fields in an extra singular-key object, a holdover from the old XML API: the real JSON API just returns flat arrays. getSettledBatchList(), getBatchStatistics(), getSubscriptionList(), and the Account Updater list endpoints had the same wrong assumption and got the same fix, now tolerant of either shape.
    • MerchantDetails.currencyCode read a currencyCode key that doesn't exist in the real response. Replaced with MerchantDetails.currencies (a List<String>), which reads the real currencies key.
    • TransactionListItem.amount read an amount key that also isn't real: the actual key is settleAmount. Fixed, with amount kept as a fallback.
    • updateCustomerPaymentProfile() put customerPaymentProfileId first in its request body. Authorize.Net's schema wants it after billTo/payment and rejected every real call with E00003; fixed by reordering the fields.
    • createCustomerShippingAddress()/updateCustomerShippingAddress() nested defaultShippingAddress inside the address node. Authorize.Net doesn't recognize it there at all: it needs to be a sibling of address, not a child.
    • getCustomerPaymentProfileNonce() was missing a connectedAccessToken field entirely, so Authorize.Net rejected every call outright. Added it as a required parameter, matching Authorize.Net's own sample code and the field order a live call requires. It's an OAuth-style Partner API token, not your apiLoginId/transactionKey: most direct-merchant integrations won't have one to pass; see its dartdoc.

    The core paths for TransactionDetail, BatchStatistics, ARBSubscriptionDetail, and a full charge/authOnly/priorAuthCapture/void/ refund/CIM (customer profile, payment profile, shipping address)/ARB cycle ran against a real account. Fields and operations added afterward are matched to the current official schema/reference samples but retain the external-verification limits called out in the README.

  • findPaymentProfilesExpiringInMonth() is complete: Authorize.Net's published AnetApiSchema.xsd defines only one value for CustomerPaymentProfileSearchTypeEnum, cardsExpiringInMonth. Not a missing general-search feature: the operation doesn't have one.

  • CardDetails.expirationDate now zero-pads a single-digit expMonth (e.g. "9""09") instead of silently sending Authorize.Net a malformed date. Found by code review, not a live call.

  • Real benchmarks added (benchmark/response_parsing_benchmark.dart): parsing even a synthetic 1,000-row transaction list takes ~1.6ms, see the README's new Performance section.

0.9.0 #

authnet_core's initially targeted Authorize.Net API surface was assembled. Held at 0.9.0 rather than 1.0.0: a stable-API commitment should follow the planned hardening pass (network retry, resource cleanup, a self-review pass) and the sibling authnet_server/authnet_flutter packages, not precede them.

Recurring billing (ARB):

  • AuthNetClient.createSubscription() / updateSubscription(): never throw, mirroring charge()'s convention.
  • AuthNetClient.getSubscription() / getSubscriptionStatus() / getSubscriptionList(): throw on failure, mirroring the CIM/reporting convention.
  • AuthNetClient.cancelSubscription().
  • New models: ARBInterval, ARBSubscription, SubscriptionResult, SubscriptionStatus, ARBSubscriptionDetail, SubscriptionListItem.

Account Updater:

  • AuthNetClient.getAccountUpdaterJobSummary() / getAccountUpdaterJobDetails(). Account Updater is an opt-in, rarely-enabled feature; the initial model was not verified against a populated live account and was corrected against the official schema/API samples in 1.0.0.
  • New models: AccountUpdaterJobSummary, AccountUpdaterSummaryItem, AccountUpdaterJobDetail.

0.5.0 #

  • AuthNetClient.updateHeldTransaction(): approve/decline a transaction held for fraud review. Never throws, mirroring charge()'s convention.
  • AuthNetClient.isTransactionSettled(): convenience check for eCheck (and any) settlement status.
  • New model: HeldTransactionAction.

0.4.0 #

Several response field mappings in this release (TransactionDetail, BatchStatistic, MerchantDetails) are best-effort: not verified against a live sandbox call. Every field on these types is nullable and a wrong/renamed field degrades to null rather than crashing, but verify against a real response before depending on a specific field in production.

Transaction reporting:

  • AuthNetClient.getTransactionDetails(): getTransactionDetailsRequest, including current settlement status. See caveat above.
  • AuthNetClient.getTransactionList(): getTransactionListRequest (by settlement batch).
  • AuthNetClient.getTransactionListForCustomer(): getTransactionListForCustomerRequest.
  • AuthNetClient.getUnsettledTransactionList(): getUnsettledTransactionListRequest, including fraud-review holds.
  • New models: TransactionDetail, TransactionListItem.

Batch/merchant reporting + the deferred payment-profile search:

  • AuthNetClient.getSettledBatchList(): getSettledBatchListRequest (client-side validated to a 31-day range).
  • AuthNetClient.getBatchStatistics(): getBatchStatisticsRequest. See caveat above.
  • AuthNetClient.getMerchantDetails(): getMerchantDetailsRequest, including the Accept.js/Accept Hosted publicClientKey. See caveat above.
  • AuthNetClient.findPaymentProfilesExpiringInMonth(): getCustomerPaymentProfileListRequest (deferred from 0.3.0). This covers the operation completely: cardsExpiringInMonth is the only searchType Authorize.Net's schema defines for it.
  • New models: SettledBatch, BatchStatistic, BatchStatistics, MerchantDetails, PaymentProfileSearchResult.

0.3.0 #

Full CIM (Customer Information Manager) except getCustomerPaymentProfileListRequest, which is deliberately deferred to v0.4: it's a cross-customer search operation, not a per-customer lookup like everything else here.

Customer profile CRUD:

  • AuthNetClient.createCustomerProfile(): createCustomerProfileRequest, with E00039 duplicate recovery.
  • AuthNetClient.getCustomerProfileIds(): getCustomerProfileIdsRequest.
  • AuthNetClient.updateCustomerProfile(): updateCustomerProfileRequest.
  • AuthNetClient.deleteCustomerProfile(): deleteCustomerProfileRequest.
  • New model: CreateCustomerProfileRequest.

Payment profile CRUD + validate + nonce:

  • AuthNetClient.createCustomerPaymentProfile(): createCustomerPaymentProfileRequest (card, bank, or Accept.js/Hosted opaqueData nonce).
  • AuthNetClient.getCustomerPaymentProfile(): getCustomerPaymentProfileRequest (single saved method by id).
  • AuthNetClient.updateCustomerPaymentProfile(): updateCustomerPaymentProfileRequest.
  • AuthNetClient.deleteCustomerPaymentProfile(): deleteCustomerPaymentProfileRequest.
  • AuthNetClient.validateCustomerPaymentProfile(): validateCustomerPaymentProfileRequest.
  • AuthNetClient.getCustomerPaymentProfileNonce(): getCustomerPaymentProfileNonceRequest.
  • New models: CreateCustomerPaymentProfileRequest, UpdateCustomerPaymentProfileRequest, ValidationMode.

Shipping address CRUD:

  • AuthNetClient.createCustomerShippingAddress(): createCustomerShippingAddressRequest.
  • AuthNetClient.getCustomerShippingAddress(): getCustomerShippingAddressRequest.
  • AuthNetClient.updateCustomerShippingAddress(): updateCustomerShippingAddressRequest.
  • AuthNetClient.deleteCustomerShippingAddress(): deleteCustomerShippingAddressRequest.
  • New models: ShippingAddress, SavedShippingAddress.

0.2.0 #

  • AuthNetClient.authOnly() (authOnlyTransaction): authorize funds without capturing them.
  • AuthNetClient.priorAuthCapture() (priorAuthCaptureTransaction): capture funds from a prior authOnly() authorization, in full or in part.
  • AuthNetClient.captureOnly() (captureOnlyTransaction): capture funds using an authorization code obtained outside Authorize.Net.
  • AuthNetClient.refund() (refundTransaction): refund/credit a settled transaction (card or bank account).
  • AuthNetClient.voidTransaction() (voidTransaction): cancel a transaction before it settles.
  • New models: CaptureOnlyRequest, RefundRequest, RefundCardInfo, RefundBankInfo.

0.1.0 #

Initial release.

  • AuthNetConfig / AuthNetEnvironment: sandbox/production credentials and endpoint resolution.
  • Typed domain models: CardDetails, BankDetails, OpaqueData, BillingDetails, PaymentLineItem, PaymentRequest, TransactionResult, SavedCard, SaveMethodResult.
  • AuthNetClient.charge(): authCaptureTransaction for credit card, eCheck (bank account), and Accept.js/Accept Hosted opaqueData nonces.
  • AuthNetClient.chargeSavedMethod(): charge a stored CIM payment profile.
  • AuthNetClient.getSavedMethods() / getProfileByMerchantId(): read a customer's saved cards/bank accounts.
  • AuthNetClient.saveMethodFromTransaction(): save the payment method used in a completed transaction to a (new or existing) customer profile.
  • Typed exception hierarchy: AuthNetException, AuthNetConfigException, AuthNetNetworkException, AuthNetApiException, AuthNetParseException.
  • maskForLog(): public log-masking utility for request/response bodies.
1
likes
160
points
217
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Authorize.Net SDK for Dart/Flutter: card, eCheck, PayPal payments, CIM profiles, ARB subscriptions, reporting. Not affiliated with or endorsed by Authorize.Net or Visa.

Repository (GitHub)
View/report issues
Contributing

Topics

#authorize-net #payments #ecommerce #payment-gateway #subscriptions

License

MIT (license)

Dependencies

http

More

Packages that depend on authnet_core