pub struct PaymentRequestTerms { /* private fields */ }Expand description
Payment Request terms set by the payee.
Fields cannot be mutated after validated construction.
ⓘ
fn cannot_mutate(mut value: paykit_lib::PaymentRequestTerms) {
value.accepted_payment_endpoint_identifiers = Vec::new();
}Implementations§
Source§impl PaymentRequestTerms
impl PaymentRequestTerms
Sourcepub fn amount(&self) -> &PaymentAmount
pub fn amount(&self) -> &PaymentAmount
Access the amount.
Sourcepub fn payment_reference(&self) -> &PaymentReference
pub fn payment_reference(&self) -> &PaymentReference
Access the Payment Reference.
Sourcepub fn proposal_expires_at(&self) -> &Option<String>
pub fn proposal_expires_at(&self) -> &Option<String>
Access the optional proposal expiry timestamp.
Sourcepub fn recurrence(&self) -> &Option<Recurrence>
pub fn recurrence(&self) -> &Option<Recurrence>
Access the recurrence.
Sourcepub fn accepted_payment_endpoint_identifiers(
&self,
) -> &[PaymentEndpointIdentifier]
pub fn accepted_payment_endpoint_identifiers( &self, ) -> &[PaymentEndpointIdentifier]
Access the accepted Payment Endpoint Identifiers.
Sourcepub fn payment_endpoints(
&self,
) -> Option<&HashMap<PaymentEndpointIdentifier, PaymentEndpointPayload>>
pub fn payment_endpoints( &self, ) -> Option<&HashMap<PaymentEndpointIdentifier, PaymentEndpointPayload>>
Access immutable request-bound Payment Endpoints, when present.
These destinations belong to required_app_id. A payer must not fall
back to endpoints outside this map. Absence leaves endpoint discovery unchanged.
ⓘ
fn cannot_mutate(value: paykit_lib::PaymentRequestTerms) {
value.payment_endpoints().unwrap().clear();
}Sourcepub fn required_app_id(&self) -> Option<&PaykitAppId>
pub fn required_app_id(&self) -> Option<&PaykitAppId>
Access the optional payee App constraint.
Sourcepub fn conversion(&self) -> Option<&PaymentConversion>
pub fn conversion(&self) -> Option<&PaymentConversion>
Access the optional conversion policy.
Sourcepub fn payment_deadline(&self) -> Option<&PaymentDeadline>
pub fn payment_deadline(&self) -> Option<&PaymentDeadline>
Access the optional payment deadline.
Source§impl PaymentRequestTerms
impl PaymentRequestTerms
Sourcepub fn builder(
amount: PaymentAmount,
payment_reference: PaymentReference,
accepted_payment_endpoint_identifiers: Vec<PaymentEndpointIdentifier>,
) -> PaymentRequestTermsBuilder
pub fn builder( amount: PaymentAmount, payment_reference: PaymentReference, accepted_payment_endpoint_identifiers: Vec<PaymentEndpointIdentifier>, ) -> PaymentRequestTermsBuilder
Start constructing terms with their required amount, reference, and endpoints.
Call PaymentRequestTermsBuilder::build to validate the complete terms.
Trait Implementations§
Source§impl Clone for PaymentRequestTerms
impl Clone for PaymentRequestTerms
Source§impl Debug for PaymentRequestTerms
impl Debug for PaymentRequestTerms
Source§impl PartialEq for PaymentRequestTerms
impl PartialEq for PaymentRequestTerms
impl StructuralPartialEq for PaymentRequestTerms
Auto Trait Implementations§
impl Freeze for PaymentRequestTerms
impl RefUnwindSafe for PaymentRequestTerms
impl Send for PaymentRequestTerms
impl Sync for PaymentRequestTerms
impl Unpin for PaymentRequestTerms
impl UnsafeUnpin for PaymentRequestTerms
impl UnwindSafe for PaymentRequestTerms
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