pub struct RequestProcessor<'pw, F, Req>where
F: Facilitator,{
pub paywall: &'pw PayWall<F>,
pub request: Request<Req>,
pub payload: PaymentPayload,
pub selected: PaymentRequirements,
pub payment_state: PaymentState,
}Expand description
Payment processing state before running the resource handler.
See PayWall for usage in the full payment processing flow.
Fields§
§paywall: &'pw PayWall<F>§request: Request<Req>§payload: PaymentPayload§selected: PaymentRequirements§payment_state: PaymentStateImplementations§
Source§impl<'pw, F, Req> RequestProcessor<'pw, F, Req>where
F: Facilitator,
impl<'pw, F, Req> RequestProcessor<'pw, F, Req>where
F: Facilitator,
Sourcepub async fn verify(
self,
) -> Result<RequestProcessor<'pw, F, Req>, ErrorResponse>
pub async fn verify( self, ) -> Result<RequestProcessor<'pw, F, Req>, ErrorResponse>
Verify the payment with the facilitator.
self.payment_state.verified will be populated on success.
Sourcepub async fn settle(
self,
) -> Result<RequestProcessor<'pw, F, Req>, ErrorResponse>
pub async fn settle( self, ) -> Result<RequestProcessor<'pw, F, Req>, ErrorResponse>
Settle the payment with the facilitator.
self.payment_state.settled will be populated on success.
Sourcepub async fn run_handler<Fun, Fut, Res>(
self,
handler: Fun,
) -> Result<ResponseProcessor<'pw, F, Res>, ErrorResponse>
pub async fn run_handler<Fun, Fut, Res>( self, handler: Fun, ) -> Result<ResponseProcessor<'pw, F, Res>, ErrorResponse>
Run the resource handler with the payment state attached to the request extensions.
After running the handler, returns a ResponseProcessor for further processing.
Auto Trait Implementations§
impl<'pw, F, Req> !Freeze for RequestProcessor<'pw, F, Req>
impl<'pw, F, Req> !RefUnwindSafe for RequestProcessor<'pw, F, Req>
impl<'pw, F, Req> Send for RequestProcessor<'pw, F, Req>
impl<'pw, F, Req> Sync for RequestProcessor<'pw, F, Req>
impl<'pw, F, Req> Unpin for RequestProcessor<'pw, F, Req>where
Req: Unpin,
impl<'pw, F, Req> !UnwindSafe for RequestProcessor<'pw, F, Req>
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> 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 more