pub struct PaymentProof { /* private fields */ }Expand description
paykit.payment_proof Event Message.
Fields cannot be mutated after validated construction.
fn cannot_mutate(mut value: paykit_lib::PaymentProof) {
value.kind = paykit_lib::PrivateMessageKind::PaymentRequest;
}Implementations§
Source§impl PaymentProof
impl PaymentProof
Sourcepub fn validate_conversion_quote(
&self,
request: &PaymentRequest,
quote: Option<&PaymentConversionQuote>,
) -> Result<()>
pub fn validate_conversion_quote( &self, request: &PaymentRequest, quote: Option<&PaymentConversionQuote>, ) -> Result<()>
Validate quote selection without rejecting a delayed proof merely because the quote has expired. Callers separately verify the paid amount and actual payment time against the selected terms.
Source§impl PaymentProof
impl PaymentProof
Sourcepub fn new(
event_id: EventId,
payment_request_id: PaymentRequestId,
payment_reference: PaymentReference,
billing_period: Option<BillingPeriod>,
payment_app_id: PaykitAppId,
payment_endpoint_identifier: PaymentEndpointIdentifier,
proof: JsonMap<String, JsonValue>,
) -> Self
pub fn new( event_id: EventId, payment_request_id: PaymentRequestId, payment_reference: PaymentReference, billing_period: Option<BillingPeriod>, payment_app_id: PaykitAppId, payment_endpoint_identifier: PaymentEndpointIdentifier, proof: JsonMap<String, JsonValue>, ) -> Self
Construct a Payment Proof using protocol version 1.
Sourcepub fn with_conversion_quote_id(self, quote_id: EventId) -> Self
pub fn with_conversion_quote_id(self, quote_id: EventId) -> Self
Bind this proof to a previously issued recurring conversion quote.
Sourcepub fn with_allowance_id(self, allowance_id: AllowanceId) -> Self
pub fn with_allowance_id(self, allowance_id: AllowanceId) -> Self
Report the Allowance used for this payment execution.
The caller must use its persisted payment association. This is reporting only; it does not authorize payment, validate usage, or change accounting.
Sourcepub fn allowance_id(&self) -> Option<&AllowanceId>
pub fn allowance_id(&self) -> Option<&AllowanceId>
Access the reported Allowance ID, when this payment used an Allowance.
Sourcepub fn validate_for_request(&self, request: &PaymentRequest) -> Result<()>
pub fn validate_for_request(&self, request: &PaymentRequest) -> Result<()>
Validate this proof against the immutable terms of a specific Payment Request.
Checks stateless correlation only: request ID, Payment Reference,
Billing Period presence/shape, accepted endpoint and conversion selection.
Use validate_conversion_quote to also check a selected quote. Caller
state owns lifecycle, role, dedupe, settlement and recurrence eligibility.
Source§impl PaymentProof
impl PaymentProof
Sourcepub fn kind(&self) -> PrivateMessageKind
pub fn kind(&self) -> PrivateMessageKind
Access the kind.
Sourcepub fn payment_request_id(&self) -> &PaymentRequestId
pub fn payment_request_id(&self) -> &PaymentRequestId
Access the Payment Request ID.
Sourcepub fn payment_reference(&self) -> &PaymentReference
pub fn payment_reference(&self) -> &PaymentReference
Access the Payment Reference.
Sourcepub fn billing_period(&self) -> &Option<BillingPeriod>
pub fn billing_period(&self) -> &Option<BillingPeriod>
Access the optional Billing Period.
Sourcepub fn payment_app_id(&self) -> &PaykitAppId
pub fn payment_app_id(&self) -> &PaykitAppId
Access the payee App whose endpoint was used for payment.
Sourcepub fn payment_endpoint_identifier(&self) -> &PaymentEndpointIdentifier
pub fn payment_endpoint_identifier(&self) -> &PaymentEndpointIdentifier
Access the Payment Endpoint Identifier.
Sourcepub fn conversion_quote_id(&self) -> Option<&EventId>
pub fn conversion_quote_id(&self) -> Option<&EventId>
Access the selected recurring conversion quote, when required.