Expand description
A typed client for the Authorize.Net XML API.
Every request and response type is generated from Authorize.Net’s XSD (see
schema), and every operation is a method on a resource of the client:
client.transactions().create(&request).
§Clients and transports
Client is async and blocking::Client blocks. Both send requests through a
transport, which you can replace to use any HTTP client (see transport). The
features provide the default transports:
reqwest(default):transport::ReqwestTransportforClient, on tokio.ureq:blocking::UreqTransportforblocking::Client, with no async runtime.rustls(default) ornative-tls: their TLS implementation.
protocol also encodes requests and decodes responses on their own.
§Webhooks
With the webhooks feature, webhook::verify_then_parse checks that a webhook
notification came from Authorize.Net and reads it as typed values.
§Logging
The clients emit tracing events: each request runs in
an authorizenet span with its operation, at DEBUG level, and request and
response bodies are logged at TRACE level with card numbers, keys and other
secrets redacted.
Re-exports§
pub use api::ApiRequest;pub use api::ApiResponse;
Modules§
- api
- What ties a request type to its response type.
- blocking
- The blocking client, which needs no async runtime.
- protocol
- Encoding requests and decoding responses, without any I/O.
- schema
- Authorize.Net schema types, generated from
schema/AnetApiSchema.xsd. - transport
- How the clients send requests over HTTP.
- types
- Value types for XSD built-ins that have no exact Rust equivalent.
- validate
- Checks of the XSD’s facets: lengths, patterns, numeric ranges and digits, and how many times a list element may occur.
- webhook
webhooks - Webhook notifications: checking that they came from Authorize.Net, and reading them as typed values.
- xml
- XML mapping for Authorize.Net’s schema.
Structs§
- ApiError
- An error the API reported: result code
Error, with codes such asE00027. - Client
- An async Authorize.Net client.
- Client
Builder - Configures a
Client. - Credentials
- How requests authenticate: the
merchantAuthenticationelement of each request. - Decimal
Decimalrepresents a 128 bit representation of a fixed-precision decimal number. The finite set of values of typeDecimalare of the form m / 10e, where m is an integer such that -296 < m < 296, and e is an integer between 0 and 28 inclusive.- Transport
Error - A failure of the HTTP transport underneath a client.
Enums§
- Environment
- Which Authorize.Net environment to send requests to.
- Error
- Why a request failed.
Constants§
- DEFAULT_
TIMEOUT - How long a request may take, including reading the response, unless set otherwise.
- DEFAULT_
USER_ AGENT - The
User-Agentsent unless set otherwise. - PRODUCTION_
ENDPOINT - The production endpoint.
- SANDBOX_
ENDPOINT - The sandbox endpoint, for testing with a sandbox account.
Type Aliases§
- Secret
String - Secret string type.