pub struct PaymentRequestEventMessage {
pub kind: PrivateMessageKind,
pub app_id: Option<PaykitAppId>,
pub event_id: Option<EventId>,
pub payment_request_id: Option<PaymentRequestId>,
pub raw_json: String,
pub event: Result<PaymentRequestEvent, String>,
}Expand description
A recognized Payment Request protocol Event Message plus the raw JSON payload received from the Encrypted Link.
Fields§
§kind: PrivateMessageKindPrivate Message Kind selected from the message header.
app_id: Option<PaykitAppId>Application that created this event.
event_id: Option<EventId>Parsed top-level Event ID when present and valid.
payment_request_id: Option<PaymentRequestId>Parsed top-level Payment Request ID when present and valid.
raw_json: StringRaw JSON plaintext as sent over the Encrypted Link.
event: Result<PaymentRequestEvent, String>Parsed event, or an error string explaining why this recognized message failed structural validation.
Implementations§
Source§impl PaymentRequestEventMessage
impl PaymentRequestEventMessage
Sourcepub fn kind(&self) -> PrivateMessageKind
pub fn kind(&self) -> PrivateMessageKind
Return the Private Message Kind for this event message.
Sourcepub fn app_id(&self) -> Option<&PaykitAppId>
pub fn app_id(&self) -> Option<&PaykitAppId>
Return the application that created this event, when valid.
Sourcepub fn parsed_event(&self) -> Option<&PaymentRequestEvent>
pub fn parsed_event(&self) -> Option<&PaymentRequestEvent>
Access the parsed event when structural validation succeeded.
Sourcepub fn validation_error(&self) -> Option<&str>
pub fn validation_error(&self) -> Option<&str>
Access the validation error when structural validation failed.
Sourcepub fn event_id(&self) -> Option<&EventId>
pub fn event_id(&self) -> Option<&EventId>
Access the Event ID.
Returns None when the recognized message is malformed and the Event ID
could not be parsed as a valid Event ID.
Sourcepub fn payment_request_id(&self) -> Option<&PaymentRequestId>
pub fn payment_request_id(&self) -> Option<&PaymentRequestId>
Access the Payment Request ID shared by this lifecycle event.
Returns None when the recognized message is malformed and the Payment
Request ID could not be parsed as a valid Payment Request ID.