pub struct TransactionRecord {Show 17 fields
pub transaction_id: TransactionId,
pub session_identity: Option<AdkIdentity>,
pub initiated_by: CommerceActor,
pub merchant_of_record: MerchantRef,
pub payment_processor: Option<PaymentProcessorRef>,
pub mode: CommerceMode,
pub state: TransactionState,
pub cart: Cart,
pub fulfillment: Option<FulfillmentSelection>,
pub order: Option<OrderSnapshot>,
pub protocol_refs: ProtocolRefs,
pub extensions: ProtocolExtensions,
pub evidence_refs: Vec<EvidenceReference>,
pub safe_summary: SafeTransactionSummary,
pub evidence_digests: Vec<ProtocolEnvelopeDigest>,
pub created_at: DateTime<Utc>,
pub last_updated_at: DateTime<Utc>,
}Available on crate feature
payments only.Expand description
Durable protocol-neutral transaction record.
Fields§
§transaction_id: TransactionId§session_identity: Option<AdkIdentity>§initiated_by: CommerceActor§merchant_of_record: MerchantRef§payment_processor: Option<PaymentProcessorRef>§mode: CommerceMode§state: TransactionState§cart: Cart§fulfillment: Option<FulfillmentSelection>§order: Option<OrderSnapshot>§protocol_refs: ProtocolRefs§extensions: ProtocolExtensions§evidence_refs: Vec<EvidenceReference>§safe_summary: SafeTransactionSummary§evidence_digests: Vec<ProtocolEnvelopeDigest>§created_at: DateTime<Utc>§last_updated_at: DateTime<Utc>Implementations§
Source§impl TransactionRecord
impl TransactionRecord
Sourcepub fn new(
transaction_id: TransactionId,
initiated_by: CommerceActor,
merchant_of_record: MerchantRef,
mode: CommerceMode,
cart: Cart,
created_at: DateTime<Utc>,
) -> TransactionRecord
pub fn new( transaction_id: TransactionId, initiated_by: CommerceActor, merchant_of_record: MerchantRef, mode: CommerceMode, cart: Cart, created_at: DateTime<Utc>, ) -> TransactionRecord
Creates a new canonical transaction record in the draft state.
Sourcepub fn transition_to(
&mut self,
next: TransactionState,
updated_at: DateTime<Utc>,
) -> Result<(), PaymentsKernelError>
pub fn transition_to( &mut self, next: TransactionState, updated_at: DateTime<Utc>, ) -> Result<(), PaymentsKernelError>
Applies one canonical transaction-state transition.
§Errors
Returns an error when the transition skips or rewinds the canonical payment lifecycle.
Sourcepub fn attach_extension(&mut self, envelope: ProtocolExtensionEnvelope)
pub fn attach_extension(&mut self, envelope: ProtocolExtensionEnvelope)
Attaches one protocol extension envelope without discarding its original fields.
Sourcepub fn attach_evidence_ref(&mut self, evidence_ref: EvidenceReference)
pub fn attach_evidence_ref(&mut self, evidence_ref: EvidenceReference)
Attaches one evidence reference to the transaction record.
Sourcepub fn attach_evidence_digest(&mut self, digest: ProtocolEnvelopeDigest)
pub fn attach_evidence_digest(&mut self, digest: ProtocolEnvelopeDigest)
Attaches a safe digest for a stored protocol artifact.
Sourcepub fn recompute_safe_summary(&mut self)
pub fn recompute_safe_summary(&mut self)
Recomputes the safe summary after canonical state changes.
Trait Implementations§
Source§impl Clone for TransactionRecord
impl Clone for TransactionRecord
Source§fn clone(&self) -> TransactionRecord
fn clone(&self) -> TransactionRecord
Returns a duplicate of the value. Read more
1.0.0 · 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 TransactionRecord
impl Debug for TransactionRecord
Source§impl<'de> Deserialize<'de> for TransactionRecord
impl<'de> Deserialize<'de> for TransactionRecord
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransactionRecord, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TransactionRecord, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TransactionRecord
impl PartialEq for TransactionRecord
Source§impl Serialize for TransactionRecord
impl Serialize for TransactionRecord
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for TransactionRecord
Auto Trait Implementations§
impl Freeze for TransactionRecord
impl RefUnwindSafe for TransactionRecord
impl Send for TransactionRecord
impl Sync for TransactionRecord
impl Unpin for TransactionRecord
impl UnsafeUnpin for TransactionRecord
impl UnwindSafe for TransactionRecord
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,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.