pub enum MandateStatus {
Created,
ApprovalPending,
ApprovalSucceeded,
ApprovalFailed,
RevocationPending,
RevocationSucceeded,
RevocationFailed,
Canceled,
}Expand description
The most recent action on the mandate. status is an informational indicator of the latest transition; it is not the source of truth for what has durably happened. Read the timestamps for that: approvedAt, canceledAt, and revokedAt each record a durable milestone independently of status.
- `created`: the mandate exists but no approval has been attempted. No
source attached. Not usable.
- `approval_pending`: an approval is in flight. Not usable. Emits
`acceptance.mandate.approval_initiated`.
- `approval_succeeded`: the mandate has a source and is usable.
- `approval_failed`: the last approval attempt failed. Not usable. Submit
a new approval to retry.
- `revocation_pending`: a wallet revocation is being confirmed on the
network. Emits `acceptance.mandate.revocation_initiated`. Resolves to
`revocation_succeeded` on success or `revocation_failed` on failure.
- `revocation_succeeded`: a wallet revocation removed the spending allowance
on-chain (`revokedAt` is set). Terminal.
- `revocation_failed`: the last wallet revocation attempt did not complete.
The spending allowance was not removed, so the mandate remains usable if it
was usable before. Submit a new revocation to retry.
- `canceled`: the merchant ended the mandate off-chain (`canceledAt` is set).
The on-chain spending allowance may still be live; a later wallet
revocation can still move `status` through the `revocation_*` values and
set `revokedAt`.
**Usable when** `approvedAt` is set, `canceledAt` is null, `revokedAt` is null, and `expiresAt` is null or in the future. Usability is derived from these timestamps, not from `status`: a failed revocation, for example, leaves `status` at `revocation_failed` but the mandate stays usable because the allowance was never removed. Authorization checks the durable conditions in order, and the first match wins: an in-flight approval or revocation returns `409` (`mandate_action_pending`); `revokedAt` set returns `422` (`mandate_revoked`); `canceledAt` set returns `422` (`mandate_canceled`); a past `expiresAt` returns `400` (`mandate_expired`); any other status returns `422` (`mandate_invalid_status`). Approve a mandate and get wallet approval options use that same order for the in-flight, revoked, canceled, and expired checks. Any other status except `created` or `approval_failed` returns `422` (`mandate_invalid_status`). Those rejections do not change the timestamps. Debit limits are enforced at authorization time.JSON schema
{
"description": "The most recent action on the mandate. `status` is an informational indicator of the latest transition; it is not the source of truth for what has durably happened. Read the timestamps for that: `approvedAt`, `canceledAt`, and `revokedAt` each record a durable milestone independently of `status`.\n\n- `created`: the mandate exists but no approval has been attempted. No\n source attached. Not usable.\n\n\n- `approval_pending`: an approval is in flight. Not usable. Emits\n `acceptance.mandate.approval_initiated`.\n\n\n- `approval_succeeded`: the mandate has a source and is usable.\n\n- `approval_failed`: the last approval attempt failed. Not usable. Submit\n a new approval to retry.\n\n\n- `revocation_pending`: a wallet revocation is being confirmed on the\n network. Emits `acceptance.mandate.revocation_initiated`. Resolves to\n `revocation_succeeded` on success or `revocation_failed` on failure.\n\n\n- `revocation_succeeded`: a wallet revocation removed the spending allowance\n on-chain (`revokedAt` is set). Terminal.\n\n\n- `revocation_failed`: the last wallet revocation attempt did not complete.\n The spending allowance was not removed, so the mandate remains usable if it\n was usable before. Submit a new revocation to retry.\n\n\n- `canceled`: the merchant ended the mandate off-chain (`canceledAt` is set).\n The on-chain spending allowance may still be live; a later wallet\n revocation can still move `status` through the `revocation_*` values and\n set `revokedAt`.\n\n\n**Usable when** `approvedAt` is set, `canceledAt` is null, `revokedAt` is null, and `expiresAt` is null or in the future. Usability is derived from these timestamps, not from `status`: a failed revocation, for example, leaves `status` at `revocation_failed` but the mandate stays usable because the allowance was never removed. Authorization checks the durable conditions in order, and the first match wins: an in-flight approval or revocation returns `409` (`mandate_action_pending`); `revokedAt` set returns `422` (`mandate_revoked`); `canceledAt` set returns `422` (`mandate_canceled`); a past `expiresAt` returns `400` (`mandate_expired`); any other status returns `422` (`mandate_invalid_status`). Approve a mandate and get wallet approval options use that same order for the in-flight, revoked, canceled, and expired checks. Any other status except `created` or `approval_failed` returns `422` (`mandate_invalid_status`). Those rejections do not change the timestamps. Debit limits are enforced at authorization time.",
"examples": [
"approval_succeeded"
],
"type": "string",
"enum": [
"created",
"approval_pending",
"approval_succeeded",
"approval_failed",
"revocation_pending",
"revocation_succeeded",
"revocation_failed",
"canceled"
]
}Variants§
Created
ApprovalPending
ApprovalSucceeded
ApprovalFailed
RevocationPending
RevocationSucceeded
RevocationFailed
Canceled
Trait Implementations§
Source§impl Clone for MandateStatus
impl Clone for MandateStatus
impl Copy for MandateStatus
Source§impl Debug for MandateStatus
impl Debug for MandateStatus
Source§impl<'de> Deserialize<'de> for MandateStatus
impl<'de> Deserialize<'de> for MandateStatus
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 Display for MandateStatus
impl Display for MandateStatus
impl Eq for MandateStatus
Source§impl From<&MandateStatus> for MandateStatus
impl From<&MandateStatus> for MandateStatus
Source§fn from(value: &MandateStatus) -> Self
fn from(value: &MandateStatus) -> Self
Converts to this type from the input type.
Source§impl FromStr for MandateStatus
impl FromStr for MandateStatus
Source§impl Hash for MandateStatus
impl Hash for MandateStatus
Source§impl Ord for MandateStatus
impl Ord for MandateStatus
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for MandateStatus
impl PartialEq for MandateStatus
Source§impl PartialOrd for MandateStatus
impl PartialOrd for MandateStatus
Source§impl Serialize for MandateStatus
impl Serialize for MandateStatus
impl StructuralPartialEq for MandateStatus
Source§impl TryFrom<&String> for MandateStatus
impl TryFrom<&String> for MandateStatus
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§impl TryFrom<&str> for MandateStatus
impl TryFrom<&str> for MandateStatus
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§impl TryFrom<String> for MandateStatus
impl TryFrom<String> for MandateStatus
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for MandateStatus
impl RefUnwindSafe for MandateStatus
impl Send for MandateStatus
impl Sync for MandateStatus
impl Unpin for MandateStatus
impl UnsafeUnpin for MandateStatus
impl UnwindSafe for MandateStatus
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.