Skip to main content

Crate authorizenet

Crate authorizenet 

Source
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::ReqwestTransport for Client, on tokio.
  • ureq: blocking::UreqTransport for blocking::Client, with no async runtime.
  • rustls (default) or native-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.
webhookwebhooks
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 as E00027.
Client
An async Authorize.Net client.
ClientBuilder
Configures a Client.
Credentials
How requests authenticate: the merchantAuthentication element of each request.
Decimal
Decimal represents a 128 bit representation of a fixed-precision decimal number. The finite set of values of type Decimal are 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.
TransportError
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-Agent sent unless set otherwise.
PRODUCTION_ENDPOINT
The production endpoint.
SANDBOX_ENDPOINT
The sandbox endpoint, for testing with a sandbox account.

Type Aliases§

SecretString
Secret string type.