pub struct PaymentAuditor { /* private fields */ }Available on crate feature
payments only.Expand description
Emits structured payment audit events through an adk-auth audit sink.
§Example
ⓘ
use std::sync::Arc;
use adk_auth::{AuditOutcome, FileAuditSink};
use adk_payments::auth::{AuthenticatedPaymentRequest, PaymentAuditor, PaymentOperation};
use adk_payments::domain::ProtocolDescriptor;
let auditor = PaymentAuditor::new(sink);
let request = AuthenticatedPaymentRequest::new("alice");
auditor
.record_operation(
&request,
&transaction,
&ProtocolDescriptor::acp("2026-01-30"),
PaymentOperation::CompleteCheckout,
AuditOutcome::Allowed,
false,
)
.await
.unwrap();Implementations§
Source§impl PaymentAuditor
impl PaymentAuditor
Sourcepub fn new(sink: Arc<dyn AuditSink>) -> PaymentAuditor
pub fn new(sink: Arc<dyn AuditSink>) -> PaymentAuditor
Creates a payment auditor backed by the provided sink.
Sourcepub async fn record_operation(
&self,
request: &AuthenticatedPaymentRequest,
record: &TransactionRecord,
protocol: &ProtocolDescriptor,
operation: PaymentOperation,
outcome: AuditOutcome,
intervention_occurred: bool,
) -> Result<(), PaymentsAuthError>
pub async fn record_operation( &self, request: &AuthenticatedPaymentRequest, record: &TransactionRecord, protocol: &ProtocolDescriptor, operation: PaymentOperation, outcome: AuditOutcome, intervention_occurred: bool, ) -> Result<(), PaymentsAuthError>
Records one sensitive payment operation with structured metadata.
§Errors
Returns PaymentsAuthError::AuditSink when the underlying sink fails.
Trait Implementations§
Source§impl Clone for PaymentAuditor
impl Clone for PaymentAuditor
Source§fn clone(&self) -> PaymentAuditor
fn clone(&self) -> PaymentAuditor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PaymentAuditor
impl !RefUnwindSafe for PaymentAuditor
impl Send for PaymentAuditor
impl Sync for PaymentAuditor
impl Unpin for PaymentAuditor
impl UnsafeUnpin for PaymentAuditor
impl !UnwindSafe for PaymentAuditor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more