pub struct PaymentPolicy {
pub auto_approve_threshold: u64,
pub require_approval_threshold: u64,
pub min_trust_for_auto_approve: TrustLevel,
pub notification_channels: Vec<String>,
}Expand description
Owner-configurable policy for auto-approving or requiring approval.
Fields§
§auto_approve_threshold: u64Auto-approve if amount is at or below this threshold (in smallest currency unit).
require_approval_threshold: u64Require explicit owner approval above this threshold.
min_trust_for_auto_approve: TrustLevelMinimum trust level for auto-approval.
notification_channels: Vec<String>Notification channel for approval requests (e.g. “email”, “sms”, “webhook”).
Implementations§
Source§impl PaymentPolicy
impl PaymentPolicy
Sourcepub fn evaluate(
&self,
amount: u64,
trust_level: TrustLevel,
) -> PaymentPolicyDecision
pub fn evaluate( &self, amount: u64, trust_level: TrustLevel, ) -> PaymentPolicyDecision
Evaluate whether a payment intent should be auto-approved, require owner approval, or be auto-rejected.
Trait Implementations§
Source§impl Clone for PaymentPolicy
impl Clone for PaymentPolicy
Source§fn clone(&self) -> PaymentPolicy
fn clone(&self) -> PaymentPolicy
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 moreSource§impl Debug for PaymentPolicy
impl Debug for PaymentPolicy
Source§impl Default for PaymentPolicy
impl Default for PaymentPolicy
Source§impl<'de> Deserialize<'de> for PaymentPolicy
impl<'de> Deserialize<'de> for PaymentPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PaymentPolicy
impl PartialEq for PaymentPolicy
Source§fn eq(&self, other: &PaymentPolicy) -> bool
fn eq(&self, other: &PaymentPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PaymentPolicy
impl Serialize for PaymentPolicy
impl StructuralPartialEq for PaymentPolicy
Auto Trait Implementations§
impl Freeze for PaymentPolicy
impl RefUnwindSafe for PaymentPolicy
impl Send for PaymentPolicy
impl Sync for PaymentPolicy
impl Unpin for PaymentPolicy
impl UnsafeUnpin for PaymentPolicy
impl UnwindSafe for PaymentPolicy
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